diff --git a/web/projects/ui/src/app/pages/server-routes/acme/acme.page.ts b/web/projects/ui/src/app/pages/server-routes/acme/acme.page.ts index 8a4e2eda9..b17af017a 100644 --- a/web/projects/ui/src/app/pages/server-routes/acme/acme.page.ts +++ b/web/projects/ui/src/app/pages/server-routes/acme/acme.page.ts @@ -7,7 +7,7 @@ import { FormDialogService } from '../../../services/form-dialog.service' import { FormComponent } from '../../../components/form.component' import { configBuilderToSpec } from '../../../util/configBuilderToSpec' import { ISB, utils } from '@start9labs/start-sdk' -import { toAcmeName } from 'src/app/util/acme' +import { ACME_Name, ACME_URL, knownACME, toAcmeName } from 'src/app/util/acme' @Component({ selector: 'acme', @@ -79,16 +79,18 @@ export class ACMEPage { const acmeSpec = ISB.InputSpec.of({ provider: ISB.Value.union( - { name: 'Provider', default: 'letsencrypt' }, + { name: 'Provider', default: knownACME['Let\'s Encrypt'] as any }, ISB.Variants.of({ - letsencrypt: { - name: `Let's Encrypt`, - spec: ISB.InputSpec.of({}), - }, - 'letsencrypt-staging': { - name: `Let's Encrypt (Staging)`, - spec: ISB.InputSpec.of({}), - }, + ...Object.entries(knownACME).reduce( + (obj, [name, url]) => ({ + ...obj, + [url]: { + name, + spec: ISB.InputSpec.of({}), + }, + }), + {}, + ), other: { name: 'Other', spec: ISB.InputSpec.of({ diff --git a/web/projects/ui/src/app/util/acme.ts b/web/projects/ui/src/app/util/acme.ts index c84089a25..79ae84faf 100644 --- a/web/projects/ui/src/app/util/acme.ts +++ b/web/projects/ui/src/app/util/acme.ts @@ -11,8 +11,8 @@ export function toAcmeUrl(name: ACME_Name | string): ACME_URL | string { } export const knownACME = { - letsencrypt: 'https://acme-v02.api.letsencrypt.org/directory', - 'letsencrypt-staging': + 'Let\'s Encrypt': 'https://acme-v02.api.letsencrypt.org/directory', + 'Let\'s Encrypt (Staging)': 'https://acme-staging-v02.api.letsencrypt.org/directory', }