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

@ -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;
});
});

View file

@ -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: {

View file

@ -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"],

View file

@ -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 },