-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
ROOT_URL setting use the default as shown in conf/app.ini #1823
Conversation
Than just define the default the same way, these placeholders should be replaced automatically |
In which file are you referring to? setting.go? Nothing else is defined in that file in that way. |
LGTM |
make L-G-T-M work |
modules/setting/setting.go
Outdated
@@ -643,6 +631,21 @@ please consider changing to GITEA_CUSTOM`) | |||
Domain = sec.Key("DOMAIN").MustString("localhost") | |||
HTTPAddr = sec.Key("HTTP_ADDR").MustString("0.0.0.0") | |||
HTTPPort = sec.Key("HTTP_PORT").MustString("3000") | |||
|
|||
defaultAppURL := string(Protocol) + "://" + Domain + ":" + HTTPPort + "/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should not add default ports to url depending on protocol (https 443 and http 80)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good suggestion. I had just recreated what was in conf/app.ini, but your refinement makes more sense and is probably what everyone would expect to happen.
I'll make that change.
I've made the requested change. Please let me know if you see any problems with it. |
The well commented conf/app.ini file that comes with the code shows the ROOT_URL (i.e. setting.AppURL) as: ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/ However the installed custom/conf/app.ini file does not include this setting as shown, and the default in the setting module was hard coded to http://localhost:3000/ instead of what is shown above. With this change the ROOT_URL will default to what is shown above if it is not set in the custom/conf/app.ini. Of course it is still possible to override the default by adding the ROOT_URL setting to your custom/conf/app.ini file as usual. Signed-off-by: Mike Fellows <[email protected]>
LGTM |
The well commented conf/app.ini file that comes with the code shows the
ROOT_URL (i.e. setting.AppURL) as:
However the installed custom/conf/app.ini file does not include this setting as
shown, and the default in the setting module was hard coded to
http://localhost:3000/ instead of what is shown above.
With this change the ROOT_URL will default to what is shown above if it is not
set in the custom/conf/app.ini.
Of course it is still possible to override the default by adding the ROOT_URL
setting to your custom/conf/app.ini file as usual.
Signed-off-by: Mike Fellows [email protected]