Add support for an overrides file

This commit is contained in:
Tom Wiesing 2021-01-18 10:39:18 +01:00
parent 19da0361f7
commit d3b6450854
No known key found for this signature in database
GPG key ID: DC1F29F2BC78AB15
7 changed files with 24 additions and 0 deletions

View file

@ -11,6 +11,10 @@ DEFAULT_DOMAIN=localhost.kwarc.info
# If you want to change this, set an alternate domain name here.
SELF_REDIRECT=
# You can override individual URLS in the homepage.
# Do this by adding URLs (without trailing '/'s) into a JSON file
SELF_OVERRIDES_FILE=/distillery/overrides.json
# The system can support setting up certificate(s) automatically.
# It can be enabled by setting an email for certbot certificates.
# This email address can be configured here.

View file

@ -204,6 +204,15 @@ if [ -z "$GRAPHDB_ADMIN_PASSWORD" ]; then
exit 1;
fi;
# The 'SELF_OVERRIDES_FILE' should point to a real json file
if ! is_valid_file "$SELF_OVERRIDES_FILE"; then
log_error "Variable 'SELF_OVERRIDES_FILE' is not a valid file. ";
log_info "The variable is currently set to '$SELF_OVERRIDES_FILE'. "
log_info "You might want to create this file (with contents '{}') to get rid of the error message. "
log_info "Please verify that it is set correctly in '.env'";
exit 1;
fi;
# flags for graphdb authorization
GRAPHDB_AUTH_FLAGS="--user $(printf "admin:%s" "$GRAPHDB_ADMIN_PASSWORD")"

View file

@ -4,6 +4,9 @@
# The target path to redirect to
TARGET=https://gitlab.cs.fau.de/AGFD/wisski-distillery
# path to .json
SELF_OVERRIDES_FILE=/overrides.json
#######################
### Web Server settings
#######################

View file

@ -4,6 +4,8 @@ services:
tr:
image: tkw01536/tr
restart: always
volumes:
- "${OVERRIDES_FILE}:/overrides.json:ro"
environment:
# port and hostname for this image to use
VIRTUAL_HOST: ${VIRTUAL_HOST}
@ -13,6 +15,9 @@ services:
LETSENCRYPT_HOST: ${LETSENCRYPT_HOST}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
# the overrides file
OVERRIDES: /overrides.json
# where to redirect to
TARGET: ${TARGET}

View file

@ -4,3 +4,4 @@ LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
TARGET=${TARGET}
OVERRIDES_FILE=${OVERRIDES_FILE}

View file

@ -83,6 +83,7 @@ load_template "docker-env/self" \
"LETSENCRYPT_HOST" "${LETSENCRYPT_HOST}" \
"LETSENCRYPT_EMAIL" "${LETSENCRYPT_EMAIL}" \
"TARGET" "${SELF_REDIRECT}" \
"OVERRIDES_FILE" "${SELF_OVERRIDES_FILE}" \
> "$DEPLOY_SELF_DIR/.env"