From 2c0cf337989524952e8d3843c320a714cde6e21a Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Thu, 17 Nov 2022 13:54:25 -0800 Subject: [PATCH 001/168] init --- packages/backend/src/remote/activitypub/models/person.ts | 2 ++ packages/backend/src/remote/activitypub/renderer/index.ts | 1 + packages/backend/src/remote/activitypub/renderer/person.ts | 1 + packages/backend/src/remote/activitypub/type.ts | 1 + 4 files changed, 5 insertions(+) diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 6097e3b6e..0b3654489 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -172,6 +172,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise; diff --git a/packages/backend/src/remote/activitypub/renderer/index.ts b/packages/backend/src/remote/activitypub/renderer/index.ts index f100b77ce..893b6fd75 100644 --- a/packages/backend/src/remote/activitypub/renderer/index.ts +++ b/packages/backend/src/remote/activitypub/renderer/index.ts @@ -19,6 +19,7 @@ export const renderActivity = (x: any): IActivity | null => { { // as non-standards manuallyApprovesFollowers: 'as:manuallyApprovesFollowers', + movedTo: 'as:movedTo', sensitive: 'as:sensitive', Hashtag: 'as:Hashtag', quoteUrl: 'as:quoteUrl', diff --git a/packages/backend/src/remote/activitypub/renderer/person.ts b/packages/backend/src/remote/activitypub/renderer/person.ts index cd2fd74d4..dfabd910e 100644 --- a/packages/backend/src/remote/activitypub/renderer/person.ts +++ b/packages/backend/src/remote/activitypub/renderer/person.ts @@ -71,6 +71,7 @@ export async function renderPerson(user: ILocalUser) { image: banner ? renderImage(banner) : null, tag, manuallyApprovesFollowers: user.isLocked, + movedTo: user.moved_to_account_id, discoverable: !!user.isExplorable, publicKey: renderKey(user, keypair, `#main-key`), isCat: user.isCat, diff --git a/packages/backend/src/remote/activitypub/type.ts b/packages/backend/src/remote/activitypub/type.ts index de7eb0ed8..2c4935a87 100644 --- a/packages/backend/src/remote/activitypub/type.ts +++ b/packages/backend/src/remote/activitypub/type.ts @@ -156,6 +156,7 @@ export interface IActor extends IObject { name?: string; preferredUsername?: string; manuallyApprovesFollowers?: boolean; + movedTo?: string; discoverable?: boolean; inbox: string; sharedInbox?: string; // 後方互換性のため From 2c5ba3f11e8deaf539e81e77d5920d865167c082 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 19 Nov 2022 00:52:41 -0800 Subject: [PATCH 002/168] perf: :zap: load icons css last --- packages/backend/src/server/web/views/base.pug | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 547fc34a8..ad6572488 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -38,7 +38,6 @@ html link(rel='prefetch' href=`/static-assets/badges/info.png?${ timestamp }`) link(rel='prefetch' href=`/static-assets/badges/not-found.png?${ timestamp }`) link(rel='prefetch' href=`/static-assets/badges/error.png?${ timestamp }`) - link(rel='stylesheet' href='/assets/phosphor/icons.css') link(rel='stylesheet' href=`/static-assets/instance.css?${ timestamp }`) link(rel='modulepreload' href=`/assets/${clientEntry.file}`) @@ -48,6 +47,8 @@ html each href in clientEntry.css link(rel='preload' href=`/assets/${href}` as='style') + link(rel='stylesheet' href='/assets/phosphor/icons.css') + title block title = title || 'Calckey' From ea3e13f1900519538a4f9dbae71b790b8b9f65f5 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Wed, 23 Nov 2022 21:48:44 +0100 Subject: [PATCH 003/168] Create move type --- packages/backend/.idea/.gitignore | 8 ++++++++ packages/backend/src/queue/processors/inbox.ts | 11 +++++------ packages/backend/src/remote/activitypub/type.ts | 5 +++++ packages/backend/src/server/activitypub.ts | 3 ++- 4 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 packages/backend/.idea/.gitignore diff --git a/packages/backend/.idea/.gitignore b/packages/backend/.idea/.gitignore new file mode 100644 index 000000000..13566b81b --- /dev/null +++ b/packages/backend/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/packages/backend/src/queue/processors/inbox.ts b/packages/backend/src/queue/processors/inbox.ts index 420d74bb0..33949672c 100644 --- a/packages/backend/src/queue/processors/inbox.ts +++ b/packages/backend/src/queue/processors/inbox.ts @@ -20,7 +20,7 @@ import { UserPublickey } from '@/models/entities/user-publickey.js'; const logger = new Logger('inbox'); -// ユーザーのinboxにアクティビティが届いた時の処理 +// Processing when an activity arrives in the user's inbox export default async (job: Bull.Job): Promise => { const signature = job.data.signature; // HTTP-signature const activity = job.data.activity; @@ -30,16 +30,15 @@ export default async (job: Bull.Job): Promise => { delete info['@context']; logger.debug(JSON.stringify(info, null, 2)); //#endregion - const host = toPuny(new URL(signature.keyId).hostname); - // ブロックしてたら中断 + // interrupt if blocked const meta = await fetchMeta(); if (meta.blockedHosts.includes(host)) { return `Blocked request: ${host}`; } - // 非公開モードなら許可なインスタンスのみ + // only whitelisted instances in private mode if (meta.privateMode && !meta.allowedHosts.includes(host)) { return `Blocked request: ${host}`; } @@ -51,7 +50,7 @@ export default async (job: Bull.Job): Promise => { const dbResolver = new DbResolver(); - // HTTP-Signature keyIdを元にDBから取得 + // HTTP-Signature keyId from DB let authUser: { user: CacheableRemoteUser; key: UserPublickey | null; @@ -62,7 +61,7 @@ export default async (job: Bull.Job): Promise => { try { authUser = await dbResolver.getAuthUserFromApId(getApId(activity.actor)); } catch (e) { - // 対象が4xxならスキップ + // Skip if target is 4xx if (e instanceof StatusError) { if (e.isClientError) { return `skip: Ignored deleted actors on both ends ${activity.actor} - ${e.statusCode}`; diff --git a/packages/backend/src/remote/activitypub/type.ts b/packages/backend/src/remote/activitypub/type.ts index 2c4935a87..d04352e4c 100644 --- a/packages/backend/src/remote/activitypub/type.ts +++ b/packages/backend/src/remote/activitypub/type.ts @@ -157,6 +157,7 @@ export interface IActor extends IObject { preferredUsername?: string; manuallyApprovesFollowers?: boolean; movedTo?: string; + alsoKnownAs?: string[]; discoverable?: boolean; inbox: string; sharedInbox?: string; // 後方互換性のため @@ -280,6 +281,10 @@ export interface IFlag extends IActivity { type: 'Flag'; } +export interface IMove extends IActivity { + type: 'Move'; +} + export const isCreate = (object: IObject): object is ICreate => getApType(object) === 'Create'; export const isDelete = (object: IObject): object is IDelete => getApType(object) === 'Delete'; export const isUpdate = (object: IObject): object is IUpdate => getApType(object) === 'Update'; diff --git a/packages/backend/src/server/activitypub.ts b/packages/backend/src/server/activitypub.ts index 250a39bf0..782915756 100644 --- a/packages/backend/src/server/activitypub.ts +++ b/packages/backend/src/server/activitypub.ts @@ -38,6 +38,7 @@ function inbox(ctx: Router.RouterContext) { return; } + // @ts-ignore processInbox(ctx.request.body, signature); ctx.status = 202; @@ -86,7 +87,7 @@ router.get('/notes/:note', async (ctx, next) => { return; } - // リモートだったらリダイレクト + // redirect if remote if (note.userHost != null) { if (note.uri == null || isSelfHost(note.userHost)) { ctx.status = 500; From 9ab2599e0da4d1f9f47a92087b11a2a21a9aa387 Mon Sep 17 00:00:00 2001 From: Cleo John <30842467+CutestNekoAqua@users.noreply.github.com> Date: Thu, 24 Nov 2022 11:32:25 +0000 Subject: [PATCH 004/168] db migration for moved to --- bun.lockb | 3 +++ packages/backend/bun.lockb | 3 +++ .../1669288094000-AddMovedToAndKnownAs.js | 16 ++++++++++++++++ packages/backend/src/models/entities/user.ts | 6 ++++++ packages/sw/bun.lockb | 3 +++ 5 files changed, 31 insertions(+) create mode 100755 bun.lockb create mode 100755 packages/backend/bun.lockb create mode 100644 packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js create mode 100755 packages/sw/bun.lockb diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 000000000..31eaaea1d --- /dev/null +++ b/bun.lockb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1c38fd62d3a95d883fed6b4eb1ea16126667248f4c03a4ac4c0367d21ac2de1 +size 255080 diff --git a/packages/backend/bun.lockb b/packages/backend/bun.lockb new file mode 100755 index 000000000..e10adde91 --- /dev/null +++ b/packages/backend/bun.lockb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc69a322b5dd9baec1f8713ed24f27e2f1c396e403a3fa7d358ecad865357ddb +size 399520 diff --git a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js b/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js new file mode 100644 index 000000000..8936c3503 --- /dev/null +++ b/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js @@ -0,0 +1,16 @@ +export class addMovedToAndKnownAs1669288094000 { + name = 'addMovedToAndKnownAs1669288094000' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" ADD "movedToUri" character varying(512)`); + await queryRunner.query(`ALTER TABLE "user" ADD "knownAs" TEXT []`); + await queryRunner.query(`COMMENT ON COLUMN "user"."movedToUri" IS 'The URI of the new account of the User'`); + await queryRunner.query(`COMMENT ON COLUMN "user"."knownAs" IS 'URIs the user is known as too'`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "movedToUri"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "knownAs"`); + } + +} diff --git a/packages/backend/src/models/entities/user.ts b/packages/backend/src/models/entities/user.ts index bc9446be4..9d79c42e6 100644 --- a/packages/backend/src/models/entities/user.ts +++ b/packages/backend/src/models/entities/user.ts @@ -68,6 +68,12 @@ export class User { }) public followingCount: number; + @Column('varchar', { + length: 512, nullable: true, + comment: 'The URI of the new account of the User', + }) + public movedToUri: string | null; + @Column('integer', { default: 0, comment: 'The count of notes.', diff --git a/packages/sw/bun.lockb b/packages/sw/bun.lockb new file mode 100755 index 000000000..2e4e467a7 --- /dev/null +++ b/packages/sw/bun.lockb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:794ad1609465ce05a365b412bdf602993c1f113b4c0af7716aba8fc8c40d7f7f +size 43759 From fe7ac800d76986a5cdc4199a6a47e5b824f41f8e Mon Sep 17 00:00:00 2001 From: Cleo John <30842467+CutestNekoAqua@users.noreply.github.com> Date: Thu, 24 Nov 2022 11:39:40 +0000 Subject: [PATCH 005/168] Add movedToUri and knownAs to DB model user --- packages/backend/src/models/entities/user.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/backend/src/models/entities/user.ts b/packages/backend/src/models/entities/user.ts index 9d79c42e6..1fa46037d 100644 --- a/packages/backend/src/models/entities/user.ts +++ b/packages/backend/src/models/entities/user.ts @@ -74,6 +74,12 @@ export class User { }) public movedToUri: string | null; + @Column('simple-array', { + nullable: true, + comment: 'URIs the user is known as too', + }) + public alsoKnownAs: string[] | null; + @Column('integer', { default: 0, comment: 'The count of notes.', From 1e16aef16de3ca1c54bd3aa0a0f2b209df1d8991 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Thu, 24 Nov 2022 19:28:38 +0100 Subject: [PATCH 006/168] Add intellij to main .gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index a4e031399..d511fa5ad 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,8 @@ packages/backend/assets/instance.css *.blend3 *.blend4 *.blend5 + +#intelij stuff +packages/backend/.idea/backend.iml +packages/backend/.idea/modules.xml +packages/backend/.idea/vcs.xml From cfab9ff2ad0550467bc3844325252d68d0d79f00 Mon Sep 17 00:00:00 2001 From: Cleo Date: Wed, 30 Nov 2022 20:26:13 +0100 Subject: [PATCH 007/168] Display moved info. It already fetches the moved to info on regular user fetches, now only the notification of a new "moved to" is missing. Signed-off-by: cutestnekoaqua Co-authored-by: Mary Strodl Signed-off-by: cutestnekoaqua --- locales/de-DE.yml | 1 + locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + .../backend/src/models/repositories/user.ts | 63 +++++++++++++++---- packages/backend/src/models/schema/user.ts | 10 +++ packages/client/src/components/MkMoved.vue | 25 ++++++++ packages/client/src/pages/user/home.vue | 2 + 7 files changed, 92 insertions(+), 11 deletions(-) create mode 100644 packages/client/src/components/MkMoved.vue diff --git a/locales/de-DE.yml b/locales/de-DE.yml index d7920b361..ea0fb8846 100644 --- a/locales/de-DE.yml +++ b/locales/de-DE.yml @@ -112,6 +112,7 @@ reactionSettingDescription2: "Ziehe um Anzuordnen, klicke um zu löschen, drück rememberNoteVisibility: "Notizsichtbarkeit merken" attachCancel: "Anhang entfernen" markAsSensitive: "Als NSFW markieren" +accountMoved: "Benutzer hat zu einem anderen Account gewechselt." unmarkAsSensitive: "Als nicht NSFW markieren" enterFileName: "Dateinamen eingeben" mute: "Stummschalten" diff --git a/locales/en-US.yml b/locales/en-US.yml index f5758ed64..1215055d5 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -149,6 +149,7 @@ addAccount: "Add account" loginFailed: "Failed to sign in" showOnRemote: "View on remote instance" general: "General" +accountMoved: "User has moved to a new account." wallpaper: "Wallpaper" setWallpaper: "Set wallpaper" removeWallpaper: "Remove wallpaper" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index b045f5448..90820d43a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -149,6 +149,7 @@ addAccount: "アカウントを追加" loginFailed: "ログインに失敗しました" showOnRemote: "リモートで表示" general: "全般" +accountMoved: "このユーザーは新しいアカウントに移行しました" wallpaper: "壁紙" setWallpaper: "壁紙を設定" removeWallpaper: "壁紙を削除" diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 5c46ae27a..47ab1fc9e 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -1,16 +1,38 @@ -import { EntityRepository, Repository, In, Not } from 'typeorm'; +import {In, Not} from 'typeorm'; import Ajv from 'ajv'; -import { User, ILocalUser, IRemoteUser } from '@/models/entities/user.js'; +import {ILocalUser, IRemoteUser, User} from '@/models/entities/user.js'; import config from '@/config/index.js'; -import { Packed } from '@/misc/schema.js'; -import { awaitAll, Promiseable } from '@/prelude/await-all.js'; -import { populateEmojis } from '@/misc/populate-emojis.js'; -import { getAntennas } from '@/misc/antenna-cache.js'; -import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from '@/const.js'; -import { Cache } from '@/misc/cache.js'; -import { db } from '@/db/postgre.js'; -import { Instance } from '../entities/instance.js'; -import { Notes, NoteUnreads, FollowRequests, Notifications, MessagingMessages, UserNotePinings, Followings, Blockings, Mutings, UserProfiles, UserSecurityKeys, UserGroupJoinings, Pages, Announcements, AnnouncementReads, Antennas, AntennaNotes, ChannelFollowings, Instances, DriveFiles } from '../index.js'; +import {Packed} from '@/misc/schema.js'; +import {awaitAll, Promiseable} from '@/prelude/await-all.js'; +import {populateEmojis} from '@/misc/populate-emojis.js'; +import {getAntennas} from '@/misc/antenna-cache.js'; +import {USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD} from '@/const.js'; +import {Cache} from '@/misc/cache.js'; +import {db} from '@/db/postgre.js'; +import {Instance} from '../entities/instance.js'; +import {resolveUser} from "@/remote/resolve-user"; +import {URL} from "url"; +import { + AnnouncementReads, + Announcements, + AntennaNotes, + Blockings, + ChannelFollowings, + DriveFiles, + Followings, + FollowRequests, + Instances, + MessagingMessages, + Mutings, + Notes, + NoteUnreads, + Notifications, + Pages, + UserGroupJoinings, + UserNotePinings, + UserProfiles, + UserSecurityKeys +} from '../index.js'; const userInstanceCache = new Cache(1000 * 60 * 60 * 3); @@ -156,6 +178,23 @@ export const UserRepository = db.getRepository(User).extend({ return count > 0; }, + async userFromURI(uri: string): Promise { + if (uri.startsWith(config.url + '/')) { + const id = uri.split('/').pop(); + if (id == undefined) return null; + return await resolveUser(id, null); + } + + let url = new URL(uri); + let userTag = url.pathname; + + if (userTag.startsWith("@")) { + userTag = userTag.substring(1); + } + + return await resolveUser(userTag, url.host); + }, + async getHasUnreadAntenna(userId: User['id']): Promise { const myAntennas = (await getAntennas()).filter(a => a.userId === userId); @@ -320,6 +359,8 @@ export const UserRepository = db.getRepository(User).extend({ ...(opts.detail ? { url: profile!.url, uri: user.uri, + movedTo: user.movedToUri ? await this.userFromURI(user.movedToUri) : null, + alsoKnownAs: user.alsoKnownAs, createdAt: user.createdAt.toISOString(), updatedAt: user.updatedAt ? user.updatedAt.toISOString() : null, lastFetchedAt: user.lastFetchedAt ? user.lastFetchedAt.toISOString() : null, diff --git a/packages/backend/src/models/schema/user.ts b/packages/backend/src/models/schema/user.ts index 218d861e5..95827272f 100644 --- a/packages/backend/src/models/schema/user.ts +++ b/packages/backend/src/models/schema/user.ts @@ -96,6 +96,16 @@ export const packedUserDetailedNotMeOnlySchema = { format: 'uri', nullable: true, optional: false, }, + movedTo: { + type: 'string', + format: 'uri', + nullable: true, optional: false, + }, + alsoKnownAs: { + type: 'array', + format: 'uri', + nullable: true, optional: false, + }, createdAt: { type: 'string', nullable: false, optional: false, diff --git a/packages/client/src/components/MkMoved.vue b/packages/client/src/components/MkMoved.vue new file mode 100644 index 000000000..f5ec1a567 --- /dev/null +++ b/packages/client/src/components/MkMoved.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/packages/client/src/pages/user/home.vue b/packages/client/src/pages/user/home.vue index b0ff75eef..e8e111cae 100644 --- a/packages/client/src/pages/user/home.vue +++ b/packages/client/src/pages/user/home.vue @@ -8,6 +8,7 @@
+
@@ -67,6 +67,7 @@ import { url } from '@/config'; import { useRouter } from '@/router'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; +import { shareAvailable } from '@/scripts/share-available'; const router = useRouter(); diff --git a/packages/client/src/pages/page.vue b/packages/client/src/pages/page.vue index 2497db950..e89fd3e2a 100644 --- a/packages/client/src/pages/page.vue +++ b/packages/client/src/pages/page.vue @@ -34,7 +34,7 @@
- +
@@ -81,6 +81,7 @@ import MkPagination from '@/components/MkPagination.vue'; import MkPagePreview from '@/components/MkPagePreview.vue'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; +import { shareAvailable } from '@/scripts/share-available'; const props = defineProps<{ pageName: string; diff --git a/packages/client/src/scripts/get-note-menu.ts b/packages/client/src/scripts/get-note-menu.ts index 9c52b2e24..e17ade59c 100644 --- a/packages/client/src/scripts/get-note-menu.ts +++ b/packages/client/src/scripts/get-note-menu.ts @@ -8,6 +8,7 @@ import * as os from '@/os'; import copyToClipboard from '@/scripts/copy-to-clipboard'; import { url } from '@/config'; import { noteActions } from '@/store'; +import { shareAvailable } from '@/scripts/share-available'; export function getNoteMenu(props: { note: misskey.entities.Note; @@ -220,11 +221,11 @@ export function getNoteMenu(props: { window.open(appearNote.url || appearNote.uri, '_blank'); }, } : undefined, - { + shareAvailable() ? { icon: 'ph-share-network-bold ph-lg', text: i18n.ts.share, action: share, - }, + } : undefined, instance.translatorAvailable ? { icon: 'ph-translate-bold ph-lg', text: i18n.ts.translate, diff --git a/packages/client/src/scripts/share-available.ts b/packages/client/src/scripts/share-available.ts new file mode 100644 index 000000000..8056d6dc2 --- /dev/null +++ b/packages/client/src/scripts/share-available.ts @@ -0,0 +1,6 @@ +export function shareAvailable(): boolean { + if (navigator.share) { + return true; + } + return false; +} From 0e3b9323a2dce4e43438a01486e57a7292cfd7b9 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 3 Dec 2022 21:32:32 -0800 Subject: [PATCH 020/168] =?UTF-8?q?release:=20=F0=9F=94=96=20.18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d732f2f79..7e0d15401 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "calckey", - "version": "12.119.0-calc.18-rc.11", + "version": "12.119.0-calc.18", "codename": "aqua", "repository": { "type": "git", From 0aa205d4e20b66f880f3a5f7155d3d4e0ce870e3 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 3 Dec 2022 21:50:18 -0800 Subject: [PATCH 021/168] feat: Docker update script (closes #9159) --- push-docker.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 push-docker.sh diff --git a/push-docker.sh b/push-docker.sh new file mode 100755 index 000000000..434c9cc63 --- /dev/null +++ b/push-docker.sh @@ -0,0 +1,10 @@ +sudo systemctl start docker.service +sudo docker rmi $(docker images -q) +sudo docker compose build +sudo docker tag thatonecalculator/calckey:latest thatonecalculator/calckey:$(git describe --tags --exact-match) +sudo docker images +echo "\nPress any key to continue\n" +read +sudo docker push thatonecalculator/calckey:$(git describe --tags --exact-match) +sudo docker push thatonecalculator/calckey:latest +sudo systemctl stop docker.service From 17bfc77964f5532b03d268dd7251bf73554f83cd Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 3 Dec 2022 21:56:45 -0800 Subject: [PATCH 022/168] locale --- locales/en-US.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index f58296b9f..0f3fff72e 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1227,7 +1227,7 @@ _tutorial: step5_3: "The Home {icon} timeline is where you can see posts from your followers." step5_4: "The Local {icon} timeline is where you can see posts from everyone else on this instance." step5_5: "The Recommended {icon} timeline is where you can see posts from instances the admins recommend." - step5_6: "The Social {icon} timeline is where you can see posts from friends of your followers." + step5_6: "The Social {icon} timeline is your home + local." step5_7: "The Global {icon} timeline is where you can see posts from every other connected instance." step6_1: "So, what is this place?" step6_2: "Well, you didn't just join Calckey. You joined a portal to the Fediverse, an interconnected network of thousands of servers, called \"instances\"." From 6001ea5c4c1e61e27ce6e809c30188c902dbddf4 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 4 Dec 2022 11:57:56 -0800 Subject: [PATCH 023/168] Update deps --- package.json | 8 +++---- packages/backend/package.json | 42 +++++++++++++++++------------------ packages/client/package.json | 20 ++++++++--------- packages/sw/package.json | 4 ++-- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 7e0d15401..6dcb6a8be 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,10 @@ "lodash": "^4.17.21" }, "dependencies": { - "@bull-board/api": "^4.6.4", - "@bull-board/ui": "^4.6.4", + "@bull-board/api": "^4.7.0", + "@bull-board/ui": "^4.7.0", "@tensorflow/tfjs": "^3.21.0", - "eslint": "^8.28.0", + "eslint": "^8.29.0", "execa": "5.1.1", "gulp": "4.0.2", "gulp-cssnano": "2.1.3", @@ -57,7 +57,7 @@ "devDependencies": { "@types/gulp": "4.0.10", "@types/gulp-rename": "2.0.1", - "@typescript-eslint/parser": "5.43.0", + "@typescript-eslint/parser": "5.45.0", "cross-env": "7.0.3", "cypress": "10.11.0", "start-server-and-test": "1.14.0", diff --git a/packages/backend/package.json b/packages/backend/package.json index 2f7a11984..721a574f0 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -21,13 +21,13 @@ "@tensorflow/tfjs-node": "3.21.1" }, "dependencies": { - "@bull-board/api": "^4.6.4", - "@bull-board/koa": "^4.6.4", - "@bull-board/ui": "^4.6.4", + "@bull-board/api": "^4.7.0", + "@bull-board/koa": "^4.7.0", + "@bull-board/ui": "^4.7.0", "@discordapp/twemoji": "14.0.2", "@elastic/elasticsearch": "7.17.0", "@koa/cors": "3.4.3", - "@koa/multer": "3.0.0", + "@koa/multer": "3.0.2", "@koa/router": "9.4.0", "@peertube/http-signature": "1.7.0", "@sinonjs/fake-timers": "9.1.2", @@ -36,10 +36,10 @@ "archiver": "5.3.1", "autobind-decorator": "2.4.0", "autwh": "0.1.0", - "aws-sdk": "2.1258.0", + "aws-sdk": "2.1267.0", "bcryptjs": "2.4.3", "blurhash": "1.1.5", - "bull": "4.10.1", + "bull": "4.10.2", "cacheable-lookup": "7.0.0", "cbor": "8.1.0", "chalk": "5.1.2", @@ -60,11 +60,11 @@ "ip-cidr": "3.0.11", "is-svg": "4.3.2", "js-yaml": "4.1.0", - "jsdom": "20.0.2", + "jsdom": "20.0.3", "json5": "2.2.1", "json5-loader": "4.0.1", "jsonld": "6.0.0", - "jsrsasign": "10.6.0", + "jsrsasign": "10.6.1", "koa": "2.13.4", "koa-bodyparser": "4.3.0", "koa-favicon": "2.1.0", @@ -85,7 +85,7 @@ "nsfwjs": "2.4.2", "oauth": "^0.10.0", "os-utils": "0.0.14", - "parse5": "7.1.1", + "parse5": "7.1.2", "pg": "8.8.0", "private-ip": "2.3.4", "probe-image-size": "7.2.3", @@ -96,7 +96,7 @@ "qrcode": "1.5.1", "random-seed": "0.3.0", "ratelimiter": "3.4.1", - "re2": "1.17.7", + "re2": "1.17.8", "redis-lock": "0.1.4", "reflect-metadata": "0.1.13", "rename": "1.0.4", @@ -111,16 +111,16 @@ "stringz": "2.1.0", "summaly": "2.7.0", "syslog-pro": "1.0.0", - "systeminformation": "5.13.5", + "systeminformation": "5.16.1", "tesseract.js": "^3.0.3", "tinycolor2": "1.4.2", "tmp": "0.2.1", - "ts-loader": "9.4.1", + "ts-loader": "9.4.2", "ts-node": "10.9.1", - "tsc-alias": "1.7.1", - "tsconfig-paths": "4.1.0", + "tsc-alias": "1.8.1", + "tsconfig-paths": "4.1.1", "twemoji-parser": "14.0.0", - "typeorm": "0.3.10", + "typeorm": "0.3.11", "ulid": "2.3.0", "unzipper": "0.10.11", "uuid": "9.0.0", @@ -130,7 +130,7 @@ "xev": "3.0.2" }, "devDependencies": { - "@redocly/openapi-core": "1.0.0-beta.114", + "@redocly/openapi-core": "1.0.0-beta.115", "@types/bcryptjs": "2.4.2", "@types/bull": "3.15.9", "@types/cbor": "6.0.0", @@ -138,7 +138,7 @@ "@types/fluent-ffmpeg": "2.1.20", "@types/js-yaml": "4.0.5", "@types/jsdom": "20.0.1", - "@types/jsonld": "1.5.7", + "@types/jsonld": "1.5.8", "@types/jsrsasign": "10.5.4", "@types/koa": "2.13.5", "@types/koa-bodyparser": "4.3.10", @@ -152,7 +152,7 @@ "@types/koa__multer": "2.0.4", "@types/koa__router": "8.0.11", "@types/mocha": "9.1.1", - "@types/node": "18.11.9", + "@types/node": "18.11.10", "@types/node-fetch": "3.0.3", "@types/nodemailer": "6.4.6", "@types/oauth": "0.9.1", @@ -174,10 +174,10 @@ "@types/web-push": "3.3.2", "@types/websocket": "1.0.5", "@types/ws": "8.5.3", - "@typescript-eslint/eslint-plugin": "5.43.0", - "@typescript-eslint/parser": "5.43.0", + "@typescript-eslint/eslint-plugin": "5.45.0", + "@typescript-eslint/parser": "5.45.0", "cross-env": "7.0.3", - "eslint": "8.28.0", + "eslint": "8.29.0", "eslint-plugin-import": "2.26.0", "execa": "6.1.0", "typescript": "4.9.3" diff --git a/packages/client/package.json b/packages/client/package.json index bc49ac021..5da6d022d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -15,7 +15,7 @@ "@vitejs/plugin-vue": "3.2.0", "@vue/compiler-sfc": "3.2.45", "autobind-decorator": "2.4.0", - "autosize": "5.0.1", + "autosize": "5.0.2", "blurhash": "1.1.5", "broadcast-channel": "4.18.1", "browser-image-resizer": "https://github.com/misskey-dev/browser-image-resizer.git#commit=0380d12c8e736788ea7f4e6e985175521ea7b23c", @@ -24,7 +24,7 @@ "chartjs-plugin-gradient": "0.5.1", "chartjs-plugin-zoom": "1.2.1", "compare-versions": "5.0.1", - "cropperjs": "2.0.0-beta.1", + "cropperjs": "2.0.0-beta.2", "date-fns": "2.29.3", "escape-regexp": "0.0.1", "eventemitter3": "4.0.7", @@ -35,7 +35,7 @@ "matter-js": "0.18.0", "mfm-js": "0.23.0", "misskey-js": "0.0.14", - "photoswipe": "5.3.3", + "photoswipe": "5.3.4", "prismjs": "1.29.0", "punycode": "2.1.1", "querystring": "0.2.1", @@ -45,14 +45,14 @@ "seedrandom": "3.0.5", "strict-event-emitter-types": "2.0.0", "stringz": "2.1.0", - "swiper": "^8.4.4", + "swiper": "^8.4.5", "syuilo-password-strength": "0.0.1", "textarea-caret": "3.1.0", "three": "0.146.0", "throttle-debounce": "5.0.0", "tinycolor2": "1.4.2", - "tsc-alias": "1.7.1", - "tsconfig-paths": "4.1.0", + "tsc-alias": "1.8.1", + "tsconfig-paths": "4.1.1", "twemoji-parser": "14.0.0", "typescript": "4.9.3", "uuid": "9.0.0", @@ -76,13 +76,13 @@ "@types/throttle-debounce": "5.0.0", "@types/tinycolor2": "1.4.3", "@types/uuid": "8.3.4", - "@typescript-eslint/eslint-plugin": "5.43.0", - "@typescript-eslint/parser": "5.43.0", + "@typescript-eslint/eslint-plugin": "5.45.0", + "@typescript-eslint/parser": "5.45.0", "cross-env": "7.0.3", "cypress": "10.11.0", - "eslint": "8.28.0", + "eslint": "8.29.0", "eslint-plugin-import": "2.26.0", - "eslint-plugin-vue": "9.7.0", + "eslint-plugin-vue": "9.8.0", "rollup": "2.79.1", "start-server-and-test": "1.14.0" } diff --git a/packages/sw/package.json b/packages/sw/package.json index 2fb0e38a3..94fc206da 100644 --- a/packages/sw/package.json +++ b/packages/sw/package.json @@ -7,11 +7,11 @@ "lint": "eslint --quiet src/**/*.{ts}" }, "dependencies": { - "esbuild": "^0.15.14", + "esbuild": "^0.15.17", "idb-keyval": "^6.2.0", "misskey-js": "0.0.14" }, "devDependencies": { - "eslint": "^8.28.0" + "eslint": "^8.29.0" } } From 954e79bbddcfb5d7878f8fecf6e6933a1e849641 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 4 Dec 2022 12:41:12 -0800 Subject: [PATCH 024/168] fix cleo's oopsie --- packages/backend/src/server/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/index.ts b/packages/backend/src/server/index.ts index 10566339e..ae236ce34 100644 --- a/packages/backend/src/server/index.ts +++ b/packages/backend/src/server/index.ts @@ -19,7 +19,7 @@ import { genIdenticon } from '@/misc/gen-identicon.js'; import { createTemp } from '@/misc/create-temp.js'; import { publishMainStream } from '@/services/stream.js'; import * as Acct from '@/misc/acct.js'; -import { envOption } from '@/env'; +import { envOption } from '@/env.js'; import activityPub from './activitypub.js'; import nodeinfo from './nodeinfo.js'; import wellKnown from './well-known.js'; From bb7678fd450cd8221081f578be64229843831f53 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 4 Dec 2022 12:46:10 -0800 Subject: [PATCH 025/168] fix imports --- .../src/remote/activitypub/kernel/index.ts | 12 +++---- .../remote/activitypub/kernel/move/index.ts | 36 ++++++++++--------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/packages/backend/src/remote/activitypub/kernel/index.ts b/packages/backend/src/remote/activitypub/kernel/index.ts index be617942d..b8af3dc48 100644 --- a/packages/backend/src/remote/activitypub/kernel/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/index.ts @@ -1,5 +1,6 @@ +import type { CacheableRemoteUser } from '@/models/entities/user.js'; +import { toArray } from '@/prelude/array.js'; import { - IObject, isCreate, isDelete, isUpdate, @@ -16,9 +17,10 @@ import { isCollectionOrOrderedCollection, isCollection, isFlag, - isMove + isMove, } from '../type.js'; -import { CacheableRemoteUser } from '@/models/entities/user.js'; +import { apLogger } from '../logger.js'; +import Resolver from '../resolver.js'; import create from './create/index.js'; import performDeleteActivity from './delete/index.js'; import performUpdateActivity from './update/index.js'; @@ -33,10 +35,8 @@ import add from './add/index.js'; import remove from './remove/index.js'; import block from './block/index.js'; import flag from './flag/index.js'; -import { apLogger } from '../logger.js'; -import Resolver from '../resolver.js'; -import { toArray } from '@/prelude/array.js'; import move from './move/index.js'; +import type { IObject } from '../type.js'; export async function performActivity(actor: CacheableRemoteUser, activity: IObject) { if (isCollectionOrOrderedCollection(activity)) { diff --git a/packages/backend/src/remote/activitypub/kernel/move/index.ts b/packages/backend/src/remote/activitypub/kernel/move/index.ts index 71d716505..d142ee8c9 100644 --- a/packages/backend/src/remote/activitypub/kernel/move/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/move/index.ts @@ -1,15 +1,17 @@ -import {CacheableRemoteUser, IRemoteUser, User} from '@/models/entities/user.js'; -import {IMove, IObject, IActor} from '../../type.js'; -import DbResolver from "@/remote/activitypub/db-resolver"; -import {getRemoteUser} from '@/server/api/common/getters.js'; +import type { CacheableRemoteUser } from '@/models/entities/user.js'; +import { IRemoteUser, User } from '@/models/entities/user.js'; +import DbResolver from '@/remote/activitypub/db-resolver'; +import { getRemoteUser } from '@/server/api/common/getters.js'; import { updatePerson } from '@/remote/activitypub/models/person.js'; -import {Followings, Users} from "@/models"; -import {makePaginationQuery} from "@/server/api/common/make-pagination-query"; +import { Followings, Users } from '@/models'; +import { makePaginationQuery } from '@/server/api/common/make-pagination-query'; import deleteFollowing from '@/services/following/delete.js'; import create from '@/services/following/create.js'; -import {IdentifiableError} from "@/misc/identifiable-error"; -import {ApiError} from "@/server/api/error"; -import {meta} from "@/server/api/endpoints/following/create"; +import { IdentifiableError } from '@/misc/identifiable-error'; +import { ApiError } from '@/server/api/error'; +import { meta } from '@/server/api/endpoints/following/create'; +import { IObject, IActor } from '../../type.js'; +import type { IMove } from '../../type.js'; export default async (actor: CacheableRemoteUser, activity: IMove): Promise => { // ※ There is a block target in activity.object, which should be a local user that exists. @@ -22,19 +24,19 @@ export default async (actor: CacheableRemoteUser, activity: IMove): Promiseactivity.actor); if (!new_acc || new_acc.uri === null) { - return `move: new acc not found`; + return 'move: new acc not found'; } if (!old_acc || old_acc.uri === null) { - return `move: old acc not found`; + return 'move: old acc not found'; } await updatePerson(new_acc.uri); await updatePerson(old_acc.uri); new_acc = await getRemoteUser(new_acc.uri); old_acc = await getRemoteUser(old_acc.uri); - if(old_acc === null || old_acc.uri === null || !new_acc?.alsoKnownAs?.includes(old_acc.uri)) return `move: accounts invalid`; + if (old_acc === null || old_acc.uri === null || !new_acc.alsoKnownAs?.includes(old_acc.uri)) return 'move: accounts invalid'; - old_acc.movedToUri = new_acc?.uri + old_acc.movedToUri = new_acc.uri; const query = makePaginationQuery(Followings.createQueryBuilder('following')) .andWhere('following.followeeId = :userId', { userId: old_acc.id }) @@ -44,8 +46,8 @@ export default async (actor: CacheableRemoteUser, activity: IMove): Promise { - if(!following.follower?.host) { - let follower = following.follower; + if (!following.follower?.host) { + const follower = following.follower; deleteFollowing(follower!, old_acc!); try { create(follower!, new_acc!); @@ -57,7 +59,7 @@ export default async (actor: CacheableRemoteUser, activity: IMove): Promise Date: Sun, 4 Dec 2022 12:53:55 -0800 Subject: [PATCH 026/168] cleo ide moment --- .../backend/src/models/repositories/user.ts | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 47ab1fc9e..023ec7eb0 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -1,17 +1,18 @@ -import {In, Not} from 'typeorm'; +import { URL } from 'url'; +import { In, Not } from 'typeorm'; import Ajv from 'ajv'; -import {ILocalUser, IRemoteUser, User} from '@/models/entities/user.js'; +import type { ILocalUser, IRemoteUser } from '@/models/entities/user.js'; +import { User } from '@/models/entities/user.js'; import config from '@/config/index.js'; -import {Packed} from '@/misc/schema.js'; -import {awaitAll, Promiseable} from '@/prelude/await-all.js'; -import {populateEmojis} from '@/misc/populate-emojis.js'; -import {getAntennas} from '@/misc/antenna-cache.js'; -import {USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD} from '@/const.js'; -import {Cache} from '@/misc/cache.js'; -import {db} from '@/db/postgre.js'; -import {Instance} from '../entities/instance.js'; -import {resolveUser} from "@/remote/resolve-user"; -import {URL} from "url"; +import type { Packed } from '@/misc/schema.js'; +import type { Promiseable } from '@/prelude/await-all.js'; +import { awaitAll } from '@/prelude/await-all.js'; +import { populateEmojis } from '@/misc/populate-emojis.js'; +import { getAntennas } from '@/misc/antenna-cache.js'; +import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from '@/const.js'; +import { Cache } from '@/misc/cache.js'; +import { db } from '@/db/postgre.js'; +import { resolveUser } from '@/remote/resolve-user.js'; import { AnnouncementReads, Announcements, @@ -31,14 +32,15 @@ import { UserGroupJoinings, UserNotePinings, UserProfiles, - UserSecurityKeys + UserSecurityKeys, } from '../index.js'; +import type { Instance } from '../entities/instance.js'; const userInstanceCache = new Cache(1000 * 60 * 60 * 3); type IsUserDetailed = Detailed extends true ? Packed<'UserDetailed'> : Packed<'UserLite'>; type IsMeAndIsUserDetailed = - Detailed extends true ? + Detailed extends true ? ExpectsMe extends true ? Packed<'MeDetailed'> : ExpectsMe extends false ? Packed<'UserDetailedNotMe'> : Packed<'UserDetailed'> : @@ -185,10 +187,10 @@ export const UserRepository = db.getRepository(User).extend({ return await resolveUser(id, null); } - let url = new URL(uri); + const url = new URL(uri); let userTag = url.pathname; - if (userTag.startsWith("@")) { + if (userTag.startsWith('@')) { userTag = userTag.substring(1); } From dfbe7d7d5e243b9c347b2cc7d751b06e549ba8a5 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 4 Dec 2022 12:57:43 -0800 Subject: [PATCH 027/168] pov: cleo uses jetbrains --- packages/backend/src/remote/activitypub/kernel/move/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/remote/activitypub/kernel/move/index.ts b/packages/backend/src/remote/activitypub/kernel/move/index.ts index d142ee8c9..2954cbb03 100644 --- a/packages/backend/src/remote/activitypub/kernel/move/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/move/index.ts @@ -1,6 +1,6 @@ import type { CacheableRemoteUser } from '@/models/entities/user.js'; import { IRemoteUser, User } from '@/models/entities/user.js'; -import DbResolver from '@/remote/activitypub/db-resolver'; +import DbResolver from '@/remote/activitypub/db-resolver.js'; import { getRemoteUser } from '@/server/api/common/getters.js'; import { updatePerson } from '@/remote/activitypub/models/person.js'; import { Followings, Users } from '@/models'; From d2f28edbd7cc8d3fbb3935eaa0b8f3d81b635336 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 4 Dec 2022 13:01:00 -0800 Subject: [PATCH 028/168] more jb cleanups --- .../src/remote/activitypub/kernel/move/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/remote/activitypub/kernel/move/index.ts b/packages/backend/src/remote/activitypub/kernel/move/index.ts index 2954cbb03..0f9fb8bb9 100644 --- a/packages/backend/src/remote/activitypub/kernel/move/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/move/index.ts @@ -3,13 +3,13 @@ import { IRemoteUser, User } from '@/models/entities/user.js'; import DbResolver from '@/remote/activitypub/db-resolver.js'; import { getRemoteUser } from '@/server/api/common/getters.js'; import { updatePerson } from '@/remote/activitypub/models/person.js'; -import { Followings, Users } from '@/models'; -import { makePaginationQuery } from '@/server/api/common/make-pagination-query'; +import { Followings, Users } from '@/models.js'; +import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js'; import deleteFollowing from '@/services/following/delete.js'; import create from '@/services/following/create.js'; -import { IdentifiableError } from '@/misc/identifiable-error'; -import { ApiError } from '@/server/api/error'; -import { meta } from '@/server/api/endpoints/following/create'; +import { IdentifiableError } from '@/misc/identifiable-error.js'; +import { ApiError } from '@/server/api/error.js'; +import { meta } from '@/server/api/endpoints/following/create.js'; import { IObject, IActor } from '../../type.js'; import type { IMove } from '../../type.js'; From 3fbe6e02a105a61adc9e49547ca3548439ab0500 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 4 Dec 2022 13:03:17 -0800 Subject: [PATCH 029/168] ? --- packages/backend/src/remote/activitypub/kernel/move/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/remote/activitypub/kernel/move/index.ts b/packages/backend/src/remote/activitypub/kernel/move/index.ts index 0f9fb8bb9..157bf097b 100644 --- a/packages/backend/src/remote/activitypub/kernel/move/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/move/index.ts @@ -3,7 +3,7 @@ import { IRemoteUser, User } from '@/models/entities/user.js'; import DbResolver from '@/remote/activitypub/db-resolver.js'; import { getRemoteUser } from '@/server/api/common/getters.js'; import { updatePerson } from '@/remote/activitypub/models/person.js'; -import { Followings, Users } from '@/models.js'; +import { Followings, Users } from '@/models'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js'; import deleteFollowing from '@/services/following/delete.js'; import create from '@/services/following/create.js'; From 0e61b83460416ccc317aa00057e2c3f0504bbfcf Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 4 Dec 2022 13:06:49 -0800 Subject: [PATCH 030/168] fix import once and for all --- packages/backend/src/remote/activitypub/kernel/move/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/remote/activitypub/kernel/move/index.ts b/packages/backend/src/remote/activitypub/kernel/move/index.ts index 157bf097b..501ee694b 100644 --- a/packages/backend/src/remote/activitypub/kernel/move/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/move/index.ts @@ -3,7 +3,7 @@ import { IRemoteUser, User } from '@/models/entities/user.js'; import DbResolver from '@/remote/activitypub/db-resolver.js'; import { getRemoteUser } from '@/server/api/common/getters.js'; import { updatePerson } from '@/remote/activitypub/models/person.js'; -import { Followings, Users } from '@/models'; +import { Followings, Users } from '@/models/index.js'; import { makePaginationQuery } from '@/server/api/common/make-pagination-query.js'; import deleteFollowing from '@/services/following/delete.js'; import create from '@/services/following/create.js'; From 98a44931d61eac3fab660da9f57bed1238905e68 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Sun, 4 Dec 2022 21:20:35 +0000 Subject: [PATCH 031/168] typo --- push-docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/push-docker.sh b/push-docker.sh index 434c9cc63..64d1ccdef 100755 --- a/push-docker.sh +++ b/push-docker.sh @@ -3,7 +3,7 @@ sudo docker rmi $(docker images -q) sudo docker compose build sudo docker tag thatonecalculator/calckey:latest thatonecalculator/calckey:$(git describe --tags --exact-match) sudo docker images -echo "\nPress any key to continue\n" +echo "\nPress enter to continue\n" read sudo docker push thatonecalculator/calckey:$(git describe --tags --exact-match) sudo docker push thatonecalculator/calckey:latest From de02c0fe4a9b6fc50f023ca9d6abf2d90ab80c26 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 4 Dec 2022 13:26:24 -0800 Subject: [PATCH 032/168] fix migration --- .../backend/migration/1669288094000-AddMovedToAndKnownAs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js b/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js index 8936c3503..2f11d2d7a 100644 --- a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js +++ b/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js @@ -3,14 +3,14 @@ export class addMovedToAndKnownAs1669288094000 { async up(queryRunner) { await queryRunner.query(`ALTER TABLE "user" ADD "movedToUri" character varying(512)`); - await queryRunner.query(`ALTER TABLE "user" ADD "knownAs" TEXT []`); + await queryRunner.query(`ALTER TABLE "user" ADD "alsoKnownAs" TEXT []`); await queryRunner.query(`COMMENT ON COLUMN "user"."movedToUri" IS 'The URI of the new account of the User'`); - await queryRunner.query(`COMMENT ON COLUMN "user"."knownAs" IS 'URIs the user is known as too'`); + await queryRunner.query(`COMMENT ON COLUMN "user"."alsoKnownAs" IS 'URIs the user is known as too'`); } async down(queryRunner) { await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "movedToUri"`); - await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "knownAs"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "alsoKnownAs"`); } } From dbb950d0ebc1f6fac4285658d5698f04dcec0c99 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sun, 4 Dec 2022 17:20:36 -0800 Subject: [PATCH 033/168] movedTo -> movedToUri --- packages/backend/src/models/repositories/user.ts | 2 +- packages/backend/src/models/schema/user.ts | 2 +- packages/backend/src/remote/activitypub/models/person.ts | 4 ++-- packages/backend/src/remote/activitypub/renderer/index.ts | 2 +- packages/backend/src/remote/activitypub/renderer/person.ts | 2 +- packages/backend/src/remote/activitypub/type.ts | 2 +- packages/client/src/pages/user/home.vue | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/backend/src/models/repositories/user.ts b/packages/backend/src/models/repositories/user.ts index 023ec7eb0..6810728e1 100644 --- a/packages/backend/src/models/repositories/user.ts +++ b/packages/backend/src/models/repositories/user.ts @@ -361,7 +361,7 @@ export const UserRepository = db.getRepository(User).extend({ ...(opts.detail ? { url: profile!.url, uri: user.uri, - movedTo: user.movedToUri ? await this.userFromURI(user.movedToUri) : null, + movedToUri: user.movedToUri ? await this.userFromURI(user.movedToUri) : null, alsoKnownAs: user.alsoKnownAs, createdAt: user.createdAt.toISOString(), updatedAt: user.updatedAt ? user.updatedAt.toISOString() : null, diff --git a/packages/backend/src/models/schema/user.ts b/packages/backend/src/models/schema/user.ts index 95827272f..b70210a0f 100644 --- a/packages/backend/src/models/schema/user.ts +++ b/packages/backend/src/models/schema/user.ts @@ -96,7 +96,7 @@ export const packedUserDetailedNotMeOnlySchema = { format: 'uri', nullable: true, optional: false, }, - movedTo: { + movedToUri: { type: 'string', format: 'uri', nullable: true, optional: false, diff --git a/packages/backend/src/remote/activitypub/models/person.ts b/packages/backend/src/remote/activitypub/models/person.ts index 2719f50d2..1634592c1 100644 --- a/packages/backend/src/remote/activitypub/models/person.ts +++ b/packages/backend/src/remote/activitypub/models/person.ts @@ -172,7 +172,7 @@ export async function createPerson(uri: string, resolver?: Resolver): Promise; diff --git a/packages/backend/src/remote/activitypub/renderer/index.ts b/packages/backend/src/remote/activitypub/renderer/index.ts index 893b6fd75..e6f976f5f 100644 --- a/packages/backend/src/remote/activitypub/renderer/index.ts +++ b/packages/backend/src/remote/activitypub/renderer/index.ts @@ -19,7 +19,7 @@ export const renderActivity = (x: any): IActivity | null => { { // as non-standards manuallyApprovesFollowers: 'as:manuallyApprovesFollowers', - movedTo: 'as:movedTo', + movedToUri: 'as:movedTo', sensitive: 'as:sensitive', Hashtag: 'as:Hashtag', quoteUrl: 'as:quoteUrl', diff --git a/packages/backend/src/remote/activitypub/renderer/person.ts b/packages/backend/src/remote/activitypub/renderer/person.ts index dfabd910e..1be2b2c18 100644 --- a/packages/backend/src/remote/activitypub/renderer/person.ts +++ b/packages/backend/src/remote/activitypub/renderer/person.ts @@ -71,7 +71,7 @@ export async function renderPerson(user: ILocalUser) { image: banner ? renderImage(banner) : null, tag, manuallyApprovesFollowers: user.isLocked, - movedTo: user.moved_to_account_id, + movedToUri: user.moved_to_account_id, discoverable: !!user.isExplorable, publicKey: renderKey(user, keypair, `#main-key`), isCat: user.isCat, diff --git a/packages/backend/src/remote/activitypub/type.ts b/packages/backend/src/remote/activitypub/type.ts index aabbd0679..3ccc85acc 100644 --- a/packages/backend/src/remote/activitypub/type.ts +++ b/packages/backend/src/remote/activitypub/type.ts @@ -156,7 +156,7 @@ export interface IActor extends IObject { name?: string; preferredUsername?: string; manuallyApprovesFollowers?: boolean; - movedTo?: string; + movedToUri?: string; alsoKnownAs?: string[]; discoverable?: boolean; inbox: string; diff --git a/packages/client/src/pages/user/home.vue b/packages/client/src/pages/user/home.vue index 00fd43039..3a969de3d 100644 --- a/packages/client/src/pages/user/home.vue +++ b/packages/client/src/pages/user/home.vue @@ -8,7 +8,7 @@
- +