services/templates/forgejo/entrypoint.sh.gotmpl

29 lines
661 B
Go Template
Raw Normal View History

#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Create the home directory.
if ! [ -d {{ .Forgejo.Home }} ]; then
mkdir -p {{ .Forgejo.Home }}
chmod 0700 {{ .Forgejo.Home }}
fi
# Create the custom directory.
if ! [ -d {{ .Forgejo.Custom }} ]; then
mkdir -p {{ .Forgejo.Custom }}
chmod 0500 {{ .Forgejo.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.SharedMountPoint }}/dynamic/dynamic_git.yaml
fi
if [ $# -gt 0 ]; then
exec "$@"
else
exec {{ .Forgejo.Bin }} -c {{ .Forgejo.AppIni }} web
fi