]> source.dussan.org Git - gitea.git/commitdiff
Set RUN_MODE prod by default (#13765)
authorsilverwind <me@silverwind.io>
Mon, 30 Nov 2020 19:52:04 +0000 (20:52 +0100)
committerGitHub <noreply@github.com>
Mon, 30 Nov 2020 19:52:04 +0000 (14:52 -0500)
I think it's a bad default to have "dev" as the default run mode which
enables debugging and now also disables HTTP caching. It's better to
just default to a value suitable for general deployments.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
custom/conf/app.example.ini
docker/root/etc/s6/gitea/setup
docker/rootless/usr/local/bin/docker-setup.sh
docs/content/doc/advanced/config-cheat-sheet.en-us.md
docs/content/doc/installation/with-docker-rootless.en-us.md
docs/content/doc/installation/with-docker.en-us.md
modules/setting/setting.go

index b9f015bf0ec3607359a3685daaa5e226e568c94b..af60fd8b678fe7f64d75a8b62e682a3362aaf640 100644 (file)
@@ -8,8 +8,8 @@
 APP_NAME = Gitea: Git with a cup of tea
 ; Change it if you run locally
 RUN_USER = git
-; Either "dev", "prod" or "test", default is "dev"
-RUN_MODE = dev
+; Application run mode, affects performance and debugging. Either "dev", "prod" or "test", default is "prod"
+RUN_MODE = prod
 
 [project]
 ; Default templates for project boards
index 892fa7fd2bd17890a861c51dddfd933158313519..4449420b99ce74850558fa8e06839658005453be 100755 (executable)
@@ -25,7 +25,7 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
 
     # Substitude the environment variables in the template
     APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
-    RUN_MODE=${RUN_MODE:-"dev"} \
+    RUN_MODE=${RUN_MODE:-"prod"} \
     DOMAIN=${DOMAIN:-"localhost"} \
     SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \
     HTTP_PORT=${HTTP_PORT:-"3000"} \
index 1ee8c2c97f448c68c5cc0fe18d5dd9da749b92a2..9764ff3c59729bcbb7fbf4741f02afe360a32dbf 100755 (executable)
@@ -27,7 +27,7 @@ if [ ! -f ${GITEA_APP_INI} ]; then
 
     # Substitude the environment variables in the template
     APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
-    RUN_MODE=${RUN_MODE:-"dev"} \
+    RUN_MODE=${RUN_MODE:-"prod"} \
     RUN_USER=${USER:-"git"} \
     SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \
     HTTP_PORT=${HTTP_PORT:-"3000"} \
index 18acbf0aaec3758abf20fad50748fb7980101921..8427523f63107f20503e3fe28b23e0726d38481c 100644 (file)
@@ -36,9 +36,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
 - `APP_NAME`: **Gitea: Git with a cup of tea**: Application name, used in the page title.
 - `RUN_USER`: **git**: The user Gitea will run as. This should be a dedicated system
    (non-user) account. Setting this incorrectly will cause Gitea to not start.
-- `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when
-   deployed to a production environment. The installation process will set this to `prod`
-   automatically. \[prod, dev, test\]
+- `RUN_MODE`: **prod**: Application run mode, affects performance and debugging. Either "dev", "prod" or "test".
 
 ## Repository (`repository`)
 
index 628053178134da43497cb402c0922ac82bd95e80..b8566372084a34e9e508ad97d85967f2dbebb57f 100644 (file)
@@ -240,7 +240,7 @@ You can configure some of Gitea's settings via environment variables:
 (Default values are provided in **bold**)
 
 * `APP_NAME`: **"Gitea: Git with a cup of tea"**: Application name, used in the page title.
-* `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment.
+* `RUN_MODE`: **prod**: Application run mode, affects performance and debugging. Either "dev", "prod" or "test".
 * `SSH_DOMAIN`: **localhost**: Domain name of this server, used for the displayed clone URL in Gitea's UI.
 * `SSH_PORT`: **2222**: SSH port displayed in clone URL.
 * `SSH_LISTEN_PORT`: **%(SSH\_PORT)s**: Port for the built-in SSH server.
index 4d0f35a001598733d09c1727ba241718f8407703..79f825a0f78e363fd48b2bced702f4f19f18935a 100644 (file)
@@ -257,7 +257,7 @@ You can configure some of Gitea's settings via environment variables:
 (Default values are provided in **bold**)
 
 * `APP_NAME`: **"Gitea: Git with a cup of tea"**: Application name, used in the page title.
-* `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment.
+* `RUN_MODE`: **prod**: Application run mode, affects performance and debugging. Either "dev", "prod" or "test".
 * `DOMAIN`: **localhost**: Domain name of this server, used for the displayed http clone URL in Gitea's UI.
 * `SSH_DOMAIN`: **localhost**: Domain name of this server, used for the displayed ssh clone URL in Gitea's UI. If the install page is enabled, SSH Domain Server takes DOMAIN value in the form (which overwrite this setting on save).
 * `SSH_PORT`: **22**: SSH port displayed in clone URL.
index 79e7751905b7814145138aad6e6fa921de8c4df3..63ae15af978a9da78ce0e594a91a41bdbdb96bed 100644 (file)
@@ -848,7 +848,7 @@ func NewContext() {
        }
 
        RunUser = Cfg.Section("").Key("RUN_USER").MustString(user.CurrentUsername())
-       RunMode = Cfg.Section("").Key("RUN_MODE").MustString("dev")
+       RunMode = Cfg.Section("").Key("RUN_MODE").MustString("prod")
        // Does not check run user when the install lock is off.
        if InstallLock {
                currentUser, match := IsRunUserMatchCurrentUser(RunUser)