新增 nginx 整站 Basic Auth(deploy.sh auth 子命令)
This commit is contained in:
@@ -110,10 +110,14 @@ bash deploy.sh # 构建并发布前端(= web,自动保留 data/
|
||||
bash deploy.sh cookie # 交互粘贴新百炼 Cookie,写入后立即试跑并回显结果
|
||||
bash deploy.sh probe # 更新探针脚本/systemd 单元并试跑(timer 每 5 分钟)
|
||||
bash deploy.sh nginx # 刷新 nginx 站点配置并 reload
|
||||
bash deploy.sh auth # 交互式设置 Basic Auth 用户名/密码(不回显),整站开启认证
|
||||
bash deploy.sh auth off # 关闭 Basic Auth
|
||||
bash deploy.sh status # 定时器、快照、各 URL HTTP 自检
|
||||
bash deploy.sh all # nginx + web + probe
|
||||
```
|
||||
|
||||
Basic Auth 在 nginx 层整站生效(页面、`/api/`、`/bailian-admin/`、`/data/` 都要登录),浏览器输入一次后同域请求自动带凭证,前端无需改动;账号密码以 apr1 哈希存在服务器 `/etc/nginx/token-list.htpasswd`(640,密码经 600 临时文件透传,不进命令行/进程列表)。`nginx` 子命令每次按该文件是否存在自动决定开/关认证,所以换机器或重刷配置不会丢开关。
|
||||
|
||||
- Cookie 经 600 权限临时文件透传,不出现在远端命令行/进程列表;`.env` 同步到站点根上一级(`www/` 之外,nginx 发不出去)。
|
||||
- 可用 `DEPLOY_HOST` / `REMOTE_DIR` / `SITE_PORT` / `SUB2API_UPSTREAM` 环境变量覆盖默认目标。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user