From b5cfd92e2b2a2de50b95af5aa4c5149b282d8457 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 16 Feb 2024 10:54:33 +0000 Subject: [PATCH 1/2] point default repo/feedback URLs to our repos the migration will update instances that have the old defaults, too --- .../1708080086874-SharkeyRepositoryUrl.js | 22 +++++++++++++++++++ packages/backend/src/models/Meta.ts | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 packages/backend/migration/1708080086874-SharkeyRepositoryUrl.js diff --git a/packages/backend/migration/1708080086874-SharkeyRepositoryUrl.js b/packages/backend/migration/1708080086874-SharkeyRepositoryUrl.js new file mode 100644 index 000000000..be07c7594 --- /dev/null +++ b/packages/backend/migration/1708080086874-SharkeyRepositoryUrl.js @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: dakkar and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +export class SharkeyRepositoryUrl1708080086874 { + name = 'SharkeyRepositoryUrl1708080086874' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "repositoryUrl" SET DEFAULT 'https://activitypub.software/TransFem-org/Sharkey/'`); + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "feedbackUrl" SET DEFAULT 'https://activitypub.software/TransFem-org/Sharkey/-/issues/new'`); + await queryRunner.query(`UPDATE "meta" SET "repositoryUrl"=DEFAULT WHERE "repositoryUrl" IN ('https://git.joinsharkey.org/Sharkey/Sharkey','https://github.com/transfem-org/sharkey','https://github.com/misskey-dev/misskey')`); + await queryRunner.query(`UPDATE "meta" SET "feedbackUrl"=DEFAULT WHERE "feedbackUrl" IN ('https://git.joinsharkey.org/Sharkey/Sharkey/issues/new/choose','https://github.com/transfem-org/sharkey/issues/new','https://github.com/misskey-dev/misskey/issues/new')`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "repositoryUrl" SET DEFAULT 'https://git.joinsharkey.org/Sharkey/Sharkey'`); + await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "feedbackUrl" SET DEFAULT 'https://git.joinsharkey.org/Sharkey/Sharkey/issues/new/choose'`); + await queryRunner.query(`UPDATE "meta" SET "repositoryUrl"=DEFAULT WHERE "repositoryUrl" IN ('https://git.joinsharkey.org/Sharkey/Sharkey','https://github.com/transfem-org/sharkey','https://github.com/misskey-dev/misskey')`); + await queryRunner.query(`UPDATE "meta" SET "feedbackUrl"=DEFAULT WHERE "feedbackUrl" IN ('https://git.joinsharkey.org/Sharkey/Sharkey/issues/new/choose','https://github.com/transfem-org/sharkey/issues/new','https://github.com/misskey-dev/misskey/issues/new')`); + } +} diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts index 149955aa5..6bfac06b8 100644 --- a/packages/backend/src/models/Meta.ts +++ b/packages/backend/src/models/Meta.ts @@ -377,14 +377,14 @@ export class MiMeta { @Column('varchar', { length: 1024, - default: 'https://github.com/misskey-dev/misskey', + default: 'https://activitypub.software/TransFem-org/Sharkey/', nullable: false, }) public repositoryUrl: string; @Column('varchar', { length: 1024, - default: 'https://github.com/misskey-dev/misskey/issues/new', + default: 'https://activitypub.software/TransFem-org/Sharkey/-/issues/new', nullable: true, }) public feedbackUrl: string | null; From d1c174ea608a4fc6ffcdace088198475bb24d385 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 19 Feb 2024 11:41:35 +0000 Subject: [PATCH 2/2] rename to get it applied after upstream changes upstream `1708266695091-repositoryUrl-from-syuilo-to-misskey-dev.js` changes `repositoryUrl` to one of the values this patch recognise, so let's do ours after theirs --- ...RepositoryUrl.js => 1708342829000-SharkeyRepositoryUrl.js} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename packages/backend/migration/{1708080086874-SharkeyRepositoryUrl.js => 1708342829000-SharkeyRepositoryUrl.js} (94%) diff --git a/packages/backend/migration/1708080086874-SharkeyRepositoryUrl.js b/packages/backend/migration/1708342829000-SharkeyRepositoryUrl.js similarity index 94% rename from packages/backend/migration/1708080086874-SharkeyRepositoryUrl.js rename to packages/backend/migration/1708342829000-SharkeyRepositoryUrl.js index be07c7594..0853ed4ed 100644 --- a/packages/backend/migration/1708080086874-SharkeyRepositoryUrl.js +++ b/packages/backend/migration/1708342829000-SharkeyRepositoryUrl.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -export class SharkeyRepositoryUrl1708080086874 { - name = 'SharkeyRepositoryUrl1708080086874' +export class SharkeyRepositoryUrl1708342829000 { + name = 'SharkeyRepositoryUrl1708342829000' async up(queryRunner) { await queryRunner.query(`ALTER TABLE "meta" ALTER COLUMN "repositoryUrl" SET DEFAULT 'https://activitypub.software/TransFem-org/Sharkey/'`);