Skip to content

Commit

Permalink
use common name for letsencrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
MattDHill committed Jan 16, 2025
1 parent 6825120 commit d5ee876
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
22 changes: 12 additions & 10 deletions web/projects/ui/src/app/pages/server-routes/acme/acme.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions web/projects/ui/src/app/util/acme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}

Expand Down

0 comments on commit d5ee876

Please sign in to comment.