Skip to content

Commit 349c56b

Browse files
committed
docs(config): 精简 README 配置说明
1 parent b67207b commit 349c56b

3 files changed

Lines changed: 41 additions & 202 deletions

File tree

README.md

Lines changed: 2 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -38,77 +38,7 @@ curl -fsSL https://gh-proxy.com/https://raw.githubusercontent.com/https-cert/dep
3838
curl -fsSL https://gh-proxy.com/https://raw.githubusercontent.com/https-cert/deploy/main/scripts/install.sh | sh -s -- --uninstall --purge
3939
```
4040

41-
### 2. 配置
42-
43-
安装脚本会把发布包中的 `config.yaml` 模板复制到 `/opt/anssl/config.yaml`,如果配置文件已存在则不会覆盖。首次安装后直接编辑该文件,修改其中的 `accessKey` 和需要启用的部署目标。
44-
45-
重复执行安装脚本时,会保留已有 `config.yaml`。如果已安装但未运行,会直接更新程序;如果检测到 anssl 正在运行,会先停止旧版本,再安装新版本。
46-
47-
后续更新时只替换 `anssl` 可执行文件即可,避免手动解压覆盖已有的 `config.yaml`
48-
49-
`config.yaml` 示例:
50-
51-
```yaml
52-
server:
53-
# 从 anssl.cn 设置 -> 个人资料 中获取
54-
accessKey: "your_access_key_here"
55-
# HTTP-01 验证服务端口
56-
port: 19000
57-
58-
ssl:
59-
# Nginx 证书目录(可选,留空则不部署到 Nginx)
60-
nginxPath: ""
61-
# Apache 证书目录(可选,留空则不部署到 Apache)
62-
apachePath: ""
63-
# RustFS TLS 证书目录(可选,留空则不部署到 RustFS)
64-
rustFSPath: ""
65-
# 飞牛部署(可选)
66-
feiNiuEnabled: false
67-
# 1Panel 配置(可选,留空则不部署到 1Panel)
68-
onePanel:
69-
url: ""
70-
apiKey: ""
71-
72-
update:
73-
# 镜像源类型:github、ghproxy、custom
74-
mirror: "ghproxy"
75-
# 使用 custom 镜像源时填写
76-
customUrl: ""
77-
# HTTP 代理地址(可选)
78-
proxy: ""
79-
80-
# 云服务配置(可选)
81-
provider:
82-
- name: "aliyun"
83-
remark: "阿里云"
84-
auth:
85-
accessKeyId: "your-aliyun-access-key-id"
86-
accessKeySecret: "your-aliyun-access-key-secret"
87-
# ESA 业务专用字段(仅在执行 ESA 业务时使用)
88-
esaSiteId: "your-esa-site-id"
89-
90-
- name: "qiniu"
91-
remark: "七牛云"
92-
auth:
93-
accessKey: "your-qiniu-access-key"
94-
accessSecret: "your-qiniu-access-secret"
95-
96-
- name: "cloudTencent"
97-
remark: "腾讯云"
98-
auth:
99-
secretId: "your-tencent-secret-id"
100-
secretKey: "your-tencent-secret-key"
101-
```
102-
103-
#### 已支持的云服务商
104-
105-
> | 服务商 | name 值 | 认证字段 |
106-
> | :----: | :------------: | :------------------------------------------------: |
107-
> | 阿里云 | `aliyun` | accessKeyId, accessKeySecret(ESA可选:esaSiteId) |
108-
> | 七牛云 | `qiniu` | accessKey, accessSecret |
109-
> | 腾讯云 | `cloudTencent` | secretId, secretKey |
110-
111-
### 3. 配置 Nginx
41+
### 2. 配置 Nginx
11242

11343
添加 HTTP-01 验证反向代理(用于证书申请):
11444

@@ -126,7 +56,7 @@ location ~ ^/.well-known/acme-challenge/(.+)$ {
12656
sudo nginx -t && sudo nginx -s reload
12757
```
12858

129-
### 4. 运行
59+
### 3. 运行
13060

13161
```bash
13262
# 启动守护进程
@@ -168,23 +98,6 @@ anssl check-update # 检查更新
16898
anssl update # 执行更新
16999
```
170100

