Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
user1191 opened this issue Aug 14, 2022 · 0 comments · Fixed by #20798
Closed

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

user1191 opened this issue Aug 14, 2022 · 0 comments · Fixed by #20798
Labels
Milestone

Comments

@user1191
Copy link

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

@lunny lunny added this to the 1.17.1 milestone Aug 15, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants