From 7ba5512a65ecd63a4347e5cbd8504e7c4bb5fe1f Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Wed, 9 Feb 2022 22:20:28 +0900 Subject: [PATCH 01/25] Node v16.13.2 (#8281) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Node v16.13.2 * 一瞬CI変更 * Revert "一瞬CI変更" This reverts commit 144df615a8eb44f621188334b18c1a73277126e2. --- .node-version | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.node-version b/.node-version index 971a6537e5..53a42214a4 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -v16.6.2 +v16.13.2 diff --git a/Dockerfile b/Dockerfile index df86034301..9a651b6c2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.6.2-alpine3.13 AS base +FROM node:16.13.2-alpine3.15 AS base ENV NODE_ENV=production From 0afebcfd9e10a1c5deb98fb739e00aa73c757624 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 10 Feb 2022 17:45:12 +0900 Subject: [PATCH 02/25] enhance: improve federation chart --- .../migration/1644481657998-chart-v15.js | 31 +++++++++++++++++ packages/backend/src/queue/index.ts | 5 +++ .../src/queue/processors/system/index.ts | 2 ++ .../queue/processors/system/tick-charts.ts | 28 ++++++++++++++++ .../api/endpoints/admin/resync-chart.ts | 22 ------------- .../src/services/chart/charts/active-users.ts | 7 +++- .../src/services/chart/charts/ap-request.ts | 7 +++- .../src/services/chart/charts/drive.ts | 7 +++- .../chart/charts/entities/federation.ts | 5 ++- .../src/services/chart/charts/federation.ts | 33 +++++++++++-------- .../src/services/chart/charts/hashtag.ts | 7 +++- .../src/services/chart/charts/instance.ts | 7 +++- .../src/services/chart/charts/notes.ts | 7 +++- .../services/chart/charts/per-user-drive.ts | 7 +++- .../chart/charts/per-user-following.ts | 7 +++- .../services/chart/charts/per-user-notes.ts | 7 +++- .../chart/charts/per-user-reactions.ts | 7 +++- .../src/services/chart/charts/test-grouped.ts | 7 +++- .../chart/charts/test-intersection.ts | 7 +++- .../src/services/chart/charts/test-unique.ts | 7 +++- .../backend/src/services/chart/charts/test.ts | 7 +++- .../src/services/chart/charts/users.ts | 7 +++- packages/backend/src/services/chart/core.ts | 19 +++++++++-- .../register-or-fetch-instance-doc.ts | 3 -- packages/client/src/components/chart.vue | 10 +++--- 25 files changed, 199 insertions(+), 64 deletions(-) create mode 100644 packages/backend/migration/1644481657998-chart-v15.js create mode 100644 packages/backend/src/queue/processors/system/tick-charts.ts delete mode 100644 packages/backend/src/server/api/endpoints/admin/resync-chart.ts diff --git a/packages/backend/migration/1644481657998-chart-v15.js b/packages/backend/migration/1644481657998-chart-v15.js new file mode 100644 index 0000000000..4eee83f612 --- /dev/null +++ b/packages/backend/migration/1644481657998-chart-v15.js @@ -0,0 +1,31 @@ +const { MigrationInterface, QueryRunner } = require("typeorm"); + +module.exports = class chartV151644481657998 { + name = 'chartV151644481657998' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___instance_total"`); + await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___instance_inc"`); + await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___instance_dec"`); + await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_total"`); + await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_inc"`); + await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___instance_dec"`); + await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___sub" smallint NOT NULL DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___pub" smallint NOT NULL DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___sub" smallint NOT NULL DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___pub" smallint NOT NULL DEFAULT '0'`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___pub"`); + await queryRunner.query(`ALTER TABLE "__chart_day__federation" DROP COLUMN "___sub"`); + await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___pub"`); + await queryRunner.query(`ALTER TABLE "__chart__federation" DROP COLUMN "___sub"`); + await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___instance_dec" smallint NOT NULL DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___instance_inc" smallint NOT NULL DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE "__chart_day__federation" ADD "___instance_total" integer NOT NULL DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___instance_dec" smallint NOT NULL DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___instance_inc" smallint NOT NULL DEFAULT '0'`); + await queryRunner.query(`ALTER TABLE "__chart__federation" ADD "___instance_total" integer NOT NULL DEFAULT '0'`); + } +} diff --git a/packages/backend/src/queue/index.ts b/packages/backend/src/queue/index.ts index 16acabfbf8..62f372f3a8 100644 --- a/packages/backend/src/queue/index.ts +++ b/packages/backend/src/queue/index.ts @@ -258,6 +258,11 @@ export default function() { processDb(dbQueue); processObjectStorage(objectStorageQueue); + systemQueue.add('tickCharts', { + }, { + repeat: { cron: '55 * * * *' }, + }); + systemQueue.add('resyncCharts', { }, { repeat: { cron: '0 0 * * *' }, diff --git a/packages/backend/src/queue/processors/system/index.ts b/packages/backend/src/queue/processors/system/index.ts index 636fefc402..1513ea4a84 100644 --- a/packages/backend/src/queue/processors/system/index.ts +++ b/packages/backend/src/queue/processors/system/index.ts @@ -1,8 +1,10 @@ import * as Bull from 'bull'; +import { tickCharts } from './tick-charts'; import { resyncCharts } from './resync-charts'; import { cleanCharts } from './clean-charts'; const jobs = { + tickCharts, resyncCharts, cleanCharts, } as Record> | Bull.ProcessPromiseFunction>>; diff --git a/packages/backend/src/queue/processors/system/tick-charts.ts b/packages/backend/src/queue/processors/system/tick-charts.ts new file mode 100644 index 0000000000..d53089f89c --- /dev/null +++ b/packages/backend/src/queue/processors/system/tick-charts.ts @@ -0,0 +1,28 @@ +import * as Bull from 'bull'; + +import { queueLogger } from '../../logger'; +import { activeUsersChart, driveChart, federationChart, hashtagChart, instanceChart, notesChart, perUserDriveChart, perUserFollowingChart, perUserNotesChart, perUserReactionsChart, usersChart, apRequestChart } from '@/services/chart/index'; + +const logger = queueLogger.createSubLogger('tick-charts'); + +export async function tickCharts(job: Bull.Job>, done: any): Promise { + logger.info(`Tick charts...`); + + await Promise.all([ + federationChart.tick(false), + notesChart.tick(false), + usersChart.tick(false), + activeUsersChart.tick(false), + instanceChart.tick(false), + perUserNotesChart.tick(false), + driveChart.tick(false), + perUserReactionsChart.tick(false), + hashtagChart.tick(false), + perUserFollowingChart.tick(false), + perUserDriveChart.tick(false), + apRequestChart.tick(false), + ]); + + logger.succ(`All charts successfully ticked.`); + done(); +} diff --git a/packages/backend/src/server/api/endpoints/admin/resync-chart.ts b/packages/backend/src/server/api/endpoints/admin/resync-chart.ts deleted file mode 100644 index d80d2b0426..0000000000 --- a/packages/backend/src/server/api/endpoints/admin/resync-chart.ts +++ /dev/null @@ -1,22 +0,0 @@ -import define from '../../define'; -import { driveChart, notesChart, usersChart } from '@/services/chart/index'; -import { insertModerationLog } from '@/services/insert-moderation-log'; - -export const meta = { - tags: ['admin'], - - requireCredential: true, - requireModerator: true, -} as const; - -// eslint-disable-next-line import/no-default-export -export default define(meta, async (ps, me) => { - insertModerationLog(me, 'chartResync'); - - driveChart.resync(); - notesChart.resync(); - usersChart.resync(); - - // TODO: ユーザーごとのチャートもキューに入れて更新する - // TODO: インスタンスごとのチャートもキューに入れて更新する -}); diff --git a/packages/backend/src/services/chart/charts/active-users.ts b/packages/backend/src/services/chart/charts/active-users.ts index 87dd95f4dc..5baf46f772 100644 --- a/packages/backend/src/services/chart/charts/active-users.ts +++ b/packages/backend/src/services/chart/charts/active-users.ts @@ -18,7 +18,12 @@ export default class ActiveUsersChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { + protected async tickMajor(): Promise>> { + return {}; + } + + @autobind + protected async tickMinor(): Promise>> { return {}; } diff --git a/packages/backend/src/services/chart/charts/ap-request.ts b/packages/backend/src/services/chart/charts/ap-request.ts index bac5e425c8..ca763c8847 100644 --- a/packages/backend/src/services/chart/charts/ap-request.ts +++ b/packages/backend/src/services/chart/charts/ap-request.ts @@ -12,7 +12,12 @@ export default class ApRequestChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { + protected async tickMajor(): Promise>> { + return {}; + } + + @autobind + protected async tickMinor(): Promise>> { return {}; } diff --git a/packages/backend/src/services/chart/charts/drive.ts b/packages/backend/src/services/chart/charts/drive.ts index 2f00adae2b..288689784e 100644 --- a/packages/backend/src/services/chart/charts/drive.ts +++ b/packages/backend/src/services/chart/charts/drive.ts @@ -15,7 +15,12 @@ export default class DriveChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { + protected async tickMajor(): Promise>> { + return {}; + } + + @autobind + protected async tickMinor(): Promise>> { return {}; } diff --git a/packages/backend/src/services/chart/charts/entities/federation.ts b/packages/backend/src/services/chart/charts/entities/federation.ts index 0c8c20991d..6b2089f0b4 100644 --- a/packages/backend/src/services/chart/charts/entities/federation.ts +++ b/packages/backend/src/services/chart/charts/entities/federation.ts @@ -3,12 +3,11 @@ import Chart from '../../core'; export const name = 'federation'; export const schema = { - 'instance.total': { accumulate: true }, - 'instance.inc': { range: 'small' }, - 'instance.dec': { range: 'small' }, 'deliveredInstances': { uniqueIncrement: true, range: 'small' }, 'inboxInstances': { uniqueIncrement: true, range: 'small' }, 'stalled': { uniqueIncrement: true, range: 'small' }, + 'sub': { accumulate: true, range: 'small' }, + 'pub': { accumulate: true, range: 'small' }, } as const; export const entity = Chart.schemaToEntity(name, schema); diff --git a/packages/backend/src/services/chart/charts/federation.ts b/packages/backend/src/services/chart/charts/federation.ts index 19c75c98ad..211ba1debc 100644 --- a/packages/backend/src/services/chart/charts/federation.ts +++ b/packages/backend/src/services/chart/charts/federation.ts @@ -1,6 +1,6 @@ import autobind from 'autobind-decorator'; import Chart, { KVs } from '../core'; -import { Instances } from '@/models/index'; +import { Followings } from '@/models/index'; import { name, schema } from './entities/federation'; /** @@ -13,23 +13,30 @@ export default class FederationChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { - const [total] = await Promise.all([ - Instances.count({}), - ]); - + protected async tickMajor(): Promise>> { return { - 'instance.total': total, }; } @autobind - public async update(isAdditional: boolean): Promise { - await this.commit({ - 'instance.total': isAdditional ? 1 : -1, - 'instance.inc': isAdditional ? 1 : 0, - 'instance.dec': isAdditional ? 0 : 1, - }); + protected async tickMinor(): Promise>> { + const [sub, pub] = await Promise.all([ + Followings.createQueryBuilder('following') + .select('COUNT(DISTINCT following.followeeHost)') + .where('following.followeeHost IS NOT NULL') + .getRawOne() + .then(x => parseInt(x.count, 10)), + Followings.createQueryBuilder('following') + .select('COUNT(DISTINCT following.followerHost)') + .where('following.followerHost IS NOT NULL') + .getRawOne() + .then(x => parseInt(x.count, 10)), + ]); + + return { + 'sub': sub, + 'pub': pub, + }; } @autobind diff --git a/packages/backend/src/services/chart/charts/hashtag.ts b/packages/backend/src/services/chart/charts/hashtag.ts index 0b7bc467d2..cbae686833 100644 --- a/packages/backend/src/services/chart/charts/hashtag.ts +++ b/packages/backend/src/services/chart/charts/hashtag.ts @@ -14,7 +14,12 @@ export default class HashtagChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { + protected async tickMajor(): Promise>> { + return {}; + } + + @autobind + protected async tickMinor(): Promise>> { return {}; } diff --git a/packages/backend/src/services/chart/charts/instance.ts b/packages/backend/src/services/chart/charts/instance.ts index 5ea4d567e1..930ac4729b 100644 --- a/packages/backend/src/services/chart/charts/instance.ts +++ b/packages/backend/src/services/chart/charts/instance.ts @@ -16,7 +16,7 @@ export default class InstanceChart extends Chart { } @autobind - protected async queryCurrentState(group: string): Promise>> { + protected async tickMajor(group: string): Promise>> { const [ notesCount, usersCount, @@ -42,6 +42,11 @@ export default class InstanceChart extends Chart { }; } + @autobind + protected async tickMinor(): Promise>> { + return {}; + } + @autobind public async requestReceived(host: string): Promise { await this.commit({ diff --git a/packages/backend/src/services/chart/charts/notes.ts b/packages/backend/src/services/chart/charts/notes.ts index 5c56a9a718..624ee5db28 100644 --- a/packages/backend/src/services/chart/charts/notes.ts +++ b/packages/backend/src/services/chart/charts/notes.ts @@ -15,7 +15,7 @@ export default class NotesChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { + protected async tickMajor(): Promise>> { const [localCount, remoteCount] = await Promise.all([ Notes.count({ userHost: null }), Notes.count({ userHost: Not(IsNull()) }), @@ -27,6 +27,11 @@ export default class NotesChart extends Chart { }; } + @autobind + protected async tickMinor(): Promise>> { + return {}; + } + @autobind public async update(note: Note, isAdditional: boolean): Promise { const prefix = note.userHost === null ? 'local' : 'remote'; diff --git a/packages/backend/src/services/chart/charts/per-user-drive.ts b/packages/backend/src/services/chart/charts/per-user-drive.ts index 969ed018f9..ae9e8c5694 100644 --- a/packages/backend/src/services/chart/charts/per-user-drive.ts +++ b/packages/backend/src/services/chart/charts/per-user-drive.ts @@ -14,7 +14,7 @@ export default class PerUserDriveChart extends Chart { } @autobind - protected async queryCurrentState(group: string): Promise>> { + protected async tickMajor(group: string): Promise>> { const [count, size] = await Promise.all([ DriveFiles.count({ userId: group }), DriveFiles.calcDriveUsageOf(group), @@ -26,6 +26,11 @@ export default class PerUserDriveChart extends Chart { }; } + @autobind + protected async tickMinor(): Promise>> { + return {}; + } + @autobind public async update(file: DriveFile, isAdditional: boolean): Promise { const fileSizeKb = file.size / 1000; diff --git a/packages/backend/src/services/chart/charts/per-user-following.ts b/packages/backend/src/services/chart/charts/per-user-following.ts index cdd0aad947..0b39881c14 100644 --- a/packages/backend/src/services/chart/charts/per-user-following.ts +++ b/packages/backend/src/services/chart/charts/per-user-following.ts @@ -15,7 +15,7 @@ export default class PerUserFollowingChart extends Chart { } @autobind - protected async queryCurrentState(group: string): Promise>> { + protected async tickMajor(group: string): Promise>> { const [ localFollowingsCount, localFollowersCount, @@ -36,6 +36,11 @@ export default class PerUserFollowingChart extends Chart { }; } + @autobind + protected async tickMinor(): Promise>> { + return {}; + } + @autobind public async update(follower: { id: User['id']; host: User['host']; }, followee: { id: User['id']; host: User['host']; }, isFollow: boolean): Promise { const prefixFollower = Users.isLocalUser(follower) ? 'local' : 'remote'; diff --git a/packages/backend/src/services/chart/charts/per-user-notes.ts b/packages/backend/src/services/chart/charts/per-user-notes.ts index 6a4f0363b2..01a2785158 100644 --- a/packages/backend/src/services/chart/charts/per-user-notes.ts +++ b/packages/backend/src/services/chart/charts/per-user-notes.ts @@ -15,7 +15,7 @@ export default class PerUserNotesChart extends Chart { } @autobind - protected async queryCurrentState(group: string): Promise>> { + protected async tickMajor(group: string): Promise>> { const [count] = await Promise.all([ Notes.count({ userId: group }), ]); @@ -25,6 +25,11 @@ export default class PerUserNotesChart extends Chart { }; } + @autobind + protected async tickMinor(): Promise>> { + return {}; + } + @autobind public async update(user: { id: User['id'] }, note: Note, isAdditional: boolean): Promise { await this.commit({ diff --git a/packages/backend/src/services/chart/charts/per-user-reactions.ts b/packages/backend/src/services/chart/charts/per-user-reactions.ts index 2ec347f40a..59af0e86c0 100644 --- a/packages/backend/src/services/chart/charts/per-user-reactions.ts +++ b/packages/backend/src/services/chart/charts/per-user-reactions.ts @@ -15,7 +15,12 @@ export default class PerUserReactionsChart extends Chart { } @autobind - protected async queryCurrentState(group: string): Promise>> { + protected async tickMajor(group: string): Promise>> { + return {}; + } + + @autobind + protected async tickMinor(): Promise>> { return {}; } diff --git a/packages/backend/src/services/chart/charts/test-grouped.ts b/packages/backend/src/services/chart/charts/test-grouped.ts index 5f0b1aafdc..19b2135849 100644 --- a/packages/backend/src/services/chart/charts/test-grouped.ts +++ b/packages/backend/src/services/chart/charts/test-grouped.ts @@ -14,12 +14,17 @@ export default class TestGroupedChart extends Chart { } @autobind - protected async queryCurrentState(group: string): Promise>> { + protected async tickMajor(group: string): Promise>> { return { 'foo.total': this.total[group], }; } + @autobind + protected async tickMinor(): Promise>> { + return {}; + } + @autobind public async increment(group: string): Promise { if (this.total[group] == null) this.total[group] = 0; diff --git a/packages/backend/src/services/chart/charts/test-intersection.ts b/packages/backend/src/services/chart/charts/test-intersection.ts index c6ba71a956..6fd780f9b9 100644 --- a/packages/backend/src/services/chart/charts/test-intersection.ts +++ b/packages/backend/src/services/chart/charts/test-intersection.ts @@ -12,7 +12,12 @@ export default class TestIntersectionChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { + protected async tickMajor(): Promise>> { + return {}; + } + + @autobind + protected async tickMinor(): Promise>> { return {}; } diff --git a/packages/backend/src/services/chart/charts/test-unique.ts b/packages/backend/src/services/chart/charts/test-unique.ts index e67036acef..2c9cc2fd6a 100644 --- a/packages/backend/src/services/chart/charts/test-unique.ts +++ b/packages/backend/src/services/chart/charts/test-unique.ts @@ -12,7 +12,12 @@ export default class TestUniqueChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { + protected async tickMajor(): Promise>> { + return {}; + } + + @autobind + protected async tickMinor(): Promise>> { return {}; } diff --git a/packages/backend/src/services/chart/charts/test.ts b/packages/backend/src/services/chart/charts/test.ts index 878acd51be..b539625c10 100644 --- a/packages/backend/src/services/chart/charts/test.ts +++ b/packages/backend/src/services/chart/charts/test.ts @@ -14,12 +14,17 @@ export default class TestChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { + protected async tickMajor(): Promise>> { return { 'foo.total': this.total, }; } + @autobind + protected async tickMinor(): Promise>> { + return {}; + } + @autobind public async increment(): Promise { this.total++; diff --git a/packages/backend/src/services/chart/charts/users.ts b/packages/backend/src/services/chart/charts/users.ts index 50fca3a8d6..70ef89f8cd 100644 --- a/packages/backend/src/services/chart/charts/users.ts +++ b/packages/backend/src/services/chart/charts/users.ts @@ -15,7 +15,7 @@ export default class UsersChart extends Chart { } @autobind - protected async queryCurrentState(): Promise>> { + protected async tickMajor(): Promise>> { const [localCount, remoteCount] = await Promise.all([ Users.count({ host: null }), Users.count({ host: Not(IsNull()) }), @@ -27,6 +27,11 @@ export default class UsersChart extends Chart { }; } + @autobind + protected async tickMinor(): Promise>> { + return {}; + } + @autobind public async update(user: { id: User['id'], host: User['host'] }, isAdditional: boolean): Promise { const prefix = Users.isLocalUser(user) ? 'local' : 'remote'; diff --git a/packages/backend/src/services/chart/core.ts b/packages/backend/src/services/chart/core.ts index 5888e1a144..61a7575706 100644 --- a/packages/backend/src/services/chart/core.ts +++ b/packages/backend/src/services/chart/core.ts @@ -81,7 +81,15 @@ export default abstract class Chart { protected repositoryForHour: Repository>; protected repositoryForDay: Repository>; - protected abstract queryCurrentState(group: string | null): Promise>>; + /** + * 1日に一回程度実行されれば良いような計算処理を入れる(主にCASCADE削除などアプリケーション側で感知できない変動によるズレの修正用) + */ + protected abstract tickMajor(group: string | null): Promise>>; + + /** + * 少なくとも最小スパン内に1回は実行されて欲しい計算処理を入れる + */ + protected abstract tickMinor(group: string | null): Promise>>; @autobind private static convertSchemaToColumnDefinitions(schema: Schema): Record { @@ -445,8 +453,8 @@ export default abstract class Chart { } @autobind - public async resync(group: string | null = null): Promise { - const data = await this.queryCurrentState(group); + public async tick(major: boolean, group: string | null = null): Promise { + const data = major ? await this.tickMajor(group) : await this.tickMinor(group); const columns = {} as Record; for (const [k, v] of Object.entries(data)) { @@ -480,6 +488,11 @@ export default abstract class Chart { update(logHour, logDay)); } + @autobind + public resync(group: string | null = null): Promise { + return this.tick(true, group); + } + @autobind public async clean(): Promise { const current = dateUTC(Chart.getCurrentDate()); diff --git a/packages/backend/src/services/register-or-fetch-instance-doc.ts b/packages/backend/src/services/register-or-fetch-instance-doc.ts index 18b42ed15b..c42506a2ed 100644 --- a/packages/backend/src/services/register-or-fetch-instance-doc.ts +++ b/packages/backend/src/services/register-or-fetch-instance-doc.ts @@ -1,6 +1,5 @@ import { Instance } from '@/models/entities/instance'; import { Instances } from '@/models/index'; -import { federationChart } from '@/services/chart/index'; import { genId } from '@/misc/gen-id'; import { toPuny } from '@/misc/convert-host'; import { Cache } from '@/misc/cache'; @@ -23,8 +22,6 @@ export async function registerOrFetchInstanceDoc(host: string): Promise Instances.findOneOrFail(x.identifiers[0])); - federationChart.update(true); - cache.set(host, i); return i; } else { diff --git a/packages/client/src/components/chart.vue b/packages/client/src/components/chart.vue index ced0d481c4..5865715deb 100644 --- a/packages/client/src/components/chart.vue +++ b/packages/client/src/components/chart.vue @@ -370,14 +370,14 @@ export default defineComponent({ const raw = await os.api('charts/federation', { limit: props.limit, span: props.span }); return { series: [{ - name: 'Total', + name: 'Sub', type: 'area', - data: format(raw.instance.total), - color: '#888888', + data: format(raw.sub), + color: colors.orange, }, { - name: 'Inc/Dec', + name: 'Pub', type: 'area', - data: format(sum(raw.instance.inc, negate(raw.instance.dec))), + data: format(raw.pub), color: colors.purple, }, { name: 'Received', From 108ec412c3f1ea73695c732762956de53d440916 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 10 Feb 2022 19:02:52 +0900 Subject: [PATCH 03/25] enhance(client): tweak chart --- packages/client/src/components/chart.vue | 17 +++++++++++++---- .../client/src/components/instance-stats.vue | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/chart.vue b/packages/client/src/components/chart.vue index 5865715deb..d4c6f9d447 100644 --- a/packages/client/src/components/chart.vue +++ b/packages/client/src/components/chart.vue @@ -213,17 +213,17 @@ export default defineComponent({ data: x.data.slice().reverse(), tension: 0.3, pointRadius: 0, - borderWidth: 2, + borderWidth: props.bar ? 0 : 2, borderColor: x.color ? x.color : getColor(i), borderDash: x.borderDash || [], borderJoinStyle: 'round', - backgroundColor: alpha(x.color ? x.color : getColor(i), 0.1), - gradient: { + backgroundColor: props.bar ? (x.color ? x.color : getColor(i)) : alpha(x.color ? x.color : getColor(i), 0.1), + gradient: props.bar ? undefined : { backgroundColor: { axis: 'y', colors: { 0: alpha(x.color ? x.color : getColor(i), 0), - [maxes[i]]: alpha(x.color ? x.color : getColor(i), 0.1), + [maxes[i]]: alpha(x.color ? x.color : getColor(i), 0.15), }, }, }, @@ -752,18 +752,27 @@ export default defineComponent({ type: 'line', borderDash: [5, 5], data: format(sum(raw.inc, negate(raw.dec))), + color: '#888888', }]), { + name: 'With file', + type: 'area', + data: format(raw.diffs.withFile), + color: colors.purple, + }, { name: 'Renotes', type: 'area', data: format(raw.diffs.renote), + color: colors.green, }, { name: 'Replies', type: 'area', data: format(raw.diffs.reply), + color: colors.yellow, }, { name: 'Normal', type: 'area', data: format(raw.diffs.normal), + color: colors.blue, }], }; }; diff --git a/packages/client/src/components/instance-stats.vue b/packages/client/src/components/instance-stats.vue index d2aa5a151a..f386a8de9a 100644 --- a/packages/client/src/components/instance-stats.vue +++ b/packages/client/src/components/instance-stats.vue @@ -59,7 +59,7 @@ export default defineComponent({ setup() { const chartSpan = ref<'hour' | 'day'>('hour'); - const chartSrc = ref('notes'); + const chartSrc = ref('active-users'); return { chartSrc, From afb63049798dd0277cd9045eb00a16ab1228376b Mon Sep 17 00:00:00 2001 From: Johann150 Date: Thu, 10 Feb 2022 11:47:46 +0100 Subject: [PATCH 04/25] fix: regular expressions in word mutes (#8254) * fix: handle regex exceptions for word mutes * add i18n strings Co-authored-by: rinsuki <428rinsuki+git@gmail.com> * stricter input validation in backend * add migration for hard mutes * fix * use correct regex library in migration * use query builder to avoid SQL injection Co-authored-by: Robin B Co-authored-by: rinsuki <428rinsuki+git@gmail.com> --- locales/ja-JP.yml | 2 + .../1644010796173-convert-hard-mutes.js | 64 +++++++++++++++++++ packages/backend/src/misc/check-word-mute.ts | 31 +++++---- .../src/server/api/endpoints/i/update.ts | 21 +++++- .../client/src/pages/settings/word-mute.vue | 55 ++++++++++++++-- .../client/src/scripts/check-word-mute.ts | 31 +++++---- 6 files changed, 173 insertions(+), 31 deletions(-) create mode 100644 packages/backend/migration/1644010796173-convert-hard-mutes.js diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 62d5587043..6caa3e3778 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -595,6 +595,8 @@ smtpSecure: "SMTP 接続に暗黙的なSSL/TLSを使用する" smtpSecureInfo: "STARTTLS使用時はオフにします。" testEmail: "配信テスト" wordMute: "ワードミュート" +regexpError: "正規表現エラー" +regexpErrorDescription: "{tab}ワードミュートの{line}行目の正規表現にエラーが発生しました:" instanceMute: "インスタンスミュート" userSaysSomething: "{name}が何かを言いました" makeActive: "アクティブにする" diff --git a/packages/backend/migration/1644010796173-convert-hard-mutes.js b/packages/backend/migration/1644010796173-convert-hard-mutes.js new file mode 100644 index 0000000000..f06da65670 --- /dev/null +++ b/packages/backend/migration/1644010796173-convert-hard-mutes.js @@ -0,0 +1,64 @@ +const RE2 = require('re2'); +const { MigrationInterface, QueryRunner } = require("typeorm"); + +module.exports = class convertHardMutes1644010796173 { + name = 'convertHardMutes1644010796173' + + async up(queryRunner) { + let entries = await queryRunner.query(`SELECT "userId", "mutedWords" FROM "user_profile"`); + for(let i = 0; i < entries.length; i++) { + let words = entries[i].mutedWords + .map(line => { + const regexp = line.join(" ").match(/^\/(.+)\/(.*)$/); + if (regexp) { + // convert regexp's + try { + new RE2(regexp[1], regexp[2]); + return `/${regexp[1]}/${regexp[2]}`; + } catch (err) { + // invalid regex, ignore it + return []; + } + } else { + // remove empty segments + return line.filter(x => x !== ''); + } + }) + // remove empty lines + .filter(x => !(Array.isArray(x) && x.length === 0)); + + await queryRunner.connection.createQueryBuilder() + .update('user_profile') + .set({ + mutedWords: words + }) + .where('userId = :id', { id: entries[i].userId }) + .execute(); + } + } + + async down(queryRunner) { + let entries = await queryRunner.query(`SELECT "userId", "mutedWords" FROM "user_profile"`); + for(let i = 0; i < entries.length; i++) { + let words = entries[i].mutedWords + .map(line => { + if (Array.isArray(line)) { + return line; + } else { + // do not split regex at spaces again + return [line]; + } + }) + // remove empty lines + .filter(x => !(Array.isArray(x) && x.length === 0)); + + await queryRunner.connection.createQueryBuilder() + .update('user_profile') + .set({ + mutedWords: words + }) + .where('userId = :id', { id: entries[i].userId }) + .execute(); + } + } +} diff --git a/packages/backend/src/misc/check-word-mute.ts b/packages/backend/src/misc/check-word-mute.ts index e2e871dd2b..dedda3cdf6 100644 --- a/packages/backend/src/misc/check-word-mute.ts +++ b/packages/backend/src/misc/check-word-mute.ts @@ -11,26 +11,31 @@ type UserLike = { id: User['id']; }; -export async function checkWordMute(note: NoteLike, me: UserLike | null | undefined, mutedWords: string[][]): Promise { +export async function checkWordMute(note: NoteLike, me: UserLike | null | undefined, mutedWords: Array): Promise { // 自分自身 if (me && (note.userId === me.id)) return false; - const words = mutedWords - // Clean up - .map(xs => xs.filter(x => x !== '')) - .filter(xs => xs.length > 0); - - if (words.length > 0) { + if (mutedWords.length > 0) { if (note.text == null) return false; - const matched = words.some(and => - and.every(keyword => { - const regexp = keyword.match(/^\/(.+)\/(.*)$/); - if (regexp) { + const matched = mutedWords.some(filter => { + if (Array.isArray(filter)) { + return filter.every(keyword => note.text!.includes(keyword)); + } else { + // represents RegExp + const regexp = filter.match(/^\/(.+)\/(.*)$/); + + // This should never happen due to input sanitisation. + if (!regexp) return false; + + try { return new RE2(regexp[1], regexp[2]).test(note.text!); + } catch (err) { + // This should never happen due to input sanitisation. + return false; } - return note.text!.includes(keyword); - })); + } + }); if (matched) return true; } diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index eb57aa2bfc..aec7bbd2e1 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -1,3 +1,4 @@ +const RE2 = require('re2'); import $ from 'cafy'; import * as mfm from 'mfm-js'; import { ID } from '@/misc/cafy-id'; @@ -117,7 +118,7 @@ export const meta = { }, mutedWords: { - validator: $.optional.arr($.arr($.str)), + validator: $.optional.arr($.either($.arr($.str.min(1)).min(1), $.str)), }, mutedInstances: { @@ -163,6 +164,12 @@ export const meta = { code: 'NO_SUCH_PAGE', id: '8e01b590-7eb9-431b-a239-860e086c408e', }, + + invalidRegexp: { + message: 'Invalid Regular Expression.', + code: 'INVALID_REGEXP', + id: '0d786918-10df-41cd-8f33-8dec7d9a89a5', + } }, res: { @@ -191,6 +198,18 @@ export default define(meta, async (ps, _user, token) => { if (ps.avatarId !== undefined) updates.avatarId = ps.avatarId; if (ps.bannerId !== undefined) updates.bannerId = ps.bannerId; if (ps.mutedWords !== undefined) { + // validate regular expression syntax + ps.mutedWords.filter(x => !Array.isArray(x)).forEach(x => { + const regexp = x.match(/^\/(.+)\/(.*)$/); + if (!regexp) throw new ApiError(meta.errors.invalidRegexp); + + try { + new RE2(regexp[1], regexp[2]); + } catch (err) { + throw new ApiError(meta.errors.invalidRegexp); + } + }); + profileUpdates.mutedWords = ps.mutedWords; profileUpdates.enableWordMute = ps.mutedWords.length > 0; } diff --git a/packages/client/src/pages/settings/word-mute.vue b/packages/client/src/pages/settings/word-mute.vue index 19980dea14..bdccd7f1ee 100644 --- a/packages/client/src/pages/settings/word-mute.vue +++ b/packages/client/src/pages/settings/word-mute.vue @@ -81,18 +81,65 @@ export default defineComponent({ }, async created() { - this.softMutedWords = this.$store.state.mutedWords.map(x => x.join(' ')).join('\n'); - this.hardMutedWords = this.$i.mutedWords.map(x => x.join(' ')).join('\n'); + const render = (mutedWords) => mutedWords.map(x => { + if (Array.isArray(x)) { + return x.join(' '); + } else { + return x; + } + }).join('\n'); + + this.softMutedWords = render(this.$store.state.mutedWords); + this.hardMutedWords = render(this.$i.mutedWords); this.hardWordMutedNotesCount = (await os.api('i/get-word-muted-notes-count', {})).count; }, methods: { async save() { - this.$store.set('mutedWords', this.softMutedWords.trim().split('\n').map(x => x.trim().split(' '))); + const parseMutes = (mutes, tab) => { + // split into lines, remove empty lines and unnecessary whitespace + let lines = mutes.trim().split('\n').map(line => line.trim()).filter(line => line != ''); + + // check each line if it is a RegExp or not + for(let i = 0; i < lines.length; i++) { + const line = lines[i] + const regexp = line.match(/^\/(.+)\/(.*)$/); + if (regexp) { + // check that the RegExp is valid + try { + new RegExp(regexp[1], regexp[2]); + // note that regex lines will not be split by spaces! + } catch (err) { + // invalid syntax: do not save, do not reset changed flag + os.alert({ + type: 'error', + title: this.$ts.regexpError, + text: this.$t('regexpErrorDescription', { tab, line: i + 1 }) + "\n" + err.toString() + }); + // re-throw error so these invalid settings are not saved + throw err; + } + } else { + lines[i] = line.split(' '); + } + } + }; + + let softMutes, hardMutes; + try { + softMutes = parseMutes(this.softMutedWords, this.$ts._wordMute.soft); + hardMutes = parseMutes(this.hardMutedWords, this.$ts._wordMute.hard); + } catch (err) { + // already displayed error message in parseMutes + return; + } + + this.$store.set('mutedWords', softMutes); await os.api('i/update', { - mutedWords: this.hardMutedWords.trim().split('\n').map(x => x.trim().split(' ')), + mutedWords: hardMutes, }); + this.changed = false; }, diff --git a/packages/client/src/scripts/check-word-mute.ts b/packages/client/src/scripts/check-word-mute.ts index 55637bb3b3..74e2581863 100644 --- a/packages/client/src/scripts/check-word-mute.ts +++ b/packages/client/src/scripts/check-word-mute.ts @@ -1,23 +1,28 @@ -export function checkWordMute(note: Record, me: Record | null | undefined, mutedWords: string[][]): boolean { +export function checkWordMute(note: Record, me: Record | null | undefined, mutedWords: Array): boolean { // 自分自身 if (me && (note.userId === me.id)) return false; - const words = mutedWords - // Clean up - .map(xs => xs.filter(x => x !== '')) - .filter(xs => xs.length > 0); - - if (words.length > 0) { + if (mutedWords.length > 0) { if (note.text == null) return false; - const matched = words.some(and => - and.every(keyword => { - const regexp = keyword.match(/^\/(.+)\/(.*)$/); - if (regexp) { + const matched = mutedWords.some(filter => { + if (Array.isArray(filter)) { + return filter.every(keyword => note.text!.includes(keyword)); + } else { + // represents RegExp + const regexp = filter.match(/^\/(.+)\/(.*)$/); + + // This should never happen due to input sanitisation. + if (!regexp) return false; + + try { return new RegExp(regexp[1], regexp[2]).test(note.text!); + } catch (err) { + // This should never happen due to input sanitisation. + return false; } - return note.text!.includes(keyword); - })); + } + }); if (matched) return true; } From 531ee16b7af04a5d17a2c0474fe03ffc17a83afb Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 10 Feb 2022 20:11:26 +0900 Subject: [PATCH 05/25] Update dependabot.yml Resolve #8259 --- .github/dependabot.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8abca405fb..2625cf75d3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,18 @@ version: 2 updates: - - package-ecosystem: "npm" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "daily" +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 0 +- package-ecosystem: npm + directory: "/packages/backend" + schedule: + interval: daily + open-pull-requests-limit: 0 +- package-ecosystem: npm + directory: "/packages/client" + schedule: + interval: daily + open-pull-requests-limit: 0 From 42149416e19a9aa0d3c04e03a215a5f194724f6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Feb 2022 21:07:46 +0900 Subject: [PATCH 06/25] chore(deps): bump axios from 0.21.1 to 0.21.4 in /packages/client (#8286) Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.4. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v0.21.1...v0.21.4) --- updated-dependencies: - dependency-name: axios dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/client/yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index e06e376bc5..5100e3a35a 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -1322,11 +1322,11 @@ aws4@^1.8.0: integrity sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug== axios@^0.21.1: - version "0.21.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.1.tgz#22563481962f4d6bde9a76d516ef0e5d3c09b2b8" - integrity sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA== + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== dependencies: - follow-redirects "^1.10.0" + follow-redirects "^1.14.0" babel-walk@3.0.0-canary-5: version "3.0.0-canary-5" @@ -2929,10 +2929,10 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.1.0.tgz#a5d06b4a8b01e3a63771daa5cb7a1903e2e57067" integrity sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA== -follow-redirects@^1.10.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43" - integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg== +follow-redirects@^1.14.0: + version "1.14.8" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.8.tgz#016996fb9a11a100566398b1c6839337d7bfa8fc" + integrity sha512-1x0S9UVJHsQprFcEC/qnNzBLcIxsjAV905f/UkQxbclCsoTWlacCNOpQa/anodLl2uaEKFhfWOvM2Qg77+15zA== forever-agent@~0.6.1: version "0.6.1" From f25ca768ad651330f611f5d7890ccca4e97caf31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Feb 2022 21:08:06 +0900 Subject: [PATCH 07/25] chore(deps): bump path-parse from 1.0.6 to 1.0.7 in /packages/client (#8288) Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/client/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index 5100e3a35a..206b704b61 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -4532,9 +4532,9 @@ path-key@^3.0.0, path-key@^3.1.0: integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== path-type@^4.0.0: version "4.0.0" From e4aadc1992c94d6f35c5ccce643af3d0e5edc84a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Feb 2022 21:08:28 +0900 Subject: [PATCH 08/25] chore(deps): bump glob-parent from 5.1.1 to 5.1.2 in /packages/client (#8289) Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2. - [Release notes](https://github.com/gulpjs/glob-parent/releases) - [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md) - [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2) --- updated-dependencies: - dependency-name: glob-parent dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/client/yarn.lock | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index 206b704b61..b8afe59370 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -3041,9 +3041,9 @@ getpass@^0.1.1: assert-plus "^1.0.0" glob-parent@^5.1.0, glob-parent@~5.1.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" - integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" @@ -3490,14 +3490,7 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-glob@^4.0.3: +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== From 448a21a85d0c06a0de1b9d6e33636d674fd24d84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Feb 2022 21:09:42 +0900 Subject: [PATCH 09/25] chore(deps): bump simple-get from 4.0.0 to 4.0.1 in /packages/backend (#8292) Bumps [simple-get](https://github.com/feross/simple-get) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/feross/simple-get/releases) - [Commits](https://github.com/feross/simple-get/compare/v4.0.0...v4.0.1) --- updated-dependencies: - dependency-name: simple-get dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/backend/yarn.lock | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/packages/backend/yarn.lock b/packages/backend/yarn.lock index c4afef8b5c..512b7f3db3 100644 --- a/packages/backend/yarn.lock +++ b/packages/backend/yarn.lock @@ -6169,20 +6169,11 @@ signal-exit@^3.0.5: integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== simple-concat@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" - integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== -simple-get@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.0.tgz#73fa628278d21de83dadd5512d2cc1f4872bd675" - integrity sha512-ZalZGexYr3TA0SwySsr5HlgOOinS4Jsa8YB2GJ6lUNAazyAu4KG/VmzMTwAt2YVXzzVj8QmefmAonZIK2BSGcQ== - dependencies: - decompress-response "^6.0.0" - once "^1.3.1" - simple-concat "^1.0.0" - -simple-get@^4.0.1: +simple-get@^4.0.0, simple-get@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== From eb8867d5414b4b27e32672534ae5bb107ab17953 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Feb 2022 21:10:35 +0900 Subject: [PATCH 10/25] chore(deps): bump node-fetch from 2.6.1 to 2.6.7 in /packages/client (#8291) Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7. - [Release notes](https://github.com/node-fetch/node-fetch/releases) - [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7) --- updated-dependencies: - dependency-name: node-fetch dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/client/yarn.lock | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index b8afe59370..e5254efbc0 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -4238,9 +4238,11 @@ next-tick@~1.0.0: integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" node-gyp-build@~3.7.0: version "3.7.0" @@ -5828,6 +5830,11 @@ tough-cookie@~2.5.0: psl "^1.1.28" punycode "^2.1.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + ts-loader@9.2.6: version "9.2.6" resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.2.6.tgz#9937c4dd0a1e3dbbb5e433f8102a6601c6615d74" @@ -6181,6 +6188,11 @@ web-push@3.4.5: minimist "^1.2.5" urlsafe-base64 "^1.0.0" +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + webpack-cli@4.9.1: version "4.9.1" resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.9.1.tgz#b64be825e2d1b130f285c314caa3b1ba9a4632b3" @@ -6291,6 +6303,14 @@ websocket@1.0.34: utf-8-validate "^5.0.2" yaeti "^0.0.6" +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" From 9c5643501db9ff11c12e4e26624d4af34dcaa436 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Feb 2022 21:10:50 +0900 Subject: [PATCH 11/25] chore(deps): bump node-fetch from 2.6.1 to 2.6.7 in /packages/backend (#8293) Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7. - [Release notes](https://github.com/node-fetch/node-fetch/releases) - [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7) --- updated-dependencies: - dependency-name: node-fetch dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/backend/package.json | 2 +- packages/backend/yarn.lock | 28 ++++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index d81688cbfe..c331da7324 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -123,7 +123,7 @@ "ms": "3.0.0-canary.1", "multer": "1.4.4", "nested-property": "4.0.0", - "node-fetch": "2.6.1", + "node-fetch": "2.6.7", "nodemailer": "6.7.2", "os-utils": "0.0.14", "parse5": "6.0.1", diff --git a/packages/backend/yarn.lock b/packages/backend/yarn.lock index 512b7f3db3..9f8e694319 100644 --- a/packages/backend/yarn.lock +++ b/packages/backend/yarn.lock @@ -4882,10 +4882,12 @@ node-fetch@*: fetch-blob "^3.1.4" formdata-polyfill "^4.0.10" -node-fetch@2.6.1, node-fetch@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" - integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== +node-fetch@2.6.7, node-fetch@^2.6.1: + version "2.6.7" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" + integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== + dependencies: + whatwg-url "^5.0.0" node-fetch@3.0.0-beta.9: version "3.0.0-beta.9" @@ -6644,6 +6646,11 @@ tr46@^3.0.0: dependencies: punycode "^2.1.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + trace-redirect@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/trace-redirect/-/trace-redirect-1.0.6.tgz#ac629b5bf8247d30dde5a35fe9811b811075b504" @@ -6989,6 +6996,11 @@ web-streams-polyfill@^3.0.3: resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.0.tgz#a6b74026b38e4885869fb5c589e90b95ccfc7965" integrity sha512-EqPmREeOzttaLRm5HS7io98goBgZ7IVz79aDvqjD0kYXLtFZTc0T/U6wHTPKyIjb+MdN7DFIIX6hgdBEpWmfPA== +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + webidl-conversions@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" @@ -7026,6 +7038,14 @@ whatwg-url@^10.0.0: tr46 "^3.0.0" webidl-conversions "^7.0.0" +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + which-boxed-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" From 9f417bd50b816e708920281c2b8983a9c003e760 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 10 Feb 2022 22:16:59 +0900 Subject: [PATCH 12/25] :art: --- packages/client/src/components/chart.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/client/src/components/chart.vue b/packages/client/src/components/chart.vue index d4c6f9d447..e6f0e6ee0e 100644 --- a/packages/client/src/components/chart.vue +++ b/packages/client/src/components/chart.vue @@ -426,7 +426,6 @@ export default defineComponent({ series: [{ name: 'All', type: 'line', - borderDash: [5, 5], data: format(type == 'combined' ? sum(raw.local.inc, negate(raw.local.dec), raw.remote.inc, negate(raw.remote.dec)) : sum(raw[type].inc, negate(raw[type].dec)) @@ -750,7 +749,6 @@ export default defineComponent({ series: [...(props.args.withoutAll ? [] : [{ name: 'All', type: 'line', - borderDash: [5, 5], data: format(sum(raw.inc, negate(raw.dec))), color: '#888888', }]), { From 43829c3ad36a2083e5fa67d2e9cde13a9355f6b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 00:16:43 +0900 Subject: [PATCH 13/25] chore(deps): bump browserslist from 4.16.3 to 4.19.1 in /packages/client (#8290) Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.3 to 4.19.1. - [Release notes](https://github.com/browserslist/browserslist/releases) - [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md) - [Commits](https://github.com/browserslist/browserslist/compare/4.16.3...4.19.1) --- updated-dependencies: - dependency-name: browserslist dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/client/yarn.lock | 74 +++++++++++---------------------------- 1 file changed, 21 insertions(+), 53 deletions(-) diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index e5254efbc0..63ca920696 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -1426,38 +1426,16 @@ browser-stdout@1.3.1: resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserslist@^4.0.0, browserslist@^4.14.5: - version "4.16.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.3.tgz#340aa46940d7db878748567c5dea24a48ddf3717" - integrity sha512-vIyhWmIkULaq04Gt93txdh+j02yX/JzlyhLYbV3YQCn/zvES3JnY7TifHHvvr1w5hTDluNKMkV05cs4vy8Q7sw== +browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.0, browserslist@^4.16.6: + version "4.19.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.19.1.tgz#4ac0435b35ab655896c31d53018b6dd5e9e4c9a3" + integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A== dependencies: - caniuse-lite "^1.0.30001181" - colorette "^1.2.1" - electron-to-chromium "^1.3.649" + caniuse-lite "^1.0.30001286" + electron-to-chromium "^1.4.17" escalade "^3.1.1" - node-releases "^1.1.70" - -browserslist@^4.16.0: - version "4.16.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.4.tgz#7ebf913487f40caf4637b892b268069951c35d58" - integrity sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ== - dependencies: - caniuse-lite "^1.0.30001208" - colorette "^1.2.2" - electron-to-chromium "^1.3.712" - escalade "^3.1.1" - node-releases "^1.1.71" - -browserslist@^4.16.6: - version "4.16.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2" - integrity sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ== - dependencies: - caniuse-lite "^1.0.30001219" - colorette "^1.2.2" - electron-to-chromium "^1.3.723" - escalade "^3.1.1" - node-releases "^1.1.71" + node-releases "^2.0.1" + picocolors "^1.0.0" buffer-crc32@~0.2.3: version "0.2.13" @@ -1527,10 +1505,10 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001181, caniuse-lite@^1.0.30001208, caniuse-lite@^1.0.30001219: - version "1.0.30001279" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001279.tgz" - integrity sha512-VfEHpzHEXj6/CxggTwSFoZBBYGQfQv9Cf42KPlO79sWXCD1QNKWKsKzFeWL7QpZHJQYAvocqV6Rty1yJMkqWLQ== +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001286: + version "1.0.30001311" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001311.tgz#682ef3f4e617f1a177ad943de59775ed3032e511" + integrity sha512-mleTFtFKfykEeW34EyfhGIFjGCqzhh38Y0LhdQ9aWF+HorZTtdgKV/1hEE0NlFkG2ubvisPV6l400tlbPys98A== caseless@~0.12.0: version "0.12.0" @@ -1722,7 +1700,7 @@ colord@^2.9.1: resolved "https://registry.yarnpkg.com/colord/-/colord-2.9.1.tgz#c961ea0efeb57c9f0f4834458f26cb9cc4a3f90e" integrity sha512-4LBMSt09vR0uLnPVkOUBnmxgoaeN4ewRbx801wY/bXcltXfpR/G46OdWn96XpYmCWuYvO46aBZP4NgX8HpNAcw== -colorette@^1.2.0, colorette@^1.2.1, colorette@^1.2.2: +colorette@^1.2.0, colorette@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== @@ -2260,20 +2238,10 @@ ecdsa-sig-formatter@1.0.11: dependencies: safe-buffer "^5.0.1" -electron-to-chromium@^1.3.649: - version "1.3.672" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.672.tgz#3a6e335016dab4bc584d5292adc4f98f54541f6a" - integrity sha512-gFQe7HBb0lbOMqK2GAS5/1F+B0IMdYiAgB9OT/w1F4M7lgJK2aNOMNOM622aEax+nS1cTMytkiT0uMOkbtFmHw== - -electron-to-chromium@^1.3.712: - version "1.3.717" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.717.tgz#78d4c857070755fb58ab64bcc173db1d51cbc25f" - integrity sha512-OfzVPIqD1MkJ7fX+yTl2nKyOE4FReeVfMCzzxQS+Kp43hZYwHwThlGP+EGIZRXJsxCM7dqo8Y65NOX/HP12iXQ== - -electron-to-chromium@^1.3.723: - version "1.3.742" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.742.tgz#7223215acbbd3a5284962ebcb6df85d88b95f200" - integrity sha512-ihL14knI9FikJmH2XUIDdZFWJxvr14rPSdOhJ7PpS27xbz8qmaRwCwyg/bmFwjWKmWK9QyamiCZVCvXm5CH//Q== +electron-to-chromium@^1.4.17: + version "1.4.68" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.68.tgz#d79447b6bd1bec9183f166bb33d4bef0d5e4e568" + integrity sha512-cId+QwWrV8R1UawO6b9BR1hnkJ4EJPCPAr4h315vliHUtVUJDk39Sg1PMNnaWKfj5x+93ssjeJ9LKL6r8LaMiA== emoji-regex@^8.0.0: version "8.0.0" @@ -4249,10 +4217,10 @@ node-gyp-build@~3.7.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-3.7.0.tgz#daa77a4f547b9aed3e2aac779eaf151afd60ec8d" integrity sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w== -node-releases@^1.1.70, node-releases@^1.1.71: - version "1.1.71" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.71.tgz#cb1334b179896b1c89ecfdd4b725fb7bbdfc7dbb" - integrity sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg== +node-releases@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01" + integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" From 2dad6ee50d0efb6fce4f955307374c9301ac5639 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 12:46:03 +0900 Subject: [PATCH 14/25] :art: --- packages/client/src/components/chart.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/client/src/components/chart.vue b/packages/client/src/components/chart.vue index e6f0e6ee0e..030ce2a422 100644 --- a/packages/client/src/components/chart.vue +++ b/packages/client/src/components/chart.vue @@ -271,6 +271,7 @@ export default defineComponent({ y: { position: 'left', stacked: props.stacked, + suggestedMax: 100, grid: { color: gridColor, borderColor: 'rgb(0, 0, 0, 0)', From 91b2a169b4ddbf9a97be5eb635457cf88761bdd9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 12:47:42 +0900 Subject: [PATCH 15/25] enhance(server): add indexes for following host --- .../migration/1644551208096-following-indexes.js | 15 +++++++++++++++ packages/backend/src/models/entities/following.ts | 2 ++ 2 files changed, 17 insertions(+) create mode 100644 packages/backend/migration/1644551208096-following-indexes.js diff --git a/packages/backend/migration/1644551208096-following-indexes.js b/packages/backend/migration/1644551208096-following-indexes.js new file mode 100644 index 0000000000..6c149d8069 --- /dev/null +++ b/packages/backend/migration/1644551208096-following-indexes.js @@ -0,0 +1,15 @@ +const { MigrationInterface, QueryRunner } = require("typeorm"); + +module.exports = class followingIndexes1644551208096 { + name = 'followingIndexes1644551208096' + + async up(queryRunner) { + await queryRunner.query(`CREATE INDEX "IDX_4ccd2239268ebbd1b35e318754" ON "following" ("followerHost") `); + await queryRunner.query(`CREATE INDEX "IDX_fcdafee716dfe9c3b5fde90f30" ON "following" ("followeeHost") `); + } + + async down(queryRunner) { + await queryRunner.query(`DROP INDEX "public"."IDX_fcdafee716dfe9c3b5fde90f30"`); + await queryRunner.query(`DROP INDEX "public"."IDX_4ccd2239268ebbd1b35e318754"`); + } +} diff --git a/packages/backend/src/models/entities/following.ts b/packages/backend/src/models/entities/following.ts index c3631e8501..ad387e5188 100644 --- a/packages/backend/src/models/entities/following.ts +++ b/packages/backend/src/models/entities/following.ts @@ -41,6 +41,7 @@ export class Following { public follower: User | null; //#region Denormalized fields + @Index() @Column('varchar', { length: 128, nullable: true, comment: '[Denormalized]', @@ -59,6 +60,7 @@ export class Following { }) public followerSharedInbox: string | null; + @Index() @Column('varchar', { length: 128, nullable: true, comment: '[Denormalized]', From cc019a217f4097f2ac205315680ad7a62d721b74 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 11 Feb 2022 13:38:47 +0900 Subject: [PATCH 16/25] feat(client): make size of reaction picker configuable --- CHANGELOG.md | 8 ++++++++ locales/ja-JP.yml | 2 ++ .../client/src/components/emoji-picker.vue | 18 +++++++++++++----- .../client/src/pages/settings/reaction.vue | 11 +++++++++-- packages/client/src/store.ts | 4 ++++ 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10a3941423..48ac66646c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,14 @@ You should also include the user name that made the change. --> +## 12.x.x (unreleased) + +### Improvements +- クライアント: リアクションピッカーのサイズを設定できるように @syuilo + +### Bugfixes +- + ## 12.105.0 (2022/02/09) ### Improvements diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 6caa3e3778..f4c9d19981 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -831,6 +831,8 @@ smartphone: "スマートフォン" tablet: "タブレット" auto: "自動" themeColor: "テーマカラー" +size: "サイズ" +numberOfColumn: "列の数" _emailUnavailable: used: "既に使用されています" diff --git a/packages/client/src/components/emoji-picker.vue b/packages/client/src/components/emoji-picker.vue index 3e1208979f..4e589b1619 100644 --- a/packages/client/src/components/emoji-picker.vue +++ b/packages/client/src/components/emoji-picker.vue @@ -1,5 +1,5 @@