Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ifuyun/cdn-cert
Automatically push the new certificates to Aliyun CDN
https://github.com/ifuyun/cdn-cert
aliyun cdn https letsencrypt
Last synced: 10 days ago
JSON representation
Automatically push the new certificates to Aliyun CDN
- Host: GitHub
- URL: https://github.com/ifuyun/cdn-cert
- Owner: ifuyun
- License: agpl-3.0
- Created: 2024-10-17T19:25:30.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-10-21T13:41:49.000Z (28 days ago)
- Last Synced: 2024-10-21T22:13:10.284Z (27 days ago)
- Topics: aliyun, cdn, https, letsencrypt
- Language: TypeScript
- Homepage: https://www.ifuyun.com
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# CDN Cert
自动将 Let's encrypt 证书推送到阿里云 CDN。
## 使用方法
1. 下载项目:`git clone [email protected]:ifuyun/cdn-cert.git`
2. 复制`config.sample.ts`,将其命名为`config.ts`,并修改配置。
3. 执行`npm i`安装依赖。
4. 执行`npm run start:dev`更新证书。
5. 执行`npm run start:demo`运行示例。## 配置
以对象数组的形式配置多个用户和域名:
| 配置项 | 说明 |
|-------------------------|------------------|
| accessKeyId | AccessKey ID |
| accessKeySecret | AccessKey Secret |
| regionId | 可用区ID,可选 |
| cert | 证书配置 |
| cert.certDomain | 根域名 |
| cert.certPublicKeyPath | 证书路径 |
| cert.certPrivateKeyPath | 证书私钥路径 |
| cert.cdnDomains | CDN域名列表 |## 定时更新
```bash
crontab -e
```
```ini
# 每周日 04:00 执行
0 4 * * 0 node /path/to/repo/dist/index.js
```或者在`certbot renew`命令中追加`--deploy-hook "node /path/to/repo/dist/index.js"`参数:
```bash
certbot renew --manual --preferred-challenges dns --manual-auth-hook "alidns" --manual-cleanup-hook "alidns clean" --deploy-hook "node /path/to/repo/dist/index.js"
```