diff --git a/docker/run/docker-compose.yaml b/docker/run/docker-compose.yaml index 2d3196bd..cf5bd70f 100644 --- a/docker/run/docker-compose.yaml +++ b/docker/run/docker-compose.yaml @@ -11,6 +11,8 @@ services: ports: # 端口映射 # ↓↓↓↓ ---------------------------------------------------------- 如果端口有冲突,可以修改第一个7001为其他不冲突的端口号 - "7001:7001" + # ↓↓↓↓ ---------------------------------------------------------- https端口,可以根据实际情况,是否暴露相关服务端口 + - "7002:7002" dns: # ↓↓↓↓ ---------------------------------------------------------- 如果出现getaddrinfo ENOTFOUND等错误,可以尝试修改或注释dns配置 - 223.5.5.5 diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 4236d318..099f3fef 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -97,6 +97,7 @@ export default defineConfig({ { text: "阿里云相关", link: "/guide/use/aliyun/" }, { text: "忘记密码", link: "/guide/use/forgotpasswd/" }, { text: "数据备份", link: "/guide/use/backup/" }, + { text: "Certd本身的证书更新", link: "/guide/use/https/index.md" }, { text: "如何贡献代码", link: "/guide/development/index.md" }, ] }, diff --git a/docs/guide/install/1panel/index.md b/docs/guide/install/1panel/index.md index 8b2215d5..2407c11a 100644 --- a/docs/guide/install/1panel/index.md +++ b/docs/guide/install/1panel/index.md @@ -24,7 +24,7 @@ https://1panel.cn/docs/installation/online_installation/ 3. 访问测试 http://ip:7001 - +https://ip:7002 ## 三、升级 diff --git a/docs/guide/install/baota/index.md b/docs/guide/install/baota/index.md index 49f35e7e..f1a92dbc 100644 --- a/docs/guide/install/baota/index.md +++ b/docs/guide/install/baota/index.md @@ -31,7 +31,8 @@ ## 二、访问应用 -http://ip:7001 +http://ip:7001 +https://ip:7002 ## 三、如何升级 diff --git a/docs/guide/install/docker/index.md b/docs/guide/install/docker/index.md index 690a03bd..f7ddb7ba 100644 --- a/docs/guide/install/docker/index.md +++ b/docs/guide/install/docker/index.md @@ -45,9 +45,10 @@ docker compose up -d ### 3. 访问测试 -http://your_server_ip:7001 -默认账号密码:admin/123456 -记得修改密码 +http://your_server_ip:7001 +https://your_server_ip:7002 +默认账号密码:admin/123456 +记得修改密码 ## 二、升级 diff --git a/docs/guide/install/source/index.md b/docs/guide/install/source/index.md index d06ba24a..7228e492 100644 --- a/docs/guide/install/source/index.md +++ b/docs/guide/install/source/index.md @@ -17,7 +17,8 @@ cd certd ### 访问测试 -http://your_server_ip:7001 +http://your_server_ip:7001 +https://your_server_ip:7002 默认账号密码:admin/123456 记得修改密码 diff --git a/docs/guide/start.md b/docs/guide/start.md index 78fff302..8d95a8c9 100644 --- a/docs/guide/start.md +++ b/docs/guide/start.md @@ -25,7 +25,8 @@ https://certd.handsfree.work/ ### 2. 访问测试 -http://your_server_ip:7001 +http://your_server_ip:7001 +https://your_server_ip:7002 默认账号密码:admin/123456 记得修改密码 diff --git a/docs/guide/use/https/images/1.png b/docs/guide/use/https/images/1.png new file mode 100644 index 00000000..4973aa96 Binary files /dev/null and b/docs/guide/use/https/images/1.png differ diff --git a/docs/guide/use/https/images/2.png b/docs/guide/use/https/images/2.png new file mode 100644 index 00000000..fdd65d1f Binary files /dev/null and b/docs/guide/use/https/images/2.png differ diff --git a/docs/guide/use/https/images/3.png b/docs/guide/use/https/images/3.png new file mode 100644 index 00000000..3e25793f Binary files /dev/null and b/docs/guide/use/https/images/3.png differ diff --git a/docs/guide/use/https/index.md b/docs/guide/use/https/index.md new file mode 100644 index 00000000..619737cb --- /dev/null +++ b/docs/guide/use/https/index.md @@ -0,0 +1,28 @@ +# Certd本身的https证书配置 + +## 一、启用https + +`Certd`默认启用https,监听7002端口 +如果你想关闭https,或者修改端口,可以在环境变量中配置 +```shell +CERTD_HTTPS_ENABLE=true +CERTD_HTTPS_port=7002 + +``` + +## 二、自动更新Certd的https证书 + +### 1、创建证书流水线 + +参考Certd顶部的创建证书流水线教程 + +### 2、配置复制到本机任务 +![](./images/1.png) +![](./images/2.png) + +### 3、重启Certd +![img.png](./images/3.png) + +:::warning +重启Certd插件,并不具备重启自己的能力,而是`杀死自己`,然后靠`Docker`来重启自己 +::: \ No newline at end of file diff --git a/packages/ui/certd-server/src/modules/auto/https/server.ts b/packages/ui/certd-server/src/modules/auto/https/server.ts index e6894600..8a4954ba 100644 --- a/packages/ui/certd-server/src/modules/auto/https/server.ts +++ b/packages/ui/certd-server/src/modules/auto/https/server.ts @@ -13,10 +13,7 @@ export type HttpsServerOptions = { }; export async function startHttpsServer(opts: HttpsServerOptions) { - // const httpsServer = https.createServer({ - // key: fs.readFileSync(path.join(__dirname, '../ssl/2_certd.cn.key')), - // cert - + logger.info('========================================='); if (!opts.key || !opts.cert) { logger.error('证书路径未配置,无法启动https服务,请先配置:koa.https.key和koa.https.cert'); return; diff --git a/packages/ui/certd-server/src/plugins/plugin-other/plugins/plugin-restart.ts b/packages/ui/certd-server/src/plugins/plugin-other/plugins/plugin-restart.ts index 7419cb9b..41cb5456 100644 --- a/packages/ui/certd-server/src/plugins/plugin-other/plugins/plugin-restart.ts +++ b/packages/ui/certd-server/src/plugins/plugin-other/plugins/plugin-restart.ts @@ -30,7 +30,7 @@ export class RestartCertdPlugin extends AbstractTaskPlugin { } this.logger.info(`Certd 将在 ${this.delay} 秒后关闭`); setTimeout(() => { - this.logger.info('重启 Certd'); + this.logger.info('关闭 Certd'); process.exit(1); }, this.delay * 1000); }