services/templates/gitea/entrypoint.sh
2022-11-18 15:08:16 +00:00

26 lines
584 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Create the home directory.
if ! [ -d ${GITEA_HOME} ]; then
mkdir -p ${GITEA_HOME}
chmod 0700 ${GITEA_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 /flow/gitea/tmp/dynamic_git.yaml ]; then
mv /flow/gitea/tmp/dynamic_git.yaml ${TRAEFIK_SHARED_MOUNT_POINT}/dynamic/dynamic_git.yaml
fi
if [ $# -gt 0 ]; then
exec "$@"
else
exec ${GITEA_BIN} -c ${GITEA_APP_INI} web
fi