-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use shadowing script for docker (#17846)
Too many docker users are caught out by the default location for the app.ini file being environment dependent so that when they docker exec into the container the gitea commands do not work properly and require additional -c arguments to correctly pick up the configuration. This PR simply shadows the gitea binary using variants of the FHS compatible script to make the command gitea have the default locations by default. Fix #14468 Reference #17497 Reference #12082 Reference #8941 ... amongst others ... Replace #17501 Signed-off-by: Andrew Thornton <art27@cantab.net>
- Loading branch information
Showing
6 changed files
with
68 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/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="/app/gitea" | ||
CUSTOM_PATH="/data/gitea" | ||
|
||
# Provide docker defaults | ||
GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" GITEA_CUSTOM="${GITEA_CUSTOM:-$CUSTOM_PATH}" exec -a "$0" "$GITEA" $CONF_ARG "$@" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/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 \"$APP_INI\"" | ||
fi | ||
|
||
|
||
# Provide docker defaults | ||
GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" $CONF_ARG "$@" | ||
|
||
|