Merge tag '13.14.1' into merge-upstream

This commit is contained in:
まっちゃとーにゅ 2023-07-23 03:08:40 +09:00
commit 72244c7ce6
No known key found for this signature in database
GPG key ID: 6AFBBF529601C1DB
560 changed files with 12755 additions and 8764 deletions

View file

@ -1,8 +1,8 @@
import { randomUUID } from 'node:crypto';
import { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { randomBytes } from 'node:crypto';
import { Inject, Injectable } from '@nestjs/common';
import { v4 as uuid } from 'uuid';
import { createBullBoard } from '@bull-board/api';
import { BullAdapter } from '@bull-board/api/bullAdapter.js';
import { FastifyAdapter } from '@bull-board/fastify';
@ -690,7 +690,7 @@ export class ClientServerService {
});
fastify.setErrorHandler(async (error, request, reply) => {
const errId = uuid();
const errId = randomUUID();
this.clientLoggerService.logger.error(`Internal error occured in ${request.routerPath}: ${error.message}`, {
path: request.routerPath,
params: request.params,

View file

@ -38,9 +38,9 @@ export class FeedService {
link: `${this.config.url}/@${user.username}`,
name: user.name ?? user.username,
};
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
const notes = await this.notesRepository.find({
where: {
userId: user.id,
@ -50,7 +50,7 @@ export class FeedService {
order: { createdAt: -1 },
take: 20,
});
const feed = new Feed({
id: author.link,
title: `${author.name} (@${user.username}@${this.config.host})`,
@ -66,13 +66,13 @@ export class FeedService {
author,
copyright: user.name ?? user.username,
});
for (const note of notes) {
const files = note.fileIds.length > 0 ? await this.driveFilesRepository.findBy({
id: In(note.fileIds),
}) : [];
const file = files.find(file => file.type.startsWith('image/'));
feed.addItem({
title: `New note by ${author.name}`,
link: `${this.config.url}/notes/${note.id}`,
@ -82,7 +82,7 @@ export class FeedService {
image: file ? this.driveFileEntityService.getPublicUrl(file) ?? undefined : undefined,
});
}
return feed;
}
}

View file

@ -8,7 +8,7 @@ window.onload = async () => {
const promise = new Promise((resolve, reject) => {
// Append a credential
if (i) data.i = i;
// Send request
window.fetch(endpoint.indexOf('://') > -1 ? endpoint : `/api/${endpoint}`, {
method: 'POST',
@ -17,7 +17,7 @@ window.onload = async () => {
cache: 'no-cache'
}).then(async (res) => {
const body = res.status === 204 ? null : await res.json();
if (res.status === 200) {
resolve(body);
} else if (res.status === 204) {
@ -27,7 +27,7 @@ window.onload = async () => {
}
}).catch(reject);
});
return promise;
};

View file

@ -8,7 +8,7 @@ window.onload = async () => {
const promise = new Promise((resolve, reject) => {
// Append a credential
if (i) data.i = i;
// Send request
fetch(endpoint.indexOf('://') > -1 ? endpoint : `/api/${endpoint}`, {
headers: {
@ -20,7 +20,7 @@ window.onload = async () => {
cache: 'no-cache'
}).then(async (res) => {
const body = res.status === 204 ? null : await res.json();
if (res.status === 200) {
resolve(body);
} else if (res.status === 204) {
@ -30,7 +30,7 @@ window.onload = async () => {
}
}).catch(reject);
});
return promise;
};

View file

@ -35,7 +35,7 @@ html
link(rel='prefetch' href=infoImageUrl)
link(rel='prefetch' href=notFoundImageUrl)
//- https://github.com/misskey-dev/misskey/issues/9842
link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.21.0')
link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.25.0')
link(rel='modulepreload' href=`/vite/${clientEntry.file}`)
if !config.clientManifestExists
@ -55,8 +55,8 @@ html
block meta
block og
meta(property='og:title' content= title || 'Misskey')
meta(property='og:description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨')
meta(property='og:title' content= title || 'Misskey')
meta(property='og:description' content= desc || '✨🌎✨ A interplanetary communication platform ✨🚀✨')
meta(property='og:image' content= img)
meta(property='twitter:card' content='summary')

View file

@ -32,12 +32,12 @@ body
path(stroke="none", d="M0 0h24v24H0z", fill="none")
path(d="M12 9v2m0 4v.01")
path(d="M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75")
h1 An error has occurred!
button.button-big(onclick="location.reload();")
span.button-label-big Refresh
p.dont-worry Don't worry, it's (probably) not your fault.
p If reloading after a period of time does not resolve the problem, contact the server administrator with the following ERROR ID.

View file

@ -47,4 +47,4 @@ html
header#banner(style=`background-image: url(${meta.bannerUrl})`)
div#title= meta.name || host
div#content
div#description= meta.description
div#description!= meta.description

View file

@ -5,8 +5,8 @@ block vars
- const title = 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;
- const image = (note.files || []).find(file => file.type.startsWith('image/') && !file.isSensitive)
- const video = (note.files || []).find(file => file.type.startsWith('video/') && !file.isSensitive)
- const images = (note.files || []).filter(file => file.type.startsWith('image/') && !file.isSensitive)
- const videos = (note.files || []).filter(file => file.type.startsWith('video/') && !file.isSensitive)
block title
= `${title} | ${instanceName}`
@ -19,15 +19,17 @@ block og
meta(property='og:title' content= title)
meta(property='og:description' content= summary)
meta(property='og:url' content= url)
if video
meta(property='og:video:url' content= video.url)
meta(property='og:video:secure_url' content= video.url)
meta(property='og:video:type' content= video.type)
// FIXME: add width and height
// FIXME: add embed player for Twitter
if image
if videos.length
each video in videos
meta(property='og:video:url' content= video.url)
meta(property='og:video:secure_url' content= video.url)
meta(property='og:video:type' content= video.type)
// FIXME: add width and height
// FIXME: add embed player for Twitter
if images.length
meta(property='twitter:card' content='summary_large_image')
meta(property='og:image' content= image.url)
each image in images
meta(property='og:image' content= image.url)
else
meta(property='twitter:card' content='summary')
meta(property='og:image' content= avatarUrl)
@ -43,7 +45,7 @@ block meta
meta(name='misskey:user-username' content=user.username)
meta(name='misskey:user-id' content=user.id)
meta(name='misskey:note-id' content=note.id)
// todo
if user.twitter
meta(name='twitter:creator' content=`@${user.twitter.screenName}`)