Skip to content

Commit d475b65

Browse files
Set RUN_MODE prod by default (#13765) (#13767)
* Set RUN_MODE prod by default (#13765) 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 <[email protected]> * flip default in checkRunMode Co-authored-by: techknowlogick <[email protected]>
1 parent 6e14773 commit d475b65

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

custom/conf/app.example.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
APP_NAME = Gitea: Git with a cup of tea
99
; Change it if you run locally
1010
RUN_USER = git
11-
; Either "dev", "prod" or "test", default is "dev"
12-
RUN_MODE = dev
11+
; Application run mode, affects performance and debugging. Either "dev", "prod" or "test", default is "prod"
12+
RUN_MODE = prod
1313

1414
[project]
1515
; Default templates for project boards

docker/root/etc/s6/gitea/setup

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [ ! -f ${GITEA_CUSTOM}/conf/app.ini ]; then
2525

2626
# Substitude the environment variables in the template
2727
APP_NAME=${APP_NAME:-"Gitea: Git with a cup of tea"} \
28-
RUN_MODE=${RUN_MODE:-"dev"} \
28+
RUN_MODE=${RUN_MODE:-"prod"} \
2929
DOMAIN=${DOMAIN:-"localhost"} \
3030
SSH_DOMAIN=${SSH_DOMAIN:-"localhost"} \
3131
HTTP_PORT=${HTTP_PORT:-"3000"} \

docs/content/doc/advanced/config-cheat-sheet.en-us.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
3636
- `APP_NAME`: **Gitea: Git with a cup of tea**: Application name, used in the page title.
3737
- `RUN_USER`: **git**: The user Gitea will run as. This should be a dedicated system
3838
(non-user) account. Setting this incorrectly will cause Gitea to not start.
39-
- `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when
40-
deployed to a production environment. The installation process will set this to `prod`
41-
automatically. \[prod, dev, test\]
39+
- `RUN_MODE`: **prod**: Application run mode, affects performance and debugging. Either "dev", "prod" or "test".
4240

4341
## Repository (`repository`)
4442

docs/content/doc/installation/with-docker.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ You can configure some of Gitea's settings via environment variables:
257257
(Default values are provided in **bold**)
258258

259259
* `APP_NAME`: **"Gitea: Git with a cup of tea"**: Application name, used in the page title.
260-
* `RUN_MODE`: **dev**: For performance and other purposes, change this to `prod` when deployed to a production environment.
260+
* `RUN_MODE`: **prod**: Application run mode, affects performance and debugging. Either "dev", "prod" or "test".
261261
* `DOMAIN`: **localhost**: Domain name of this server, used for the displayed http clone URL in Gitea's UI.
262262
* `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).
263263
* `SSH_PORT`: **22**: SSH port displayed in clone URL.

routers/init.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ import (
4343

4444
func checkRunMode() {
4545
switch setting.Cfg.Section("").Key("RUN_MODE").String() {
46-
case "prod":
46+
case "dev":
47+
git.Debug = true
48+
case "test":
49+
git.Debug = true
50+
default:
4751
macaron.Env = macaron.PROD
4852
macaron.ColorLog = false
4953
setting.ProdMode = true
50-
default:
51-
git.Debug = true
5254
}
5355
log.Info("Run Mode: %s", strings.Title(macaron.Env))
5456
}

0 commit comments

Comments
 (0)