73b68015de
Currently when calling `gitea` from any shell in rootless docker image it won't respect my `$GITEA_APP_INI`. Which this change it will use that value when defined instead of the default value. - https://discourse.gitea.io/t/gitea-1-16-0-unable-to-find-configuration-file/4543 - https://gitea.com/gitea/helm-chart/issues/287 Co-authored-by: Michael Kriese <michael.kriese@visualon.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
42 lines
821 B
Bash
42 lines
821 B
Bash
#!/bin/bash
|
|
|
|
###############################################################
|
|
# This script sets defaults for gitea to run in the container #
|
|
###############################################################
|
|
|
|
# It assumes that you place this script as gitea in /usr/local/bin
|
|
#
|
|
# And place the original in /usr/lib/gitea with working files in /data/gitea
|
|
GITEA="/app/gitea/gitea"
|
|
WORK_DIR="/var/lib/gitea"
|
|
APP_INI="/etc/gitea/app.ini"
|
|
|
|
APP_INI_SET=""
|
|
for i in "$@"; do
|
|
case "$i" in
|
|
"-c")
|
|
APP_INI_SET=1
|
|
;;
|
|
"-c="*)
|
|
APP_INI_SET=1
|
|
;;
|
|
"--config")
|
|
APP_INI_SET=1
|
|
;;
|
|
"--config="*)
|
|
APP_INI_SET=1
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ -z "$APP_INI_SET" ]; then
|
|
CONF_ARG="-c \"${GITEA_APP_INI:-$APP_INI}\""
|
|
fi
|
|
|
|
|
|
# Provide docker defaults
|
|
GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" $CONF_ARG "$@"
|
|
|
|
|