mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-02 21:24:23 +01:00
Make registrations configurable by env
This commit is contained in:
@@ -22,6 +22,10 @@ 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());
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ const instanceController: AppController = (c) => {
|
||||
title: 'Ditto',
|
||||
description: 'An efficient and flexible social media server.',
|
||||
short_description: 'An efficient and flexible social media server.',
|
||||
registrations: false,
|
||||
registrations: Conf.registrations,
|
||||
max_toot_chars: Conf.postCharLimit,
|
||||
configuration: {
|
||||
media_attachments: {
|
||||
|
||||
Reference in New Issue
Block a user