171-
## 配置说明
172-
173-
| 配置项 | 必填 | 说明 |
174-
| --------------------- | ---- | -------------------------------------------- |
175-
| `server.accessKey` | ✅ | 从 anssl.cn 获取的访问密钥 |
176-
| `server.port` | ❌ | HTTP-01 验证端口,默认 19000 |
177-
| `ssl.nginxPath` | ❌ | Nginx 证书目录,配置后自动部署并重载 Nginx |
178-
| `ssl.apachePath` | ❌ | Apache 证书目录,配置后自动部署并重载 Apache |
179-
| `ssl.rustFSPath` | ❌ | RustFS TLS 证书目录,配置后自动部署证书 |
180-
| `ssl.feiNiuEnabled` | ❌ | 飞牛 OS 证书部署开关,默认 false |
181-
| `ssl.onePanel.url` | ❌ | 1Panel 面板地址(如 http://localhost:10000) |
182-
| `ssl.onePanel.apiKey` | ❌ | 1Panel API 密钥,在面板设置中生成 |
183-
| `log.maxSizeMB` | ❌ | 单个日志文件最大体积,默认 20 MB |
184-
| `log.maxBackups` | ❌ | 最多保留的轮转日志数量,默认 5 |
185-
| `log.maxAgeDays` | ❌ | 轮转日志最长保留天数,默认 30 |
186-
| `provider` | ❌ | 云服务配置(阿里云/七牛云/腾讯云) |
187-
188101
## 故障排除
189102

190103
### HTTP-01 验证失败

README_EN.md

Lines changed: 2 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -38,86 +38,7 @@ curl -fsSL https://gh-proxy.com/https://raw.githubusercontent.com/https-cert/dep
3838
curl -fsSL https://gh-proxy.com/https://raw.githubusercontent.com/https-cert/deploy/main/scripts/install.sh | sh -s -- --uninstall --purge
3939
```
4040

41-
### 2. Configure
42-
43-
The install script copies the packaged `config.yaml` template to `/opt/anssl/config.yaml` and never overwrites an existing config file. On first install, edit that file and set its `accessKey` and any deployment targets you want to enable.
44-
45-
Running the install script again keeps the existing `config.yaml`. If anssl is installed but not running, the script updates the binary directly; if anssl is running, the script stops the old daemon before installing the new version.
46-
47-
For later updates, replace only the `anssl` executable to avoid overwriting an existing `config.yaml`.
48-
49-
`config.yaml` example:
50-
51-
```yaml
52-
server:
53-
# Get this from anssl.cn -> Settings -> Profile
54-
accessKey: "your_access_key_here"
55-
# HTTP-01 validation service port
56-
port: 19000
57-
58-
ssl:
59-
# Nginx certificate directory (optional; leave empty to disable Nginx deployment)
60-
nginxPath: ""
61-
# Apache certificate directory (optional; leave empty to disable Apache deployment)
62-
apachePath: ""
63-
# RustFS TLS certificate directory (optional; leave empty to disable RustFS deployment)
64-
rustFSPath: ""
65-
# FeiNiu deployment (optional)
66-
feiNiuEnabled: false
67-
# 1Panel configuration (optional; leave empty to disable 1Panel deployment)
68-
onePanel:
69-
url: ""
70-
apiKey: ""
71-
72-
update:
73-
# Mirror type: github, ghproxy, custom
74-
mirror: "ghproxy"
75-
# Required when mirror is custom
76-
customUrl: ""
77-
# HTTP proxy URL (optional)
78-
proxy: ""
79-
80-
# Cloud provider configuration (optional)
81-
provider:
82-
- name: "aliyun"
83-
remark: "Alibaba Cloud"
84-
auth:
85-
accessKeyId: "your-aliyun-access-key-id"
86-
accessKeySecret: "your-aliyun-access-key-secret"
87-
# ESA-specific field (only used for ESA deployment)
88-
esaSiteId: "your-esa-site-id"
89-
90-
- name: "qiniu"
91-
remark: "Qiniu Cloud"
92-
auth:
93-
accessKey: "your-qiniu-access-key"
94-
accessSecret: "your-qiniu-access-secret"
95-
96-
- name: "cloudTencent"
97-
remark: "Tencent Cloud"
98-
auth:
99-
secretId: "your-tencent-secret-id"
100-
secretKey: "your-tencent-secret-key"
101-
```
102-
103-
> #### Supported Cloud Providers
104-
>
105-
> | Provider | `name` value | Auth fields |
106-
> | :------------ | :-------------- | :-------------------------------------------------- |
107-
> | Alibaba Cloud | `aliyun` | accessKeyId, accessKeySecret (ESA optional: esaSiteId) |
108-
> | Qiniu Cloud | `qiniu` | accessKey, accessSecret |
109-
> | Tencent Cloud | `cloudTencent` | secretId, secretKey |
110-
111-
> #### Alibaba Cloud CAS/ESA Separation (No Auto-Detection)
112-
>
113-
> - Select “Alibaba Cloud - CAS Upload Certificate”: calls CAS `UploadUserCertificate`
114-
> - Select “Alibaba Cloud - ESA Upload Certificate”: calls ESA `SetCertificate` (requires `esaSiteId`)
115-
>
116-
> #### Tencent Cloud Certificate Upload
117-
>
118-
> - Select “Tencent Cloud - Upload Certificate”: uses Tencent Cloud Go SDK to call SSL `UploadCertificate` (`ssl.tencentcloudapi.com`, `2019-12-05`)
119-
120-
### 3. Configure Nginx
41+
### 2. Configure Nginx
12142

12243
Add an HTTP-01 reverse proxy rule (for certificate issuance):
12344

@@ -135,7 +56,7 @@ Reload Nginx:
13556
sudo nginx -t && sudo nginx -s reload
13657
```
13758

138-
### 4. Run
59+
### 3. Run
13960

14061
```bash
14162
# Start daemon
@@ -177,23 +98,6 @@ anssl check-update # Check updates
17798
anssl update # Run update
17899
```
179100

180-
## Configuration Reference
181-
182-
| Config key | Required | Description |
183-
| ---------------------- | -------- | ------------------------------------------------------------ |
184-
| `server.accessKey` | ✅ | Access key from anssl.cn |
185-
| `server.port` | ❌ | HTTP-01 validation port, default `19000` |
186-
| `ssl.nginxPath` | ❌ | Nginx cert directory; auto deploy + reload Nginx |
187-
| `ssl.apachePath` | ❌ | Apache cert directory; auto deploy + reload Apache |
188-
| `ssl.rustFSPath` | ❌ | RustFS TLS cert directory; auto deploy certificates |
189-
| `ssl.feiNiuEnabled` | ❌ | FeiNiu OS deployment switch, default `false` |
190-
| `ssl.onePanel.url` | ❌ | 1Panel URL (e.g. `http://localhost:10000`) |
191-
| `ssl.onePanel.apiKey` | ❌ | 1Panel API key generated from panel settings |
192-
| `log.maxSizeMB` | ❌ | Max size per log file, default `20` MB |
193-
| `log.maxBackups` | ❌ | Max rotated log files to keep, default `5` |
194-
| `log.maxAgeDays` | ❌ | Max age for rotated logs, default `30` days |
195-
| `provider` | ❌ | Cloud provider config (Alibaba Cloud / Qiniu Cloud / Tencent Cloud) |
196-
197101
## Troubleshooting
198102

199103
### HTTP-01 validation failed

config.example.yaml

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,79 @@
1-
# anssl 配置模板
1+
# anssl 配置模板。
2+
# 首次安装后通常只需要先填写 server.accessKey。
3+
# 除 server.accessKey 外,其余字段均可按需要启用;留空或 false 表示不启用对应能力。
24
server:
3-
# 从 anssl.cn 设置 -> 个人资料 中获取
5+
# 必填。从 anssl.cn 设置 -> 个人资料 中获取,用于客户端连接后端时鉴权。
46
accessKey: "your_access_key_here"
5-
# HTTP-01 验证服务端口
7+
# 可选。HTTP-01 验证服务端口,默认 19000。
8+
# Nginx/Apache 反向代理 .well-known/acme-challenge 到该端口后,证书申请验证可自动完成。
69
port: 19000
710

811
ssl:
9-
# Nginx 证书目录(可选,留空则不部署到 Nginx)
12+
# 可选。Nginx 证书目录,配置后会自动部署证书并执行 nginx -t / nginx reload。
13+
# 留空则不部署到 Nginx。
1014
nginxPath: ""
11-
# Apache 证书目录(可选,留空则不部署到 Apache)
15+
# 可选。Apache 证书目录,配置后会自动部署证书并执行 Apache 配置测试 / graceful reload。
16+
# 留空则不部署到 Apache。
1217
apachePath: ""
13-
# RustFS TLS 证书目录(可选,留空则不部署到 RustFS)
18+
# 可选。RustFS TLS 证书目录,配置后会自动部署 RustFS 使用的 TLS 证书。
19+
# 留空则不部署到 RustFS。
1420
rustFSPath: ""
15-
# 飞牛部署(可选)
21+
# 可选。飞牛 OS 证书部署开关,默认 false。
1622
feiNiuEnabled: false
17-
# 1Panel 配置(可选,留空则不部署到 1Panel
23+
# 可选。1Panel 配置。url 或 apiKey 留空则不部署到 1Panel
1824
onePanel:
25+
# 1Panel 面板地址,例如 http://localhost:10000。
1926
url: ""
27+
# 1Panel API 密钥,在 1Panel 面板 设置 -> 安全 -> API 接口 中生成。
2028
apiKey: ""
2129

2230
update:
23-
# 镜像源类型:github、ghproxy、custom
31+
# 可选。自更新下载源类型,支持 github、ghproxy、custom,默认 ghproxy。
32+
# github:直连 GitHub。
33+
# ghproxy:使用 https://gh-proxy.com/https://github.com 加速。
34+
# custom:使用 customUrl 指定的自定义 GitHub 镜像前缀。
2435
mirror: "ghproxy"
25-
# 使用 custom 镜像源时填写
36+
# 可选。mirror 为 custom 时必填,例如 https://your-proxy.example.com/https://github.com。
2637
customUrl: ""
27-
# HTTP 代理地址(可选)
38+
# 可选。HTTP/HTTPS 代理地址,例如 http://127.0.0.1:7890。
2839
proxy: ""
2940

3041
log:
31-
# 单个日志文件最大体积(MB),0 表示使用默认值 20
42+
# 可选。单个日志文件最大体积(MB),0 表示使用默认值 20
3243
maxSizeMB: 20
33-
# 最多保留的轮转日志文件数量,0 表示使用默认值 5
44+
# 可选。最多保留的轮转日志文件数量,0 表示使用默认值 5
3445
maxBackups: 5
35-
# 轮转日志最长保留天数,0 表示使用默认值 30
46+
# 可选。轮转日志最长保留天数,0 表示使用默认值 30
3647
maxAgeDays: 30
3748

38-
# 云服务配置(可选)
49+
# 可选。云服务 provider 配置。未配置则不启用云服务上传。
50+
# 支持的 name:
51+
# - aliyun:阿里云。CAS 上传证书使用 accessKeyId/accessKeySecret;ESA 业务额外需要 esaSiteId。
52+
# - qiniu:七牛云。使用 accessKey/accessSecret。
53+
# - cloudTencent:腾讯云。使用 secretId/secretKey,通过腾讯云 SSL UploadCertificate 上传。
3954
# provider:
4055
# - name: "aliyun"
4156
# remark: "阿里云"
4257
# auth:
58+
# # 阿里云 AccessKey ID。
4359
# accessKeyId: "your-aliyun-access-key-id"
60+
# # 阿里云 AccessKey Secret。
4461
# accessKeySecret: "your-aliyun-access-key-secret"
62+
# # 阿里云 ESA 业务专用字段,仅执行 ESA 上传证书时需要。
4563
# esaSiteId: "your-esa-site-id"
4664
#
4765
# - name: "qiniu"
4866
# remark: "七牛云"
4967
# auth:
68+
# # 七牛云 AccessKey。
5069
# accessKey: "your-qiniu-access-key"
70+
# # 七牛云 SecretKey。
5171
# accessSecret: "your-qiniu-access-secret"
5272
#
5373
# - name: "cloudTencent"
5474
# remark: "腾讯云"
5575
# auth:
76+
# # 腾讯云 SecretId。
5677
# secretId: "your-tencent-secret-id"
78+
# # 腾讯云 SecretKey。
5779
# secretKey: "your-tencent-secret-key"

0 commit comments

Comments
 (0)