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

APP_LOCAL_URL default incorrect in docs #23769

Closed
jrjake opened this issue Mar 28, 2023 · 1 comment · Fixed by #25426
Closed

APP_LOCAL_URL default incorrect in docs #23769

jrjake opened this issue Mar 28, 2023 · 1 comment · Fixed by #25426
Labels
type/bug type/docs This PR mainly updates/creates documentation

Comments

@jrjake
Copy link

jrjake commented Mar 28, 2023

Description

On the Config Cheat Sheet, the default listed for [server] LOCAL_ROOT_URL is only correct when protocol is not fcgi/fcgi+unix/http+unix:

LOCAL_ROOT_URL: %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/: Local (DMZ) URL for Gitea workers (such as SSH update) accessing web service. In most cases you do not need to change the default value. Alter it only if your SSH server node is not the same as HTTP node. Do not set this variable if PROTOCOL is set to http+unix.

See the code here:

	var defaultLocalURL string
	switch Protocol {
	case HTTPUnix:
		defaultLocalURL = "http://unix/"
	case FCGI:
		defaultLocalURL = AppURL
	case FCGIUnix:
		defaultLocalURL = AppURL
	default:
		defaultLocalURL = string(Protocol) + "://"
		if HTTPAddr == "0.0.0.0" {
			defaultLocalURL += net.JoinHostPort("localhost", HTTPPort) + "/"
		} else {
			defaultLocalURL += net.JoinHostPort(HTTPAddr, HTTPPort) + "/"
		}
	}
	LocalURL = sec.Key("LOCAL_ROOT_URL").MustString(defaultLocalURL)

Gitea Version

6a0ef71

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

N/A

Database

None

@lunny lunny added the type/docs This PR mainly updates/creates documentation label Mar 28, 2023
@lunny
Copy link
Member

lunny commented Mar 28, 2023

Looks like the logic is too complicated to change the documentation.

lunny added a commit that referenced this issue Jun 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/bug type/docs This PR mainly updates/creates documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants