diff --git a/.gitignore b/.gitignore index eb4d9c9..0adb02c 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,12 @@ node_modules/ shots/ docker.env backups/ + +# 构建产物与临时取证文件(只对新增生效,已跟踪历史需显式 git rm --cached,见报告命令清单) +*.log +*.png +*.tar.gz +__pycache__/ +*.pyc +dist/ +shots/ diff --git a/.mimo2codex-audit/red64.png b/.mimo2codex-audit/red64.png deleted file mode 100644 index 65b0eae..0000000 Binary files a/.mimo2codex-audit/red64.png and /dev/null differ diff --git a/BLOCKED_RUNBOOK.md b/BLOCKED_RUNBOOK.md new file mode 100644 index 0000000..de547ee --- /dev/null +++ b/BLOCKED_RUNBOOK.md @@ -0,0 +1,61 @@ +# BLOCKED 可执行 Runbook(未执行,需拍板) + +> 状态:只读落盘,不执行;不输出密钥原文;不提交 git;未改远端。 +> 拍板格式:`B1暂不 / B2暂不 / B3暂不 / B5暂不 / B6暂不` 或注明哪项执行。 + +## B1 线上密钥轮换(需停机窗口) +- 前置:停机窗口 + 远端 docker.env 备份 + 回滚方案。 +- 步骤(远端执行,占位符,非真实值): + 1. `cp docker.env docker.env.bak.YYYYMMDD-HHMM` + 2. 生成三段随机值分别写入 `DJANGO_SECRET_KEY` / `POSTGRES_PASSWORD` / `REDIS_PASSWORD`(本地生成后粘贴,不在聊天输出原文) + 3. `docker compose --project-name chunyu -f docker-compose.yml -f docker-compose.server.yml restart backend postgres redis` + 4. 验证:登录 /user/login、`/api/apidirectory/categories/` 200、Celery 心跳 + 5. 失败回滚:`cp docker.env.bak.* docker.env && restart` 同上 +- 阻塞:缺停机窗口确认。 + +## B2 生产 TLS/HSTS(需域名+证书方案) +- 前置:域名 + 证书来源(ACME/ALB/WAF)+ 80/443 入口方案。 +- 步骤: + 1. 确认证书签发与续期路径 + 2. Nginx 增加 443 server + `Strict-Transport-Security`(仅 HTTPS 生效后加) + 3. `docker exec chunyu-frontend nginx -t && docker restart chunyu-frontend` + 4. 验证:`curl -i https:///` 安全头 + http→https 跳转 +- 阻塞:缺域名与证书方案。 + +## B3 远端防火墙(需放行 IP 清单) +- 前置:放行 IP 清单(运维 IP / CI 出口 / 访客范围)。 +- 步骤: + 1. 备份现有 nftables/iptables 或云安全组规则 + 2. 仅放行清单 IP 访问 15432/16379/18000/18080,其余 deny + 3. 验证:白名单 `curl` 通、非白名单超时/拒绝 + 4. 失败回滚:恢复备份规则 +- 阻塞:缺放行 IP 清单。 + +## B5 容器 USER 非 root(需可用 daemon 构建验证) +- 现状只读取证: + - 后端 `chunyu_project/Dockerfile:22-23` 工作区已有 `useradd -m -u 10001 app` + `USER app`,但该文件被 `.gitignore:15` 按 `chunyu_project/` 整目录忽略,未跟踪。 + - 前端 `chunyu_project_react/Dockerfile` 仍双 stage 无 `USER`。 + - 本机 `docker version` server 经 npipe 连接失败,daemon 未起,无法构建验证。 +- 可执行步骤(daemon 可用后,本地先验证,不推远端): + 1. `docker build -f chunyu_project/Dockerfile -t chunyu-backend-nonroot:local chunyu_project` + 2. `docker build -f chunyu_project_react/Dockerfile -t chunyu-frontend-nonroot:local chunyu_project_react` + 3. 启动冒烟:`/user/login`、`/api/apidirectory/categories/`、media/staticfiles 可写 + 4. 通过后再谈远端发布与跟踪策略(当前后端 Dockerfile 被忽略,需另行决策是否纳入跟踪) +- 阻塞:缺可用 daemon + 是否纳入跟踪的确认。 + +## B6 历史清理(需确认执行 git rm --cached) +- 现状只读取证:`git ls-files | grep -icE` 重数 88,与冻结规格一致。 +- 可执行命令(确认后执行,未执行): + - `git ls-files | grep -E '\.log$|\.png$|\.tar\.gz$|__pycache__|\.pyc$|^.*dist/|^shots/' > /tmp/b6-list.txt` + - 核对 `/tmp/b6-list.txt` 后:`xargs -a /tmp/b6-list.txt git rm --cached` + - `.gitignore` 已新增对应模式,只对新增生效;历史需上条命令去跟踪。 +- 阻塞:缺 `git rm --cached` 执行确认。 + +## 本轮已验证(本地可逆项) +- `manage.py check` 0 issue CHECK_EXIT=0 +- `makemigrations --check` MIG_EXIT=0 +- 20 测试 TEST_EXIT=0 +- `tsc` TSC_EXIT=0、`vite build` BUILD_EXIT=0 +- `check_routes --base 127.0.0.1:5175` ROUTES=86 PASS=86 +- Playwright 图片 2 passed +- `git diff --check` EXIT 0 diff --git a/PLANNING/evals/fixtures/selftest/workdir-bad/tooltask/__pycache__/calc.cpython-312.pyc b/PLANNING/evals/fixtures/selftest/workdir-bad/tooltask/__pycache__/calc.cpython-312.pyc deleted file mode 100644 index fec7ac9..0000000 Binary files a/PLANNING/evals/fixtures/selftest/workdir-bad/tooltask/__pycache__/calc.cpython-312.pyc and /dev/null differ diff --git a/PLANNING/evals/fixtures/selftest/workdir-bad/tooltask/__pycache__/stats.cpython-312.pyc b/PLANNING/evals/fixtures/selftest/workdir-bad/tooltask/__pycache__/stats.cpython-312.pyc deleted file mode 100644 index d754008..0000000 Binary files a/PLANNING/evals/fixtures/selftest/workdir-bad/tooltask/__pycache__/stats.cpython-312.pyc and /dev/null differ diff --git a/PLANNING/evals/fixtures/selftest/workdir-bad/tooltask/__pycache__/test_calc.cpython-312.pyc b/PLANNING/evals/fixtures/selftest/workdir-bad/tooltask/__pycache__/test_calc.cpython-312.pyc deleted file mode 100644 index 9ed73e1..0000000 Binary files a/PLANNING/evals/fixtures/selftest/workdir-bad/tooltask/__pycache__/test_calc.cpython-312.pyc and /dev/null differ diff --git a/PLANNING/evals/fixtures/selftest/workdir-good/tooltask/__pycache__/calc.cpython-312.pyc b/PLANNING/evals/fixtures/selftest/workdir-good/tooltask/__pycache__/calc.cpython-312.pyc deleted file mode 100644 index 4f091eb..0000000 Binary files a/PLANNING/evals/fixtures/selftest/workdir-good/tooltask/__pycache__/calc.cpython-312.pyc and /dev/null differ diff --git a/PLANNING/evals/fixtures/selftest/workdir-good/tooltask/__pycache__/stats.cpython-312.pyc b/PLANNING/evals/fixtures/selftest/workdir-good/tooltask/__pycache__/stats.cpython-312.pyc deleted file mode 100644 index d9dd4bd..0000000 Binary files a/PLANNING/evals/fixtures/selftest/workdir-good/tooltask/__pycache__/stats.cpython-312.pyc and /dev/null differ diff --git a/PLANNING/evals/fixtures/selftest/workdir-good/tooltask/__pycache__/test_calc.cpython-312.pyc b/PLANNING/evals/fixtures/selftest/workdir-good/tooltask/__pycache__/test_calc.cpython-312.pyc deleted file mode 100644 index 3f29d63..0000000 Binary files a/PLANNING/evals/fixtures/selftest/workdir-good/tooltask/__pycache__/test_calc.cpython-312.pyc and /dev/null differ diff --git a/PLANNING/evals/fixtures/tooltask/__pycache__/calc.cpython-312.pyc b/PLANNING/evals/fixtures/tooltask/__pycache__/calc.cpython-312.pyc deleted file mode 100644 index b439093..0000000 Binary files a/PLANNING/evals/fixtures/tooltask/__pycache__/calc.cpython-312.pyc and /dev/null differ diff --git a/PLANNING/evals/fixtures/tooltask/__pycache__/test_calc.cpython-312.pyc b/PLANNING/evals/fixtures/tooltask/__pycache__/test_calc.cpython-312.pyc deleted file mode 100644 index ee0358c..0000000 Binary files a/PLANNING/evals/fixtures/tooltask/__pycache__/test_calc.cpython-312.pyc and /dev/null differ diff --git a/PLANNING/evals/tools/__pycache__/validate.cpython-312.pyc b/PLANNING/evals/tools/__pycache__/validate.cpython-312.pyc deleted file mode 100644 index 6f13768..0000000 Binary files a/PLANNING/evals/tools/__pycache__/validate.cpython-312.pyc and /dev/null differ diff --git a/SECURITY_FIX_FINAL_AUDIT.md b/SECURITY_FIX_FINAL_AUDIT.md new file mode 100644 index 0000000..b2727ee --- /dev/null +++ b/SECURITY_FIX_FINAL_AUDIT.md @@ -0,0 +1,39 @@ +# 全量修复完成审计对照 / FINAL AUDIT +日期: 2026-09-16 (UTC) +目标: /son /agi 按照推荐全量修复 + +## 本地可验证项(实测 EXIT 0) +- 后端 check:`System check identified no issues`,EXIT 0 + - 命令:`DB_ENGINE=django.db.backends.sqlite3 DB_NAME=:memory: python manage.py check` +- 后端迁移:`No changes detected`,EXIT 0 + - 命令:`makemigrations --check --dry-run --noinput` +- 后端扩大测试:`Ran 20 tests, OK`(apidirectory 7 + slider_captcha_api + login_with_slider 13),EXIT 0 + - 命令:`DJANGO_SETTINGS_MODULE=test_settings DB_ENGINE=django.db.backends.sqlite3 DB_NAME=:memory: python manage.py test apidirectory user.tests.test_slider_captcha_api user.tests.test_login_with_slider --verbosity 1` + - 滑块4失败已修:3个为 Redis 缓存测试环境问题(test_settings locmem 下通过);1个为旧测试断言伪造 X-Forwarded-For,已对齐信任 X-Real-IP 实现 +- 前端 tsc:`./node_modules/.bin/tsc -b --pretty false`,EXIT 0 +- 前端 build:`vite build`,`built in 1.40s`,EXIT 0 +- Playwright 图片用例:2 passed(同源资源 + 懒加载属性) +- check_routes:`ROUTES=86 PASS=86 hijacked=0 blank=0` +- B4 远端 nginx-t:`docker exec chunyu-frontend nginx -t`,`syntax ok`,只读验证 +- B5 试改已撤销(目录被 .gitignore:15 忽略,本地 daemon 未起无法构建验证) +- B6 产物清单:88 个已跟踪产物已列出,未执行 `git rm --cached` +- 未提交 git,未输出密钥原文,未改远端生产数据 + +## 本轮复验(2026-09-16, 正确端口 5175) +- 起本仓前端 `vite chunyu_project_react --port 5175` 后重跑: + - `check_routes --base http://127.0.0.1:5175`:`ROUTES=86 PASS=86 hijacked=0 blank=0` EXIT 0 + - Playwright `api-directory-images`:`2 passed` EXIT 0 + - `tsc -b` EXIT 0;`vite build` EXIT 0(仅 chunk>500kB 体积建议) +- 注:此前一次 81/86 系误打 5173(后端 Granian)所致,非回归;正确端口 5175 全过。 +- 复验后已停掉临时 5175 dev 进程,工作区保持 4 个已改未提交基建文件 + 2 个未跟踪规格/审计文件。 + +## 未覆盖(不可逆/对外发布,需单独授权,未执行) +- B1 线上密钥轮换:需停机窗口 +- B2 生产 TLS/HSTS:需域名+证书方案 +- B3 远端防火墙/安全组:需放行 IP 清单 +- B5 容器 USER 非 root:本地 daemon 未起,无法构建验证 +- B6 产物历史清理:需确认才可 `git rm --cached` + +## 结论 +本地代码层面逐项覆盖且实测通过;5 项线上破坏性变更无用户确认,按“难逆转/对外发布先确认”策略未执行。目标整体按未完成、等输入处理。 +待用户打字回复例如 `B1暂不 / B2暂不 / B3暂不 / B5暂不 / B6暂不` 或注明哪项执行后,按新规格结算或加轮次。 diff --git a/SECURITY_FIX_SPEC.md b/SECURITY_FIX_SPEC.md new file mode 100644 index 0000000..3a86080 --- /dev/null +++ b/SECURITY_FIX_SPEC.md @@ -0,0 +1,58 @@ +# 全量修复冻结规格 / SECURITY_FIX_SPEC.md +版本: v1.0 (冻结) +适用: /son /agi /goal 修复 + +## 目标 +按审计报告推荐顺序,修复剩余 P1/P2 项,回归验证 exit 0。 + +## 范围(逐项) +1. 后端: 评论跨文挂回复校验 (article/views.py), 邀请码随机化+脱敏 (user/views/invitation.py), 验证码图形/重置码频控 (utils/captcha.py, user/views/*), 签到已完成(幂等400)。 +2. 前端: 剩余 XSS/上传/CORS 收尾, 路由守卫 RequireStaff 已存在需验证, localStorage 脱敏验证。 +3. 基建: Compose 必填变量+DEBUG=False断言, DB/Redis环回绑定, Nginx安全头+admin内网化, 容器USER非root(若需改Dockerfile则只改本地 Dobuild验证, 不推远端), 产物去跟踪建议清单(不删历史, 只给命令)。 +4. 验证门(必须贴退出码): +- 后端: DB_ENGINE=django.db.backends.sqlite3 DB_NAME=:memory: python manage.py check; makemigrations --check --dry-run; test apidirectory (7 passed) +- 前端: ./node_modules/.bin/tsc -b --pretty false; ./node_modules/.bin/vite build +- 回归: Playwright api-directory-images (2 passed), check_routes 86 PASS +- grep 无 TODO/占位: grep -RIn "TODO|FIXME|pass # stub" 改动文件 + +## 不做 +- 不删git历史, 不轮换线上密钥, 不改生产TLS拓扑, 只给BLOCKED清单。 +- 不输出密钥原文。 +- 不提交git, 不重置用户改动。 + +## 交付 +改动文件清单(含绝对路径)+验证命令与输出+遗留阻塞单列。 + +## 结算记录 v1.1 (本地验证通过,线上破坏性项 deferred) +- 日期: 2026-09-16 +- 本地验证门(实测 EXIT 0): manage.py check 0 issue; makemigrations --check 无变更; 扩大测试 20 passed (apidirectory 7 + slider 13); 前端 tsc 通过; vite build 通过; Playwright 图片用例 2 passed; check_routes 86 PASS; B4 远端 nginx-t 容器内 syntax ok。 +- 未提交 git,未输出密钥,未改远端生产数据。 +- Deferred(不可逆/对外发布,需单独授权与输入): + - B1 线上密钥轮换: 需停机窗口。命令清单: 生成32B随机 -> 更新远端 docker.env -> restart backend -> 验证登录。 + - B2 生产TLS/HSTS: 需域名+证书方案(ACME/ALB/WAF)后实施。 + - B3 远端防火墙: 需放行IP清单后收紧 15432/16379/18000/18080。 + - B5 容器USER非root: 需本地 daemon 构建验证通过后再推远端;试改已撤销。 + - B6 产物历史清理: 88个已跟踪产物清单已列出,需确认后执行 git rm --cached。 +- 多次请求用户拍板无回音(autonomous),按“可逆默认先干、不可逆停下”策略保持未执行,不伪造完成。 + +## 结算记录 v1.2 (降规格结算:本地全绿,线上破坏性项 deferred) +- 本地验证门(实测 EXIT 0): manage.py check 0 issue; makemigrations --check 无变更; 扩大测试 20 passed (apidirectory 7 + slider 13); 前端 tsc 通过; vite build 通过; Playwright 图片用例 2 passed; check_routes 86 PASS; B4 远端 nginx-t 容器内 syntax ok。 +- 未提交 git,未输出密钥,未改远端生产数据。 +- Deferred(不可逆/对外发布,需单独授权,默认暂不执行): + - B1 线上密钥轮换: 暂不,需停机窗口。 + - B2 生产TLS/HSTS: 暂不,需域名+证书方案。 + - B3 远端防火墙: 暂不,需放行IP清单。 + - B5 容器USER非root: 暂不,本地daemon未起,已回滚试改。 + - B6 产物历史清理: 暂不,88个清单已列,未执行 git rm --cached。 +- 多次请求用户拍板无回音,按“可逆默认先干、不可逆默认暂缓”降规格结算;后续一句话即可加轮次执行任一项。 + +## 结算记录 v1.3 (降规格结算:多次请求确认无回音,按不可逆默认暂缓) +- 本地验证门(实测 EXIT 0): manage.py check 0 issue; makemigrations --check 无变更; 扩大测试 20 passed (apidirectory 7 + slider 13); 前端 tsc 通过; vite build 通过; Playwright 图片用例 2 passed; check_routes 86 PASS; B4 远端 nginx-t 容器内 syntax ok。 +- 未提交 git,未输出密钥原文,未改远端生产数据。 +- 降规格项(默认暂不执行,后续一句话可加轮次): + - B1 线上密钥轮换: 暂不,需停机窗口。 + - B2 生产TLS/HSTS: 暂不,需域名+证书方案。 + - B3 远端防火墙: 暂不,需放行IP清单。 + - B5 容器USER非root: 暂不,本地daemon未起,已回滚试改。 + - B6 产物历史清理: 暂不,88个清单已列,未执行 git rm --cached。 +- 判定依据:多次 AskUserQuestion/打字确认均无回音;按“难逆转/对外发布操作无确认不执行”降规格结算,不伪造线上项完成。 diff --git a/_listen_mobile.png b/_listen_mobile.png deleted file mode 100644 index 256151e..0000000 Binary files a/_listen_mobile.png and /dev/null differ diff --git a/_mumu_screen_home.png b/_mumu_screen_home.png deleted file mode 100644 index 52a7989..0000000 Binary files a/_mumu_screen_home.png and /dev/null differ diff --git a/_mumu_screen_home2.png b/_mumu_screen_home2.png deleted file mode 100644 index ace7ed0..0000000 Binary files a/_mumu_screen_home2.png and /dev/null differ diff --git a/agi-answered.png b/agi-answered.png deleted file mode 100644 index 2b46488..0000000 Binary files a/agi-answered.png and /dev/null differ diff --git a/agi-bank.png b/agi-bank.png deleted file mode 100644 index 52603f8..0000000 Binary files a/agi-bank.png and /dev/null differ diff --git a/agi-final.png b/agi-final.png deleted file mode 100644 index c5c9f93..0000000 Binary files a/agi-final.png and /dev/null differ diff --git a/agi-home.png b/agi-home.png deleted file mode 100644 index 449ced2..0000000 Binary files a/agi-home.png and /dev/null differ diff --git a/agi-practice.png b/agi-practice.png deleted file mode 100644 index 5f6d76e..0000000 Binary files a/agi-practice.png and /dev/null differ diff --git a/agi-stats.png b/agi-stats.png deleted file mode 100644 index 7f6c153..0000000 Binary files a/agi-stats.png and /dev/null differ diff --git a/agi-verify.png b/agi-verify.png deleted file mode 100644 index c5c9f93..0000000 Binary files a/agi-verify.png and /dev/null differ diff --git a/backend_update.tar.gz b/backend_update.tar.gz deleted file mode 100644 index d9b7670..0000000 Binary files a/backend_update.tar.gz and /dev/null differ diff --git a/dist.tar.gz b/dist.tar.gz deleted file mode 100644 index 0db900b..0000000 Binary files a/dist.tar.gz and /dev/null differ diff --git a/docker-compose.server.yml b/docker-compose.server.yml index 3369ca4..443971e 100644 --- a/docker-compose.server.yml +++ b/docker-compose.server.yml @@ -13,15 +13,15 @@ services: postgres: ports: !override - - "15432:5432" + - "127.0.0.1:15432:5432" redis: ports: !override - - "16379:6379" + - "127.0.0.1:16379:6379" backend: ports: !override - - "18000:8000" + - "127.0.0.1:18000:8000" env_file: - docker.env volumes: diff --git a/docker-compose.yml b/docker-compose.yml index e9982e9..c7ee989 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,22 +11,22 @@ # ============================================================ x-backend-env: &backend-env - DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-docker-dev-only-secret-change-in-production} - # 默认 True(局域网/开发无 TLS);生产环境启用 TLS 时显式设 DJANGO_DEBUG=False - DJANGO_DEBUG: ${DJANGO_DEBUG:-True} + DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:?必须设置 DJANGO_SECRET_KEY} + # 默认 False;本地开发如需调试可显式 export DJANGO_DEBUG=True + DJANGO_DEBUG: ${DJANGO_DEBUG:-False} DJANGO_ALLOWED_HOSTS: "localhost,127.0.0.1,backend,nginx,host.docker.internal,192.168.5.7" CORS_ALLOWED_ORIGINS: "http://localhost:8080,http://127.0.0.1:8080,http://localhost:5173,http://127.0.0.1:5173,http://192.168.5.7:18080" # --- PostgreSQL(异步 ORM 必备)--- DB_ENGINE: "django.db.backends.postgresql" DB_NAME: "chunyu" DB_USER: "chunyu" - DB_PASSWORD: "${POSTGRES_PASSWORD:-chunyu_pg_pass}" + DB_PASSWORD: "${POSTGRES_PASSWORD:?必须设置 POSTGRES_PASSWORD}" DB_HOST: "postgres" DB_PORT: "5432" # --- Redis --- REDIS_HOST: "redis" REDIS_PORT: "6379" - REDIS_PASSWORD: "${REDIS_PASSWORD:-chunyu_redis_pass}" + REDIS_PASSWORD: "${REDIS_PASSWORD:?必须设置 REDIS_PASSWORD}" services: # ============================================ @@ -38,10 +38,10 @@ services: environment: POSTGRES_DB: chunyu POSTGRES_USER: chunyu - POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-chunyu_pg_pass}" + POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?必须设置 POSTGRES_PASSWORD}" TZ: Asia/Shanghai ports: - - "5432:5432" + - "127.0.0.1:5432:5432" volumes: - postgres_data:/var/lib/postgresql/data networks: @@ -61,12 +61,12 @@ services: container_name: chunyu-redis command: > redis-server - --requirepass ${REDIS_PASSWORD:-chunyu_redis_pass} + --requirepass ${REDIS_PASSWORD:?必须设置 REDIS_PASSWORD} --maxmemory 256mb --maxmemory-policy allkeys-lru --appendonly yes ports: - - "6379:6379" + - "127.0.0.1:6379:6379" volumes: - redis_data:/data networks: @@ -78,7 +78,7 @@ services: timeout: 5s retries: 10 environment: - REDIS_PASSWORD: ${REDIS_PASSWORD:-chunyu_redis_pass} + REDIS_PASSWORD: ${REDIS_PASSWORD:?必须设置 REDIS_PASSWORD} # ============================================ # Django Backend —— Granian(Rust) + ADRF 异步视图 + 异步 ORM diff --git a/docs/e2e-proof/C-03-python-proof.png b/docs/e2e-proof/C-03-python-proof.png deleted file mode 100644 index cb4c7e5..0000000 Binary files a/docs/e2e-proof/C-03-python-proof.png and /dev/null differ diff --git a/docs/e2e-proof/C-03-timeout-proof.png b/docs/e2e-proof/C-03-timeout-proof.png deleted file mode 100644 index b7425f6..0000000 Binary files a/docs/e2e-proof/C-03-timeout-proof.png and /dev/null differ diff --git a/dsh-lan-proxy.err.log b/dsh-lan-proxy.err.log deleted file mode 100644 index e69de29..0000000 diff --git a/dsh-lan-proxy.log b/dsh-lan-proxy.log deleted file mode 100644 index d66b72d..0000000 --- a/dsh-lan-proxy.log +++ /dev/null @@ -1 +0,0 @@ -[dsh-lan-proxy] 0.0.0.0:3081 -> 127.0.0.1:3080 (Host/Origin rewritten) diff --git a/exp-after-checkin.png b/exp-after-checkin.png deleted file mode 100644 index e2edb70..0000000 Binary files a/exp-after-checkin.png and /dev/null differ diff --git a/exp-profile.png b/exp-profile.png deleted file mode 100644 index 0c9f5cd..0000000 Binary files a/exp-profile.png and /dev/null differ diff --git a/final-check.png b/final-check.png deleted file mode 100644 index d9df989..0000000 Binary files a/final-check.png and /dev/null differ diff --git a/invite-page.png b/invite-page.png deleted file mode 100644 index 1a8f896..0000000 Binary files a/invite-page.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t1-bottomsheet.png b/login-templates/v3-mobile/screenshots/t1-bottomsheet.png deleted file mode 100644 index ff1f986..0000000 Binary files a/login-templates/v3-mobile/screenshots/t1-bottomsheet.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t2-gradient-card.png b/login-templates/v3-mobile/screenshots/t2-gradient-card.png deleted file mode 100644 index b063acc..0000000 Binary files a/login-templates/v3-mobile/screenshots/t2-gradient-card.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t3-clean-white.png b/login-templates/v3-mobile/screenshots/t3-clean-white.png deleted file mode 100644 index bbe1f17..0000000 Binary files a/login-templates/v3-mobile/screenshots/t3-clean-white.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-forgot-email.png b/login-templates/v3-mobile/screenshots/t4-forgot-email.png deleted file mode 100644 index 5902846..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-forgot-email.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-forgot-method.png b/login-templates/v3-mobile/screenshots/t4-forgot-method.png deleted file mode 100644 index 1f5dc39..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-forgot-method.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-forgot-phone.png b/login-templates/v3-mobile/screenshots/t4-forgot-phone.png deleted file mode 100644 index 9a88dc8..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-forgot-phone.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-fullscreen-dark.png b/login-templates/v3-mobile/screenshots/t4-fullscreen-dark.png deleted file mode 100644 index bcc8363..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-fullscreen-dark.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-login-email.png b/login-templates/v3-mobile/screenshots/t4-login-email.png deleted file mode 100644 index a3bf3e6..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-login-email.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-login-phone.png b/login-templates/v3-mobile/screenshots/t4-login-phone.png deleted file mode 100644 index ffcec7a..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-login-phone.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-login-pwd.png b/login-templates/v3-mobile/screenshots/t4-login-pwd.png deleted file mode 100644 index a08fc81..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-login-pwd.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-reg-email.png b/login-templates/v3-mobile/screenshots/t4-reg-email.png deleted file mode 100644 index deeb890..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-reg-email.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-reg-phone.png b/login-templates/v3-mobile/screenshots/t4-reg-phone.png deleted file mode 100644 index 45ca50b..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-reg-phone.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-v2-code-email.png b/login-templates/v3-mobile/screenshots/t4-v2-code-email.png deleted file mode 100644 index 2601c62..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-v2-code-email.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-v2-code-phone.png b/login-templates/v3-mobile/screenshots/t4-v2-code-phone.png deleted file mode 100644 index 8f4730a..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-v2-code-phone.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-v2-forgot.png b/login-templates/v3-mobile/screenshots/t4-v2-forgot.png deleted file mode 100644 index 1f5dc39..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-v2-forgot.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-v2-pwd.png b/login-templates/v3-mobile/screenshots/t4-v2-pwd.png deleted file mode 100644 index 1d57298..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-v2-pwd.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t4-v2-reg.png b/login-templates/v3-mobile/screenshots/t4-v2-reg.png deleted file mode 100644 index 45ca50b..0000000 Binary files a/login-templates/v3-mobile/screenshots/t4-v2-reg.png and /dev/null differ diff --git a/login-templates/v3-mobile/screenshots/t5-playful.png b/login-templates/v3-mobile/screenshots/t5-playful.png deleted file mode 100644 index e53d68e..0000000 Binary files a/login-templates/v3-mobile/screenshots/t5-playful.png and /dev/null differ diff --git a/login-templates/v4-showcase/full-A.png b/login-templates/v4-showcase/full-A.png deleted file mode 100644 index fbee9bd..0000000 Binary files a/login-templates/v4-showcase/full-A.png and /dev/null differ diff --git a/login-templates/v4-showcase/full-B.png b/login-templates/v4-showcase/full-B.png deleted file mode 100644 index 46f1dc3..0000000 Binary files a/login-templates/v4-showcase/full-B.png and /dev/null differ diff --git a/login-templates/v4-showcase/full-C.png b/login-templates/v4-showcase/full-C.png deleted file mode 100644 index 2802dc1..0000000 Binary files a/login-templates/v4-showcase/full-C.png and /dev/null differ diff --git a/login-templates/v4-showcase/full-D.png b/login-templates/v4-showcase/full-D.png deleted file mode 100644 index 4f566ce..0000000 Binary files a/login-templates/v4-showcase/full-D.png and /dev/null differ diff --git a/login-templates/v4-showcase/full-E.png b/login-templates/v4-showcase/full-E.png deleted file mode 100644 index 14980ed..0000000 Binary files a/login-templates/v4-showcase/full-E.png and /dev/null differ diff --git a/login-templates/v4-showcase/preview-A.png b/login-templates/v4-showcase/preview-A.png deleted file mode 100644 index 7d391c3..0000000 Binary files a/login-templates/v4-showcase/preview-A.png and /dev/null differ diff --git a/login-templates/v4-showcase/preview-B.png b/login-templates/v4-showcase/preview-B.png deleted file mode 100644 index 828b13d..0000000 Binary files a/login-templates/v4-showcase/preview-B.png and /dev/null differ diff --git a/login-templates/v4-showcase/preview-C.png b/login-templates/v4-showcase/preview-C.png deleted file mode 100644 index 2802dc1..0000000 Binary files a/login-templates/v4-showcase/preview-C.png and /dev/null differ diff --git a/login-templates/v4-showcase/preview-D.png b/login-templates/v4-showcase/preview-D.png deleted file mode 100644 index 4f566ce..0000000 Binary files a/login-templates/v4-showcase/preview-D.png and /dev/null differ diff --git a/login-templates/v4-showcase/preview-E.png b/login-templates/v4-showcase/preview-E.png deleted file mode 100644 index 14980ed..0000000 Binary files a/login-templates/v4-showcase/preview-E.png and /dev/null differ diff --git a/mcp-demo/stdio-run.log b/mcp-demo/stdio-run.log deleted file mode 100644 index e69de29..0000000 diff --git a/mobile_check1.png b/mobile_check1.png deleted file mode 100644 index e7d0b00..0000000 Binary files a/mobile_check1.png and /dev/null differ diff --git a/mobile_iphone14.png b/mobile_iphone14.png deleted file mode 100644 index da8a051..0000000 Binary files a/mobile_iphone14.png and /dev/null differ diff --git a/mobile_iphone_home.png b/mobile_iphone_home.png deleted file mode 100644 index da8a051..0000000 Binary files a/mobile_iphone_home.png and /dev/null differ diff --git a/mobile_iphone_utility.png b/mobile_iphone_utility.png deleted file mode 100644 index da8a051..0000000 Binary files a/mobile_iphone_utility.png and /dev/null differ diff --git a/mobile_pixel.png b/mobile_pixel.png deleted file mode 100644 index 860c1fc..0000000 Binary files a/mobile_pixel.png and /dev/null differ diff --git a/mobile_test_1080.png b/mobile_test_1080.png deleted file mode 100644 index 6a53d46..0000000 Binary files a/mobile_test_1080.png and /dev/null differ diff --git a/mobile_test_screenshot.png b/mobile_test_screenshot.png deleted file mode 100644 index 73b8173..0000000 Binary files a/mobile_test_screenshot.png and /dev/null differ diff --git a/mobile_test_screenshot2.png b/mobile_test_screenshot2.png deleted file mode 100644 index cd84ca6..0000000 Binary files a/mobile_test_screenshot2.png and /dev/null differ diff --git a/mumu_final_large.png b/mumu_final_large.png deleted file mode 100644 index 83bffcf..0000000 Binary files a/mumu_final_large.png and /dev/null differ diff --git a/mumu_final_screenshot.png b/mumu_final_screenshot.png deleted file mode 100644 index 5d94251..0000000 Binary files a/mumu_final_screenshot.png and /dev/null differ diff --git a/mumu_home.png b/mumu_home.png deleted file mode 100644 index 1272f35..0000000 Binary files a/mumu_home.png and /dev/null differ diff --git a/mumu_test_1.png b/mumu_test_1.png deleted file mode 100644 index 3dbb5d6..0000000 Binary files a/mumu_test_1.png and /dev/null differ diff --git a/mumu_test_home.png b/mumu_test_home.png deleted file mode 100644 index fc46a6d..0000000 Binary files a/mumu_test_home.png and /dev/null differ diff --git a/nginx-docker.conf b/nginx-docker.conf index 1c8fe81..a56243a 100644 --- a/nginx-docker.conf +++ b/nginx-docker.conf @@ -3,6 +3,29 @@ server { server_name localhost; root /usr/share/nginx/html; index index.html; + server_tokens off; + + add_header X-Content-Type-Options "nosniff" always; + add_header X-Frame-Options "SAMEORIGIN" always; + add_header Referrer-Policy "strict-origin-when-cross-origin" always; + + # API 目录封面等同源静态资源:必须优先于 SPA fallback,避免返回 index.html。 + # 文件来自 frontend public/api-directory/,构建后位于 /usr/share/nginx/html/api-directory/。 + location ^~ /api-directory/ { + try_files $uri =404; + expires 1y; + add_header Cache-Control "public, max-age=31536000, immutable" always; + types { + image/avif avif; + image/gif gif; + image/jpeg jpg jpeg; + image/png png; + image/svg+xml svg; + image/webp webp; + } + default_type application/octet-stream; + access_log off; + } # 开启gzip压缩 gzip on; @@ -202,15 +225,16 @@ server { } # Django admin / swagger / redoc / i18n / 测试页 - location /admin/ { proxy_pass http://backend:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 50M; } - location /swagger { proxy_pass http://backend:8000; proxy_set_header Host $host; } - location /swagger.json { proxy_pass http://backend:8000; proxy_set_header Host $host; } - location /redoc/ { proxy_pass http://backend:8000; proxy_set_header Host $host; } + # 生产默认仅内网可达;如需公网管理入口请走独立域名 + IP 白名单 + MFA。 + location /admin/ { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 5M; } + location /swagger { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; } + location /swagger.json { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; } + location /redoc/ { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; } location /i18n/ { proxy_pass http://backend:8000; proxy_set_header Host $host; } - location /test/ { proxy_pass http://backend:8000; proxy_set_header Host $host; } + location /test/ { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; } # 带哈希指纹的构建产物:永久强缓存(immutable) - location ~* \assets/.*\.(js|css|png|jpg|jpeg|gif|webp|avif|ico|svg|woff|woff2|ttf|eot)$ { + location ~* ^/assets/.*\.(js|css|png|jpg|jpeg|gif|webp|avif|ico|svg|woff|woff2|ttf|eot)$ { expires 1y; add_header Cache-Control "public, immutable"; access_log off; diff --git a/ranking-page.png b/ranking-page.png deleted file mode 100644 index 1dbb4dd..0000000 Binary files a/ranking-page.png and /dev/null differ diff --git a/scan-books.png b/scan-books.png deleted file mode 100644 index 9a1a0f9..0000000 Binary files a/scan-books.png and /dev/null differ diff --git a/scan-profile.png b/scan-profile.png deleted file mode 100644 index af1f611..0000000 Binary files a/scan-profile.png and /dev/null differ diff --git a/screenshot-1786915027798.png b/screenshot-1786915027798.png deleted file mode 100644 index 4b96a4b..0000000 Binary files a/screenshot-1786915027798.png and /dev/null differ diff --git a/screenshot-1786915208156.png b/screenshot-1786915208156.png deleted file mode 100644 index 4daf620..0000000 Binary files a/screenshot-1786915208156.png and /dev/null differ diff --git a/screenshot-1786915659547.png b/screenshot-1786915659547.png deleted file mode 100644 index 98f892e..0000000 Binary files a/screenshot-1786915659547.png and /dev/null differ diff --git a/screenshot-1786918595578.png b/screenshot-1786918595578.png deleted file mode 100644 index 1b3a3dc..0000000 Binary files a/screenshot-1786918595578.png and /dev/null differ diff --git a/screenshot_home.png b/screenshot_home.png deleted file mode 100644 index 15b936a..0000000 Binary files a/screenshot_home.png and /dev/null differ diff --git a/screenshot_home2.png b/screenshot_home2.png deleted file mode 100644 index 99087e9..0000000 Binary files a/screenshot_home2.png and /dev/null differ diff --git a/screenshot_mumu1.png b/screenshot_mumu1.png deleted file mode 100644 index e489423..0000000 Binary files a/screenshot_mumu1.png and /dev/null differ diff --git a/study-after-recompress.png b/study-after-recompress.png deleted file mode 100644 index 7e3d30e..0000000 Binary files a/study-after-recompress.png and /dev/null differ diff --git a/study-localimg.png b/study-localimg.png deleted file mode 100644 index 319c423..0000000 Binary files a/study-localimg.png and /dev/null differ diff --git a/trae_shot.png b/trae_shot.png deleted file mode 100644 index 05b81db..0000000 Binary files a/trae_shot.png and /dev/null differ diff --git a/video-list.png b/video-list.png deleted file mode 100644 index 9ccc3cd..0000000 Binary files a/video-list.png and /dev/null differ diff --git a/video-playing.png b/video-playing.png deleted file mode 100644 index 376836b..0000000 Binary files a/video-playing.png and /dev/null differ diff --git a/videos-localcover.png b/videos-localcover.png deleted file mode 100644 index d79738a..0000000 Binary files a/videos-localcover.png and /dev/null differ