work-in-progress atproto PDS
typescript atproto pds atcute
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: clarify registration status

Mary 6ab1d2d1 990835fb

+16 -13
+1 -1
packages/danaus/src/api/com.atproto/server.describeServer.ts
··· 12 12 return json({ 13 13 did: config.service.did, 14 14 availableUserDomains: config.identity.serviceHandleDomains, 15 - inviteCodeRequired: config.service.invites.required, 15 + inviteCodeRequired: config.service.registration !== 'open', 16 16 contact: { 17 17 email: config.service.branding.contactEmailAddress ?? undefined, 18 18 },
+11 -2
packages/danaus/src/api/local.danaus/account.createAccount.ts
··· 29 29 const auth = await authVerifier.adminOptional(request); 30 30 const isAdmin = auth.type === AuthCredentialsType.AdminToken; 31 31 32 - // public signup path: check invite code if required 32 + // public signup path: check registration mode 33 33 if (!isAdmin) { 34 - if (context.config.service.invites.required) { 34 + const registration = context.config.service.registration; 35 + 36 + if (registration === 'none') { 37 + throw new InvalidRequestError({ 38 + error: 'RegistrationDisabled', 39 + description: 'public registration is disabled', 40 + }); 41 + } 42 + 43 + if (registration === 'invite-only') { 35 44 if (!input.inviteCode) { 36 45 throw new InvalidRequestError({ 37 46 error: 'InvalidInviteCode',
+2 -6
packages/danaus/src/config.ts
··· 27 27 maxUploadSize: number; 28 28 }; 29 29 30 - invites: { 31 - required: boolean; 32 - }; 30 + registration: 'open' | 'invite-only' | 'none'; 33 31 34 32 branding: { 35 33 name: string; ··· 157 155 maxUploadSize: env.PDS_BLOB_UPLOAD_SIZE_LIMIT ?? 100 * 1024 * 1024, 158 156 }, 159 157 160 - invites: { 161 - required: env.PDS_INVITE_REQUIRED ?? true, 162 - }, 158 + registration: env.PDS_REGISTRATION ?? 'invite-only', 163 159 164 160 branding: { 165 161 name: env.PDS_SERVICE_NAME ?? `${hostname} PDS`,
+1 -1
packages/danaus/src/environment.ts
··· 81 81 PDS_JWT_SECRET: v.optional(str), 82 82 PDS_ADMIN_PASSWORD: v.optional(str), 83 83 84 - PDS_INVITE_REQUIRED: v.optional(strbool), 84 + PDS_REGISTRATION: v.optional(v.picklist(['open', 'invite-only', 'none'])), 85 85 86 86 PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: v.optional(str), 87 87
+1 -3
packages/danaus/src/test/test-pds.ts
··· 80 80 blobs: { 81 81 maxUploadSize: 100 * 1024 * 1024, 82 82 }, 83 - invites: { 84 - required: false, 85 - }, 83 + registration: 'open', 86 84 branding: { 87 85 name: `${hostname} PDS`, 88 86 logoUrl: null,