Skip to content

Commit

Permalink
add backup nameserver cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Sep 27, 2023
1 parent c3f4860 commit 1c30e8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/pds/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export const envToCfg = (env: ServerEnvironment): ServerConfig => {
resolverTimeout: env.resolverTimeout ?? 3 * SECOND,
recoveryDidKey: env.recoveryDidKey ?? null,
serviceHandleDomains,
handleBackupNameservers: env.handleBackupNameservers,
}

// default to being required if left undefined
Expand Down Expand Up @@ -246,6 +247,7 @@ export type IdentityConfig = {
cacheMaxTTL: number
recoveryDidKey: string | null
serviceHandleDomains: string[]
handleBackupNameservers?: string[]
}

export type InvitesConfig =
Expand Down
2 changes: 2 additions & 0 deletions packages/pds/src/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const readEnv = (): ServerEnvironment => {
resolverTimeout: envInt('PDS_ID_RESOLVER_TIMEOUT'),
recoveryDidKey: envStr('PDS_RECOVERY_DID_KEY'),
serviceHandleDomains: envList('PDS_SERVICE_HANDLE_DOMAINS'),
handleBackupNameservers: envList('PDS_HANDLE_BACKUP_NAMESERVERS'),

// invites
inviteRequired: envBool('PDS_INVITE_REQUIRED'),
Expand Down Expand Up @@ -123,6 +124,7 @@ export type ServerEnvironment = {
resolverTimeout?: number
recoveryDidKey?: string
serviceHandleDomains?: string[] // public hostname by default
handleBackupNameservers?: string[]

// invites
inviteRequired?: boolean
Expand Down
1 change: 1 addition & 0 deletions packages/pds/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class AppContext {
plcUrl: cfg.identity.plcUrl,
didCache,
timeout: cfg.identity.resolverTimeout,
backupNameservers: cfg.identity.handleBackupNameservers,
})
const plcClient = new plc.Client(cfg.identity.plcUrl)

Expand Down

0 comments on commit 1c30e8c

Please sign in to comment.