Files
Nathan Fretz 5100f03689 Fix https sign-in for apps with trusted-origin lists
Trust https:// origins in apps with trusted-origin lists

umbrelOS 2.0 serves app ports over HTTPS too, but these apps only trusted
http:// origins, so CSRF or auth origin checks reject sign-ins and form
submissions when the app is opened with https://.
2026-11-12 11:21:53 +10:00

17 lines
562 B
Bash

export APP_AGENTZERO_PORT="3015"
local_ips=$(hostname --all-ip-addresses 2> /dev/null) || local_ips=""
export APP_AGENTZERO_LOCAL_IPS="${local_ips}"
# Build URLs with http:// and https:// and port, comma-separated
ips_with_port=$(for ip in $local_ips; do
# Wrap IPv6 addresses in []
if [[ "$ip" == *:* ]]; then
echo -n "http://[$ip]:$APP_AGENTZERO_PORT,https://[$ip]:$APP_AGENTZERO_PORT,"
else
echo -n "http://$ip:$APP_AGENTZERO_PORT,https://$ip:$APP_AGENTZERO_PORT,"
fi
done | sed 's/,$//')
export APP_AGENTZERO_LOCAL_URLS="${ips_with_port}"