Brings the Work Package Suite from a browser-local prototype to a multi-tenant, SQL-backed deployment hardened for customer IP. Auth & access control - Local username/password login (bcrypt + JWT in an HttpOnly cookie), admin-managed users, per-project membership, and project-scoped API access. - Admin console: change user roles, view the audit trail, manage settings. Security hardening - CSP / HSTS / X-Frame-Options / nosniff headers in nginx; Secure cookie via X-Forwarded-Proto; CSRF Origin check; attribute-safe output escaping. - Login lockout, token_version session revocation, stronger password policy, fail-closed secret loading, encrypted (AES-256) database backups. Persistence & schema - SOPs and Work Packages are now DB-backed and shared across users, written through a durable client sync outbox that queues offline edits. - Alembic migrations applied automatically on container start. New capabilities - Phase 2 dashboard (progress, gating, pagination, archive). - Phase 3 PWA "Field View" with offline caching and auth fallback. - WP owner assignment with OPTIONAL email notifications, OFF by default and toggled from the admin console. SMTP password is read only from the SMTP_PASSWORD env var (never stored); emails carry a WP number + deep link, never customer IP. Also: IBM Carbon restyle, Help section, and DEPLOYMENT.md brought up to date. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
40 lines
1.9 KiB
Plaintext
40 lines
1.9 KiB
Plaintext
# Work Package Suite — NGINX site config
|
|
# This container sits behind an external reverse proxy that handles SSL.
|
|
# It listens on port 80 (plain HTTP on the internal Docker network).
|
|
|
|
server {
|
|
listen 80;
|
|
server_name wp.controls.dev;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# ── Security response headers (defense-in-depth) ─────────────────────────
|
|
# CSP keeps 'unsafe-inline' for now because the app uses inline handlers/styles
|
|
# heavily; even so, connect-src/img-src/object-src/base-uri/frame-ancestors
|
|
# sharply limit what injected script could load or exfiltrate. Tighten toward
|
|
# nonce-based scripts once inline handlers are refactored.
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header Referrer-Policy "no-referrer" always;
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'self'; form-action 'self'" always;
|
|
|
|
location / {
|
|
try_files $uri $uri/ =404;
|
|
}
|
|
|
|
# Proxy /api/ to the FastAPI container (service name "api" on the internal network)
|
|
location /api/ {
|
|
proxy_pass http://api:8000;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
# This container is only ever reached via the TLS-terminating external
|
|
# proxy, so the real client scheme is HTTPS. Hard-set it (a local $scheme
|
|
# here is always "http") so the API marks the session cookie Secure.
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
client_max_body_size 5m;
|
|
}
|
|
}
|