-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Improve RunMode / dev mode #24886
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
Improve RunMode / dev mode #24886
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,7 +251,13 @@ func loadRunModeFrom(rootCfg ConfigProvider) { | |
if RunMode == "" { | ||
RunMode = rootSec.Key("RUN_MODE").MustString("prod") | ||
} | ||
IsProd = strings.EqualFold(RunMode, "prod") | ||
|
||
// non-dev mode is treated as prod mode, to protect users from accidentally running in dev mode if there is a typo in this value. | ||
RunMode = strings.ToLower(RunMode) | ||
if RunMode != "dev" { | ||
RunMode = "prod" | ||
} | ||
IsProd = RunMode != "dev" | ||
Comment on lines
+255
to
+260
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this warrants a log message if it's not within the "enum" we expect. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do no think it is necessary or must.
So , I think we do not need an extra warning message here. |
||
|
||
// check if we run as root | ||
if os.Getuid() == 0 { | ||
|
Uh oh!
There was an error while loading. Please reload this page.