Backend: - Add validate_mapping_database_ownership() to verify source/target UUIDs belong to declared environments before persisting mappings (mappings.py) - Add API-key environment scoping to get_mappings (filter) and suggest_mappings_api (enforce) (mappings.py) - Add user_id Column to TaskRecord model + Alembic migration (task.py) - Persist task.user_id on save, restore on load (persistence.py) - Wire current_user.id into migrate_dashboards + backup_dashboards task creation (_action_routes.py) - Fix test_migration_routes.py: module-level patch leak → autouse fixture, SupersetClient→AsyncSupersetClient, AsyncMock for sync_environment/run - Fix 7 Pydantic serializer warnings: 'PENDING'→TaskStatus.PENDING in test_tasks.py + import TaskStatus Frontend: - Deepen isDryRunResult(): validate selection field, risk.items entries (all 5 fields), and diff object uuids individually (ExecutorModel.svelte.ts) Prior work included: task password redaction, resume ownership checks, canonical dry-run DTO alignment, migration UI callback fixes, credential exposure reduction, assistant dry-run await fix.
110 lines
4.3 KiB
Plaintext
110 lines
4.3 KiB
Plaintext
# #region docker.nginx.ssl.conf [C:3] [TYPE Module] [SEMANTICS nginx,ssl,https,enterprise]
|
||
# @BRIEF Nginx config с опциональным SSL — HTTP (порт 80) + HTTPS (порт 443), JSON access logs and trace forwarding.
|
||
# Используется frontend.entrypoint.sh, если найдены server.crt + server.key.
|
||
# @PRE SSL сертификаты: /etc/nginx/ssl/server.crt и /etc/nginx/ssl/server.key.
|
||
# Внутренний Docker DNS: backend:8000 для API/WS прокси.
|
||
# @POST HTTP (80) редиректит на HTTPS (443) если SSL включён.
|
||
# Proxy access records are JSON on stdout and include client X-Trace-ID/timings.
|
||
# HTTPS (443) сервит статику + прокси /api/ и /ws/ на backend.
|
||
# @LAYER Infrastructure
|
||
# @RELATION DEPENDS_ON -> [docker/frontend.entrypoint.sh]
|
||
# @RELATION DEPENDS_ON -> [docker/nginx.conf]
|
||
# @INVARIANT Порт 80 всегда открыт (fallback для HTTP-only окружений).
|
||
# @INVARIANT /api/ и /ws/ проксируются на http://backend:8000 (без TLS внутри compose-сети),
|
||
# preserving Authorization and X-Trace-ID headers.
|
||
# @RATIONALE stdout JSON logs survive container log aggregation and make nginx/backend/agent event correlation queryable.
|
||
# @REJECTED Прокси на HTTPS внутри compose-сети отвергнут — избыточно.
|
||
# #endregion docker.nginx.ssl.conf
|
||
|
||
map $http_upgrade $connection_upgrade {
|
||
default upgrade;
|
||
'' close;
|
||
}
|
||
|
||
# Keep TLS deployment observability identical to HTTP-only deployment.
|
||
log_format observability_json escape=json '{'
|
||
'"ts":"$time_iso8601",'
|
||
'"trace_id":"$http_x_trace_id",'
|
||
'"request_id":"$request_id",'
|
||
'"remote_addr":"$remote_addr",'
|
||
'"method":"$request_method",'
|
||
'"uri":"$uri",'
|
||
'"status":$status,'
|
||
'"upstream_status":"$upstream_status",'
|
||
'"request_time":$request_time,'
|
||
'"upstream_response_time":"$upstream_response_time"'
|
||
'}';
|
||
|
||
access_log /dev/stdout observability_json;
|
||
error_log /dev/stderr warn;
|
||
|
||
server {
|
||
listen 80 default_server;
|
||
server_name _;
|
||
|
||
# Редирект на HTTPS если сертификаты установлены
|
||
return 301 https://$host$request_uri;
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl default_server;
|
||
server_name _;
|
||
resolver 127.0.0.11 ipv6=off;
|
||
|
||
ssl_certificate /etc/nginx/ssl/server.crt;
|
||
ssl_certificate_key /etc/nginx/ssl/server.key;
|
||
ssl_protocols TLSv1.2 TLSv1.3;
|
||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||
ssl_prefer_server_ciphers on;
|
||
|
||
root /usr/share/nginx/html;
|
||
index index.html;
|
||
|
||
location / {
|
||
try_files $uri $uri/ /index.html;
|
||
}
|
||
|
||
# Gradio agent proxy — must be before /api/ (longest prefix match wins)
|
||
location /api/agent/gradio/ {
|
||
set $agent_api http://agent:7860;
|
||
proxy_pass $agent_api;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
proxy_set_header Connection $connection_upgrade;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header Authorization $http_authorization;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto https;
|
||
proxy_set_header X-Trace-ID $http_x_trace_id;
|
||
proxy_redirect http://agent:7860/ /api/agent/gradio/;
|
||
proxy_read_timeout 300s;
|
||
}
|
||
|
||
location /api/ {
|
||
set $backend_api http://backend:8000;
|
||
proxy_pass $backend_api;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto https;
|
||
proxy_set_header X-Trace-ID $http_x_trace_id;
|
||
proxy_read_timeout 300s;
|
||
}
|
||
|
||
location /ws/ {
|
||
set $backend_ws http://backend:8000;
|
||
proxy_pass $backend_ws;
|
||
proxy_http_version 1.1;
|
||
proxy_set_header Upgrade $http_upgrade;
|
||
proxy_set_header Connection "upgrade";
|
||
proxy_set_header Host $host;
|
||
proxy_set_header X-Real-IP $remote_addr;
|
||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
proxy_set_header X-Forwarded-Proto https;
|
||
proxy_set_header X-Trace-ID $http_x_trace_id;
|
||
proxy_read_timeout 300s;
|
||
}
|
||
}
|