File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ RUN_USER = ; git
7474; ; especially when the Gitea instance needs to be accessed in a container network.
7575; ; * legacy: generate the public URL by "Host" header if "X-Forwarded-Proto" header exists, otherwise use "ROOT_URL".
7676; ; * auto: always use "Host" header, and also use "X-Forwarded-Proto" header if it exists. If no "Host" header, use "ROOT_URL".
77- ; PUBLIC_URL_GENERATION = legacy
77+ ; PUBLIC_URL_DETECTION = legacy
7878; ;
7979; ; For development purpose only. It makes Gitea handle sub-path ("/sub-path/owner/repo/...") directly when debugging without a reverse proxy.
8080; ; DO NOT USE IT IN PRODUCTION!!!
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ func GuessCurrentHostURL(ctx context.Context) string {
6969 // 3. There is no reverse proxy.
7070 // Without more information, Gitea is impossible to distinguish between case 2 and case 3, then case 2 would result in
7171 // wrong guess like guessed public URL becomes "http://gitea:3000/" behind a "https" reverse proxy, which is not accessible by end users.
72- // So we introduced "PUBLIC_URL_GENERATION " option, to control the guessing behavior to satisfy different use cases.
72+ // So we introduced "PUBLIC_URL_DETECTION " option, to control the guessing behavior to satisfy different use cases.
7373 req , ok := ctx .Value (RequestContextKey ).(* http.Request )
7474 if ! ok {
7575 return strings .TrimSuffix (setting .AppURL , setting .AppSubURL + "/" )
Original file line number Diff line number Diff line change @@ -289,9 +289,9 @@ func loadServerFrom(rootCfg ConfigProvider) {
289289
290290 defaultAppURL := string (Protocol ) + "://" + Domain + ":" + HTTPPort
291291 AppURL = sec .Key ("ROOT_URL" ).MustString (defaultAppURL )
292- PublicURLGeneration = sec .Key ("PUBLIC_URL_GENERATION " ).MustString (PublicURLLegacy )
292+ PublicURLGeneration = sec .Key ("PUBLIC_URL_DETECTION " ).MustString (PublicURLLegacy )
293293 if PublicURLGeneration != PublicURLAuto && PublicURLGeneration != PublicURLLegacy {
294- log .Fatal ("Invalid PUBLIC_URL_GENERATION value: %s" , PublicURLGeneration )
294+ log .Fatal ("Invalid PUBLIC_URL_DETECTION value: %s" , PublicURLGeneration )
295295 }
296296
297297 // Check validity of AppURL
You can’t perform that action at this time.
0 commit comments