mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-04 22:24:25 +01:00
Add nodeinfo
This commit is contained in:
55
src/controllers/well-known/nodeinfo.ts
Normal file
55
src/controllers/well-known/nodeinfo.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { Conf } from '@/config.ts';
|
||||
|
||||
import type { AppController } from '@/app.ts';
|
||||
|
||||
const nodeInfoController: AppController = (c) => {
|
||||
return c.json({
|
||||
links: [
|
||||
{
|
||||
rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0',
|
||||
href: Conf.local('/nodeinfo/2.0'),
|
||||
},
|
||||
{
|
||||
rel: 'http://nodeinfo.diaspora.software/ns/schema/2.1',
|
||||
href: Conf.local('/nodeinfo/2.1'),
|
||||
},
|
||||
],
|
||||
});
|
||||
};
|
||||
|
||||
const nodeInfoSchemaController: AppController = (c) => {
|
||||
return c.json({
|
||||
version: '2.1',
|
||||
software: {
|
||||
name: 'ditto',
|
||||
version: '0.0.0',
|
||||
repository: 'https://gitlab.com/soapbox-pub/ditto',
|
||||
homepage: 'https://soapbox.pub',
|
||||
},
|
||||
protocols: [
|
||||
'activitypub',
|
||||
],
|
||||
services: {
|
||||
inbound: [],
|
||||
outbound: [],
|
||||
},
|
||||
openRegistrations: false,
|
||||
usage: {
|
||||
users: {
|
||||
total: 0,
|
||||
activeMonth: 0,
|
||||
activeHalfyear: 0,
|
||||
},
|
||||
localPosts: 0,
|
||||
localComments: 0,
|
||||
},
|
||||
metadata: {
|
||||
features: [
|
||||
'nip05',
|
||||
'nostr_bridge',
|
||||
],
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export { nodeInfoController, nodeInfoSchemaController };
|
||||
Reference in New Issue
Block a user