# 部署说明（NobadyBox 项目文件下载站）

> 状态：**已部署**（2026-10-28），首页、STL、zip 在服务器本机和 Mac 上都验证过 200，大小一致。

- 服务器：shihe（FDE 演示服务器，47.119.151.148，宝塔 + nginx）
- 服务器目录：`/www/wwwroot/nobadybox-files/`
- 访问地址（推荐）：**https://nobadybox.imai.fan/**（2026-10-28 新增，http 会 301 跳到 https）
- 旧地址（仍可用）：http://47.119.151.148/nobadybox-files/

## 域名站点 nobadybox.imai.fan

- 解析：imai.fan 泛解析 → 47.119.151.148
- nginx 配置：`/www/server/panel/vhost/nginx/nobadybox.imai.fan.conf`（新增文件；80 端口只留 `/.well-known/acme-challenge/`，其余 301 到 https；443 的 root 同为 `/www/wwwroot/nobadybox-files`，开 autoindex、charset utf-8）
- 日志：`/www/wwwlogs/nobadybox.imai.fan.access.log`、`/www/wwwlogs/nobadybox.imai.fan.error.log`
- 证书：Let's Encrypt，单域名，用服务器上已有的 certbot（`/opt/octop/certbot-venv/bin/certbot`）webroot 模式签发；
  文件在 `/etc/letsencrypt/live/nobadybox.imai.fan/`，当前到期 2027-01-26
- 续期：systemd 定时器 `nobadybox-cert-renew.timer`（每天 04:50、16:50 前后各检查一次，`certbot renew --cert-name nobadybox.imai.fan`，续完自动 reload nginx）。
  查看：`systemctl list-timers | grep nobady`
- 开通脚本：本文件夹里的 `开通nobadybox域名.sh`（已执行过，不要再跑；配置文件已存在时它会自动停止）

## 旧 IP 地址站点
- 方式：在 `/www/server/panel/vhost/nginx/` 新增了 `nobadybox-files.conf`（只新增文件，不改已有站点），
  监听 80 端口、`server_name 47.119.151.148`，`location /nobadybox-files/` 指向上面的目录，开 `autoindex on`、`charset utf-8`。
  用 80 端口是因为它已经放行，不用动防火墙。

## 以后怎么更新

在本文件夹里运行：

```bash
./同步到服务器.sh
```

它会先跑 `python3 生成下载页.py`（重新生成 index.html 和全量 zip），再执行：

```bash
rsync -avz --delete --exclude '.DS_Store' --exclude '.git' --exclude '.ssh' ./ shihe:/www/wwwroot/nobadybox-files/
```

注意：同步脚本带 `--delete`，本地删掉的文件服务器上也会删（只限 nobadybox-files 目录）。
