Hack the setup script and drop paths config

This commit is contained in:
decentral1se 2021-04-29 15:29:05 +02:00
parent 14aa5b7f8c
commit 854ecfbf49
No known key found for this signature in database
GPG Key ID: 92DAD76BD9567B8A
4 changed files with 23 additions and 9 deletions

View File

@ -1 +1,2 @@
export APP_INI_VERSION=v5
export DOCKER_SETUP_SH_VERSION=v1

View File

@ -24,10 +24,8 @@ DEFAULT_BRANCH = main
STARTUP_TIMEOUT = 0
[server]
APP_DATA_PATH = /data/gitea
DOMAIN = {{ env "GITEA_DOMAIN" }}
LANDING_PAGE = organizations
LFS_CONTENT_PATH = /data/gitea/lfs
ROOT_URL = https://%(DOMAIN)s/
SSH_DOMAIN = {{ env "GITEA_DOMAIN" }}
SSH_LISTEN_PORT = {{ env "GITEA_SSH_PORT" }}
@ -58,10 +56,3 @@ ENABLED = true
FILE_EXTENSIONS = .rst
RENDER_COMMAND = rst2html
IS_INPUT_FILE = false
[picture]
AVATAR_UPLOAD_PATH = /data/gitea/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
[attachment]
PATH = /data/gitea/attachments

View File

@ -5,6 +5,9 @@ services:
configs:
- source: app_ini
target: /etc/gitea/app.ini
- source: docker_setup_sh
target: /usr/local/bin/docker-setup.sh
mode: 0555
secrets:
- db_password
- internal_token
@ -79,6 +82,10 @@ configs:
name: ${STACK_NAME}_app_ini_${APP_INI_VERSION}
file: app.ini.tmpl
template_driver: golang
docker_setup_sh:
name: ${STACK_NAME}_docker_setup_sh_${DOCKER_SETUP_SH_VERSION}
file: docker-setup.sh.tmpl
template_driver: golang
secrets:
db_password:
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}

15
docker-setup.sh.tmpl Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# modified version of https://github.com/go-gitea/gitea/blob/d7dbe4feebac7805a4ca184f0989f58de8063d96/docker/rootless/usr/local/bin/docker-setup.sh
# also see https://github.com/go-gitea/gitea/pull/14762#issuecomment-829224656
# Prepare git folder
mkdir -p ${HOME} && chmod 0700 ${HOME}
if [ ! -w ${HOME} ]; then echo "${HOME} is not writable"; exit 1; fi
# Prepare custom folder
mkdir -p ${GITEA_CUSTOM} && chmod 0500 ${GITEA_CUSTOM}
# Prepare temp folder
mkdir -p ${GITEA_TEMP} && chmod 0700 ${GITEA_TEMP}
if [ ! -w ${GITEA_TEMP} ]; then echo "${GITEA_TEMP} is not writable"; exit 1; fi