From fc13e0a147a8977fd8a1f7e17e47ea2fe6a1e4e0 Mon Sep 17 00:00:00 2001 From: Thomas Matysik Date: Tue, 19 May 2020 11:55:43 +1200 Subject: [PATCH] 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 --- templates/init/_container.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/init/_container.tpl b/templates/init/_container.tpl index 55eda65..ac457c9 100644 --- a/templates/init/_container.tpl +++ b/templates/init/_container.tpl @@ -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 }}