This repository has been archived on 2023-05-06. You can view files and clone it, but cannot push or open issues or pull requests.
helix/internal/stacks/templates/gitea/entrypoint.sh

29 lines
637 B
Bash

#!/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