aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorBen Yanke <ben@benyanke.com>2022-07-30 01:28:50 -0400
committerGitHub <noreply@github.com>2022-07-30 13:28:50 +0800
commit2b94b02f33d472c0ae76c398aebe527ba9490ada (patch)
tree103e24602932e812e1a4375d1219592c512874a0 /docs
parent33bb7c485dedd5e3346a7d32c76d411192dcfaeb (diff)
downloadgitea-2b94b02f33d472c0ae76c398aebe527ba9490ada.tar.gz
gitea-2b94b02f33d472c0ae76c398aebe527ba9490ada.zip
Improve token and secret key generation docs (#20387)
This PR proposes a minor improvement to the docs which allows a user to paste a single command into their terminal and get the needed tokens and keys. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/content/doc/installation/with-docker.en-us.md18
1 files changed, 17 insertions, 1 deletions
diff --git a/docs/content/doc/installation/with-docker.en-us.md b/docs/content/doc/installation/with-docker.en-us.md
index fb60b97118..895f04804e 100644
--- a/docs/content/doc/installation/with-docker.en-us.md
+++ b/docs/content/doc/installation/with-docker.en-us.md
@@ -303,7 +303,23 @@ services:
- GITEA__mailer__PASSWD="""${GITEA__mailer__PASSWD:?GITEA__mailer__PASSWD not set}"""
```
-To set required TOKEN and SECRET values, consider using Gitea's built-in [generate utility functions](https://docs.gitea.io/en-us/command-line/#generate).
+Gitea will generate new secrets/tokens for every new installation automatically and write them into the app.ini. If you want to set the secrets/tokens manually, you can use the following docker commands to use of Gitea's built-in [generate utility functions](https://docs.gitea.io/en-us/command-line/#generate). Do not lose/change your SECRET_KEY after the installation, otherwise the encrypted data can not be decrypted anymore.
+
+The following commands will output a new `SECRET_KEY` and `INTERNAL_TOKEN` to `stdout`, which you can then place in your environment variables.
+
+```bash
+docker run -it --rm gitea/gitea:1 gitea generate secret SECRET_KEY
+docker run -it --rm gitea/gitea:1 gitea generate secret INTERNAL_TOKEN
+```
+
+```yaml
+...
+services:
+ server:
+ environment:
+ - GITEA__security__SECRET_KEY=[value returned by generate secret SECRET_KEY]
+ - GITEA__security__INTERNAL_TOKEN=[value returned by generate secret INTERNAL_TOKEN]
+```
## SSH Container Passthrough