Files

65 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AutoSSL - 自动 SSL 证书管理工具
基于 Go 开发的 ACME 自动 SSL 证书申请与管理工具,提供 Web 管理界面。
## 功能
- ✅ 自动申请 SSL 证书(Let's Encrypt / ZeroSSL
- ✅ 自动续期(每天凌晨 3 点自动检查并续期)
- ✅ HTTP-01(端口 80)和 DNS-01 验证方式
- ✅ 支持阿里云 DNS / Cloudflare / DNSPod
- ✅ Web 管理界面(仪表盘、证书列表、申请、查看、续期、删除)
- ✅ SQLite 数据存储
- ✅ Docker 一键部署
## 快速开始
### Docker 部署
```bash
git clone <your-repo-url> autossl
cd autossl
docker compose up -d
```
访问 http://localhost:8080
### 直接运行
```bash
# 编译
cd backend && go build -o autossl .
# 运行(默认端口 8080
./autossl
```
## 环境变量
| 变量 | 默认值 | 说明 |
|------|--------|------|
| PORT | 8080 | Web 服务端口 |
| DB_PATH | ./data/autossl.db | SQLite 数据库路径 |
| CERT_DIR | ./data/certs | 证书文件存储目录 |
| ACCOUNTS_DIR | ./data/accounts | ACME 账号存储目录 |
## API 接口
| 方法 | 路径 | 说明 |
|------|------|------|
| GET | /api/stats | 统计信息 |
| GET | /api/certificates | 证书列表 |
| GET | /api/certificates/:id | 证书详情 |
| POST | /api/certificates | 申请证书 |
| PUT | /api/certificates/:id | 更新证书配置 |
| DELETE | /api/certificates/:id | 删除证书 |
| POST | /api/certificates/:id/renew | 手动续期 |
| GET | /api/certificates/:id/files | 查看证书文件 |
| GET | /api/renewals/check | 触发续期检查 |
## 证书文件位置
申请成功后的证书文件存储在 `./data/certs/<domain>/` 目录:
- `fullchain.pem` - 完整证书链
- `privkey.pem` - 私钥
- `chain.pem` - CA 证书链