From 4941c4c878df5d1786645c379cd354da7abb9b77 Mon Sep 17 00:00:00 2001 From: Cleo Date: Sat, 7 Jan 2023 23:32:13 +0000 Subject: [PATCH 1/7] =?UTF-8?q?=E2=80=9E.woodpecker/dockerHubRelease.yml?= =?UTF-8?q?=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/dockerHubRelease.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.woodpecker/dockerHubRelease.yml b/.woodpecker/dockerHubRelease.yml index 60be66fc8..e995b3fd0 100644 --- a/.woodpecker/dockerHubRelease.yml +++ b/.woodpecker/dockerHubRelease.yml @@ -11,7 +11,5 @@ pipeline: password: # Secret 'docker_password' needs to be set in the CI settings from_secret: docker_password - when: - # Push new version of tag latest if new push on main-branch - event: push - branch: main + +branch: main From f2b3c889c10b2658dee4c493e962f5d7d2bfc24e Mon Sep 17 00:00:00 2001 From: Cleo Date: Sun, 8 Jan 2023 18:11:12 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=E2=80=9EDockerfile=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7a92509d8..44fb1ef8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN yarn plugin import workspace-tools # Install Dependencies RUN yarn install -RUN yarn rebuild +RUN yarn build # Remove git files RUN rm -rf .git From 731925a1f210a09856104e1b675e6d9a8e6a8f1f Mon Sep 17 00:00:00 2001 From: Jae Lo Presti Date: Sun, 8 Jan 2023 11:26:35 +0000 Subject: [PATCH 3/7] Dockerfile: path builds producing brick image Signed-off-by: cutestnekoaqua --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7a92509d8..9e8c00115 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,11 +13,12 @@ RUN apk add git ffmpeg tini alpine-sdk python3 # Configure corepack and yarn RUN corepack enable RUN yarn set version berry +RUN yarn install --immutable RUN yarn plugin import workspace-tools # Install Dependencies -RUN yarn install -RUN yarn rebuild +RUN yarn run build + # Remove git files RUN rm -rf .git From 6a01de05d8a795701858cf5339b2722434997982 Mon Sep 17 00:00:00 2001 From: Cleo Date: Sun, 8 Jan 2023 18:54:05 +0000 Subject: [PATCH 4/7] =?UTF-8?q?=E2=80=9EDockerfile=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e8c00115..b0ffa9904 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,13 +13,12 @@ RUN apk add git ffmpeg tini alpine-sdk python3 # Configure corepack and yarn RUN corepack enable RUN yarn set version berry -RUN yarn install --immutable RUN yarn plugin import workspace-tools # Install Dependencies +RUN yarn install RUN yarn run build - # Remove git files RUN rm -rf .git From 06ee523871ccdab8874b3af34637eb8c131264e1 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 4 Feb 2023 12:37:20 -0800 Subject: [PATCH 5/7] fix: :bug: following issues Closes #9544 --- packages/backend/src/services/following/create.ts | 4 ++-- packages/backend/src/services/following/requests/create.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/services/following/create.ts b/packages/backend/src/services/following/create.ts index 635d706fc..61a8c6b26 100644 --- a/packages/backend/src/services/following/create.ts +++ b/packages/backend/src/services/following/create.ts @@ -209,12 +209,12 @@ export default async function ( await Blockings.delete(blocking.id); } else { // それ以外は単純に例外 - if (blocking != null) + if (blocking) throw new IdentifiableError( "710e8fb0-b8c3-4922-be49-d5d93d8e6a6e", "blocking", ); - if (blocked != null) + if (blocked) throw new IdentifiableError( "3338392a-f764-498d-8855-db939dcf8c48", "blocked", diff --git a/packages/backend/src/services/following/requests/create.ts b/packages/backend/src/services/following/requests/create.ts index 0833f2aeb..8b2e86ab5 100644 --- a/packages/backend/src/services/following/requests/create.ts +++ b/packages/backend/src/services/following/requests/create.ts @@ -38,8 +38,8 @@ export default async function ( }), ]); - if (blocking != null) throw new Error("blocking"); - if (blocked != null) throw new Error("blocked"); + if (blocking) throw new Error("blocking"); + if (blocked) throw new Error("blocked"); const followRequest = await FollowRequests.insert({ id: genId(), From 4073b746b4ad4f0843a7d5705d24b5c971a28cb5 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 4 Feb 2023 12:38:46 -0800 Subject: [PATCH 6/7] fix: :lock: improve tag search security --- .../backend/src/server/api/endpoints/notes/search-by-tag.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts index 8cf9ce8fb..899323742 100644 --- a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts +++ b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts @@ -93,7 +93,7 @@ export default define(meta, paramDef, async (ps, me) => { try { if (ps.tag) { - if (!safeForSql(ps.tag)) throw new Error("Injection"); + if (!safeForSql(normalizeForSearch(ps.tag))) throw 'Injection'; query.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`); } else { query.andWhere( @@ -102,7 +102,7 @@ export default define(meta, paramDef, async (ps, me) => { qb.orWhere( new Brackets((qb) => { for (const tag of tags) { - if (!safeForSql(tag)) throw new Error("Injection"); + if (!safeForSql(normalizeForSearch(ps.tag))) throw 'Injection'; qb.andWhere(`'{"${normalizeForSearch(tag)}"}' <@ note.tags`); } }), From 9afe5424c0d908ccbfc7ee02da214956dcfae5d0 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Sat, 4 Feb 2023 12:41:25 -0800 Subject: [PATCH 7/7] chore: formatting --- packages/backend/src/misc/nyaize.ts | 6 +++--- .../backend/src/server/api/endpoints/notes/search-by-tag.ts | 5 +++-- packages/client/src/components/MkEmojiPicker.vue | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/backend/src/misc/nyaize.ts b/packages/backend/src/misc/nyaize.ts index 7ec26c1eb..b85f1d918 100644 --- a/packages/backend/src/misc/nyaize.ts +++ b/packages/backend/src/misc/nyaize.ts @@ -2,9 +2,9 @@ export function nyaize(text: string): string { return ( text // ja-JP - .replace(/な/g, "にゃ") - .replace(/ナ/g, "ニャ") - .replace(/ナ/g, "ニャ") + .replaceAll("な", "にゃ") + .replaceAll("ナ", "ニャ") + .replaceAll("ナ", "ニャ") // en-US .replace(/(?<=n)a/gi, (x) => (x === "A" ? "YA" : "ya")) .replace(/(?<=morn)ing/gi, (x) => (x === "ING" ? "YAN" : "yan")) diff --git a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts index 899323742..d8d0dbbf7 100644 --- a/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts +++ b/packages/backend/src/server/api/endpoints/notes/search-by-tag.ts @@ -93,7 +93,7 @@ export default define(meta, paramDef, async (ps, me) => { try { if (ps.tag) { - if (!safeForSql(normalizeForSearch(ps.tag))) throw 'Injection'; + if (!safeForSql(normalizeForSearch(ps.tag))) throw "Injection"; query.andWhere(`'{"${normalizeForSearch(ps.tag)}"}' <@ note.tags`); } else { query.andWhere( @@ -102,7 +102,8 @@ export default define(meta, paramDef, async (ps, me) => { qb.orWhere( new Brackets((qb) => { for (const tag of tags) { - if (!safeForSql(normalizeForSearch(ps.tag))) throw 'Injection'; + if (!safeForSql(normalizeForSearch(ps.tag))) + throw "Injection"; qb.andWhere(`'{"${normalizeForSearch(tag)}"}' <@ note.tags`); } }), diff --git a/packages/client/src/components/MkEmojiPicker.vue b/packages/client/src/components/MkEmojiPicker.vue index ac1983255..b26eb1206 100644 --- a/packages/client/src/components/MkEmojiPicker.vue +++ b/packages/client/src/components/MkEmojiPicker.vue @@ -316,7 +316,7 @@ function done(query?: any): boolean | void { if (query == null) query = q.value; if (query == null || typeof query !== 'string') return; - const q2 = query.replace(/:/g, ''); + const q2 = query.replaceAll(':', ''); const exactMatchCustom = customEmojis.find(emoji => emoji.name === q2); if (exactMatchCustom) { chosen(exactMatchCustom);