Merge branch 'misskey-dev:develop' into develop

This commit is contained in:
老兄 2023-08-21 17:15:06 +08:00 committed by GitHub
commit b59d47dbcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 127 additions and 34 deletions

View File

@ -159,6 +159,9 @@ id: 'aid'
#deliverJobMaxAttempts: 12
#inboxJobMaxAttempts: 8
# Local address used for outgoing requests
#outgoingAddress: 127.0.0.1
# IP address family used for outgoing request (ipv4, ipv6 or dual)
#outgoingAddressFamily: ipv4

View File

@ -14,7 +14,7 @@ jobs:
- run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v3.8.0
uses: actions/setup-node@v3.8.1
with:
node-version-file: '.node-version'
cache: 'pnpm'

View File

@ -19,7 +19,7 @@ jobs:
with:
version: 8
run_install: false
- uses: actions/setup-node@v3.8.0
- uses: actions/setup-node@v3.8.1
with:
node-version-file: '.node-version'
cache: 'pnpm'
@ -46,7 +46,7 @@ jobs:
with:
version: 7
run_install: false
- uses: actions/setup-node@v3.8.0
- uses: actions/setup-node@v3.8.1
with:
node-version-file: '.node-version'
cache: 'pnpm'
@ -72,7 +72,7 @@ jobs:
with:
version: 7
run_install: false
- uses: actions/setup-node@v3.8.0
- uses: actions/setup-node@v3.8.1
with:
node-version-file: '.node-version'
cache: 'pnpm'

View File

@ -38,7 +38,7 @@ jobs:
version: 8
run_install: false
- name: Use Node.js 20.x
uses: actions/setup-node@v3.8.0
uses: actions/setup-node@v3.8.1
with:
node-version-file: '.node-version'
cache: 'pnpm'

View File

@ -38,7 +38,7 @@ jobs:
version: 8
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0
uses: actions/setup-node@v3.8.1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View File

@ -25,7 +25,7 @@ jobs:
version: 8
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0
uses: actions/setup-node@v3.8.1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
@ -83,7 +83,7 @@ jobs:
version: 7
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0
uses: actions/setup-node@v3.8.1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View File

@ -26,7 +26,7 @@ jobs:
- run: corepack enable
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0
uses: actions/setup-node@v3.8.1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View File

@ -28,7 +28,7 @@ jobs:
version: 8
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3.8.0
uses: actions/setup-node@v3.8.1
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

View File

@ -12,7 +12,7 @@
-->
## 2023.8.0 (unreleased)
## 2023.9.0 (unreleased)
### General
- OAuth 2.0のサポート
@ -27,18 +27,26 @@
- 絵文字ピッカーの検索の表示件数を100件に増加
- Enhance: ユーザーメニューでスイッチでユーザーリストに追加・削除できるように
- Enhance: 自分が押したリアクションのデザインを改善
- Enhance: ノート検索にローカルのみ検索可能なオプションの追加
- Enhance: AiScriptで`LOCALE`として現在の設定言語を取得できるように
- Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正
- Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正
- Fix: iOSで画面を回転させるとテキストサイズが変わる問題を修正
- Fix: word mute for sub note is not applied
- Fix: タイムラインを下にスクロールしてノート画面に移動して再び戻ったら以前のスクロール位置を失う問題を修正
- Fix: Misskeyプラグインをインストールする際のAiScriptバージョンのチェックが0.14.0以降に対応していない問題を修正
- Fix: 他のサーバーのユーザーへ「メッセージを送信」した時の初期テキストのメンションが間違っている問題を修正
- Playの操作を行うAPI TokenをAPIコンソールから発行できるように
### Server
- Fix: ノート検索 `notes/search` にてhostを指定した際に検索結果に反映されるように
- cacheRemoteFilesの初期値はfalseになりました
- ファイルアップロード時等にファイル名の拡張子を修正する関数(correctFilename)の挙動を改善
- Webhookのペイロードにサーバーのurlが含まれるようになりました
- Fix: 一部のfeatured noteを照会できない問題を修正
- Fix: muteがapiからのuser list timeline取得で機能しない問題を修正
- Fix: ジョブキュー管理画面の認証を回避できる問題を修正
- Fix: 一部のサーバー内部エラーがスタックトレースを返さないように修正
## 13.14.2
@ -53,6 +61,7 @@
### Server
- Fix: APIのオフセットが壊れていたせいで「もっと見る」でもっと見れない問題を修正
- Fix: 外部サーバーの投稿がタイムラインに表示されないことがある問題を修正
- Enhance: Add address bind config option (outgoingAddress)
## 13.14.1

