mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-03 20:03:25 +01:00
fix(authelia): handle IP vs domain for authelia_url config
- IP address: use https://IP:9091 instead of invalid https://auth.IP - Domain: keep https://auth.DOMAIN as before - Improve completion message with actual URL hint Closes #11117
This commit is contained in:
@@ -45,4 +45,4 @@ description
|
||||
msg_ok "Completed successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}https://YOUR_AUTHELIA_URL${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9091 or https://auth.YOURDOMAIN ${CL}"
|
||||
|
||||
@@ -52,6 +52,14 @@ touch /etc/authelia/emails.txt
|
||||
JWT_SECRET=$(openssl rand -hex 64)
|
||||
SESSION_SECRET=$(openssl rand -hex 64)
|
||||
STORAGE_KEY=$(openssl rand -hex 64)
|
||||
|
||||
if [[ "$DOMAIN" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then
|
||||
AUTHELIA_URL="https://${DOMAIN}:9091"
|
||||
else
|
||||
AUTHELIA_URL="https://auth.${DOMAIN}"
|
||||
fi
|
||||
echo "$AUTHELIA_URL" > /etc/authelia/.authelia_url
|
||||
|
||||
cat <<EOF >/etc/authelia/users.yml
|
||||
users:
|
||||
authelia:
|
||||
@@ -75,7 +83,7 @@ session:
|
||||
remember_me: '1M'
|
||||
cookies:
|
||||
- domain: "${DOMAIN}"
|
||||
authelia_url: "https://auth.${DOMAIN}"
|
||||
authelia_url: "${AUTHELIA_URL}"
|
||||
storage:
|
||||
encryption_key: "${STORAGE_KEY}"
|
||||
local:
|
||||
|
||||
Reference in New Issue
Block a user