| @@ -19,6 +19,7 @@ const PEM_PATH = path.join(ROOT_PATH, 'cert'); | |||||
| const leStore = GreenlockStoreFs.create({ | const leStore = GreenlockStoreFs.create({ | ||||
| configDir: path.join(ROOT_PATH, 'letsencrypt'), | configDir: path.join(ROOT_PATH, 'letsencrypt'), | ||||
| basePath: path.join(ROOT_PATH, 'letsencrypt'), | basePath: path.join(ROOT_PATH, 'letsencrypt'), | ||||
| env: think.env | |||||
| }); | }); | ||||
| // 创建验证对象 | // 创建验证对象 | ||||
| const leHttpChallenge = LeChallengeFs.create({ | const leHttpChallenge = LeChallengeFs.create({ | ||||
| @@ -35,7 +36,7 @@ const greenlock = Greenlock.create({ | |||||
| // 测试环境 | // 测试环境 | ||||
| // server: 'https://acme-staging-v02.api.letsencrypt.org/directory', | // server: 'https://acme-staging-v02.api.letsencrypt.org/directory', | ||||
| // 生产环境 | // 生产环境 | ||||
| server: 'https://acme-v02.api.letsencrypt.org/directory', | |||||
| server: 'https://acme-v02.api.letsencrypt.org/directory', | |||||
| store: leStore, | store: leStore, | ||||
| challenges: { | challenges: { | ||||
| 'http-01': leHttpChallenge, | 'http-01': leHttpChallenge, | ||||
| @@ -128,7 +129,7 @@ export default class extends Base { | |||||
| return this.display(); | return this.display(); | ||||
| } | } | ||||
| async showsslAction(){ | |||||
| async showsslAction () { | |||||
| console.log("==".repeat(20), "开始检查证书", "==".repeat(20)); | console.log("==".repeat(20), "开始检查证书", "==".repeat(20)); | ||||
| let domains = this.config().domains; | let domains = this.config().domains; | ||||
| let msgs = [] | let msgs = [] | ||||
| @@ -177,7 +178,7 @@ export default class extends Base { | |||||
| for (let domain of updateList) { | for (let domain of updateList) { | ||||
| try { | try { | ||||
| let email = "waitshan@163.com" | let email = "waitshan@163.com" | ||||
| const results = await CreateSSL(domain,email); | |||||
| const results = await CreateSSL(domain, email); | |||||
| console.log(`证书${domain},生成成功`); | console.log(`证书${domain},生成成功`); | ||||
| } catch (e) { | } catch (e) { | ||||
| console.log("==".repeat(20), "证书生成失败", "==".repeat(20)); | console.log("==".repeat(20), "证书生成失败", "==".repeat(20)); | ||||