diff --git a/src/config.ts b/src/config.ts index cdd07ba..e43dab1 100644 --- a/src/config.ts +++ b/src/config.ts @@ -126,10 +126,6 @@ const Conf = { 'system', ]; }, - /** Whether registrations are open or closed. */ - get registrations() { - return optionalBooleanSchema.parse(Deno.env.get('DITTO_REGISTRATIONS')) ?? false; - }, /** Proof-of-work configuration. */ pow: { get registrations() { diff --git a/src/controllers/api/accounts.ts b/src/controllers/api/accounts.ts index efe5050..92e2045 100644 --- a/src/controllers/api/accounts.ts +++ b/src/controllers/api/accounts.ts @@ -1,7 +1,6 @@ import { NostrFilter } from '@soapbox/nspec'; import { type AppController } from '@/app.ts'; import { Conf } from '@/config.ts'; -import { insertUser } from '@/db/users.ts'; import { nip19, z } from '@/deps.ts'; import { getAuthor, getFollowedPubkeys } from '@/queries.ts'; import { booleanParamSchema, fileSchema } from '@/schema.ts'; @@ -28,10 +27,6 @@ const createAccountSchema = z.object({ }); const createAccountController: AppController = async (c) => { - if (!Conf.registrations) { - return c.json({ error: 'Registrations are disabled.' }, 403); - } - const pubkey = c.get('pubkey')!; const result = createAccountSchema.safeParse(await c.req.json()); @@ -39,12 +34,6 @@ const createAccountController: AppController = async (c) => { return c.json({ error: 'Bad request', schema: result.error }, 400); } - await insertUser({ - pubkey, - inserted_at: new Date(), - admin: false, - }); - return c.json({ access_token: nip19.npubEncode(pubkey), token_type: 'Bearer', diff --git a/src/controllers/api/instance.ts b/src/controllers/api/instance.ts index b4035bb..15a99c3 100644 --- a/src/controllers/api/instance.ts +++ b/src/controllers/api/instance.ts @@ -18,7 +18,7 @@ const instanceController: AppController = async (c) => { title: meta.name ?? 'Ditto', description: meta.about ?? 'Nostr and the Fediverse', short_description: meta.tagline ?? meta.about ?? 'Nostr and the Fediverse', - registrations: Conf.registrations, + registrations: true, max_toot_chars: Conf.postCharLimit, configuration: { media_attachments: { diff --git a/src/controllers/well-known/nodeinfo.ts b/src/controllers/well-known/nodeinfo.ts index 47bf6d8..4f03f42 100644 --- a/src/controllers/well-known/nodeinfo.ts +++ b/src/controllers/well-known/nodeinfo.ts @@ -33,7 +33,7 @@ const nodeInfoSchemaController: AppController = (c) => { inbound: [], outbound: [], }, - openRegistrations: false, + openRegistrations: true, usage: { users: { total: 0,