4
locales/index.d.ts vendored
View File

@ -1862,6 +1862,10 @@ export interface Locale {
"write:gallery": string;
"read:gallery-likes": string;
"write:gallery-likes": string;
"read:flash": string;
"write:flash": string;
"read:flash-likes": string;
"write:flash-likes": string;
};
"_auth": {
"shareAccessTitle": string;

View File

@ -1780,6 +1780,10 @@ _permissions:
"write:gallery": "ギャラリーを操作する"
"read:gallery-likes": "ギャラリーのいいねを見る"
"write:gallery-likes": "ギャラリーのいいねを操作する"
"read:flash": "Playを見る"
"write:flash": "Playを操作する"
"read:flash-likes": "Playのいいねを見る"
"write:flash-likes": "Playのいいねを操作する"
_auth:
shareAccessTitle: "アプリへのアクセス許可"

View File

@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "13.14.2",
"version": "2023.9.0-beta.1",
"codename": "nasubi",
"repository": {
"type": "git",

View File

@ -16,5 +16,9 @@ export class addRenoteMuting1665091090561 {
}
async down(queryRunner) {
await queryRunner.query(`DROP INDEX "IDX_renote_muting_muterId"`);
await queryRunner.query(`DROP INDEX "IDX_renote_muting_muteeId"`);
await queryRunner.query(`DROP INDEX "IDX_renote_muting_createdAt"`);
await queryRunner.query(`DROP TABLE "renote_muting"`);
}
}

View File

@ -0,0 +1,12 @@
export class FixRenoteMuting1690417561185 {
name = 'FixRenoteMuting1690417561185'
async up(queryRunner) {
await queryRunner.query(`DELETE FROM "renote_muting" WHERE "muteeId" NOT IN (SELECT "id" FROM "user")`);
await queryRunner.query(`DELETE FROM "renote_muting" WHERE "muterId" NOT IN (SELECT "id" FROM "user")`);
}
async down(queryRunner) {
}
}

View File

@ -76,6 +76,7 @@ export type Source = {
id: string;
outgoingAddress?: string;
outgoingAddressFamily?: 'ipv4' | 'ipv6' | 'dual';
deliverJobConcurrency?: number;

View File

@ -53,12 +53,14 @@ export class HttpRequestService {
keepAlive: true,
keepAliveMsecs: 30 * 1000,
lookup: cache.lookup as unknown as net.LookupFunction,
localAddress: config.outgoingAddress,
});
this.https = new https.Agent({
keepAlive: true,
keepAliveMsecs: 30 * 1000,
lookup: cache.lookup as unknown as net.LookupFunction,
localAddress: config.outgoingAddress,
});
const maxSockets = Math.max(256, config.deliverJobConcurrency ?? 128);
@ -71,6 +73,7 @@ export class HttpRequestService {
maxFreeSockets: 256,
scheduling: 'lifo',
proxy: config.proxy,
localAddress: config.outgoingAddress,
})
: this.http;
@ -82,6 +85,7 @@ export class HttpRequestService {
maxFreeSockets: 256,
scheduling: 'lifo',
proxy: config.proxy,
localAddress: config.outgoingAddress,
})
: this.https;
}

View File

