Compare commits
14 commits
dev
...
feature/pl
Author | SHA1 | Date | |
---|---|---|---|
|
d81412e84e | ||
|
4e9959bd73 | ||
|
e482db3f33 | ||
|
4afc2eb950 | ||
|
053b5bdb27 | ||
|
d2c5ada55d | ||
|
8fe7709f29 | ||
|
08c7e52596 | ||
|
2c935fe9db | ||
|
20a48cabd0 | ||
|
8e7c6526e1 | ||
|
8a088b8d74 | ||
|
f967da4dda | ||
|
e17691df43 |
3 changed files with 101 additions and 3 deletions
|
@ -37,7 +37,41 @@ export async function getInstance(
|
|||
languages: meta.langs,
|
||||
registrations: !meta.disableRegistration || response.registrations,
|
||||
approval_required: !response.registrations,
|
||||
invites_enabled: response.registrations,
|
||||
invites_enabled: response.registrations,
|
||||
pleroma : {
|
||||
metadata: {
|
||||
account_activation_required: !response.registrations,
|
||||
birthday_min_age: 0,
|
||||
birthday_required: false,
|
||||
features: [
|
||||
"mastodon_api",
|
||||
"mastodon_api_float",
|
||||
"polls",
|
||||
"relay",
|
||||
"quote_posting",
|
||||
"pleroma_emoji_reactions",
|
||||
"pleroma_chat_messages",
|
||||
"exposable_reactions",
|
||||
"profile_directory"
|
||||
],
|
||||
federation: {
|
||||
enabled : true
|
||||
},
|
||||
fields_limits: {
|
||||
max_fields: 10,
|
||||
max_remote_fields: 20,
|
||||
name_length: 512,
|
||||
value_length: 2048
|
||||
},
|
||||
post_formats: [
|
||||
"text/x.misskeymarkdown"
|
||||
]
|
||||
},
|
||||
stats: {
|
||||
mau: 1,
|
||||
},
|
||||
vapid_public_key: meta.swPublicKey ? meta.swPublicKey : "",
|
||||
},
|
||||
configuration: {
|
||||
accounts: {
|
||||
max_featured_tags: 20,
|
||||
|
|
|
@ -24,7 +24,7 @@ import * as Acct from "@/misc/acct.js";
|
|||
import { envOption } from "@/env.js";
|
||||
import megalodon, { MegalodonInterface } from "megalodon";
|
||||
import activityPub from "./activitypub.js";
|
||||
import nodeinfo from "./nodeinfo.js";
|
||||
import nodeinfo, { nodeinfo2 } from "./nodeinfo.js";
|
||||
import wellKnown from "./well-known.js";
|
||||
import apiServer from "./api/index.js";
|
||||
import fileServer from "./file/index.js";
|
||||
|
@ -34,6 +34,7 @@ import { initializeStreamingServer } from "./api/streaming.js";
|
|||
import { koaBody } from "koa-body";
|
||||
import removeTrailingSlash from "koa-remove-trailing-slashes";
|
||||
import { v4 as uuid } from "uuid";
|
||||
import { Cache } from "@/misc/cache.js";
|
||||
|
||||
export const serverLogger = new Logger("server", "gray", false);
|
||||
|
||||
|
@ -149,6 +150,24 @@ mastoRouter.get("/oauth/authorize", async (ctx) => {
|
|||
);
|
||||
});
|
||||
|
||||
const cache = new Cache<Awaited<ReturnType<typeof nodeinfo2>>>(
|
||||
"nodeinfo",
|
||||
60 * 10,
|
||||
);
|
||||
|
||||
|
||||
mastoRouter.get("/nodeinfo/2.0.json", async (ctx) => {
|
||||
const base = await cache.fetch(null, () => nodeinfo2());
|
||||
|
||||
// @ts-ignore
|
||||
base.software.repository = undefined;
|
||||
|
||||
ctx.body = {
|
||||
version: "2.0",
|
||||
...base };
|
||||
ctx.set("Cache-Control", "public, max-age=600");
|
||||
});
|
||||
|
||||
mastoRouter.post("/oauth/token", async (ctx) => {
|
||||
const body: any = ctx.request.body || ctx.request.query;
|
||||
console.log("token-request", body);
|
||||
|
|
|
@ -23,7 +23,7 @@ export const links = [
|
|||
},
|
||||
];
|
||||
|
||||
const nodeinfo2 = async () => {
|
||||
export const nodeinfo2 = async () => {
|
||||
const now = Date.now();
|
||||
const [meta, total, activeHalfyear, activeMonth, localPosts] =
|
||||
await Promise.all([
|
||||
|
@ -96,6 +96,51 @@ const nodeinfo2 = async () => {
|
|||
enableServiceWorker: meta.enableServiceWorker,
|
||||
proxyAccountName: proxyAccount ? proxyAccount.username : null,
|
||||
themeColor: meta.themeColor || "#31748f",
|
||||
|
||||
//Akkoma
|
||||
features: [
|
||||
"mastodon_api",
|
||||
"mastodon_api_float",
|
||||
"polls",
|
||||
"relay",
|
||||
"quote_posting",
|
||||
"pleroma_emoji_reactions",
|
||||
"pleroma_chat_messages",
|
||||
"exposable_reactions",
|
||||
"profile_directory"
|
||||
],
|
||||
federation: {
|
||||
enabled : true
|
||||
},
|
||||
fields_limits: {
|
||||
max_fields: 10,
|
||||
max_remote_fields: 20,
|
||||
name_length: 512,
|
||||
value_length: 2048
|
||||
},
|
||||
post_formats: [
|
||||
"text/x.misskeymarkdown"
|
||||
],
|
||||
publicTimelineVisibility: {
|
||||
local: false,
|
||||
federated: false,
|
||||
bubble: false,
|
||||
},
|
||||
uploadLimits: {
|
||||
background: 40000000,
|
||||
avatar: 40000000,
|
||||
banner: 40000000,
|
||||
general: 40000000,
|
||||
},
|
||||
suggestions: {
|
||||
enabled: false
|
||||
},
|
||||
staffAccounts: [
|
||||
"https://fedi.afra.berlin/@april"
|
||||
],
|
||||
localBubbleInstances: [
|
||||
"mk.absturztau.be"
|
||||
]
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue