Don't use 'gitea generate' for internal-token file

Workaround for go-gitea/gitea/#11498

Gitea breaks if the INTERNAL_TOKEN_URI file contains a `\n`, but
`gitea generate secret` appends one.

As long as the file exists, is empty, and is writable, Gitea will
auto-generate the content, so we just `touch` it instead.

Signed-off-by: Thomas Matysik <thomas@matysik.co.nz>
This commit is contained in:
Thomas Matysik 2020-05-19 11:55:43 +12:00
parent 978d6395fe
commit fc13e0a147

View File

@ -14,7 +14,8 @@ Create helm partial for gitea server
cp /etc/gitea-secret/internal-token /datatmp/gitea/conf/internal-token
fi
if [ ! -f /datatmp/gitea/conf/internal-token ]; then
gitea generate secret INTERNAL_TOKEN >/datatmp/gitea/conf/internal-token
# File must exist, Gitea will generate the content if empty.
touch /datatmp/gitea/conf/internal-token
fi
{{- if not .Values.config.immutableConfig }}