32 lines
776 B
Bash
32 lines
776 B
Bash
|
|
#!/bin/bash
|
||
|
|
|
||
|
|
set -e
|
||
|
|
set -a # export everything in the config for later use by envsubst
|
||
|
|
|
||
|
|
. $1 # source the apps.config file with then env vars
|
||
|
|
|
||
|
|
read -r -a APP_CONFIGS <<< "$APP_CONFIGS"
|
||
|
|
|
||
|
|
authelia_subdomain=
|
||
|
|
dozzle_subdomain=
|
||
|
|
|
||
|
|
for config_string in ${APP_CONFIGS[@]}; do
|
||
|
|
IFS=','
|
||
|
|
read -r -a config <<< "$config_string"
|
||
|
|
|
||
|
|
app=${config[0]}
|
||
|
|
subdomain=${config[1]}
|
||
|
|
|
||
|
|
if [ "$app" = "authelia" ]; then
|
||
|
|
authelia_subdomain="$subdomain"
|
||
|
|
fi
|
||
|
|
|
||
|
|
if [ "$app" = "dozzle" ]; then
|
||
|
|
dozzle_subdomain="$subdomain"
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
|
||
|
|
export AUTHELIA_FULL_DOMAIN="$authelia_subdomain.$ROOT_DOMAIN"
|
||
|
|
export DOZZLE_FULL_DOMAIN="$dozzle_subdomain.$ROOT_DOMAIN"
|
||
|
|
envsubst < app/authelia/authelia-config/configuration.yml.tmpl > app/authelia/authelia-config/configuration.yml
|