fix: disable COOP and Origin-Agent-Cluster headers to resolve blank page over HTTP#2992
fix: disable COOP and Origin-Agent-Cluster headers to resolve blank page over HTTP#2992Copilot wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…on HTTP Agent-Logs-Url: https://github.com/whyour/qinglong/sessions/71ccc655-4ea0-4735-9e7c-9230000e08d5 Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
|
@copilot 主要问题不是这个,是 非 root 用户启动失败 |
Understood. Investigating the non-root startup failures now. The root causes are:
Fixing all of these now. |
- Guard /etc/resolv.conf write and crond behind root check in entrypoint;
non-root containers now stay alive via 'tail -f /dev/null' instead of
failing when crond exits with EPERM
- Set PM2_HOME to ${QL_DIR}/data/.pm2 (inside the data volume) so PM2
does not fall back to /root/.pm2, which is inaccessible to non-root users
- Pre-create /ql/.tmp and /ql/shell/preload during image build and make
them world-writable so non-root processes can write runtime files
- Wrap directory creation in initFile.ts with try/catch + recursive:true
so a permission error on ~/.ssh (HOME=/root for non-root user) is logged
as a warning instead of crashing the server init
使用 docker build 临时打包镜像测试下 |
|
... Built a local test image using Also confirmed the root path still works correctly ( The changes are ready — a full |
@copilot pm2 目录 和 shell preload 目录能不能不放到
whyour/qinglong:debian 镜像是不是是支持的 |
关于 pm2 目录和 shell/preload 目录的放置位置 — 您的句子似乎被引用块截断了,我不确定您希望将它们放到哪里。如果您希望:
请补充说明希望如何处理,我来对应修改。 关于 |
helmetv8 enablesCross-Origin-Opener-Policy: same-originandOrigin-Agent-Cluster: ?1by default. Both headers malfunction over HTTP: browsers ignore COOP for untrusted (non-HTTPS) origins, andOrigin-Agent-Clustertriggers a hard conflict when a browser previously cached the origin as site-keyed — causing the React app to render a blank page.Change
Explicitly disable both headers in the
helmetconfiguration inback/app.ts:Neither header provides security value over HTTP — COOP is spec'd to apply only to secure origins, and
Origin-Agent-Clusteris a memory-isolation hint with no auth/integrity implications.