backend: partially revert repo url change in nodeinfo
All checks were successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
Norm 2022-11-16 17:58:55 -05:00
parent b18c9b27a6
commit 848b9bcdf1
Signed by: norm
GPG key ID: 7123E30E441E80DE

View file

@ -24,6 +24,7 @@ type NodeInfo2Base = {
software: {
name: string;
version: string;
repository?: string;
};
protocols: string[];
services: {
@ -65,6 +66,7 @@ const nodeinfo2 = async (): Promise<NodeInfo2Base> => {
software: {
name: 'foundkey',
version: config.version,
repository,
},
protocols: ['activitypub'],
services: {
@ -109,13 +111,15 @@ const nodeinfo2 = async (): Promise<NodeInfo2Base> => {
router.get(nodeinfo2_1path, async ctx => {
const base = await nodeinfo2();
ctx.body = { version: '2.1', repository, ...base };
ctx.body = { version: '2.1', ...base };
ctx.set('Cache-Control', 'public, max-age=600');
});
router.get(nodeinfo2_0path, async ctx => {
const base = await nodeinfo2();
delete base.software.repository;
ctx.body = { version: '2.0', ...base };
ctx.set('Cache-Control', 'public, max-age=600');
});