Use file based sessions

Fixes #5
This commit is contained in:
Girish Ramakrishnan 2019-08-19 16:54:25 -07:00
parent 2d15227f2e
commit 1943723dd3
2 changed files with 16 additions and 1 deletions

View file

@ -95,3 +95,11 @@ PATH =
[indexer] [indexer]
; this setting is protected and can't be modified ; this setting is protected and can't be modified
ISSUE_INDEXER_PATH = /app/data/appdata/indexers/issues.bleve 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

View file

@ -2,7 +2,7 @@
set -eu -o pipefail 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() { setup_ldap_source() {
set -eu 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" log ROOT_PATH "/run/gitea"
crudini --set "/run/gitea/app.ini" indexer ISSUE_INDEXER_PATH "/app/data/appdata/indexers/issues.bleve" 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" echo "==> Creating dirs and changing permissions"
mkdir -p /app/data/repository /app/data/ssh /app/data/custom mkdir -p /app/data/repository /app/data/ssh /app/data/custom
chown -R git:git /app/data /run/gitea chown -R git:git /app/data /run/gitea