#!/usr/bin/env bash set -euo pipefail TRAEFIK_CONFIG_SRC="/helix/gitea/tmp/dynamic_git.yaml" TRAEFIK_CONFIG_DEST="/helix/shared/traefik/dynamic/dynamic_git.yaml" # Create the home directory. if ! [ -d ${HOME} ]; then mkdir -p ${HOME} chmod 0700 ${HOME} fi # Create the custom directory. if ! [ -d ${GITEA_CUSTOM} ]; then mkdir -p ${GITEA_CUSTOM} chmod 0500 ${GITEA_CUSTOM} fi # Move the dynamic Traefik config to the shared volume. if [ -f ${TRAEFIK_CONFIG_SRC} ]; then mv ${TRAEFIK_CONFIG_SRC} ${TRAEFIK_CONFIG_DEST} fi if [ $# -gt 0 ]; then exec "$@" else exec ${GITEA_BIN} -c ${GITEA_APP_INI} web fi