添加portainer,优化部署

This commit is contained in:
2026-04-08 09:58:40 +08:00
parent 14584aed3d
commit e5f841c624
31 changed files with 1882 additions and 1261 deletions

View File

@@ -33,6 +33,7 @@ certd/
├── .env.example # 配置模板
├── deploy.sh # 一键部署脚本
├── backup.sh # 备份脚本
├── uninstall.sh # 完全卸载脚本
├── nginx/
│ └── certd.conf # Nginx 反向代理配置
└── README.md # 本文件
@@ -198,6 +199,65 @@ docker compose up -d # 启动
docker compose restart # 重启
```
## 完全卸载
如果需要从服务器上完全移除 Certd使用卸载脚本
```bash
cd /opt/certd
bash uninstall.sh
```
脚本会**交互式确认**每个危险操作,按顺序执行:
| 步骤 | 操作 | 确认方式 |
|------|------|----------|
| 0 | 卸载前备份(可选) | y/N |
| 1 | 停止并删除 Certd 容器 | 输入 YES |
| 2 | 删除 Docker 镜像 | 自动 |
| 3 | 删除 Nginx 站点配置并重载 | 自动 |
| 4 | 删除 Let's Encrypt SSL 证书 | 自动 |
| 5 | 清理 Certbot 定时任务(仅当无其他证书时) | 自动 |
| 6 | 删除数据目录 | 输入 DELETE |
| 7 | 删除部署目录 `/opt/certd` | y/N |
**备份目录 `/var/backups/certd/` 始终保留**,不会被删除。
> 卸载后如需恢复,参考上方「恢复备份」章节。
<details>
<summary>手动卸载步骤(不使用脚本)</summary>
```bash
cd /opt/certd
# 1. 建议先备份
bash backup.sh
# 2. 停止并删除容器
docker compose down -v
# 3. 删除 Docker 镜像(可选)
docker image rm registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
# 4. 删除 Nginx 配置
rm -f /etc/nginx/sites-enabled/certd /etc/nginx/sites-available/certd
nginx -t && systemctl reload nginx
# 5. 删除 SSL 证书
certbot delete --cert-name 你的域名
# 6. 删除数据目录(⚠ 不可恢复)
rm -rf /data/certd
# 7. 删除部署目录(可选)
rm -rf /opt/certd
# 备份目录保留在 /var/backups/certd/
```
</details>
## 使用 Certd 管理证书
### 添加 DNS 授权