Finishing make app refactor.
This commit is contained in:
@@ -21,40 +21,7 @@ host_admin_password_encoded=`echo "$HOST_ADMIN_PASSWORD" | docker run --rm -i ca
|
||||
read -r -a APP_CONFIGS <<< "$APP_CONFIGS"
|
||||
APP_CONFIGS+=('lb,root')
|
||||
|
||||
|
||||
declare -A bodys
|
||||
bodys["nextcloud"]=" reverse_proxy http://nextcloud:80"
|
||||
bodys["wg-easy"]=" reverse_proxy http://wg-easy:80"
|
||||
bodys["ghost"]=" reverse_proxy http://ghost:2368"
|
||||
bodys["nassella"]=$(cat <<EOF
|
||||
route {
|
||||
@authelia path /authelia /authelia/*
|
||||
handle @authelia {
|
||||
reverse_proxy nassella_authelia:9091
|
||||
}
|
||||
|
||||
handle /unsecured/* {
|
||||
reverse_proxy http://nassella:8080
|
||||
}
|
||||
|
||||
forward_auth nassella_authelia:9091 {
|
||||
uri /api/authz/forward-auth
|
||||
copy_headers Remote-User Remote-Groups Remote-Email Remote-Name
|
||||
}
|
||||
|
||||
reverse_proxy http://nassella:8080
|
||||
}
|
||||
EOF
|
||||
)
|
||||
bodys["dozzle"]=$(cat <<EOF
|
||||
basic_auth {
|
||||
$HOST_ADMIN_USER $host_admin_password_encoded
|
||||
}
|
||||
reverse_proxy http://dozzle:8080
|
||||
EOF
|
||||
)
|
||||
bodys["instance-control"]=" reverse_proxy http://instance_control:9000"
|
||||
bodys["lb"]=" reverse_proxy http://nginx:80"
|
||||
echo "ROOT_DOMAIN=\"${ROOT_DOMAIN}\""
|
||||
|
||||
for config_string in ${APP_CONFIGS[@]}; do
|
||||
IFS=','
|
||||
@@ -62,39 +29,6 @@ for config_string in ${APP_CONFIGS[@]}; do
|
||||
|
||||
app=${config[0]}
|
||||
subdomain=${config[1]}
|
||||
body=${bodys[$app]}
|
||||
fulldomain="$subdomain.$ROOT_DOMAIN"
|
||||
|
||||
echo "$fulldomain {"
|
||||
if [ "$app" != "instance-control" ] && [ "$app" != "dozzle" ]; then
|
||||
# config for maintenance mode
|
||||
echo "@maintenanceModeActive file /maintenance/maintenance.on {"
|
||||
echo " root /"
|
||||
echo "}"
|
||||
echo "handle @maintenanceModeActive {"
|
||||
echo " respond \"We are performing a maintenance, come back later\" 503"
|
||||
echo "}"
|
||||
fi
|
||||
|
||||
echo $body
|
||||
echo "}"
|
||||
|
||||
# this is a hack specifically for nassella
|
||||
# because lldap should be on a separate domain
|
||||
# for security but this was not designed for one app
|
||||
# to map to multiple caddy blocks
|
||||
# currently this is hardcoded to prefix the nassella
|
||||
# domain with 'lldap'
|
||||
if [ "$app" = "nassella" ]; then
|
||||
echo "lldap.$subdomain.$ROOT_DOMAIN {"
|
||||
# config for maintenance mode
|
||||
echo "@maintenanceModeActive file /maintenance/maintenance.on {"
|
||||
echo " root /"
|
||||
echo "}"
|
||||
echo "handle @maintenanceModeActive {"
|
||||
echo " respond \"We are performing a maintenance, come back later\" 503"
|
||||
echo "}"
|
||||
echo " reverse_proxy nassella_lldap:17170"
|
||||
echo "}"
|
||||
fi
|
||||
echo "${app//-/_}_SUBDOMAIN=\"${subdomain}\""
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user