Skip to content

Migrations: "migration can only call allowed HTTP servers" when using proxy #20793

Closed
@user1191

Description

@user1191

Description

Hello.
I want Gitea to always use a local proxy to access the external network.
As per documentation, this can be done by setting some values in proxy section of your app.ini.
So I got this configuration:

[proxy]
PROXY_ENABLED	= true
PROXY_URL	= socks://127.0.0.1:9050
PROXY_HOSTS	= **

I tested Git, GitHub and GitLab migrations.
When the above configuration is set (and only then), migration of GitHub and GitLab fails.
While Git migrations work well (I don't know why by the way, expect it not to work either as GitHub and GitLab).
In the logs I see:

...ervices/task/task.go:56:handle() [E] Run task failed: Get "https://github.com/api/v4/version": proxyconnect tcp: dial tcp 127.0.0.1:9050: migration can only call allowed HTTP servers (check your migrations.ALLOWED_DOMAINS/ALLOW_LOCALNETWORKS setting), deny '127.0.0.1(127.0.0.1:9050)'

The same for GitLab.
The issue is fixed when migrations.ALLOW_LOCALNETWORKS is set to true. But I think it's not how it supposed to work.
I expect migrations.ALLOWED_DOMAINS/ALLOW_LOCALNETWORKS to not depend on whether the proxy is set or not and ALLOWED_DOMAINS to allow actual domains, but not the proxy itself.

Is it a bug, or I just misconfigured something?

Gitea Version

1.17.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.37.1

Operating System

Ubuntu 20.2

How are you running Gitea?

Linux service installed from official binary file

Database

MySQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions