From 1943723dd387bdaa698ae3e70290c11a57d0bfff Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 19 Aug 2019 16:54:25 -0700 Subject: [PATCH] Use file based sessions Fixes #5 --- app.ini.template | 8 ++++++++ start.sh | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app.ini.template b/app.ini.template index 3dbf872..c59f2a3 100644 --- a/app.ini.template +++ b/app.ini.template @@ -95,3 +95,11 @@ PATH = [indexer] ; this setting is protected and can't be modified ISSUE_INDEXER_PATH = /app/data/appdata/indexers/issues.bleve + +[session] +PROVIDER = file +PROVIDER_CONFIG = /run/gitea/sessions +COOKIE_SECURE = true +COOKIE_NAME = cloudron_gitea +GC_INTERVAL_TIME = 2592000 + diff --git a/start.sh b/start.sh index d266095..dc087d2 100755 --- a/start.sh +++ b/start.sh @@ -2,7 +2,7 @@ set -eu -o pipefail -mkdir -p /run/gitea/tmp/uploads /run/sshd +mkdir -p /run/gitea/tmp/uploads /run/sshd /run/gitea/sessions setup_ldap_source() { set -eu @@ -119,6 +119,13 @@ crudini --set "/run/gitea/app.ini" log MODE "console" crudini --set "/run/gitea/app.ini" log ROOT_PATH "/run/gitea" crudini --set "/run/gitea/app.ini" indexer ISSUE_INDEXER_PATH "/app/data/appdata/indexers/issues.bleve" +# this can be removed in the next release +crudini --set "/run/gitea/app.ini" session PROVIDER "file" +crudini --set "/run/gitea/app.ini" session PROVIDER_CONFIG "/run/gitea/sessions" +crudini --set "/run/gitea/app.ini" session COOKIE_SECURE "true" +crudini --set "/run/gitea/app.ini" session COOKIE_NAME "cloudron_gitea" +crudini --set "/run/gitea/app.ini" session GC_INTERVAL_TIME 2592000 + echo "==> Creating dirs and changing permissions" mkdir -p /app/data/repository /app/data/ssh /app/data/custom chown -R git:git /app/data /run/gitea