UI delivery, stage B: single CSP with optional connect-src origins (OVPMON_CSP_CONNECT_EXTRA)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d38acd74de
commit
d5e83eaff5
13 files changed
+211
-17
No files matched your search
@@ -71,11 +71,20 @@ ensure_rule mangle FORWARD -o "$NAT_IFACE" -p tcp --tcp-flags SYN,RST SYN -j TCP
|
||||
ensure_rule mangle FORWARD -i "$NAT_IFACE" -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
|
||||
|
||||
# --- 5. Nginx configuration ---------------------------------------------------------------
|
||||
# The same template as the UI image of variant B; all upstreams are local. Only the four
|
||||
# OVP_* variables are substituted, nginx's own $variables stay intact.
|
||||
# The same template as the UI image of variant B; all upstreams are local. Only the OVP_* variables
|
||||
# are substituted, nginx's own $variables stay intact.
|
||||
# OVP_CSP_CONNECT_EXTRA (compose: OVPMON_CSP_CONNECT_EXTRA): extra connect-src origins of the CSP. It goes into
|
||||
# a response header, so only origins are accepted (APP_UI/check-csp-connect-extra.sh, copied into the image):
|
||||
# anything else could inject another CSP directive.
|
||||
# Empty value: same origin only.
|
||||
OVP_CSP_CONNECT_EXTRA="${OVP_CSP_CONNECT_EXTRA:-}"
|
||||
/usr/local/bin/ovpmon-check-csp.sh || die "invalid OVPMON_CSP_CONNECT_EXTRA (see above)"
|
||||
# one space between origins (the template has the value after 'self' and a space)
|
||||
OVP_CSP_CONNECT_EXTRA=$(printf '%s' "$OVP_CSP_CONNECT_EXTRA" | tr -s ' ')
|
||||
export OVP_CSP_CONNECT_EXTRA
|
||||
export OVP_API_HOST=127.0.0.1 OVP_API_PORT=5001
|
||||
export OVP_PROFILER_HOST=127.0.0.1 OVP_PROFILER_PORT=8000
|
||||
envsubst '${OVP_API_HOST} ${OVP_API_PORT} ${OVP_PROFILER_HOST} ${OVP_PROFILER_PORT}' \
|
||||
envsubst '${OVP_API_HOST} ${OVP_API_PORT} ${OVP_PROFILER_HOST} ${OVP_PROFILER_PORT} ${OVP_CSP_CONNECT_EXTRA}' \
|
||||
< /etc/ovpmon/default.conf.template > /etc/nginx/http.d/ovpmon.conf
|
||||
nginx -t || die "generated nginx configuration is invalid (see above)"
|
||||
|
||||
|
||||
Reference in new issue
Block a user