diff --git a/server/api/api/v1/instance/index.ts b/server/api/api/v1/instance/index.ts index 91925b3a..784ab10d 100644 --- a/server/api/api/v1/instance/index.ts +++ b/server/api/api/v1/instance/index.ts @@ -116,6 +116,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => { streaming_api: "", }, version: "4.3.0-alpha.3+glitch", + lysand_version: version, pleroma: { metadata: { account_activation_required: false, @@ -188,6 +189,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => { contact_account: contactAccount?.toAPI() || undefined, } satisfies APIInstance & { banner: string; + lysand_version: string; pleroma: object; }); }); diff --git a/server/api/api/v2/instance/index.ts b/server/api/api/v2/instance/index.ts index fecf7076..fa60ccdd 100644 --- a/server/api/api/v2/instance/index.ts +++ b/server/api/api/v2/instance/index.ts @@ -53,6 +53,7 @@ export default apiRoute(async (req, matchedRoute, extraData) => { domain: new URL(config.http.base_url).hostname, title: config.instance.name, version: "4.3.0-alpha.3+glitch", + lysand_version: version, source_url: "https://github.com/lysand-org/lysand", description: config.instance.description, usage: { diff --git a/server/api/well-known/lysand.ts b/server/api/well-known/lysand.ts index 8672a265..3a754b7d 100644 --- a/server/api/well-known/lysand.ts +++ b/server/api/well-known/lysand.ts @@ -2,7 +2,7 @@ import { apiRoute, applyConfig } from "@api"; import { urlToContentFormat } from "@content_types"; import { jsonResponse } from "@response"; import type * as Lysand from "lysand-types"; -import pkg from "../../../package.json"; +import pkg from "~package.json"; export const meta = applyConfig({ allowedMethods: ["GET"], diff --git a/server/api/nodeinfo/2.0/index.ts b/server/api/well-known/nodeinfo/2.0/index.ts similarity index 79% rename from server/api/nodeinfo/2.0/index.ts rename to server/api/well-known/nodeinfo/2.0/index.ts index 581d2ef4..c67f3648 100644 --- a/server/api/nodeinfo/2.0/index.ts +++ b/server/api/well-known/nodeinfo/2.0/index.ts @@ -1,5 +1,6 @@ import { apiRoute, applyConfig } from "@api"; import { jsonResponse } from "@response"; +import manifest from "~package.json"; export const meta = applyConfig({ allowedMethods: ["GET"], @@ -10,7 +11,7 @@ export const meta = applyConfig({ duration: 60, max: 500, }, - route: "/nodeinfo/2.0", + route: "/.well-known/nodeinfo/2.0", }); /** @@ -20,8 +21,8 @@ export default apiRoute(() => { // TODO: Implement this return jsonResponse({ version: "2.0", - software: { name: "lysand", version: "0.0.1" }, - protocols: ["activitypub"], + software: { name: "lysand", version: manifest.version }, + protocols: ["lysand"], services: { outbound: [], inbound: [] }, usage: { users: { total: 0, activeMonth: 0, activeHalfyear: 0 },