mirror of
https://github.com/getumbrel/umbrel-apps.git
synced 2026-11-20 21:23:41 +03:00
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://.
20 lines
800 B
Bash
20 lines
800 B
Bash
export APP_OPENREADER_PORT="3391"
|
|
export APP_OPENREADER_PLAYBACK_SECRET="$(derive_entropy "${app_entropy_identifier}-tts-playback")"
|
|
# Preserve Nginx variables through Umbrel's template expansion.
|
|
export APP_OPENREADER_NGINX_DOLLAR='$'
|
|
|
|
local_ips=$(hostname --all-ip-addresses 2> /dev/null) || local_ips=""
|
|
export APP_OPENREADER_LOCAL_IPS="${local_ips}"
|
|
|
|
# Build http:// and https:// origins with the app_proxy port for Better Auth trusted origins.
|
|
ips_with_port=$(for ip in $local_ips; do
|
|
# Wrap IPv6 addresses in []
|
|
if [[ "$ip" == *:* ]]; then
|
|
echo -n "http://[$ip]:$APP_OPENREADER_PORT,https://[$ip]:$APP_OPENREADER_PORT,"
|
|
else
|
|
echo -n "http://$ip:$APP_OPENREADER_PORT,https://$ip:$APP_OPENREADER_PORT,"
|
|
fi
|
|
done | sed 's/,$//')
|
|
|
|
export APP_OPENREADER_LOCAL_URLS="${ips_with_port}"
|