加固部署配置与敏感路径拦截
Storage Persistence Guard / storage-persistence-audit (pull_request) Has been cancelled
Storage Persistence Guard / storage-persistence-audit (push) Has been cancelled

This commit is contained in:
Cheng Zhou
2026-06-22 15:35:25 +08:00
parent 1fef12cd86
commit 79d2ee344c
3 changed files with 28 additions and 4 deletions
+22
View File
@@ -0,0 +1,22 @@
.git
.gitignore
.worktrees
.agents
.claude
.DS_Store
.env
.env.*
**/.env
**/.env.*
pg_data
tmp
.install-logs
.pytest_cache
**/.pytest_cache
**/__pycache__
**/*.pyc
frontend/node_modules
frontend/dist
backend/.coverage
backend/.pytest_cache
nginx/certs
-4
View File
@@ -10,8 +10,6 @@ services:
volumes: volumes:
# 持久化数据到 Linux 本地,防止重启丢失 # 持久化数据到 Linux 本地,防止重启丢失
- ./pg_data:/var/lib/postgresql/data - ./pg_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U ctms_user -d ctms_db"] test: ["CMD-SHELL", "pg_isready -U ctms_user -d ctms_db"]
interval: 5s interval: 5s
@@ -26,8 +24,6 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
container_name: ctms_backend container_name: ctms_backend
restart: always restart: always
ports:
- "8000:8000"
environment: environment:
DATABASE_URL: postgresql+asyncpg://ctms_user:secret_password@db/ctms_db DATABASE_URL: postgresql+asyncpg://ctms_user:secret_password@db/ctms_db
ENV: ${ENV:-development} ENV: ${ENV:-development}
+6
View File
@@ -52,6 +52,12 @@ http {
add_header Cache-Control "public, max-age=31536000, immutable" always; add_header Cache-Control "public, max-age=31536000, immutable" always;
} }
location ~* (^|/)(\.git|\.env($|[./_-])|wp-config\.php|config\.php|database\.yml|backup($|[._/-])) {
access_log off;
log_not_found off;
return 404;
}
location /api/ { location /api/ {
proxy_pass http://backend; proxy_pass http://backend;
proxy_set_header Host $host; proxy_set_header Host $host;