@ -25,6 +25,8 @@ type Q =
{ op: '<', k: K, v: number } |
{ op: '>=', k: K, v: number } |
{ op: '<=', k: K, v: number } |
{ op: 'is null', k: K} |
{ op: 'is not null', k: K} |
{ op: 'and', qs: Q[] } |
{ op: 'or', qs: Q[] } |
{ op: 'not', q: Q };
@ -50,6 +52,8 @@ function compileQuery(q: Q): string {
case '<=': return `(${q.k} <= ${compileValue(q.v)})`;
case 'and': return q.qs.length === 0 ? '' : `(${ q.qs.map(_q => compileQuery(_q)).join(' AND ') })`;
case 'or': return q.qs.length === 0 ? '' : `(${ q.qs.map(_q => compileQuery(_q)).join(' OR ') })`;
case 'is null': return `(${q.k} IS NULL)`;
case 'is not null': return `(${q.k} IS NOT NULL)`;
case 'not': return `(NOT ${compileQuery(q.q)})`;
default: throw new Error('unrecognized query operator');
}
@ -170,7 +174,7 @@ export class SearchService {
if (opts.channelId) filter.qs.push({ op: '=', k: 'channelId', v: opts.channelId });
if (opts.host) {
if (opts.host === '.') {
// TODO: Meilisearchが2023/05/07現在値がNULLかどうかのクエリが書けない
filter.qs.push({ op: 'is null', k: 'userHost' });
} else {
filter.qs.push({ op: '=', k: 'userHost', v: opts.host });
}
@ -204,6 +208,14 @@ export class SearchService {
.leftJoinAndSelect('reply.user', 'replyUser')
.leftJoinAndSelect('renote.user', 'renoteUser');
if (opts.host) {
if (opts.host === '.') {
query.andWhere('user.host IS NULL');
} else {
query.andWhere('user.host = :host', { host: opts.host });
}
}
this.queryService.generateVisibilityQuery(query, me);
if (me) this.queryService.generateMutedUserQuery(query, me);
if (me) this.queryService.generateBlockedUserQuery(query, me);

View File

@ -47,6 +47,7 @@ export class WebhookDeliverProcessorService {
'Content-Type': 'application/json',
},
body: JSON.stringify({
server: this.config.url,
hookId: job.data.webhookId,
userId: job.data.userId,
eventId: job.data.eventId,

View File

@ -85,8 +85,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private globalEventService: GlobalEventService,
) {
super(meta, paramDef, async (ps, me) => {
if ((ps.keywords.length === 0) || ps.keywords[0].every(x => x === '')) {
throw new Error('invalid param');
if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) {
throw new Error('either keywords or excludeKeywords is required.');
}
const currentAntennasCount = await this.antennasRepository.countBy({

View File

@ -82,6 +82,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private globalEventService: GlobalEventService,
) {
super(meta, paramDef, async (ps, me) => {
if (ps.keywords.flat().every(x => x === '') && ps.excludeKeywords.flat().every(x => x === '')) {
throw new Error('either keywords or excludeKeywords is required.');
}
// Fetch the antenna
const antenna = await this.antennasRepository.findOneBy({
id: ps.antennaId,

View File

@ -143,21 +143,23 @@ export class ClientServerService {
// Authenticate
fastify.addHook('onRequest', async (request, reply) => {
if (request.url === bullBoardPath || request.url.startsWith(bullBoardPath + '/')) {
// %71ueueとかでリクエストされたら困るため
const url = decodeURI(request.url);
if (url === bullBoardPath || url.startsWith(bullBoardPath + '/')) {
const token = request.cookies.token;
if (token == null) {
reply.code(401);
throw new Error('login required');
reply.code(401).send('Login required');
return;
}
const user = await this.usersRepository.findOneBy({ token });
if (user == null) {
reply.code(403);
throw new Error('no such user');
reply.code(403).send('No such user');
return;
}
const isAdministrator = await this.roleService.isAdministrator(user);
if (!isAdministrator) {
reply.code(403);
throw new Error('access denied');
reply.code(403).send('Access denied');
return;
}
}
});

View File

@ -34,6 +34,8 @@ describe('Webリソース', () => {
let aliceGalleryPost: any;
let aliceChannel: any;
let bob: misskey.entities.MeSignup;
type Request = {
path: string,
accept?: string,
@ -90,6 +92,8 @@ describe('Webリソース', () => {
fileIds: [aliceUploadedFile.body.id],
});
aliceChannel = await channel(alice, {});
bob = await signup({ username: 'alice' });
}, 1000 * 60 * 2);
afterAll(async () => {
@ -163,9 +167,15 @@ describe('Webリソース', () => {
});
describe.each([{ path: '/queue' }])('$path', ({ path }) => {
test('はログインしないとGETできない。', async () => await notOk({
path,
status: 401,
}));
test('はadminでなければGETできない。', async () => await notOk({
path,
status: 500, // FIXME? 403ではない。
cookie: cookie(bob),
status: 403,
}));
test('はadminならGETできる。', async () => await ok({

View File

@ -57,6 +57,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
</MkFolder>
<MkButton class="button" @click="more()">
<i class="ti ti-reload"></i>{{ i18n.ts.more }}
</MkButton>
</div>
</MkSpacer>
</MkStickyContainer>
@ -124,6 +127,12 @@ async function save(announcement) {
}
}
function more() {
os.api('admin/announcements/list', { untilId: announcements.reduce((acc, announcement) => announcement.id != null ? announcement : acc).id }).then(announcementResponse => {
announcements = announcements.concat(announcementResponse);
});
}
function refresh() {
os.api('admin/announcements/list').then(announcementResponse => {
announcements = announcementResponse;

View File

@ -12,18 +12,22 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkFolder>
<template #label>{{ i18n.ts.options }}</template>
<MkFolder>
<template #label>{{ i18n.ts.specifyUser }}</template>
<template v-if="user" #suffix>@{{ user.username }}</template>
<div class="_gaps_m">
<MkSwitch v-model="isLocalOnly">{{ i18n.ts.localOnly }}</MkSwitch>
<div style="text-align: center;" class="_gaps">
<div v-if="user">@{{ user.username }}</div>
<div>
<MkButton v-if="user == null" primary rounded inline @click="selectUser">{{ i18n.ts.selectUser }}</MkButton>
<MkButton v-else danger rounded inline @click="user = null">{{ i18n.ts.remove }}</MkButton>
<MkFolder>
<template #label>{{ i18n.ts.specifyUser }}</template>
<template v-if="user" #suffix>@{{ user.username }}</template>
<div style="text-align: center;" class="_gaps">
<div v-if="user">@{{ user.username }}</div>
<div>
<MkButton v-if="user == null" primary rounded inline @click="selectUser">{{ i18n.ts.selectUser }}</MkButton>
<MkButton v-else danger rounded inline @click="user = null">{{ i18n.ts.remove }}</MkButton>
</div>
</div>
</div>
</MkFolder>
</MkFolder>
</div>
</MkFolder>
<div>
<MkButton large primary gradate rounded style="margin: 0 auto;" @click="search">{{ i18n.ts.search }}</MkButton>
@ -43,6 +47,7 @@ import MkNotes from '@/components/MkNotes.vue';
import MkInput from '@/components/MkInput.vue';
import MkRadios from '@/components/MkRadios.vue';
import MkButton from '@/components/MkButton.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import { i18n } from '@/i18n';
import * as os from '@/os';
import MkFoldableSection from '@/components/MkFoldableSection.vue';
@ -59,6 +64,7 @@ let searchQuery = $ref('');
let searchOrigin = $ref('combined');
let notePagination = $ref();
let user = $ref(null);
let isLocalOnly = $ref(false);
function selectUser() {
os.selectUser().then(_user => {
@ -98,6 +104,8 @@ async function search() {
},
};
if (isLocalOnly) notePagination.params.host = '.';
key++;
}
</script>

View File

@ -8,6 +8,7 @@ import * as os from '@/os';
import { $i } from '@/account';
import { miLocalStorage } from '@/local-storage';
import { customEmojis } from '@/custom-emojis';
import { lang } from '@/config';
export function createAiScriptEnv(opts) {
let apiRequests = 0;
@ -16,6 +17,7 @@ export function createAiScriptEnv(opts) {
USER_NAME: $i ? values.STR($i.name) : values.NULL,
USER_USERNAME: $i ? values.STR($i.username) : values.NULL,
CUSTOM_EMOJIS: utils.jsToVal(customEmojis.value),
LOCALE: values.STR(lang),
'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => {
await os.alert({
type: type ? type.value : 'info',

View File

@ -156,7 +156,8 @@ export function getUserMenu(user: misskey.entities.UserDetailed, router: Router
icon: 'ti ti-mail',
text: i18n.ts.sendMessage,
action: () => {
os.post({ specified: user, initialText: `@${user.username} ` });
const canonical = user.host === null ? `@${user.username}` : `@${user.username}@${user.host}`;
os.post({ specified: user, initialText: `${canonical} ` });
},
}, null, {
icon: 'ti ti-pencil',

View File

@ -39,4 +39,8 @@ export const permissions = [
'write:gallery',
'read:gallery-likes',
'write:gallery-likes',
'read:flash',
'write:flash',
'read:flash-likes',
'write:flash-likes',
];