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:
MickLesk
2026-01-24 23:22:50 +01:00
parent 87610515a3
commit aab4edf25e
2 changed files with 10 additions and 2 deletions

View File

@@ -45,4 +45,4 @@ description
msg_ok "Completed successfully!\n" msg_ok "Completed successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${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}"

View File

@@ -52,6 +52,14 @@ touch /etc/authelia/emails.txt
JWT_SECRET=$(openssl rand -hex 64) JWT_SECRET=$(openssl rand -hex 64)
SESSION_SECRET=$(openssl rand -hex 64) SESSION_SECRET=$(openssl rand -hex 64)
STORAGE_KEY=$(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 cat <<EOF >/etc/authelia/users.yml
users: users:
authelia: authelia:
@@ -75,7 +83,7 @@ session:
remember_me: '1M' remember_me: '1M'
cookies: cookies:
- domain: "${DOMAIN}" - domain: "${DOMAIN}"
authelia_url: "https://auth.${DOMAIN}" authelia_url: "${AUTHELIA_URL}"
storage: storage:
encryption_key: "${STORAGE_KEY}" encryption_key: "${STORAGE_KEY}"
local: local: