mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import { ADMIN_EMAIL, LOCAL_DOMAIN, POST_CHAR_LIMIT } from '@/config.ts';
|
|
|
|
import type { Context } from '@/deps.ts';
|
|
|
|
function instanceController(c: Context) {
|
|
const { host, protocol } = new URL(LOCAL_DOMAIN);
|
|
|
|
return c.json({
|
|
uri: host,
|
|
title: 'Ditto',
|
|
description: 'An efficient and flexible social media server.',
|
|
short_description: 'An efficient and flexible social media server.',
|
|
registrations: false,
|
|
max_toot_chars: POST_CHAR_LIMIT,
|
|
configuration: {
|
|
media_attachments: {
|
|
image_size_limit: 100000000,
|
|
video_size_limit: 100000000,
|
|
},
|
|
polls: {
|
|
max_characters_per_option: 0,
|
|
max_expiration: 0,
|
|
max_options: 0,
|
|
min_expiration: 0,
|
|
},
|
|
statuses: {
|
|
max_characters: POST_CHAR_LIMIT,
|
|
max_media_attachments: 20,
|
|
},
|
|
},
|
|
languages: ['en'],
|
|
stats: {
|
|
domain_count: 0,
|
|
status_count: 0,
|
|
user_count: 0,
|
|
},
|
|
urls: {
|
|
streaming_api: `${protocol === 'http:' ? 'ws:' : 'wss:'}//${host}`,
|
|
},
|
|
version: '0.0.0 (compatible; Ditto 0.0.1)',
|
|
email: ADMIN_EMAIL,
|
|
rules: [],
|
|
});
|
|
}
|
|
|
|
export default instanceController;
|