From aab4edf25e8c03afc5ee628dccd87d7dbb2ea56e Mon Sep 17 00:00:00 2001 From: MickLesk Date: Sat, 24 Jan 2026 23:22:50 +0100 Subject: [PATCH] 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 --- ct/authelia.sh | 2 +- install/authelia-install.sh | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ct/authelia.sh b/ct/authelia.sh index ee77973d9..dc3404afc 100644 --- a/ct/authelia.sh +++ b/ct/authelia.sh @@ -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}" diff --git a/install/authelia-install.sh b/install/authelia-install.sh index 755e3de4b..010be6cab 100644 --- a/install/authelia-install.sh +++ b/install/authelia-install.sh @@ -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 </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: