SECRET_KEY in app.ini not generated during unattended install #8234

Closed
opened 2025-11-02 07:58:59 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @mshgh on GitHub (Dec 10, 2021).

Gitea Version

1.15.7

Git Version

N/A

Operating System

N/A

How are you running Gitea?

docker image 1.15.7 from Docker hub

Database

No response

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

After starting docker image of gitea with INSTALL_LOCK set to true (unattended install) I have found out SECRET_KEY in the app.ini is not set. I assume this is a bug, or is it?

Steps to reproduce

docker run -d --rm --name gitea_test -e INSTALL_LOCK=true gitea/gitea:1.15.7
docker exec gitea_test cat /data/gitea/conf/app.ini | grep -A6 "\[security\]"
# cleanup
docker stop gitea_test

Output

[security]
INSTALL_LOCK                  = true
SECRET_KEY                    =
REVERSE_PROXY_LIMIT           = 1
REVERSE_PROXY_TRUSTED_PROXIES = *
INTERNAL_TOKEN                = <deleted>

Screenshots

No response

Originally created by @mshgh on GitHub (Dec 10, 2021). ### Gitea Version 1.15.7 ### Git Version N/A ### Operating System N/A ### How are you running Gitea? docker image 1.15.7 from Docker hub ### Database _No response_ ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Description After starting docker image of gitea with `INSTALL_LOCK` set to `true` (unattended install) I have found out `SECRET_KEY` in the `app.ini` is not set. I assume this is a bug, or is it? Steps to reproduce ```sh docker run -d --rm --name gitea_test -e INSTALL_LOCK=true gitea/gitea:1.15.7 docker exec gitea_test cat /data/gitea/conf/app.ini | grep -A6 "\[security\]" # cleanup docker stop gitea_test ``` Output ``` [security] INSTALL_LOCK = true SECRET_KEY = REVERSE_PROXY_LIMIT = 1 REVERSE_PROXY_TRUSTED_PROXIES = * INTERNAL_TOKEN = <deleted> ``` ### Screenshots _No response_
Author
Owner

@wxiaoguang commented on GitHub (Dec 10, 2021):

If you set INSTALL_LOCK=true, then you must generate SECRET_KEY manually.

INSTALL_LOCK=true means the Gitea instance has been installed, and no secret key will be generated anymore.

Empty SECRET_KEY means disabling the database encryption, that's also a correct option.

@wxiaoguang commented on GitHub (Dec 10, 2021): If you set `INSTALL_LOCK=true`, then you must generate SECRET_KEY manually. `INSTALL_LOCK=true` means the Gitea instance has been installed, and no secret key will be generated anymore. Empty SECRET_KEY means disabling the database encryption, that's also a correct option.
Author
Owner

@mshgh commented on GitHub (Dec 10, 2021):

I see. Thank you for the explanation.

@mshgh commented on GitHub (Dec 10, 2021): I see. Thank you for the explanation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8234