mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 19:56:48 +00:00
fix(settings): ALLOWED_HOSTS lists the server's names instead of accepting any host
This commit is contained in:
parent
c1381318f1
commit
9f5e8fe1c4
8 changed files with 90 additions and 4 deletions
|
|
@ -318,6 +318,9 @@ install_webvirtcloud () {
|
|||
done
|
||||
fi
|
||||
sed -i "s|^\\(CSRF_TRUSTED_ORIGINS = \\).*|\\1\[ \'http://$fqdn\', $host_ip ]|" "$APP_PATH/webvirtcloud/settings.py"
|
||||
# shellcheck disable=SC2046
|
||||
allowed_hosts="$(wvc_allowed_hosts "$fqdn" $(hostname -I 2>/dev/null))"
|
||||
sed -i "s|^ALLOWED_HOSTS = .*|ALLOWED_HOSTS = $allowed_hosts|" "$APP_PATH/webvirtcloud/settings.py"
|
||||
else
|
||||
echo "* Keeping existing settings.py (not overwritten)."
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue