From 7fd1f05bb39ad38b6b69dc95d52fda0a3b06573d Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 00:50:11 -0700 Subject: [PATCH 01/30] debug log --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 1cd47557a..3aa10d182 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -64,12 +64,11 @@ export default define(meta, paramDef, async (ps, user) => { throw new ApiError(meta.errors.rtlDisabled); } } + console.log(`\n\n${m.recommendedInstances}\n\n`) - // .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: instances }) //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - // Query where note.userHost is in recommended instances .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances }) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) From b475ea415d15e0f6f226e18c1f9671e828697779 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 00:53:57 -0700 Subject: [PATCH 02/30] I doubt itll work, but... --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 3aa10d182..18cf4944e 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -1,6 +1,6 @@ import { Brackets } from 'typeorm'; import { fetchMeta } from '@/misc/fetch-meta.js'; -import { Notes, Users } from '@/models/index.js'; +import { Notes } from '@/models/index.js'; import { activeUsersChart } from '@/services/chart/index.js'; import define from '../../define.js'; import { ApiError } from '../../error.js'; @@ -64,12 +64,11 @@ export default define(meta, paramDef, async (ps, user) => { throw new ApiError(meta.errors.rtlDisabled); } } - console.log(`\n\n${m.recommendedInstances}\n\n`) //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances }) + .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances.toString().split(',') }) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From f08acce023e1650422e404984530c0093d006216 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 00:57:15 -0700 Subject: [PATCH 03/30] =?UTF-8?q?=F0=9F=99=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 18cf4944e..ec7f225b3 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,6 +59,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); + const formatted = `(${m.recommendedInstances.map(v => JSON.stringify(v.toString())).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); @@ -68,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => { //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: m.recommendedInstances.toString().split(',') }) + .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: formatted }) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From 7a4ddeba16e7b92aedcb4de737a04cc66165192b Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:02:11 -0700 Subject: [PATCH 04/30] hail mairy --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index ec7f225b3..b4b4ba674 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,7 +59,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - const formatted = `(${m.recommendedInstances.map(v => JSON.stringify(v.toString())).join(', ')})`; + const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(v.toString())).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); @@ -69,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => { //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('(note.userHost IN (:instances)) OR (note.userHost IS NULL)', { instances: formatted }) + .andWhere('(note.userHost IN :instances)', { instances: formattedInstances }) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From f9d9bd9f5079fabd2b489c71716605667497b843 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:04:20 -0700 Subject: [PATCH 05/30] certified typeorm moment --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index b4b4ba674..82cbf132f 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -69,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => { //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere('(note.userHost IN :instances)', { instances: formattedInstances }) + .andWhere(`(note.userHost IN ${formattedInstances})`) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From 1ae895d098ed62e82ad01c752c4aa8ad85606bbf Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:07:46 -0700 Subject: [PATCH 06/30] im stuff --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 82cbf132f..fb48bcc35 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -69,7 +69,7 @@ export default define(meta, paramDef, async (ps, user) => { //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere(`(note.userHost IN ${formattedInstances})`) + .andWhere(`(note.userHost = ANY (ARRAY[${m.recommendedInstances}])`) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From 6aaf8cbd7dc23865b82978693c765da0ae6e68d6 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:09:44 -0700 Subject: [PATCH 07/30] debug log --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index fb48bcc35..20a73798d 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -66,10 +66,12 @@ export default define(meta, paramDef, async (ps, user) => { } } + const cursed = `(note.userHost = ANY (ARRAY[${m.recommendedInstances}])`; + console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere(`(note.userHost = ANY (ARRAY[${m.recommendedInstances}])`) + .andWhere(cursed) // .andWhere(new Brackets(qb => { // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) // .orWhere('note.userHost IS NULL'); From 82813ffe7b70b889fa2a52f66f658f6f4d250357 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:13:08 -0700 Subject: [PATCH 08/30] not a fan of js/ts --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 20a73798d..c95159ef4 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,14 +59,14 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(v.toString())).join(', ')})`; + const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(`'${v.toString()}'`)).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); } } - const cursed = `(note.userHost = ANY (ARRAY[${m.recommendedInstances}])`; + const cursed = `(note.userHost = ANY (ARRAY${m.recommendedInstances.toString().split(',')})`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 5289de0cf0c8a8ed69e4d7d6ba57eeab22656ee2 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:19:56 -0700 Subject: [PATCH 09/30] istg --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index c95159ef4..a6de9f9f4 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,14 +59,14 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(`'${v.toString()}'`)).join(', ')})`; + // const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(`'${v.toString()}'`)).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); } } - const cursed = `(note.userHost = ANY (ARRAY${m.recommendedInstances.toString().split(',')})`; + const cursed = `(note.userHost = ANY (ARRAY["${m.recommendedInstances.join('","')}"])`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 30bedee17b8968548b4390b701da1fd380726f86 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:21:27 -0700 Subject: [PATCH 10/30] missing parenthesis --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index a6de9f9f4..267858546 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -66,7 +66,7 @@ export default define(meta, paramDef, async (ps, user) => { } } - const cursed = `(note.userHost = ANY (ARRAY["${m.recommendedInstances.join('","')}"])`; + const cursed = `(note.userHost = ANY (ARRAY["${m.recommendedInstances.join('","')}"]))`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 90ecb119dbaf844c97a4b382f151bcace953999c Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:26:07 -0700 Subject: [PATCH 11/30] postgres can kiss my ass --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 267858546..723938195 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -66,7 +66,7 @@ export default define(meta, paramDef, async (ps, user) => { } } - const cursed = `(note.userHost = ANY (ARRAY["${m.recommendedInstances.join('","')}"]))`; + const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'::string[]))`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 5e612a96f54aae657b231463312d951bc7044def Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:28:03 -0700 Subject: [PATCH 12/30] didnt need `::string[]` i think --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 723938195..82f211a86 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -66,7 +66,7 @@ export default define(meta, paramDef, async (ps, user) => { } } - const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'::string[]))`; + const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`; console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), From 42de210a6c56cf7712a25e29d40d457e784df354 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:30:17 -0700 Subject: [PATCH 13/30] hide caption button --- package.json | 2 +- packages/client/src/components/media-caption.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 437d98564..4abe46d5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.4.13", + "version": "12.118.1-calc.rc.5", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/components/media-caption.vue b/packages/client/src/components/media-caption.vue index 49ad51b59..c75dbed5b 100644 --- a/packages/client/src/components/media-caption.vue +++ b/packages/client/src/components/media-caption.vue @@ -12,7 +12,7 @@
{{ $ts.ok }} - {{ $ts.caption }} + {{ $ts.cancel }}
From e7fa99de86bfa23fa441a5c58fe16de149061980 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:30:38 -0700 Subject: [PATCH 14/30] Remove debug log --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index 82f211a86..b86f64447 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -67,15 +67,10 @@ export default define(meta, paramDef, async (ps, user) => { } const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`; - console.log(cursed); //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) .andWhere(cursed) - // .andWhere(new Brackets(qb => { - // qb.where('note.userHost IN :instances', { instances: m.recommendedInstances }) - // .orWhere('note.userHost IS NULL'); - // })) .andWhere('(note.visibility = \'public\')') .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('user.avatar', 'avatar') From 8d9596d209f2065789a02ab895f234feea92db02 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:32:50 -0700 Subject: [PATCH 15/30] Clean up --- .../src/server/api/endpoints/notes/recommended-timeline.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts index b86f64447..ae2d58274 100644 --- a/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/recommended-timeline.ts @@ -59,18 +59,16 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const m = await fetchMeta(); - // const formattedInstances = `(${m.recommendedInstances.toString().split(',').map(v => JSON.stringify(`'${v.toString()}'`)).join(', ')})`; if (m.disableRecommendedTimeline) { if (user == null || (!user.isAdmin && !user.isModerator)) { throw new ApiError(meta.errors.rtlDisabled); } } - const cursed = `(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`; //#region Construct query const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) - .andWhere(cursed) + .andWhere(`(note.userHost = ANY ('{"${m.recommendedInstances.join('","')}"}'))`) .andWhere('(note.visibility = \'public\')') .innerJoinAndSelect('note.user', 'user') .leftJoinAndSelect('user.avatar', 'avatar') From d50ad16ac8157aad6a466a07bfb9980f3d4b6178 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:35:18 -0700 Subject: [PATCH 16/30] no longer beta! --- CALCKEY.md | 2 +- package.json | 2 +- packages/client/src/pages/admin/settings.vue | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CALCKEY.md b/CALCKEY.md index 9644a0fc6..dacaf77ee 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -20,7 +20,6 @@ ## Work in progress -- Recommended instances timeline - OCR image captioning - Admin custom CSS - Improve accesibility score @@ -35,6 +34,7 @@ - Yarn 3 - Fix Dockerfile @hanna - Saner defaults +- Recommended instances timeline - Star as default reaction - Recommended Instances timeline - Rosé Pine by default (+ non-themable elements made Rosé Pine) diff --git a/package.json b/package.json index 4abe46d5c..ce203bf1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.5", + "version": "12.118.1-calc.rc.5.1", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index ed8ae6ed8..101c4a6b4 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -56,7 +56,6 @@ {{ i18n.ts.enableRecommendedTimeline }} - From 0cdd5c22410a4ebd2aa72c85eb5b6939e869b45e Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 01:52:32 -0700 Subject: [PATCH 17/30] fix streaming --- package.json | 2 +- .../src/server/api/stream/channels/recommended-timeline.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ce203bf1e..fa1ae4545 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.5.1", + "version": "12.118.1-calc.rc.6", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts index 4d4b324f9..c0625aec8 100644 --- a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts @@ -30,7 +30,7 @@ export default class extends Channel { // フォローしているチャンネルの投稿 の場合だけ const meta = await fetchMeta(); if (!( - ((note.user.host == null || meta.recommendedInstances.includes(note.user.host)) && note.visibility === 'public') + ((note.user.host != null && meta.recommendedInstances.includes(note.user.host)) && note.visibility === 'public') )) return; // Ignore notes from instances the user has muted From 9ec3f97505cfcd27685069bcbb27a1d7552af012 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:09:09 -0700 Subject: [PATCH 18/30] Seperate splash screen settings in admin panel --- locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + package.json | 2 +- packages/client/src/pages/admin/settings.vue | 24 ++++++++++++-------- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index d7e8c224b..f64a7c20d 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -912,6 +912,7 @@ showUpdates: "Show a popup when Calckey updates" recommendedInstances: "Recommended instances" recommendedInstancesDescription: "Recommended instances seperated by line breaks to appear in the recommended timeline. Do NOT add `https://`, ONLY the domain." caption: "Auto Caption" +splash: "Splash Screen" _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing NSFW media via Machine Learning. This will slightly increase the load on the server." diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index ac7154de2..ecd30b42d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -912,6 +912,7 @@ showUpdates: "Calckeyの更新時にポップアップを表示する" recommendedInstances: "推奨インスタンス" recommendedInstancesDescription: "推奨タイムラインに表示するために改行で区切られた推奨インスタンス。`https://`を追加しないでください。ドメインのみを追加してください。" caption: "自動キャプション" +splash: "スプラッシュスクリーン" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てることができます。サーバーの負荷が少し増えます。" diff --git a/package.json b/package.json index fa1ae4545..6fe1d479d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.6", + "version": "12.118.1-calc.rc.7", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 101c4a6b4..43d1f43f9 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -34,16 +34,6 @@ - - - - - - - - - - @@ -66,6 +56,20 @@ {{ i18n.ts.disablingTimelinesInfo }} + + + + + + + + + + + + + + From 3a1daaeaed4b3e30f4b9ba569cb14473caddc386 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:33:07 -0700 Subject: [PATCH 19/30] Custom --- README.md | 5 +++++ custom/instance.css | 7 +++++++ gulpfile.js | 5 +++++ packages/backend/src/server/web/views/base.pug | 1 + 4 files changed, 18 insertions(+) create mode 100644 custom/instance.css diff --git a/README.md b/README.md index c99181965..06d3e01e0 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,11 @@ cp ../misskey/.config/default.yml ./.config/default.yml # replace `../misskey/` # cp -r ../misskey/files . # if you don't use object storage ``` +## 💅 Customize + +- To add custom CSS for all users, edit `/custom/instance.css`. +- To add static assets (such as images for the splash screen), place them in the `/custom/` folder. They'll then be avaliable with `https://yourinstance.tld/static-assets/filename.png`. + ## 🚀 Build and launch! ### `git pull` and run these steps to update Calckey in the future! diff --git a/custom/instance.css b/custom/instance.css new file mode 100644 index 000000000..9a70e6642 --- /dev/null +++ b/custom/instance.css @@ -0,0 +1,7 @@ +/* +* !!! WARNING !!! +* Editing this file may cause your instance to break for EVERYONE. +* Please know what you're doing and test it out with regular user custom CSS. +* With that said, GLHF! +* This may eventuallly be replaced with a function in the admin panel. + */ diff --git a/gulpfile.js b/gulpfile.js index 90f8ebaab..c407ba0e2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,10 @@ gulp.task('copy:backend:views', () => gulp.src('./packages/backend/src/server/web/views/**/*').pipe(gulp.dest('./packages/backend/built/server/web/views')) ); +gulp.task('copy:backend:custom', () => + gulp.src('./custom/*').pipe(gulp.dest('./packages/backend/assets/')) +); + gulp.task('copy:client:fonts', () => gulp.src('./packages/client/node_modules/three/examples/fonts/**/*').pipe(gulp.dest('./built/_client_dist_/fonts/')) ); @@ -35,6 +39,7 @@ gulp.task('copy:client:locales', cb => { cb(); }); + gulp.task('build:backend:script', () => { return gulp.src(['./packages/backend/src/server/web/boot.js', './packages/backend/src/server/web/bios.js', './packages/backend/src/server/web/cli.js']) .pipe(replace('LANGS', JSON.stringify(Object.keys(locales)))) diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 416f4d818..925bd6ba9 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -36,6 +36,7 @@ html link(rel='prefetch' href='/static-assets/badges/not-found.png') link(rel='prefetch' href='/static-assets/badges/error.png') link(rel='stylesheet' href='/assets/fontawesome/css/all.css') + link(rel='stylesheet' href='/static-assets/instance.css') link(rel='modulepreload' href=`/assets/${clientEntry.file}`) each href in clientEntry.css From b2829fa7bf58f040220b8953cff111281f90194f Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:34:00 -0700 Subject: [PATCH 20/30] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06d3e01e0..36606c12d 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ cp ../misskey/.config/default.yml ./.config/default.yml # replace `../misskey/` ## 💅 Customize - To add custom CSS for all users, edit `/custom/instance.css`. -- To add static assets (such as images for the splash screen), place them in the `/custom/` folder. They'll then be avaliable with `https://yourinstance.tld/static-assets/filename.png`. +- To add static assets (such as images for the splash screen), place them in the `/custom/` folder. They'll then be avaliable on `https://yourinstance.tld/static-assets/filename.png`. ## 🚀 Build and launch! From 1514757198ecdd45dbc4294dbb2e1b31d3713467 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:37:12 -0700 Subject: [PATCH 21/30] fix gulpfile --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index c407ba0e2..2eaeac0f3 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -58,7 +58,7 @@ gulp.task('build:backend:style', () => { }); gulp.task('build', gulp.parallel( - 'copy:client:locales', 'copy:backend:views', 'build:backend:script', 'build:backend:style', 'copy:client:fonts', 'copy:client:fontawesome' + 'copy:client:locales', 'copy:backend:views', 'copy:backend:custom', 'build:backend:script', 'build:backend:style', 'copy:client:fonts', 'copy:client:fontawesome' )); gulp.task('default', gulp.task('build')); From 9addbd1e2bc7cf0dfbc1228c954ba71e4d874fe7 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 02:40:51 -0700 Subject: [PATCH 22/30] fix caption in admin settings --- package.json | 2 +- packages/client/src/pages/admin/settings.vue | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 6fe1d479d..286fef7a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.7", + "version": "12.118.1-calc.rc.8", "codename": "aqua", "repository": { "type": "git", diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 43d1f43f9..bcdc7ea02 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -46,8 +46,10 @@ {{ i18n.ts.enableRecommendedTimeline }} - - + + + + From 072be6870f61fad913d88de88cfbb1b00368a86f Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 10:35:46 -0700 Subject: [PATCH 23/30] Move splash below theme --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 286fef7a8..392ab0893 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "12.118.1-calc.rc.8", +"version": "12.118.1-calc.rc.8", "codename": "aqua", "repository": { "type": "git", From ea01259b963e7fee1d4f335a4e3a03201e102196 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 10:35:47 -0700 Subject: [PATCH 24/30] Splash below theme --- packages/client/src/pages/admin/settings.vue | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index bcdc7ea02..2871abab2 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -58,20 +58,6 @@ {{ i18n.ts.disablingTimelinesInfo }} - - - - - - - - - - - - - - @@ -107,6 +93,20 @@ + + + + + + + + + + + + + + From d9b8450efb30c033d64b0e5bab69d40c33e4d00f Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:12:56 -0700 Subject: [PATCH 25/30] Togglable guest timeline --- CALCKEY.md | 1 + locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + packages/backend/migration/1660068273737GuestTimeline.js | 9 +++++++++ packages/backend/src/models/entities/meta.ts | 5 +++++ packages/backend/src/server/api/endpoints/meta.ts | 6 ++++++ packages/backend/src/server/nodeinfo.ts | 1 + packages/client/src/pages/admin/settings.vue | 4 ++++ packages/client/src/router.ts | 5 +++++ packages/client/src/ui/visitor/b.vue | 2 +- packages/client/src/ui/visitor/header.vue | 2 +- 11 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 packages/backend/migration/1660068273737GuestTimeline.js diff --git a/CALCKEY.md b/CALCKEY.md index dacaf77ee..e25034a46 100644 --- a/CALCKEY.md +++ b/CALCKEY.md @@ -68,6 +68,7 @@ - 👍 also triggers generic like/favorite - [Add additional background for acrylic popups if backdrop-filter is unsupported](https://github.com/misskey-dev/misskey/pull/8671) - [Timeline page for non-login users](https://github.com/misskey-dev/misskey/pull/8927) + - Made toggleable by instance admins, off by default - [Add parameters to MFM rotate](https://github.com/misskey-dev/misskey/pull/8549) - Many changes from [Foundkey](https://akkoma.dev/FoundKeyGang/Foundkey) - 0ece67b04c3f0365057624c1068808276ccab981: refactor pages/auth.form.vue to composition API diff --git a/locales/en-US.yml b/locales/en-US.yml index f64a7c20d..9ac13a7e9 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -324,6 +324,7 @@ disconnectService: "Disconnect" enableLocalTimeline: "Enable local timeline" enableGlobalTimeline: "Enable global timeline" enableRecommendedTimeline: "Enable recommended timeline" +enableGuestTimeline: "Enable timelines for non-logged in users" disablingTimelinesInfo: "Adminstrators and Moderators will always have access to all timelines, even if they are not enabled." registration: "Register" enableRegistration: "Enable new user registration" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index ecd30b42d..bb159aba3 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -324,6 +324,7 @@ disconnectService: "切断する" enableLocalTimeline: "ローカルタイムラインを有効にする" enableGlobalTimeline: "グローバルタイムラインを有効にする" enableRecommendedTimeline: "推奨されるタイムラインを有効にする" +enableGuestTimeline: "非ログインユーザーのタイムラインを有効にする" disablingTimelinesInfo: "これらのタイムラインを無効化しても、利便性のため管理者およびモデレーターは引き続き利用することができます。" registration: "登録" enableRegistration: "誰でも新規登録できるようにする" diff --git a/packages/backend/migration/1660068273737GuestTimeline.js b/packages/backend/migration/1660068273737GuestTimeline.js new file mode 100644 index 000000000..cabea7201 --- /dev/null +++ b/packages/backend/migration/1660068273737GuestTimeline.js @@ -0,0 +1,9 @@ +export class GuestTimeline1660068273737 { + name = 'GuestTimeline1660068273737' + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT true`); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`); + } + } diff --git a/packages/backend/src/models/entities/meta.ts b/packages/backend/src/models/entities/meta.ts index 63a4193aa..3c1612c36 100644 --- a/packages/backend/src/models/entities/meta.ts +++ b/packages/backend/src/models/entities/meta.ts @@ -57,6 +57,11 @@ export class Meta { }) public disableGlobalTimeline: boolean; + @Column('boolean', { + default: false, + }) + public enableGuestTimeline: boolean; + @Column('boolean', { default: false, }) diff --git a/packages/backend/src/server/api/endpoints/meta.ts b/packages/backend/src/server/api/endpoints/meta.ts index ca7edc352..43a3524c1 100644 --- a/packages/backend/src/server/api/endpoints/meta.ts +++ b/packages/backend/src/server/api/endpoints/meta.ts @@ -88,6 +88,10 @@ export const meta = { type: 'boolean', optional: false, nullable: false, }, + enableGuestTimeline: { + type: 'boolean', + optional: false, nullable: false, + }, driveCapacityPerLocalUserMb: { type: 'number', optional: false, nullable: false, @@ -366,6 +370,7 @@ export default define(meta, paramDef, async (ps, me) => { disableLocalTimeline: instance.disableLocalTimeline, disableRecommendedTimeline: instance.disableRecommendedTimeline, disableGlobalTimeline: instance.disableGlobalTimeline, + enableGuestTimeline: instance.enableGuestTimeline, driveCapacityPerLocalUserMb: instance.localDriveCapacityMb, driveCapacityPerRemoteUserMb: instance.remoteDriveCapacityMb, emailRequiredForSignup: instance.emailRequiredForSignup, @@ -423,6 +428,7 @@ export default define(meta, paramDef, async (ps, me) => { localTimeLine: !instance.disableLocalTimeline, recommendedTimeline: !instance.disableRecommendedTimeline, globalTimeLine: !instance.disableGlobalTimeline, + guestTimeline: instance.enableGuestTimeline, emailRequiredForSignup: instance.emailRequiredForSignup, elasticsearch: config.elasticsearch ? true : false, hcaptcha: instance.enableHcaptcha, diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts index b4216d9d9..4e3cb6388 100644 --- a/packages/backend/src/server/nodeinfo.ts +++ b/packages/backend/src/server/nodeinfo.ts @@ -69,6 +69,7 @@ const nodeinfo2 = async () => { disableLocalTimeline: meta.disableLocalTimeline, disableRecommendedTimeline: meta.disableRecommendedTimeline, disableGlobalTimeline: meta.disableGlobalTimeline, + enableGuestTimeline: meta.enableGuestTimeline, emailRequiredForSignup: meta.emailRequiredForSignup, enableHcaptcha: meta.enableHcaptcha, enableRecaptcha: meta.enableRecaptcha, diff --git a/packages/client/src/pages/admin/settings.vue b/packages/client/src/pages/admin/settings.vue index 2871abab2..d5cf776f8 100644 --- a/packages/client/src/pages/admin/settings.vue +++ b/packages/client/src/pages/admin/settings.vue @@ -55,6 +55,7 @@ {{ i18n.ts.enableLocalTimeline }} {{ i18n.ts.enableGlobalTimeline }} + {{ i18n.ts.enableGuestTimeline }} {{ i18n.ts.disablingTimelinesInfo }} @@ -198,6 +199,7 @@ let defaultDarkTheme: any = $ref(null); let enableLocalTimeline: boolean = $ref(false); let enableGlobalTimeline: boolean = $ref(false); let enableRecommendedTimeline: boolean = $ref(false); +let enableGuestTimeline: boolean = $ref(false); let pinnedUsers: string = $ref(''); let customMOTD: string = $ref(''); let recommendedInstances: string = $ref(''); @@ -229,6 +231,7 @@ async function init() { enableLocalTimeline = !meta.disableLocalTimeline; enableGlobalTimeline = !meta.disableGlobalTimeline; enableRecommendedTimeline = !meta.disableRecommendedTimeline; + enableGuestTimeline = meta.enableGuestTimeline; pinnedUsers = meta.pinnedUsers.join('\n'); customMOTD = meta.customMOTD.join('\n'); customSplashIcons = meta.customSplashIcons.join('\n'); @@ -261,6 +264,7 @@ function save() { disableLocalTimeline: !enableLocalTimeline, disableGlobalTimeline: !enableGlobalTimeline, disableRecommendedTimeline: !enableRecommendedTimeline, + enableGuestTimeline: enableGuestTimeline, pinnedUsers: pinnedUsers.split('\n'), customMOTD: customMOTD.split('\n'), customSplashIcons: customSplashIcons.split('\n'), diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 29b2eb590..322f9bc12 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -4,6 +4,10 @@ import { $i, iAmModerator } from '@/account'; import MkLoading from '@/pages/_loading_.vue'; import MkError from '@/pages/_error_.vue'; import { ui } from '@/config'; +import * as os from '@/os'; + +const meta = await os.api('admin/meta'); +const guestTimeline = meta.enableGuestTimeline; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, @@ -456,6 +460,7 @@ export const routes = [{ }, { path: '/timeline', component: page(() => import('./pages/timeline.vue')), + loginRequired: guestTimeline, }, { name: 'index', path: '/', diff --git a/packages/client/src/ui/visitor/b.vue b/packages/client/src/ui/visitor/b.vue index bb0c59e4f..e2c70d734 100644 --- a/packages/client/src/ui/visitor/b.vue +++ b/packages/client/src/ui/visitor/b.vue @@ -77,7 +77,7 @@ const announcements = { endpoint: 'announcements', limit: 10, }; -const isTimelineAvailable = !instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline; +const isTimelineAvailable = instance.enableGuestTimeline && (!instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline); let showMenu = $ref(false); let isDesktop = $ref(window.innerWidth >= DESKTOP_THRESHOLD); let narrow = $ref(window.innerWidth < 1280); diff --git a/packages/client/src/ui/visitor/header.vue b/packages/client/src/ui/visitor/header.vue index 6b4dd1ded..80a3a3491 100644 --- a/packages/client/src/ui/visitor/header.vue +++ b/packages/client/src/ui/visitor/header.vue @@ -60,7 +60,7 @@ export default defineComponent({ return { narrow: null, showMenu: false, - isTimelineAvailable: !instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline, + isTimelineAvailable: instance.enableGuestTimeline && (!instance.disableLocalTimeline || !instance.disableRecommendedTimeline || !instance.disableGlobalTimeline), }; }, From 5c164119f1d91c15de86a054efba4fdb1bccf25b Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:14:14 -0700 Subject: [PATCH 26/30] default false --- packages/backend/migration/1660068273737GuestTimeline.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/migration/1660068273737GuestTimeline.js b/packages/backend/migration/1660068273737GuestTimeline.js index cabea7201..23d3bc51b 100644 --- a/packages/backend/migration/1660068273737GuestTimeline.js +++ b/packages/backend/migration/1660068273737GuestTimeline.js @@ -1,7 +1,7 @@ export class GuestTimeline1660068273737 { name = 'GuestTimeline1660068273737' async up(queryRunner) { - await queryRunner.query(`ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT true`); + await queryRunner.query(`ALTER TABLE "meta" ADD "enableGuestTimeline" boolean NOT NULL DEFAULT false`); } async down(queryRunner) { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableGuestTimeline"`); From c845d196953495e867b24ff8c4c02fd05d67f30d Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:14:40 -0700 Subject: [PATCH 27/30] rc 9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 392ab0893..bd70df317 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", -"version": "12.118.1-calc.rc.8", +"version": "12.118.1-calc.rc.9", "codename": "aqua", "repository": { "type": "git", From 19a2c32836c3df9312bbbb0be3a42f96c0f7e72e Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:19:03 -0700 Subject: [PATCH 28/30] no async --- packages/client/src/router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 322f9bc12..8edfa03f3 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -6,7 +6,7 @@ import MkError from '@/pages/_error_.vue'; import { ui } from '@/config'; import * as os from '@/os'; -const meta = await os.api('admin/meta'); +const meta = os.api('admin/meta'); const guestTimeline = meta.enableGuestTimeline; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ From 47c19181f829a4678f66649a0e0049e766d13ffc Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 11:23:23 -0700 Subject: [PATCH 29/30] welcome explore button to `/explore` --- packages/client/src/pages/welcome.entrance.a.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/pages/welcome.entrance.a.vue b/packages/client/src/pages/welcome.entrance.a.vue index a2eec58f0..ba7c54f9a 100644 --- a/packages/client/src/pages/welcome.entrance.a.vue +++ b/packages/client/src/pages/welcome.entrance.a.vue @@ -35,7 +35,7 @@
{{ i18n.ts.signup }} {{ i18n.ts.login }} - Explore + Explore
From da83fd1ef2586b0f0418eec416afb95e45bb80af Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 9 Aug 2022 13:00:14 -0700 Subject: [PATCH 30/30] fix: :fire: Remove meta implementation in routing for now --- packages/backend/src/server/api/endpoints/admin/meta.ts | 1 + .../backend/src/server/api/endpoints/admin/update-meta.ts | 5 +++++ packages/client/src/router.ts | 6 ++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 71a217d93..afe588914 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -398,6 +398,7 @@ export default define(meta, paramDef, async (ps, me) => { disableLocalTimeline: instance.disableLocalTimeline, disableRecommendedTimeline: instance.disableRecommendedTimeline, disableGlobalTimeline: instance.disableGlobalTimeline, + enableGuestTimeline: instance.enableGuestTimeline, driveCapacityPerLocalUserMb: instance.localDriveCapacityMb, driveCapacityPerRemoteUserMb: instance.remoteDriveCapacityMb, emailRequiredForSignup: instance.emailRequiredForSignup, diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 0220c4a7c..26745339b 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -18,6 +18,7 @@ export const paramDef = { disableLocalTimeline: { type: 'boolean', nullable: true }, disableRecommendedTimeline: { type: 'boolean', nullable: true }, disableGlobalTimeline: { type: 'boolean', nullable: true }, + enableGuestTimeline: { type: 'boolean', nullable: true }, useStarForReactionFallback: { type: 'boolean', nullable: true }, recommendedInstances: { type: 'array', nullable: true, items: { type: 'string', @@ -141,6 +142,10 @@ export default define(meta, paramDef, async (ps, me) => { set.disableGlobalTimeline = ps.disableGlobalTimeline; } + if (typeof ps.enableGuestTimeline === 'boolean') { + set.enableGuestTimeline = ps.enableGuestTimeline; + } + if (typeof ps.useStarForReactionFallback === 'boolean') { set.useStarForReactionFallback = ps.useStarForReactionFallback; } diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 8edfa03f3..89f89461c 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -4,10 +4,8 @@ import { $i, iAmModerator } from '@/account'; import MkLoading from '@/pages/_loading_.vue'; import MkError from '@/pages/_error_.vue'; import { ui } from '@/config'; -import * as os from '@/os'; -const meta = os.api('admin/meta'); -const guestTimeline = meta.enableGuestTimeline; +// const guestTimeline = nodeinfo.meta.enableGuestTimeline; const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader, @@ -460,7 +458,7 @@ export const routes = [{ }, { path: '/timeline', component: page(() => import('./pages/timeline.vue')), - loginRequired: guestTimeline, + // loginRequired: guestTimeline, }, { name: 'index', path: '/',