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

Support allowed hosts for migrations to work with proxy #32025

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

wolfogre
Copy link
Member

Fix #32024. Follow #27655.

After this PR, all usage of "new dial context" needs to provide a proxy, so I dropped the old NewDialContext and renamed NewDialContextWithProxy to NewDialContext.

@wolfogre wolfogre added type/bug topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them backport/v1.22 This PR should be backported to Gitea 1.22 labels Sep 11, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 11, 2024
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 11, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Sep 11, 2024
Comment on lines -502 to -505
if setting.Proxy.Enabled && setting.Proxy.ProxyURLFixed != nil {
allowList.AppendPattern(setting.Proxy.ProxyURLFixed.Host)
}

Copy link
Member Author

@wolfogre wolfogre Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code doesn't really work. The proxy host is "ip:port", but the allow list is treated as domains or IPs.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 11, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 11, 2024
@lunny lunny enabled auto-merge (squash) September 11, 2024 05:18
@lunny lunny merged commit 125679f into go-gitea:main Sep 11, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Sep 11, 2024
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Sep 11, 2024
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Sep 11, 2024
wolfogre added a commit that referenced this pull request Sep 11, 2024
)

Backport #32025 by @wolfogre

Fix #32024. Follow #27655.

After this PR, all usage of "new dial context" needs to provide a proxy,
so I dropped the old `NewDialContext` and renamed
`NewDialContextWithProxy` to `NewDialContext`.

Co-authored-by: Jason Song <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Sep 12, 2024
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Failed authentications are logged to level Warning (go-gitea#32016)
  Fix `/repos/{owner}/{repo}/pulls/{index}/files` endpoint not populating `previous_filename` (go-gitea#32017)
  Support allowed hosts for migrations to work with proxy (go-gitea#32025)
  Support migration from AWS CodeCommit (go-gitea#31981)
  bump to go 1.23 (go-gitea#31855)
  Enable compression for Actions logs by default (go-gitea#32013)
  Save initial signup information for users to aid in spam prevention (go-gitea#31852)
  Increase `cacheContextLifetime` to reduce false reports (go-gitea#32011)
@yp05327 yp05327 modified the milestones: 1.24.0, 1.23.0 Sep 19, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code size/S Denotes a PR that changes 10-29 lines, ignoring generated files. topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

migrations.ALLOWED_DOMAINS doesn't work as expected with PROXY_URL set
5 participants