refactor: remove repositoryUrl & feedbackUrl from meta

These two URLs are static so there is no reason to keep them in the
database. They are also not even used anywhere by the API, so they can
also be removed from there.

Where they are used is in the nodeinfo, where they are now hardcoded.

While editing the nodeinfo, also uncommented nodeinfo version 2.1.
This commit is contained in:
Johann150 2022-07-18 14:31:34 +02:00
parent eeee4c713c
commit a0940c49a2
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1
6 changed files with 18 additions and 43 deletions

View file

@ -0,0 +1,13 @@
export class removeRepoUrl1658146000392 {
name = 'removeRepoUrl1658146000392';
async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "repositoryUrl"`);
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "feedbackUrl"`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "meta" ADD "repositoryUrl" character varying(512) not null default 'https://github.com/misskey-dev/misskey'`);
await queryRunner.query(`ALTER TABLE "meta" ADD "feedbackUrl" character varying(512) default 'https://github.com/misskey-dev/misskey/issues/new'`);
}
}

View file

@ -316,20 +316,6 @@ export class Meta {
})
public ToSUrl: string | null;
@Column('varchar', {
length: 512,
default: 'https://github.com/misskey-dev/misskey',
nullable: false,
})
public repositoryUrl: string;
@Column('varchar', {
length: 512,
default: 'https://github.com/misskey-dev/misskey/issues/new',
nullable: true,
})
public feedbackUrl: string | null;
@Column('varchar', {
length: 8192,
nullable: true,

View file

@ -294,8 +294,6 @@ export default define(meta, paramDef, async (ps, me) => {
description: instance.description,
langs: instance.langs,
tosUrl: instance.ToSUrl,
repositoryUrl: instance.repositoryUrl,
feedbackUrl: instance.feedbackUrl,
disableRegistration: instance.disableRegistration,
disableLocalTimeline: instance.disableLocalTimeline,
disableGlobalTimeline: instance.disableGlobalTimeline,

View file

@ -78,8 +78,6 @@ export const paramDef = {
swPublicKey: { type: 'string', nullable: true },
swPrivateKey: { type: 'string', nullable: true },
tosUrl: { type: 'string', nullable: true },
repositoryUrl: { type: 'string' },
feedbackUrl: { type: 'string' },
useObjectStorage: { type: 'boolean' },
objectStorageBaseUrl: { type: 'string', nullable: true },
objectStorageBucket: { type: 'string', nullable: true },
@ -313,14 +311,6 @@ export default define(meta, paramDef, async (ps, me) => {
set.ToSUrl = ps.tosUrl;
}
if (ps.repositoryUrl !== undefined) {
set.repositoryUrl = ps.repositoryUrl;
}
if (ps.feedbackUrl !== undefined) {
set.feedbackUrl = ps.feedbackUrl;
}
if (ps.useObjectStorage !== undefined) {
set.useObjectStorage = ps.useObjectStorage;
}

View file

@ -53,16 +53,6 @@ export const meta = {
type: 'string',
optional: false, nullable: true,
},
repositoryUrl: {
type: 'string',
optional: false, nullable: false,
default: 'https://github.com/misskey-dev/misskey',
},
feedbackUrl: {
type: 'string',
optional: false, nullable: false,
default: 'https://github.com/misskey-dev/misskey/issues/new',
},
defaultDarkTheme: {
type: 'string',
optional: false, nullable: true,
@ -297,8 +287,6 @@ export default define(meta, paramDef, async (ps, me) => {
description: instance.description,
langs: instance.langs,
tosUrl: instance.ToSUrl,
repositoryUrl: instance.repositoryUrl,
feedbackUrl: instance.feedbackUrl,
disableRegistration: instance.disableRegistration,
disableLocalTimeline: instance.disableLocalTimeline,
disableGlobalTimeline: instance.disableGlobalTimeline,

View file

@ -11,10 +11,10 @@ const router = new Router();
const nodeinfo2_1path = '/nodeinfo/2.1';
const nodeinfo2_0path = '/nodeinfo/2.0';
export const links = [/* (awaiting release) {
export const links = [{
rel: 'http://nodeinfo.diaspora.software/ns/schema/2.1',
href: config.url + nodeinfo2_1path
}, */{
}, {
rel: 'http://nodeinfo.diaspora.software/ns/schema/2.0',
href: config.url + nodeinfo2_0path,
}];
@ -39,9 +39,9 @@ const nodeinfo2 = async () => {
return {
software: {
name: 'misskey',
name: 'foundkey',
version: config.version,
repository: meta.repositoryUrl,
repository: 'https://akkoma.dev/FoundKeyGang/FoundKey',
},
protocols: ['activitypub'],
services: {
@ -64,7 +64,7 @@ const nodeinfo2 = async () => {
langs: meta.langs,
tosUrl: meta.ToSUrl,
repositoryUrl: meta.repositoryUrl,
feedbackUrl: meta.feedbackUrl,
feedbackUrl: 'ircs://irc.akkoma.dev/foundkey',
disableRegistration: meta.disableRegistration,
disableLocalTimeline: meta.disableLocalTimeline,
disableGlobalTimeline: meta.disableGlobalTimeline,