services/templates/forgejo/entrypoint.sh

27 lines
600 B
Bash
Raw Normal View History

2022-11-18 15:08:16 +00:00
#!/usr/bin/env bash
set -euo pipefail
# Create the home directory.
if ! [ -d ${FORGEJO_HOME} ]; then
mkdir -p ${FORGEJO_HOME}
chmod 0700 ${FORGEJO_HOME}
2022-11-18 15:08:16 +00:00
fi
# Create the custom directory.
if ! [ -d ${FORGEJO_CUSTOM} ]; then
mkdir -p ${FORGEJO_CUSTOM}
chmod 0500 ${FORGEJO_CUSTOM}
2022-11-18 15:08:16 +00:00
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 ${FORGEJO_BIN} -c ${FORGEJO_APP_INI} web
2022-11-18 15:08:16 +00:00
fi