feat(api): Put the correct lysand version everywhere, add a new lysand_version field in the instance metadata endpoints

This commit is contained in:
Jesse Wierzbinski 2024-04-25 15:57:57 -10:00
parent 03750d5e86
commit 50ea9461e2
No known key found for this signature in database
4 changed files with 8 additions and 4 deletions

View file

@ -0,0 +1,34 @@
import { apiRoute, applyConfig } from "@api";
import { jsonResponse } from "@response";
import manifest from "~package.json";
export const meta = applyConfig({
allowedMethods: ["GET"],
auth: {
required: false,
},
ratelimits: {
duration: 60,
max: 500,
},
route: "/.well-known/nodeinfo/2.0",
});
/**
* ActivityPub nodeinfo 2.0 endpoint
*/
export default apiRoute(() => {
// TODO: Implement this
return jsonResponse({
version: "2.0",
software: { name: "lysand", version: manifest.version },
protocols: ["lysand"],
services: { outbound: [], inbound: [] },
usage: {
users: { total: 0, activeMonth: 0, activeHalfyear: 0 },
localPosts: 0,
},
openRegistrations: false,
metadata: {},
});
});