Commit 0a244950 authored by nanahira's avatar nanahira

Update src/acme.ts, src/site.ts files

parent c5af1036
Pipeline #32617 passed with stages
in 22 minutes and 9 seconds
......@@ -2,11 +2,16 @@ import { createServer } from 'http';
import acme, { Client } from 'acme-client';
import fs from 'fs';
import path from 'path';
import { pickCert } from './check-cert';
let email: string;
export const domainsToBeSigned: string[] = [];
export function addSignCert(domains: string[], payload: string) {
export async function addSignCert(domains: string[], payload: string) {
const pickedCert = await pickCert(domains);
if (pickedCert) {
return pickedCert;
}
domainsToBeSigned.push(...domains);
if (!email) {
// acme://
......
......@@ -125,7 +125,7 @@ async function getSiteData(
const domains = hostname.split('+');
if (httpsCert !== '0' && httpsCert !== 'false') {
const cert = httpsCert?.startsWith('acme://')
? addSignCert(domains, httpsCert)
? await addSignCert(domains, httpsCert)
: !httpsCert ||
httpsCert === '1' ||
httpsCert === 'true' ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment