diff --git a/packages/backend/src/remote/activitypub/resolver.ts b/packages/backend/src/remote/activitypub/resolver.ts index 5c9d44292..e89a7b21a 100644 --- a/packages/backend/src/remote/activitypub/resolver.ts +++ b/packages/backend/src/remote/activitypub/resolver.ts @@ -76,7 +76,7 @@ export default class Resolver { throw new Error('Instance is not allowed'); } - if (!this.user) { + if (config.signToActivityPubGet && !this.user) { this.user = await getInstanceActor(); } diff --git a/packages/backend/src/server/api/endpoints/notes/children.ts b/packages/backend/src/server/api/endpoints/notes/children.ts index 7f2245c7e..72282b3de 100644 --- a/packages/backend/src/server/api/endpoints/notes/children.ts +++ b/packages/backend/src/server/api/endpoints/notes/children.ts @@ -12,8 +12,6 @@ export const meta = { requireCredential: false, requireCredentialPrivateMode: true, - description: 'Get a list of children of a notes. Children includes replies as well as quote renotes that quote the respective post. A post will not be duplicated if it is a reply and a quote of a note in this thread. For depths larger than 1 the threading has to be computed by the client.', - res: { type: 'array', optional: false, nullable: false, @@ -29,20 +27,7 @@ export const paramDef = { type: 'object', properties: { noteId: { type: 'string', format: 'misskey:id' }, - limit: { - description: 'The maximum number of replies/quotes to show per parent note, i.e. the maximum number of children each note may have.', - type: 'integer', - minimum: 1, - maximum: 100, - default: 10, - }, - depth: { - description: 'The number of layers of replies to fetch at once. Defaults to 1 for backward compatibility.', - type: 'integer', - minimum: 1, - maximum: 100, - default: 1, - }, + limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, }, diff --git a/packages/backend/src/server/web/index.ts b/packages/backend/src/server/web/index.ts index 4a6dfaff1..975cb6b66 100644 --- a/packages/backend/src/server/web/index.ts +++ b/packages/backend/src/server/web/index.ts @@ -327,32 +327,24 @@ router.get('/notes/:note', async (ctx, next) => { }); if (note) { - try { - // FIXME: packing with detail may throw an error if the reply or renote is not visible (#8774) - const _note = await Notes.pack(note); - const profile = await UserProfiles.findOneByOrFail({ userId: note.userId }); - const meta = await fetchMeta(); - await ctx.render('note', { - note: _note, - profile, - avatarUrl: await Users.getAvatarUrl(await Users.findOneByOrFail({ id: note.userId })), - // TODO: Let locale changeable by instance setting - summary: getNoteSummary(_note), - instanceName: meta.name || 'Calckey', - icon: meta.iconUrl, - themeColor: meta.themeColor, - }); + const _note = await Notes.pack(note); + const profile = await UserProfiles.findOneByOrFail({ userId: note.userId }); + const meta = await fetchMeta(); + await ctx.render('note', { + note: _note, + profile, + avatarUrl: await Users.getAvatarUrl(await Users.findOneByOrFail({ id: note.userId })), + // TODO: Let locale changeable by instance setting + summary: getNoteSummary(_note), + instanceName: meta.name || 'Calckey', + icon: meta.iconUrl, + privateMode: meta.privateMode, + themeColor: meta.themeColor, + }); - ctx.set('Cache-Control', 'public, max-age=15'); + ctx.set('Cache-Control', 'public, max-age=15'); - return; - } catch (err) { - if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') { - // note not visible to user - } else { - throw err; - } - } + return; } await next(); @@ -543,7 +535,6 @@ router.get('(.*)', async ctx => { splashIcon: splashIconUrl, themeColor: meta.themeColor, privateMode: meta.privateMode, - randomMOTD: motd[Math.floor(Math.random() * motd.length)], }); ctx.set('Cache-Control', 'public, max-age=3'); }); diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index d019d2f64..ed1689da7 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -58,7 +58,7 @@ html block og meta(property='og:title' content= title || 'Calckey') - meta(property='og:description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨') + meta(property='og:description' content= desc || '✨🌎 A interplanetary communication platform 🚀✨') meta(property='og:image' content= img) style diff --git a/packages/backend/src/server/web/views/channel.pug b/packages/backend/src/server/web/views/channel.pug index fd5da0deb..c4594b766 100644 --- a/packages/backend/src/server/web/views/channel.pug +++ b/packages/backend/src/server/web/views/channel.pug @@ -1,7 +1,7 @@ extends ./base block vars - - const title = privateMode ? '非公開インスタンス' : channel.name; + - const title = privateMode ? instanceName : channel.name; - const url = `${config.url}/channels/${channel.id}`; block title diff --git a/packages/backend/src/server/web/views/clip.pug b/packages/backend/src/server/web/views/clip.pug index 5247b56af..2432470c1 100644 --- a/packages/backend/src/server/web/views/clip.pug +++ b/packages/backend/src/server/web/views/clip.pug @@ -2,7 +2,7 @@ extends ./base block vars - const user = clip.user; - - const title = privateMode ? '非公開インスタンス' : clip.name; + - const title = privateMode ? instanceName : clip.name; - const url = `${config.url}/clips/${clip.id}`; block title diff --git a/packages/backend/src/server/web/views/gallery-post.pug b/packages/backend/src/server/web/views/gallery-post.pug index 1bbe740b2..1b1c2fbfb 100644 --- a/packages/backend/src/server/web/views/gallery-post.pug +++ b/packages/backend/src/server/web/views/gallery-post.pug @@ -2,7 +2,7 @@ extends ./base block vars - const user = post.user; - - const title = privateMode ? '非公開インスタンス' : post.title; + - const title = privateMode ? instanceName : post.title; - const url = `${config.url}/gallery/${post.id}`; block title diff --git a/packages/backend/src/server/web/views/note.pug b/packages/backend/src/server/web/views/note.pug index 1e6efa375..6b55f6ba0 100644 --- a/packages/backend/src/server/web/views/note.pug +++ b/packages/backend/src/server/web/views/note.pug @@ -2,7 +2,7 @@ extends ./base block vars - const user = note.user; - - const title = privateMode ? '非公開インスタンス' : (user.name ? `${user.name} (@${user.username})` : `@${user.username}`); + - const title = privateMode ? instanceName : (user.name ? `${user.name} (@${user.username})` : `@${user.username}`); - const url = `${config.url}/notes/${note.id}`; - const isRenote = note.renote && note.text == null && note.fileIds.length == 0 && note.poll == null; diff --git a/packages/backend/src/server/web/views/page.pug b/packages/backend/src/server/web/views/page.pug index 3378562d4..109528213 100644 --- a/packages/backend/src/server/web/views/page.pug +++ b/packages/backend/src/server/web/views/page.pug @@ -2,7 +2,7 @@ extends ./base block vars - const user = page.user; - - const title = privateMode ? '非公開インスタンス' : page.title; + - const title = privateMode ? instanceName : page.title; - const url = `${config.url}/@${user.username}/${page.name}`; block title diff --git a/packages/backend/src/server/web/views/user.pug b/packages/backend/src/server/web/views/user.pug index d52a92694..cc14dedb3 100644 --- a/packages/backend/src/server/web/views/user.pug +++ b/packages/backend/src/server/web/views/user.pug @@ -1,7 +1,7 @@ extends ./base block vars - - const title = privateMode ? '非公開インスタンス' : (user.name ? `${user.name} (@${user.username})` : `@${user.username}`); + - const title = privateMode ? instanceName : (user.name ? `${user.name} (@${user.username})` : `@${user.username}`); - const url = `${config.url}/@${(user.host ? `${user.username}@${user.host}` : user.username)}`; block title diff --git a/packages/client/src/pages/admin/security.vue b/packages/client/src/pages/admin/security.vue index be3d27aba..735c7dc3e 100644 --- a/packages/client/src/pages/admin/security.vue +++ b/packages/client/src/pages/admin/security.vue @@ -133,6 +133,7 @@ import FormRange from '@/components/form/range.vue'; import FormInput from '@/components/form/input.vue'; import FormTextarea from '@/components/form/textarea.vue'; import FormButton from '@/components/MkButton.vue'; +import FormTextarea from '@/components/form/textarea.vue'; import * as os from '@/os'; import { fetchInstance } from '@/instance'; import { i18n } from '@/i18n';