Docs restructure gatherer jwt hardening #2

Merged
ayurishchev merged 18 commits from docs-restructure-gatherer-jwt-hardening into main 2026-10-07 16:46:37 +03:00
4 changed files with 15 additions and 12 deletions
Showing only changes of commit 3347fffe8e - Show all commits

No files matched your search

+9 -7
View File
@@ -7,15 +7,17 @@ COPY . .
RUN npm run build RUN npm run build
# Stage 2: Serve # Stage 2: Serve
# nginx runs as root here: the image entrypoint renders the template into /etc/nginx/conf.d and port 80 # nginx runs as the unprivileged user "nginx" (uid 101) and listens on 8080 (OVP_UI_PORT); docker-compose publishes
# is published by docker-compose. An unprivileged variant would change the port and the image. # it as the host port (OVPMON_HTTP_PORT, default 80). The image entrypoint renders the template into
FROM nginx:alpine # /etc/nginx/conf.d. Behind another proxy or Kubernetes: target port 8080.
FROM nginxinc/nginx-unprivileged:alpine
COPY --from=build-stage /app/dist /usr/share/nginx/html COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY default.conf.template /etc/nginx/templates/default.conf.template COPY default.conf.template /etc/nginx/templates/default.conf.template
# Validates OVP_CSP_CONNECT_EXTRA before the template is rendered (20-envsubst-on-templates.sh) # Validates OVP_CSP_CONNECT_EXTRA before the template is rendered (20-envsubst-on-templates.sh)
COPY check-csp-connect-extra.sh /docker-entrypoint.d/15-check-csp-connect-extra.sh COPY check-csp-connect-extra.sh /docker-entrypoint.d/15-check-csp-connect-extra.sh
# Extra connect-src origins of the CSP, separated by spaces (empty: same origin only). envsubst replaces # envsubst replaces only variables that are defined, so the defaults must exist.
# only variables that are defined, so the default must exist # OVP_CSP_CONNECT_EXTRA: extra connect-src origins of the CSP, separated by spaces (empty: same origin only)
ENV OVP_CSP_CONNECT_EXTRA="" ENV OVP_UI_PORT=8080 \
EXPOSE 80 OVP_CSP_CONNECT_EXTRA=""
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]
+1 -1
View File
@@ -1,5 +1,5 @@
server { server {
listen 80; listen ${OVP_UI_PORT};
server_name localhost; server_name localhost;
server_tokens off; server_tokens off;
+2 -1
View File
@@ -84,7 +84,8 @@ OVP_CSP_CONNECT_EXTRA=$(printf '%s' "$OVP_CSP_CONNECT_EXTRA" | tr -s ' ')
export OVP_CSP_CONNECT_EXTRA export OVP_CSP_CONNECT_EXTRA
export OVP_API_HOST=127.0.0.1 OVP_API_PORT=5001 export OVP_API_HOST=127.0.0.1 OVP_API_PORT=5001
export OVP_PROFILER_HOST=127.0.0.1 OVP_PROFILER_PORT=8000 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} ${OVP_CSP_CONNECT_EXTRA}' \ export OVP_UI_PORT=80
envsubst '${OVP_API_HOST} ${OVP_API_PORT} ${OVP_PROFILER_HOST} ${OVP_PROFILER_PORT} ${OVP_UI_PORT} ${OVP_CSP_CONNECT_EXTRA}' \
< /etc/ovpmon/default.conf.template > /etc/nginx/http.d/ovpmon.conf < /etc/ovpmon/default.conf.template > /etc/nginx/http.d/ovpmon.conf
nginx -t || die "generated nginx configuration is invalid (see above)" nginx -t || die "generated nginx configuration is invalid (see above)"
+3 -3
View File
@@ -15,7 +15,7 @@ services:
container_name: ovp-ui container_name: ovp-ui
restart: unless-stopped restart: unless-stopped
ports: ports:
- "${OVPMON_HTTP_PORT:-80}:80" - "${OVPMON_HTTP_PORT:-80}:8080"
depends_on: depends_on:
- app-api - app-api
- app-profiler - app-profiler
@@ -29,8 +29,8 @@ services:
# Extra connect-src origins of the CSP (API on another host), separated by spaces; empty = same origin only # Extra connect-src origins of the CSP (API on another host), separated by spaces; empty = same origin only
OVP_CSP_CONNECT_EXTRA: ${OVPMON_CSP_CONNECT_EXTRA:-} OVP_CSP_CONNECT_EXTRA: ${OVPMON_CSP_CONNECT_EXTRA:-}
healthcheck: healthcheck:
# busybox wget exists in nginx:alpine # busybox wget exists in the nginx alpine image; nginx listens on 8080 inside (unprivileged, OVP_UI_PORT)
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1/"] test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://127.0.0.1:8080/"]
interval: 30s interval: 30s
timeout: 5s timeout: 5s
retries: 3 retries: 3