mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-03-16 17:54:07 +01:00
Fix usage of WOODPECKER_ROOT_PATH (#2485)
I had experienced some issues running Woodpecker behind a reverse-proxy, resulting from not defining the `WOODPECKER_ROOT_PATH` environment variable in #2477. As suggested by @qwerty287, specifying `WOODPECKER_ROOT_PATH=/foo` *mostly* solved the issue of running the woodpecker server at an url like `https://example.org/foo`. However, the webhook urls and badge urls were generated excluding the configured `WOODPECKER_ROOT_PATH`. This PR (mostly) fixes issues related to non-empty `WOODPECKER_ROOT_PATH`. --------- Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
@@ -103,7 +103,7 @@ func (c *Gitea) oauth2Config(ctx context.Context) (*oauth2.Config, context.Conte
|
||||
AuthURL: fmt.Sprintf(authorizeTokenURL, c.url),
|
||||
TokenURL: fmt.Sprintf(accessTokenURL, c.url),
|
||||
},
|
||||
RedirectURL: fmt.Sprintf("%s%s/authorize", server.Config.Server.OAuthHost, server.Config.Server.RootPath),
|
||||
RedirectURL: fmt.Sprintf("%s/authorize", server.Config.Server.OAuthHost),
|
||||
},
|
||||
|
||||
context.WithValue(ctx, oauth2.HTTPClient, &http.Client{Transport: &http.Transport{
|
||||
|
||||
Reference in New Issue
Block a user