Compare commits
No commits in common. "3117203913395fe9319bb26fe0a55f5ce2dd28fe" and "8f02e3ff2ef7d5ca2faae931024696ce0cf43a9e" have entirely different histories.
3117203913
...
8f02e3ff2e
@ -4,12 +4,8 @@
|
|||||||
#
|
#
|
||||||
# Each app declares its prerequisites in its .config as
|
# Each app declares its prerequisites in its .config as
|
||||||
# CFG_<APP>_REQUIRES="<csv>"
|
# CFG_<APP>_REQUIRES="<csv>"
|
||||||
# where <csv> is a comma-separated list of requirement keys: the special types
|
# where <csv> is a comma-separated list of requirement keys (see the
|
||||||
# domain — at least one CFG_DOMAIN_N is set
|
# `case` arms below for the full set). Examples:
|
||||||
# mail — global mail is enabled
|
|
||||||
# or the name of any other app/service that must be installed first. The service
|
|
||||||
# case is data-driven — any real container name works with NO code change here,
|
|
||||||
# just list it. Examples:
|
|
||||||
# CFG_AUTHELIA_REQUIRES="domain,traefik"
|
# CFG_AUTHELIA_REQUIRES="domain,traefik"
|
||||||
# CFG_BOOKSTACK_REQUIRES="domain,traefik"
|
# CFG_BOOKSTACK_REQUIRES="domain,traefik"
|
||||||
#
|
#
|
||||||
@ -44,23 +40,38 @@ appInstallCheckRequirements()
|
|||||||
missing+=("Set at least one CFG_DOMAIN_N (General → Network) before installing $app_name.")
|
missing+=("Set at least one CFG_DOMAIN_N (General → Network) before installing $app_name.")
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
"traefik")
|
||||||
|
if ! _appReqServiceInstalled "traefik"; then
|
||||||
|
missing+=("Install Traefik first — $app_name needs a reverse proxy to publish itself.")
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"gluetun")
|
||||||
|
if ! _appReqServiceInstalled "gluetun"; then
|
||||||
|
missing+=("Install Gluetun first — $app_name expects a VPN gateway to route through.")
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"authelia")
|
||||||
|
if ! _appReqServiceInstalled "authelia"; then
|
||||||
|
missing+=("Install Authelia first — $app_name's auth integration depends on it.")
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"headscale")
|
||||||
|
if ! _appReqServiceInstalled "headscale"; then
|
||||||
|
missing+=("Install Headscale first.")
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
"prometheus")
|
||||||
|
if ! _appReqServiceInstalled "prometheus"; then
|
||||||
|
missing+=("Install Prometheus first — $app_name has nothing to query without it.")
|
||||||
|
fi
|
||||||
|
;;
|
||||||
"mail")
|
"mail")
|
||||||
if [[ "$CFG_MAIL_ENABLED" != "true" ]]; then
|
if [[ "$CFG_MAIL_ENABLED" != "true" ]]; then
|
||||||
missing+=("Configure global mail (CFG_MAIL_ENABLED=true under General → Mail) first.")
|
missing+=("Configure global mail (CFG_MAIL_ENABLED=true under General → Mail) first.")
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Any other requirement names a service/app that must be installed.
|
|
||||||
# Data-driven: if it's a real container it's a service prerequisite —
|
|
||||||
# adding a new one needs NO code here, just list it in the app's
|
|
||||||
# CFG_<APP>_REQUIRES. A name that's not a known app is a typo → ignore.
|
|
||||||
if [[ -d "${install_containers_dir}${req}" ]]; then
|
|
||||||
if ! _appReqServiceInstalled "$req"; then
|
|
||||||
missing+=("$(_appReqServiceMsg "$req" "$app_name")")
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
isNotice "Unknown requirement '$req' declared by $app_name — ignoring."
|
isNotice "Unknown requirement '$req' declared by $app_name — ignoring."
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@ -77,26 +88,6 @@ appInstallCheckRequirements()
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Human-friendly "install X first" line for a service prerequisite. Known services
|
|
||||||
# get a reason; anything else falls back to a generic message — so a NEW service
|
|
||||||
# requirement works with no code change (add a reason here only if you want flavor).
|
|
||||||
_appReqServiceMsg()
|
|
||||||
{
|
|
||||||
local svc="$1" app="$2" reason=""
|
|
||||||
case "$svc" in
|
|
||||||
traefik) reason="a reverse proxy to publish itself" ;;
|
|
||||||
gluetun) reason="a VPN gateway to route through" ;;
|
|
||||||
authelia) reason="its auth integration" ;;
|
|
||||||
prometheus) reason="something to query" ;;
|
|
||||||
esac
|
|
||||||
local disp="$(tr '[:lower:]' '[:upper:]' <<< ${svc:0:1})${svc:1}"
|
|
||||||
if [[ -n "$reason" ]]; then
|
|
||||||
echo "Install $disp first — $app needs $reason."
|
|
||||||
else
|
|
||||||
echo "Install $disp first — required by $app."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# True if any CFG_DOMAIN_<n> is set to a non-empty value.
|
# True if any CFG_DOMAIN_<n> is set to a non-empty value.
|
||||||
_appReqHasDomain()
|
_appReqHasDomain()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user