From 44c6bc7dd0c796a2c28136ab5574c39a8941c20c Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Sun, 5 Feb 2023 12:38:40 +0100 Subject: [PATCH 01/28] fixing a git merge error. --- packages/backend/src/misc/reaction-lib.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/backend/src/misc/reaction-lib.ts b/packages/backend/src/misc/reaction-lib.ts index 5fd47aab7..babebfb62 100644 --- a/packages/backend/src/misc/reaction-lib.ts +++ b/packages/backend/src/misc/reaction-lib.ts @@ -71,6 +71,12 @@ export async function toDbReaction( if (Object.keys(legacies).includes(reaction)) return legacies[reaction]; // Convert old heart to new if (reaction === "♥️") return "❤️"; + // Allow unicode reactions + const match = emojiRegex.exec(reaction); + if (match) { + const unicode = match[0]; + return unicode; + } const custom = reaction.match(/^:([\w+-]+)(?:@\.)?:$/); if (custom) { From 2ae58c1c629dcd6d2d0e8f8f48d5dc80e26923fb Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Sun, 5 Feb 2023 12:39:57 +0100 Subject: [PATCH 02/28] fix: docker tags --- .woodpecker/dockerHubTag.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.woodpecker/dockerHubTag.yml b/.woodpecker/dockerHubTag.yml index 4294e1a58..5543ae234 100644 --- a/.woodpecker/dockerHubTag.yml +++ b/.woodpecker/dockerHubTag.yml @@ -16,6 +16,3 @@ pipeline: # Push new version when version tag is created event: tag tag: v* - -depends_on: - - prSecurityCheck From 3ecc69185c9f01334d8c0047f37eed78d7f740eb Mon Sep 17 00:00:00 2001 From: Cleo Date: Thu, 9 Feb 2023 22:59:05 +0000 Subject: [PATCH 03/28] Beta Docker build (#9589) Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9589 --- .woodpecker/dockerHubRelease.yml | 2 +- .woodpecker/dockerHubReleaseCandidate.yml | 15 +++++++++++++++ .woodpecker/testDocker.yml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .woodpecker/dockerHubReleaseCandidate.yml diff --git a/.woodpecker/dockerHubRelease.yml b/.woodpecker/dockerHubRelease.yml index e995b3fd0..bcb6df490 100644 --- a/.woodpecker/dockerHubRelease.yml +++ b/.woodpecker/dockerHubRelease.yml @@ -12,4 +12,4 @@ pipeline: # Secret 'docker_password' needs to be set in the CI settings from_secret: docker_password -branch: main +branches: main diff --git a/.woodpecker/dockerHubReleaseCandidate.yml b/.woodpecker/dockerHubReleaseCandidate.yml new file mode 100644 index 000000000..9b1a84316 --- /dev/null +++ b/.woodpecker/dockerHubReleaseCandidate.yml @@ -0,0 +1,15 @@ +pipeline: + publish-docker-latest: + image: plugins/kaniko + settings: + repo: thatonecalculator/calckey + tags: rc + dockerfile: Dockerfile + username: + # Secret 'docker_username' needs to be set in the CI settings + from_secret: docker_username + password: + # Secret 'docker_password' needs to be set in the CI settings + from_secret: docker_password + +branches: beta diff --git a/.woodpecker/testDocker.yml b/.woodpecker/testDocker.yml index aef58c9ad..e3fdf0eb9 100644 --- a/.woodpecker/testDocker.yml +++ b/.woodpecker/testDocker.yml @@ -8,4 +8,4 @@ pipeline: no_push: true branches: - include: [ main, develop ] + include: [ main, develop, beta ] From 69089016d551c5a39a89a1ddc7c6a057bff1daab Mon Sep 17 00:00:00 2001 From: Cleo Date: Fri, 10 Feb 2023 07:00:47 +0000 Subject: [PATCH 04/28] Meow --- .woodpecker/dockerHubReleaseCandidate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.woodpecker/dockerHubReleaseCandidate.yml b/.woodpecker/dockerHubReleaseCandidate.yml index 9b1a84316..48bd39525 100644 --- a/.woodpecker/dockerHubReleaseCandidate.yml +++ b/.woodpecker/dockerHubReleaseCandidate.yml @@ -11,5 +11,4 @@ pipeline: password: # Secret 'docker_password' needs to be set in the CI settings from_secret: docker_password - branches: beta From a6e1669d608a1518be6e5b8c48b97770dcd6c33e Mon Sep 17 00:00:00 2001 From: Cleo Date: Fri, 10 Feb 2023 07:10:42 +0000 Subject: [PATCH 05/28] Nya --- cypress/e2e/widgets.cy.js | 1 - 1 file changed, 1 deletion(-) diff --git a/cypress/e2e/widgets.cy.js b/cypress/e2e/widgets.cy.js index db35a60b5..9eea010bd 100644 --- a/cypress/e2e/widgets.cy.js +++ b/cypress/e2e/widgets.cy.js @@ -2,7 +2,6 @@ describe('After user signed in', () => { beforeEach(() => { cy.resetState(); cy.viewport('macbook-16'); - // インスタンス初期セットアップ cy.registerUser('admin', 'pass', true); From 234315dacd415567e0c7381b601bcfb94857c3d9 Mon Sep 17 00:00:00 2001 From: Cleo Date: Fri, 10 Feb 2023 10:04:32 +0000 Subject: [PATCH 06/28] Fix build --- packages/backend/src/misc/reaction-lib.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/backend/src/misc/reaction-lib.ts b/packages/backend/src/misc/reaction-lib.ts index 41036489a..babebfb62 100644 --- a/packages/backend/src/misc/reaction-lib.ts +++ b/packages/backend/src/misc/reaction-lib.ts @@ -78,13 +78,6 @@ export async function toDbReaction( return unicode; } - // Allow unicode reactions - const match = emojiRegex.exec(reaction); - if (match) { - const unicode = match[0]; - return unicode; - } - const custom = reaction.match(/^:([\w+-]+)(?:@\.)?:$/); if (custom) { const name = custom[1]; From 424fdd4f267d1f8630588a2d540e3102f0c3ba45 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Sat, 11 Feb 2023 06:02:08 +0000 Subject: [PATCH 07/28] Upload files to 'packages/backend/assets' --- packages/backend/assets/favicon.svg | Bin 0 -> 4285 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/backend/assets/favicon.svg diff --git a/packages/backend/assets/favicon.svg b/packages/backend/assets/favicon.svg new file mode 100644 index 0000000000000000000000000000000000000000..a77c6e22bbd6a1a0142e667bf938e57ee5aa97ba GIT binary patch literal 4285 zcmb7I+m74F5q-~BG-L$pMZ{*`FN$O!fs@6)B*3nLJO(t`nqfu~1(IXU%-82sla%CL zC)sFVh}DA>M!)oCb~@n!Q8*LCwUz=!U+uhS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zAlB3is4s3zX?%9}p05ZaXxk1z;?qzP4Ik%3CmoY!}zKrxVpv=o-Q3x_lze4<`s zJxSOpq6zb$dM*@P=2C(BBNHV?!Ch@fRZN^K$EAfYa21^;(orrx672A&EpSJWN`QTj zTmYm-9m|ZKGbDLje2kX)*yxNfSda01?qn-;GOr+B+$5D2=$Kq92`x(Q(Gp4d!we!4bCQyVFKa>F@{ky4juS_Asnglt`N|< zA(+gU$~}yPkbf{Zazib3VwWuNhF*Z`BgW7JbCBo=xloA+8kn6!*yx`$U~LGQQ`8|X zK?{Hg$;q5L$zfvoiUmLd6nQQBGcq?3=pz6T!7r5@@;}gv2)`=nrG@@YiNGlmKyS+5 z8CD207cGhybw^4fo6Zd3Drm|Pg2qOYAl(S=*5!VLb7?XvuxX$poC-}ul)eYDsD#;4 zJPME3A6`y68la3|HA(=L=QPMe3xiyc2!JI-(O&5d1yKPbycQw3#qwMS6fN+coDv); zW9XZFTi|h93FnXq+_{inm)R}(!#j@-o$CD-M7H1l=bhx#o!(O4{inOfd?T5E3DK_? z+&bv?AvLxv|6zcePNK{Huv^vBXQ+qU!~BS$>5pdeg2lYMd6f^#{Xai!$==d$k`Mm| D`KnNH literal 0 HcmV?d00001 From a1592dad907736c3afe1f8d44f9a9188d0348da3 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Sat, 11 Feb 2023 06:10:15 +0000 Subject: [PATCH 08/28] Delete 'packages/backend/assets/favicon.svg' --- packages/backend/assets/favicon.svg | Bin 4285 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 packages/backend/assets/favicon.svg diff --git a/packages/backend/assets/favicon.svg b/packages/backend/assets/favicon.svg deleted file mode 100644 index a77c6e22bbd6a1a0142e667bf938e57ee5aa97ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4285 zcmb7I+m74F5q-~BG-L$pMZ{*`FN$O!fs@6)B*3nLJO(t`nqfu~1(IXU%-82sla%CL zC)sFVh}DA>M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TnmC9wGt0P(>hdP*_ZtDzn;h zAlB3is4s3zX?%9}p05ZaXxk1z;?qzP4Ik%3CmoY!}zKrxVpv=o-Q3x_lze4<`s zJxSOpq6zb$dM*@P=2C(BBNHV?!Ch@fRZN^K$EAfYa21^;(orrx672A&EpSJWN`QTj zTmYm-9m|ZKGbDLje2kX)*yxNfSda01?qn-;GOr+B+$5D2=$Kq92`x(Q(Gp4d!we!4bCQyVFKa>F@{ky4juS_Asnglt`N|< zA(+gU$~}yPkbf{Zazib3VwWuNhF*Z`BgW7JbCBo=xloA+8kn6!*yx`$U~LGQQ`8|X zK?{Hg$;q5L$zfvoiUmLd6nQQBGcq?3=pz6T!7r5@@;}gv2)`=nrG@@YiNGlmKyS+5 z8CD207cGhybw^4fo6Zd3Drm|Pg2qOYAl(S=*5!VLb7?XvuxX$poC-}ul)eYDsD#;4 zJPME3A6`y68la3|HA(=L=QPMe3xiyc2!JI-(O&5d1yKPbycQw3#qwMS6fN+coDv); zW9XZFTi|h93FnXq+_{inm)R}(!#j@-o$CD-M7H1l=bhx#o!(O4{inOfd?T5E3DK_? z+&bv?AvLxv|6zcePNK{Huv^vBXQ+qU!~BS$>5pdeg2lYMd6f^#{Xai!$==d$k`Mm| D`KnNH From 00bcaeaa47ef48d1fd13f190b21a6ceda619235a Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Mon, 13 Feb 2023 03:35:21 +0000 Subject: [PATCH 09/28] Update 'CALCKEY.md' --- CALCKEY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CALCKEY.md b/CALCKEY.md index 015232f70..1186277e2 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -108,6 +108,7 @@ - Allows custom emoji - Fix lint errors - Use Rome instead of ESLint +- Keyboard accesibility - MissV: [fix Misskey Forkbomb](https://code.vtopia.live/Vtopia/MissV/commit/40b23c070bd4adbb3188c73546c6c625138fb3c1) - [Make showing ads optional](https://github.com/misskey-dev/misskey/pull/8996) - [Tapping avatar in mobile opens account modal](https://github.com/misskey-dev/misskey/pull/9056) From 94b9db451ec9121e1494adbc7e0ca92bfa2f2231 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Mon, 20 Feb 2023 12:20:47 -0800 Subject: [PATCH 10/28] update readme --- README.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index bc4141a8e..fd6b14c25 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ If you have access to a server that supports one of the sources below, I recomme ### 🐋 Docker -[How to run Calckey with Docker](./docker-README.md). +[How to run Calckey with Docker](./docs/docker.md). ## 🧑‍💻 Dependencies @@ -97,9 +97,10 @@ If you have access to a server that supports one of the sources below, I recomme ```sh git clone --depth 1 https://codeberg.org/calckey/calckey.git cd calckey/ -# git checkout main # if you want only stable versions ``` +By default, you're on the development branch. Run `git checkout beta` or `git checkout main` to switch to the Beta/Main branches. + ## 📩 Install dependencies ```sh @@ -123,6 +124,8 @@ psql postgres -c "create database calckey with encoding = 'UTF8';" - To add custom CSS for all users, edit `./custom/assets/instance.css`. - To add static assets (such as images for the splash screen), place them in the `./custom/assets/` directory. They'll then be available on `https://yourinstance.tld/static-assets/filename.ext`. - To add custom locales, place them in the `./custom/locales/` directory. If you name your custom locale the same as an existing locale, it will overwrite it. If you give it a unique name, it will be added to the list. Also make sure that the first part of the filename matches the locale you're basing it on. (Example: `en-FOO.yml`) +- To add custom error images, place them in the `./custom/assets/badges` directory, replacing the files already there. +- To add custom sounds, place only mp3 files in the `./custom/assets/sounds` directory. - To update custom assets without rebuilding, just run `pnpm run gulp`. ## 🧑‍🔬 Configuring a new instance @@ -133,12 +136,7 @@ psql postgres -c "create database calckey with encoding = 'UTF8';" ## 🚚 Migrating from Misskey to Calckey -> ⚠️ Because of their changes, migrating from Foundkey is not supported. - -```sh -cp ../misskey/.config/default.yml ./.config/default.yml # replace `../misskey/` with misskey path, add `docker.env` if you use Docker -cp -r ../misskey/files . -``` +For migrating from Misskey v13, Misskey v12, and Foundkey, read [this document](https://codeberg.org/calckey/calckey/src/branch/develop/docs/migrate.md). ## 🍀 NGINX From c48c42850c6b08eb4345815e43087f2261ddeeec Mon Sep 17 00:00:00 2001 From: Freeplay Date: Thu, 23 Feb 2023 20:50:58 -0500 Subject: [PATCH 11/28] fix not being able to click around there are new posts button --- packages/client/src/pages/timeline.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 3646e8d86..9357050c7 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -315,12 +315,14 @@ onMounted(() => { top: calc(var(--stickyTop, 0px) + 16px); z-index: 1000; width: 100%; + pointer-events: none; > button { display: block; margin: var(--margin) auto 0 auto; padding: 8px 16px; border-radius: 32px; + pointer-events: all; } } From 2f419ad7278fd23d9afe0261e569c9f251af4e00 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 17 Feb 2023 00:01:22 -0800 Subject: [PATCH 12/28] perf: :zap: emoji lib performance fix --- packages/backend/src/misc/reaction-lib.ts | 87 +++++++++++------------ 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/packages/backend/src/misc/reaction-lib.ts b/packages/backend/src/misc/reaction-lib.ts index a61c0a119..7d78904bb 100644 --- a/packages/backend/src/misc/reaction-lib.ts +++ b/packages/backend/src/misc/reaction-lib.ts @@ -4,73 +4,68 @@ import { Emojis } from "@/models/index.js"; import { toPunyNullable } from "./convert-host.js"; import { IsNull } from "typeorm"; -const legacies: Record = { - like: "👍", - love: "❤️", // ここに記述する場合は異体字セレクタを入れない <- not that good because modern browsers just display it as the red heart so just convert it to it to not end up with two seperate reactions of "the same emoji" for the user - laugh: "😆", - hmm: "🤔", - surprise: "😮", - congrats: "🎉", - angry: "💢", - confused: "😥", - rip: "😇", - pudding: "🍮", - star: "⭐", -}; +const legacies = new Map([ + ['like', '👍'], + ['love', '❤️'], + ['laugh', '😆'], + ['hmm', '🤔'], + ['surprise', '😮'], + ['congrats', '🎉'], + ['angry', '💢'], + ['confused', '😥'], + ['rip', '😇'], + ['pudding', '🍮'], + ['star', '⭐'], +]); -export async function getFallbackReaction(): Promise { +export async function getFallbackReaction() { const meta = await fetchMeta(); return meta.defaultReaction; } export function convertLegacyReactions(reactions: Record) { - const _reactions = {} as Record; + const _reactions = new Map(); + const decodedReactions = new Map(); - for (const reaction of Object.keys(reactions)) { + for (const reaction in reactions) { if (reactions[reaction] <= 0) continue; - if (Object.keys(legacies).includes(reaction)) { - if (_reactions[legacies[reaction]]) { - _reactions[legacies[reaction]] += reactions[reaction]; - } else { - _reactions[legacies[reaction]] = reactions[reaction]; - } - } else if (reaction === "♥️") { - if (_reactions["❤️"]) { - _reactions["❤️"] += reactions[reaction]; - } else { - _reactions["❤️"] = reactions[reaction]; - } + let decodedReaction; + if (decodedReactions.has(reaction)) { + decodedReaction = decodedReactions.get(reaction); } else { - if (_reactions[reaction]) { - _reactions[reaction] += reactions[reaction]; - } else { - _reactions[reaction] = reactions[reaction]; - } + decodedReaction = decodeReaction(reaction); + decodedReactions.set(reaction, decodedReaction); + } + + let emoji = legacies.get(decodedReaction.reaction); + if (emoji) { + _reactions.set(emoji, (_reactions.get(emoji) || 0) + reactions[reaction]); + } else { + _reactions.set(reaction, (_reactions.get(reaction) || 0) + reactions[reaction]); } } - const _reactions2 = {} as Record; - - for (const reaction of Object.keys(_reactions)) { - _reactions2[decodeReaction(reaction).reaction] = _reactions[reaction]; + const _reactions2 = new Map(); + for (const [reaction, count] of _reactions) { + const decodedReaction = decodedReactions.get(reaction); + _reactions2.set(decodedReaction.reaction, count); } - return _reactions2; + return Object.fromEntries(_reactions2); } export async function toDbReaction( reaction?: string | null, reacterHost?: string | null, ): Promise { - if (reaction == null) return await getFallbackReaction(); + if (!reaction) return await getFallbackReaction(); reacterHost = toPunyNullable(reacterHost); // Convert string-type reactions to unicode - if (Object.keys(legacies).includes(reaction)) return legacies[reaction]; - // Convert old heart to new - if (reaction === "♥️") return "❤️"; + const emoji = legacies.get(reaction) || (reaction === "♥️" ? "❤️" : null); + if (emoji) return emoji; // Allow unicode reactions const match = emojiRegex.exec(reaction); @@ -83,7 +78,7 @@ export async function toDbReaction( if (custom) { const name = custom[1]; const emoji = await Emojis.findOneBy({ - host: reacterHost ?? IsNull(), + host: reacterHost || IsNull(), name, }); @@ -132,7 +127,7 @@ export function decodeReaction(str: string): DecodedReaction { } export function convertLegacyReaction(reaction: string): string { - reaction = decodeReaction(reaction).reaction; - if (Object.keys(legacies).includes(reaction)) return legacies[reaction]; - return reaction; + const decoded = decodeReaction(reaction).reaction; + if (legacies.has(decoded)) return legacies.get(decoded)!; + return decoded; } From 456eb4b62746c62cdf505872cd1b7a501dc0a9c9 Mon Sep 17 00:00:00 2001 From: Free Date: Mon, 13 Feb 2023 21:14:06 +0000 Subject: [PATCH 13/28] New MkPageHeader --- .../src/components/global/MkPageHeader.vue | 85 +++++++++++-------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/packages/client/src/components/global/MkPageHeader.vue b/packages/client/src/components/global/MkPageHeader.vue index 464a965b3..5eaa5e4fe 100644 --- a/packages/client/src/components/global/MkPageHeader.vue +++ b/packages/client/src/components/global/MkPageHeader.vue @@ -1,35 +1,35 @@