2022-11-18 15:08:16 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
# Create the home directory.
|
2023-02-09 03:06:36 +00:00
|
|
|
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.
|
2023-02-09 03:06:36 +00:00
|
|
|
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
|
2023-02-09 03:06:36 +00:00
|
|
|
exec ${FORGEJO_BIN} -c ${FORGEJO_APP_INI} web
|
2022-11-18 15:08:16 +00:00
|
|
|
fi
|