Merge branch 'develop' into ed25519

This commit is contained in:
tamaina 2024-05-08 21:40:35 +09:00
commit baca55c814
42 changed files with 13978 additions and 10547 deletions

View File

@ -8,7 +8,7 @@
"version": "8.9.2" "version": "8.9.2"
}, },
"ghcr.io/devcontainers/features/node:1": { "ghcr.io/devcontainers/features/node:1": {
"version": "20.10.0" "version": "20.12.2"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [3000],

View File

@ -26,7 +26,7 @@ jobs:
- name: setup pnpm - name: setup pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
- name: setup node - name: setup node
id: setup-node id: setup-node

View File

@ -18,7 +18,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [20.10.0] node-version: [20.12.2]
api-json-name: [api-base.json, api-head.json] api-json-name: [api-base.json, api-head.json]
include: include:
- api-json-name: api-base.json - api-json-name: api-base.json
@ -34,7 +34,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.2 uses: actions/setup-node@v4.0.2

View File

@ -29,7 +29,7 @@ jobs:
submodules: true submodules: true
- uses: pnpm/action-setup@v3 - uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
run_install: false run_install: false
- uses: actions/setup-node@v4.0.2 - uses: actions/setup-node@v4.0.2
with: with:
@ -56,7 +56,7 @@ jobs:
submodules: true submodules: true
- uses: pnpm/action-setup@v3 - uses: pnpm/action-setup@v3
with: with:
version: 7 version: 9
run_install: false run_install: false
- uses: actions/setup-node@v4.0.2 - uses: actions/setup-node@v4.0.2
with: with:
@ -82,7 +82,7 @@ jobs:
submodules: true submodules: true
- uses: pnpm/action-setup@v3 - uses: pnpm/action-setup@v3
with: with:
version: 7 version: 9
run_install: false run_install: false
- uses: actions/setup-node@v4.0.2 - uses: actions/setup-node@v4.0.2
with: with:

View File

@ -17,7 +17,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [20.10.0] node-version: [20.12.2]
steps: steps:
- uses: actions/checkout@v4.1.1 - uses: actions/checkout@v4.1.1
@ -26,7 +26,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.2 uses: actions/setup-node@v4.0.2

View File

@ -61,6 +61,7 @@ jobs:
- -
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }} use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
indent: ${{ vars.INDENT }}
secrets: secrets:
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
@ -75,6 +76,7 @@ jobs:
pr_number: ${{ needs.get-pr.outputs.pr_number }} pr_number: ${{ needs.get-pr.outputs.pr_number }}
package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }} package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }}
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }} use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
indent: ${{ vars.INDENT }}
secrets: secrets:
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
@ -115,6 +117,7 @@ jobs:
# } # }
package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }} package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }}
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }} use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
indent: ${{ vars.INDENT }}
secrets: secrets:
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}

View File

@ -33,6 +33,7 @@ jobs:
pr_number: ${{ github.event.pull_request.number }} pr_number: ${{ github.event.pull_request.number }}
package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }} package_jsons_to_rewrite: ${{ vars.PACKAGE_JSONS_TO_REWRITE }}
use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }} use_external_app_to_release: ${{ vars.USE_RELEASE_APP == 'true' }}
indent: ${{ vars.INDENT }}
secrets: secrets:
RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }} RELEASE_APP_ID: ${{ secrets.RELEASE_APP_ID }}
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}

View File

@ -36,7 +36,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
run_install: false run_install: false
- name: Use Node.js 20.x - name: Use Node.js 20.x
uses: actions/setup-node@v4.0.2 uses: actions/setup-node@v4.0.2

View File

@ -21,7 +21,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [20.10.0] node-version: [20.12.2]
services: services:
postgres: postgres:
@ -43,7 +43,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
run_install: false run_install: false
- name: Install FFmpeg - name: Install FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3 uses: FedericoCarboni/setup-ffmpeg@v3
@ -73,7 +73,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [20.10.0] node-version: [20.12.2]
services: services:
postgres: postgres:
@ -95,7 +95,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.2 uses: actions/setup-node@v4.0.2

View File

@ -26,7 +26,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [20.10.0] node-version: [20.12.2]
steps: steps:
- uses: actions/checkout@v4.1.1 - uses: actions/checkout@v4.1.1
@ -35,7 +35,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.2 uses: actions/setup-node@v4.0.2
@ -64,7 +64,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
node-version: [20.10.0] node-version: [20.12.2]
browser: [chrome] browser: [chrome]
services: services:
@ -93,7 +93,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 7 version: 9
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.2 uses: actions/setup-node@v4.0.2

View File

@ -20,7 +20,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [20.10.0] node-version: [20.12.2]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps: steps:

View File

@ -16,7 +16,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [20.10.0] node-version: [20.12.2]
steps: steps:
- uses: actions/checkout@v4.1.1 - uses: actions/checkout@v4.1.1
@ -25,7 +25,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.2 uses: actions/setup-node@v4.0.2

View File

@ -17,7 +17,7 @@ jobs:
strategy: strategy:
matrix: matrix:
node-version: [20.10.0] node-version: [20.12.2]
steps: steps:
- uses: actions/checkout@v4.1.1 - uses: actions/checkout@v4.1.1
@ -26,7 +26,7 @@ jobs:
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v3 uses: pnpm/action-setup@v3
with: with:
version: 8 version: 9
run_install: false run_install: false
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.0.2 uses: actions/setup-node@v4.0.2

View File

@ -1 +1 @@
20.10.0 20.12.2

View File

@ -38,7 +38,8 @@
- Enhance: フォローするかどうかの確認ダイアログを出せるように - Enhance: フォローするかどうかの確認ダイアログを出せるように
- Enhance: Playを手動でリロードできるように - Enhance: Playを手動でリロードできるように
- Enhance: 通報のコメント内のリンクをクリックした際、ウィンドウで開くように - Enhance: 通報のコメント内のリンクをクリックした際、ウィンドウで開くように
- Chore: AiScriptを0.18.0にバージョンアップ - Enhance: `Ui:C:postForm` および `Ui:C:postFormButton``localOnly``visibility` を設定できるように
- Enhance: AiScriptを0.18.0にバージョンアップ
- Fix: 一部のページ内リンクが正しく動作しない問題を修正 - Fix: 一部のページ内リンクが正しく動作しない問題を修正
- Fix: 周年の実績が閏年を考慮しない問題を修正 - Fix: 周年の実績が閏年を考慮しない問題を修正
- Fix: ローカルURLのプレビューポップアップが左上に表示される - Fix: ローカルURLのプレビューポップアップが左上に表示される
@ -62,6 +63,8 @@
### Server ### Server
- Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに - Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに
- Enhance: misskey-dev/summaly@5.1.0の取り込み(プレビュー生成処理の効率化) - Enhance: misskey-dev/summaly@5.1.0の取り込み(プレビュー生成処理の効率化)
- Enhance: ドライブのファイルがNSFWかどうか個別に連合されるように (#13756)
- 可能な場合、ノートの添付ファイルのセンシティブ判定がファイル単位になります
- Fix: リモートから配送されたアクティビティにJSON-LD compactionをかける - Fix: リモートから配送されたアクティビティにJSON-LD compactionをかける
- Fix: フォローリクエストを作成する際に既存のものは削除するように - Fix: フォローリクエストを作成する際に既存のものは削除するように
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/440) (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/440)
@ -77,8 +80,6 @@
- Fix: グローバルタイムラインで返信が表示されないことがある問題を修正 - Fix: グローバルタイムラインで返信が表示されないことがある問題を修正
- Fix: リノートをミュートしたユーザの投稿のリノートがミュートされる問題を修正 - Fix: リノートをミュートしたユーザの投稿のリノートがミュートされる問題を修正
- Fix: AP Link等は添付ファイル扱いしないようになど (#13754) - Fix: AP Link等は添付ファイル扱いしないようになど (#13754)
- Enhance: ドライブのファイルがNSFWかどうか個別に連合されるように (#13756)
- 可能な場合、ノートの添付ファイルのセンシティブ判定がファイル単位になります
## 2024.3.1 ## 2024.3.1

View File

@ -1,6 +1,6 @@
# syntax = docker/dockerfile:1.4 # syntax = docker/dockerfile:1.4
ARG NODE_VERSION=20.10.0-bullseye ARG NODE_VERSION=20.12.2-bullseye
# build assets & compile TypeScript # build assets & compile TypeScript

View File

@ -6,7 +6,7 @@
"type": "git", "type": "git",
"url": "https://github.com/misskey-dev/misskey.git" "url": "https://github.com/misskey-dev/misskey.git"
}, },
"packageManager": "pnpm@8.15.4", "packageManager": "pnpm@9.0.6",
"workspaces": [ "workspaces": [
"packages/frontend", "packages/frontend",
"packages/backend", "packages/backend",
@ -48,24 +48,24 @@
"lodash": "4.17.21" "lodash": "4.17.21"
}, },
"dependencies": { "dependencies": {
"cssnano": "6.0.5", "cssnano": "6.1.2",
"execa": "8.0.1", "execa": "8.0.1",
"fast-glob": "3.3.2", "fast-glob": "3.3.2",
"ignore-walk": "6.0.4", "ignore-walk": "6.0.4",
"js-yaml": "4.1.0", "js-yaml": "4.1.0",
"postcss": "8.4.35", "postcss": "8.4.38",
"tar": "6.2.0", "tar": "6.2.1",
"terser": "5.28.1", "terser": "5.30.3",
"typescript": "5.3.3", "typescript": "5.4.5",
"esbuild": "0.19.11", "esbuild": "0.20.2",
"glob": "10.3.10" "glob": "10.3.12"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.11.28", "@types/node": "20.12.7",
"@typescript-eslint/eslint-plugin": "7.1.0", "@typescript-eslint/eslint-plugin": "7.7.1",
"@typescript-eslint/parser": "7.1.0", "@typescript-eslint/parser": "7.7.1",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"cypress": "13.6.6", "cypress": "13.7.3",
"eslint": "8.57.0", "eslint": "8.57.0",
"ncp": "2.0.0", "ncp": "2.0.0",
"start-server-and-test": "2.0.3" "start-server-and-test": "2.0.3"

View File

@ -12,9 +12,9 @@
"migrate": "pnpm typeorm migration:run -d ormconfig.js", "migrate": "pnpm typeorm migration:run -d ormconfig.js",
"revert": "pnpm typeorm migration:revert -d ormconfig.js", "revert": "pnpm typeorm migration:revert -d ormconfig.js",
"check:connect": "node ./scripts/check_connect.js", "check:connect": "node ./scripts/check_connect.js",
"build": "swc src -d built -D", "build": "swc src -d built -D --strip-leading-paths",
"build:test": "swc test-server -d built-test -D --config-file test-server/.swcrc", "build:test": "swc test-server -d built-test -D --config-file test-server/.swcrc --strip-leading-paths",
"watch:swc": "swc src -d built -D -w", "watch:swc": "swc src -d built -D -w --strip-leading-paths",
"build:tsc": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json", "build:tsc": "tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
"watch": "node ./scripts/watch.mjs", "watch": "node ./scripts/watch.mjs",
"restart": "pnpm build && pnpm start", "restart": "pnpm build && pnpm start",
@ -67,38 +67,39 @@
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "3.412.0", "@aws-sdk/client-s3": "3.412.0",
"@aws-sdk/lib-storage": "3.412.0", "@aws-sdk/lib-storage": "3.412.0",
"@bull-board/api": "5.14.2", "@bull-board/api": "5.17.0",
"@bull-board/fastify": "5.14.2", "@bull-board/fastify": "5.17.0",
"@bull-board/ui": "5.14.2", "@bull-board/ui": "5.17.0",
"@discordapp/twemoji": "15.0.2", "@discordapp/twemoji": "15.0.3",
"@fastify/accepts": "4.3.0", "@fastify/accepts": "4.3.0",
"@fastify/cookie": "9.3.1", "@fastify/cookie": "9.3.1",
"@fastify/cors": "8.5.0", "@fastify/cors": "9.0.1",
"@fastify/express": "2.3.0", "@fastify/express": "3.0.0",
"@fastify/http-proxy": "9.3.0", "@fastify/http-proxy": "9.5.0",
"@fastify/multipart": "8.1.0", "@fastify/multipart": "8.2.0",
"@fastify/static": "6.12.0", "@fastify/static": "7.0.3",
"@fastify/view": "8.2.0", "@fastify/view": "9.1.0",
"@misskey-dev/node-http-message-signatures": "0.0.8", "@misskey-dev/node-http-message-signatures": "0.0.8",
"@misskey-dev/sharp-read-bmp": "1.2.0", "@misskey-dev/sharp-read-bmp": "1.2.0",
"@misskey-dev/summaly": "5.1.0", "@misskey-dev/summaly": "5.1.0",
"@nestjs/common": "10.3.3", "@napi-rs/canvas": "^0.1.52",
"@nestjs/core": "10.3.3", "@nestjs/common": "10.3.8",
"@nestjs/testing": "10.3.3", "@nestjs/core": "10.3.8",
"@simplewebauthn/server": "9.0.3", "@nestjs/testing": "10.3.8",
"@simplewebauthn/server": "10.0.0",
"@sinonjs/fake-timers": "11.2.2", "@sinonjs/fake-timers": "11.2.2",
"@smithy/node-http-handler": "2.1.10", "@smithy/node-http-handler": "2.5.0",
"@swc/cli": "0.1.63", "@swc/cli": "0.3.12",
"@swc/core": "1.3.107", "@swc/core": "1.4.17",
"@twemoji/parser": "15.0.0", "@twemoji/parser": "15.1.1",
"accepts": "1.3.8", "accepts": "1.3.8",
"ajv": "8.12.0", "ajv": "8.13.0",
"archiver": "6.0.1", "archiver": "7.0.1",
"async-mutex": "0.4.1", "async-mutex": "0.5.0",
"bcryptjs": "2.4.3", "bcryptjs": "2.4.3",
"blurhash": "2.0.5", "blurhash": "2.0.5",
"body-parser": "1.20.2", "body-parser": "1.20.2",
"bullmq": "5.4.0", "bullmq": "5.7.8",
"cacheable-lookup": "7.0.0", "cacheable-lookup": "7.0.0",
"cbor": "9.0.2", "cbor": "9.0.2",
"chalk": "5.3.0", "chalk": "5.3.0",
@ -109,85 +110,84 @@
"content-disposition": "0.5.4", "content-disposition": "0.5.4",
"date-fns": "2.30.0", "date-fns": "2.30.0",
"deep-email-validator": "0.1.21", "deep-email-validator": "0.1.21",
"fastify": "4.25.2", "fastify": "4.26.2",
"fastify-raw-body": "4.3.0", "fastify-raw-body": "4.3.0",
"feed": "4.2.2", "feed": "4.2.2",
"file-type": "19.0.0", "file-type": "19.0.0",
"fluent-ffmpeg": "2.1.2", "fluent-ffmpeg": "2.1.2",
"form-data": "4.0.0", "form-data": "4.0.0",
"got": "14.2.0", "got": "14.2.1",
"happy-dom": "10.0.3", "happy-dom": "14.7.1",
"hpagent": "1.2.0", "hpagent": "1.2.0",
"htmlescape": "1.1.1", "htmlescape": "1.1.1",
"http-link-header": "1.1.2", "http-link-header": "1.1.3",
"ioredis": "5.3.2", "ioredis": "5.4.1",
"ip-cidr": "3.1.0", "ip-cidr": "3.1.0",
"ipaddr.js": "2.1.0", "ipaddr.js": "2.2.0",
"is-svg": "5.0.0", "is-svg": "5.0.0",
"js-yaml": "4.1.0", "js-yaml": "4.1.0",
"jsdom": "23.2.0", "jsdom": "24.0.0",
"json5": "2.2.3", "json5": "2.2.3",
"jsonld": "8.3.2", "jsonld": "8.3.2",
"jsrsasign": "11.1.0", "jsrsasign": "11.1.0",
"meilisearch": "0.37.0", "meilisearch": "0.38.0",
"mfm-js": "0.24.0", "mfm-js": "0.24.0",
"microformats-parser": "2.0.2", "microformats-parser": "2.0.2",
"mime-types": "2.1.35", "mime-types": "2.1.35",
"misskey-js": "workspace:*", "misskey-js": "workspace:*",
"misskey-reversi": "workspace:*", "misskey-reversi": "workspace:*",
"ms": "3.0.0-canary.1", "ms": "3.0.0-canary.1",
"nanoid": "5.0.6", "nanoid": "5.0.7",
"nested-property": "4.0.0", "nested-property": "4.0.0",
"node-fetch": "3.3.2", "node-fetch": "3.3.2",
"nodemailer": "6.9.10", "nodemailer": "6.9.13",
"nsfwjs": "2.4.2", "nsfwjs": "2.4.2",
"oauth": "0.10.0", "oauth": "0.10.0",
"oauth2orize": "1.12.0", "oauth2orize": "1.12.0",
"oauth2orize-pkce": "0.1.2", "oauth2orize-pkce": "0.1.2",
"os-utils": "0.0.14", "os-utils": "0.0.14",
"otpauth": "9.2.2", "otpauth": "9.2.3",
"parse5": "7.1.2", "parse5": "7.1.2",
"pg": "8.11.3", "pg": "8.11.5",
"pkce-challenge": "4.1.0", "pkce-challenge": "4.1.0",
"probe-image-size": "7.2.3", "probe-image-size": "7.2.3",
"promise-limit": "2.7.0", "promise-limit": "2.7.0",
"pug": "3.0.2", "pug": "3.0.2",
"punycode": "2.3.1", "punycode": "2.3.1",
"pureimage": "0.3.17",
"qrcode": "1.5.3", "qrcode": "1.5.3",
"random-seed": "0.3.0", "random-seed": "0.3.0",
"ratelimiter": "3.4.1", "ratelimiter": "3.4.1",
"re2": "1.20.9", "re2": "1.20.10",
"redis-lock": "0.1.4", "redis-lock": "0.1.4",
"reflect-metadata": "0.2.1", "reflect-metadata": "0.2.2",
"rename": "1.0.4", "rename": "1.0.4",
"rss-parser": "3.13.0", "rss-parser": "3.13.0",
"rxjs": "7.8.1", "rxjs": "7.8.1",
"sanitize-html": "2.12.1", "sanitize-html": "2.13.0",
"secure-json-parse": "2.7.0", "secure-json-parse": "2.7.0",
"sharp": "0.33.2", "sharp": "0.33.3",
"slacc": "0.0.10", "slacc": "0.0.10",
"strict-event-emitter-types": "2.0.0", "strict-event-emitter-types": "2.0.0",
"stringz": "2.1.0", "stringz": "2.1.0",
"systeminformation": "5.22.0", "systeminformation": "5.22.7",
"tinycolor2": "1.6.0", "tinycolor2": "1.6.0",
"tmp": "0.2.2", "tmp": "0.2.3",
"tsc-alias": "1.8.8", "tsc-alias": "1.8.8",
"tsconfig-paths": "4.2.0", "tsconfig-paths": "4.2.0",
"typeorm": "0.3.20", "typeorm": "0.3.20",
"typescript": "5.3.3", "typescript": "5.4.5",
"ulid": "2.3.0", "ulid": "2.3.0",
"vary": "1.1.2", "vary": "1.1.2",
"web-push": "3.6.7", "web-push": "3.6.7",
"ws": "8.16.0", "ws": "8.17.0",
"xev": "3.0.2" "xev": "3.0.2"
}, },
"devDependencies": { "devDependencies": {
"@jest/globals": "29.7.0", "@jest/globals": "29.7.0",
"@misskey-dev/eslint-plugin": "1.0.0", "@misskey-dev/eslint-plugin": "1.0.0",
"@nestjs/platform-express": "10.3.3", "@nestjs/platform-express": "10.3.8",
"@simplewebauthn/types": "9.0.1", "@simplewebauthn/types": "10.0.0",
"@swc/jest": "0.2.31", "@swc/jest": "0.2.36",
"@types/accepts": "1.3.7", "@types/accepts": "1.3.7",
"@types/archiver": "6.0.2", "@types/archiver": "6.0.2",
"@types/bcryptjs": "2.4.6", "@types/bcryptjs": "2.4.6",
@ -197,20 +197,20 @@
"@types/fluent-ffmpeg": "2.1.24", "@types/fluent-ffmpeg": "2.1.24",
"@types/htmlescape": "^1.1.3", "@types/htmlescape": "^1.1.3",
"@types/http-link-header": "1.0.5", "@types/http-link-header": "1.0.5",
"@types/jest": "29.5.11", "@types/jest": "29.5.12",
"@types/js-yaml": "4.0.9", "@types/js-yaml": "4.0.9",
"@types/jsdom": "21.1.6", "@types/jsdom": "21.1.6",
"@types/jsonld": "1.5.13", "@types/jsonld": "1.5.13",
"@types/jsrsasign": "10.5.12", "@types/jsrsasign": "10.5.14",
"@types/mime-types": "2.1.4", "@types/mime-types": "2.1.4",
"@types/ms": "0.7.34", "@types/ms": "0.7.34",
"@types/node": "20.11.22", "@types/node": "20.12.7",
"@types/node-fetch": "3.0.3", "@types/node-fetch": "3.0.3",
"@types/nodemailer": "6.4.14", "@types/nodemailer": "6.4.15",
"@types/oauth": "0.9.4", "@types/oauth": "0.9.4",
"@types/oauth2orize": "1.11.3", "@types/oauth2orize": "1.11.5",
"@types/oauth2orize-pkce": "0.1.2", "@types/oauth2orize-pkce": "0.1.2",
"@types/pg": "8.11.2", "@types/pg": "8.11.5",
"@types/pug": "2.0.10", "@types/pug": "2.0.10",
"@types/punycode": "2.1.4", "@types/punycode": "2.1.4",
"@types/qrcode": "1.5.5", "@types/qrcode": "1.5.5",
@ -226,8 +226,8 @@
"@types/vary": "1.1.3", "@types/vary": "1.1.3",
"@types/web-push": "3.6.3", "@types/web-push": "3.6.3",
"@types/ws": "8.5.10", "@types/ws": "8.5.10",
"@typescript-eslint/eslint-plugin": "7.1.0", "@typescript-eslint/eslint-plugin": "7.7.1",
"@typescript-eslint/parser": "7.1.0", "@typescript-eslint/parser": "7.7.1",
"aws-sdk-client-mock": "3.0.1", "aws-sdk-client-mock": "3.0.1",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"eslint": "8.57.0", "eslint": "8.57.0",

View File

@ -10,7 +10,7 @@ import {
generateRegistrationOptions, verifyAuthenticationResponse, generateRegistrationOptions, verifyAuthenticationResponse,
verifyRegistrationResponse, verifyRegistrationResponse,
} from '@simplewebauthn/server'; } from '@simplewebauthn/server';
import { AttestationFormat, isoCBOR } from '@simplewebauthn/server/helpers'; import { AttestationFormat, isoCBOR, isoUint8Array } from '@simplewebauthn/server/helpers';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type { UserSecurityKeysRepository } from '@/models/_.js'; import type { UserSecurityKeysRepository } from '@/models/_.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
@ -49,7 +49,7 @@ export class WebAuthnService {
const instance = await this.metaService.fetch(); const instance = await this.metaService.fetch();
return { return {
origin: this.config.url, origin: this.config.url,
rpId: this.config.host, rpId: this.config.hostname,
rpName: instance.name ?? this.config.host, rpName: instance.name ?? this.config.host,
rpIcon: instance.iconUrl ?? undefined, rpIcon: instance.iconUrl ?? undefined,
}; };
@ -65,13 +65,12 @@ export class WebAuthnService {
const registrationOptions = await generateRegistrationOptions({ const registrationOptions = await generateRegistrationOptions({
rpName: relyingParty.rpName, rpName: relyingParty.rpName,
rpID: relyingParty.rpId, rpID: relyingParty.rpId,
userID: userId, userID: isoUint8Array.fromUTF8String(userId),
userName: userName, userName: userName,
userDisplayName: userDisplayName, userDisplayName: userDisplayName,
attestationType: 'indirect', attestationType: 'indirect',
excludeCredentials: keys.map(key => (<PublicKeyCredentialDescriptorFuture>{ excludeCredentials: keys.map(key => (<{ id: string; transports?: AuthenticatorTransportFuture[]; }>{
id: Buffer.from(key.id, 'base64url'), id: key.id,
type: 'public-key',
transports: key.transports ?? undefined, transports: key.transports ?? undefined,
})), })),
authenticatorSelection: { authenticatorSelection: {
@ -87,7 +86,7 @@ export class WebAuthnService {
@bindThis @bindThis
public async verifyRegistration(userId: MiUser['id'], response: RegistrationResponseJSON): Promise<{ public async verifyRegistration(userId: MiUser['id'], response: RegistrationResponseJSON): Promise<{
credentialID: Uint8Array; credentialID: string;
credentialPublicKey: Uint8Array; credentialPublicKey: Uint8Array;
attestationObject: Uint8Array; attestationObject: Uint8Array;
fmt: AttestationFormat; fmt: AttestationFormat;
@ -144,6 +143,7 @@ export class WebAuthnService {
@bindThis @bindThis
public async initiateAuthentication(userId: MiUser['id']): Promise<PublicKeyCredentialRequestOptionsJSON> { public async initiateAuthentication(userId: MiUser['id']): Promise<PublicKeyCredentialRequestOptionsJSON> {
const relyingParty = await this.getRelyingParty();
const keys = await this.userSecurityKeysRepository.findBy({ const keys = await this.userSecurityKeysRepository.findBy({
userId: userId, userId: userId,
}); });
@ -153,9 +153,9 @@ export class WebAuthnService {
} }
const authenticationOptions = await generateAuthenticationOptions({ const authenticationOptions = await generateAuthenticationOptions({
allowCredentials: keys.map(key => (<PublicKeyCredentialDescriptorFuture>{ rpID: relyingParty.rpId,
id: Buffer.from(key.id, 'base64url'), allowCredentials: keys.map(key => (<{ id: string; transports?: AuthenticatorTransportFuture[]; }>{
type: 'public-key', id: key.id,
transports: key.transports ?? undefined, transports: key.transports ?? undefined,
})), })),
userVerification: 'preferred', userVerification: 'preferred',
@ -219,7 +219,7 @@ export class WebAuthnService {
expectedOrigin: relyingParty.origin, expectedOrigin: relyingParty.origin,
expectedRPID: relyingParty.rpId, expectedRPID: relyingParty.rpId,
authenticator: { authenticator: {
credentialID: Buffer.from(key.id, 'base64url'), credentialID: key.id,
credentialPublicKey: Buffer.from(key.publicKey, 'base64url'), credentialPublicKey: Buffer.from(key.publicKey, 'base64url'),
counter: key.counter, counter: key.counter,
transports: key.transports ? key.transports as AuthenticatorTransportFuture[] : undefined, transports: key.transports ? key.transports as AuthenticatorTransportFuture[] : undefined,

View File

@ -8,9 +8,8 @@
* https://en.wikipedia.org/wiki/Identicon * https://en.wikipedia.org/wiki/Identicon
*/ */
import * as p from 'pureimage'; import { createCanvas } from '@napi-rs/canvas';
import gen from 'random-seed'; import gen from 'random-seed';
import type { WriteStream } from 'node:fs';
const size = 128; // px const size = 128; // px
const n = 5; // resolution const n = 5; // resolution
@ -45,9 +44,9 @@ const sideN = Math.floor(n / 2);
/** /**
* Generate buffer of an identicon by seed * Generate buffer of an identicon by seed
*/ */
export function genIdenticon(seed: string, stream: WriteStream): Promise<void> { export async function genIdenticon(seed: string): Promise<Buffer> {
const rand = gen.create(seed); const rand = gen.create(seed);
const canvas = p.make(size, size, undefined); const canvas = createCanvas(size, size);
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
const bgColors = colors[rand(colors.length)]; const bgColors = colors[rand(colors.length)];
@ -101,5 +100,5 @@ export function genIdenticon(seed: string, stream: WriteStream): Promise<void> {
} }
} }
return p.encodePNGToStream(canvas, stream); return await canvas.encode('png');
} }

View File

@ -18,7 +18,6 @@ import { DI } from '@/di-symbols.js';
import type Logger from '@/logger.js'; import type Logger from '@/logger.js';
import * as Acct from '@/misc/acct.js'; import * as Acct from '@/misc/acct.js';
import { genIdenticon } from '@/misc/gen-identicon.js'; import { genIdenticon } from '@/misc/gen-identicon.js';
import { createTemp } from '@/misc/create-temp.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js';
import { LoggerService } from '@/core/LoggerService.js'; import { LoggerService } from '@/core/LoggerService.js';
import { bindThis } from '@/decorators.js'; import { bindThis } from '@/decorators.js';
@ -192,9 +191,7 @@ export class ServerService implements OnApplicationShutdown {
reply.header('Cache-Control', 'public, max-age=86400'); reply.header('Cache-Control', 'public, max-age=86400');
if ((await this.metaService.fetch()).enableIdenticonGeneration) { if ((await this.metaService.fetch()).enableIdenticonGeneration) {
const [temp, cleanup] = await createTemp(); return await genIdenticon(request.params.x);
await genIdenticon(request.params.x, fs.createWriteStream(temp));
return fs.createReadStream(temp).on('close', () => cleanup());
} else { } else {
return reply.redirect('/static-assets/avatar.png'); return reply.redirect('/static-assets/avatar.png');
} }

View File

@ -96,10 +96,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
} }
const keyInfo = await this.webAuthnService.verifyRegistration(me.id, ps.credential); const keyInfo = await this.webAuthnService.verifyRegistration(me.id, ps.credential);
const keyId = keyInfo.credentialID;
const credentialId = Buffer.from(keyInfo.credentialID).toString('base64url');
await this.userSecurityKeysRepository.insert({ await this.userSecurityKeysRepository.insert({
id: credentialId, id: keyId,
userId: me.id, userId: me.id,
name: ps.name, name: ps.name,
publicKey: Buffer.from(keyInfo.credentialPublicKey).toString('base64url'), publicKey: Buffer.from(keyInfo.credentialPublicKey).toString('base64url'),
@ -116,7 +116,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
})); }));
return { return {
id: credentialId, id: keyId,
name: ps.name, name: ps.name,
}; };
}); });

View File

@ -199,6 +199,11 @@ export class ClientServerService {
// Authenticate // Authenticate
fastify.addHook('onRequest', async (request, reply) => { fastify.addHook('onRequest', async (request, reply) => {
if (request.routeOptions.url == null) {
reply.code(404).send('Not found');
return;
}
// %71ueueとかでリクエストされたら困るため // %71ueueとかでリクエストされたら困るため
const url = decodeURI(request.routeOptions.url); const url = decodeURI(request.routeOptions.url);
if (url === bullBoardPath || url.startsWith(bullBoardPath + '/')) { if (url === bullBoardPath || url.startsWith(bullBoardPath + '/')) {

View File

@ -36,7 +36,7 @@ html
link(rel='prefetch' href=infoImageUrl) link(rel='prefetch' href=infoImageUrl)
link(rel='prefetch' href=notFoundImageUrl) link(rel='prefetch' href=notFoundImageUrl)
//- https://github.com/misskey-dev/misskey/issues/9842 //- https://github.com/misskey-dev/misskey/issues/9842
link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v2.44.0') link(rel='stylesheet' href='/assets/tabler-icons/tabler-icons.min.css?v3.3.0')
link(rel='modulepreload' href=`/vite/${clientEntry.file}`) link(rel='modulepreload' href=`/vite/${clientEntry.file}`)
if !config.clientManifestExists if !config.clientManifestExists

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<link rel="preload" href="https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true" as="image" type="image/png" crossorigin="anonymous"> <link rel="preload" href="https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true" as="image" type="image/png" crossorigin="anonymous">
<link rel="preload" href="https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true" as="image" type="image/jpeg" crossorigin="anonymous"> <link rel="preload" href="https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true" as="image" type="image/jpeg" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/@tabler/icons-webfont@2.44.0/tabler-icons.min.css"> <link rel="stylesheet" href="https://unpkg.com/@tabler/icons-webfont@3.3.0/tabler-icons.min.css">
<link rel="stylesheet" href="https://unpkg.com/@fontsource/m-plus-rounded-1c/index.css"> <link rel="stylesheet" href="https://unpkg.com/@fontsource/m-plus-rounded-1c/index.css">
<style> <style>
html { html {

View File

@ -17,7 +17,7 @@
"lint": "pnpm typecheck && pnpm eslint" "lint": "pnpm typecheck && pnpm eslint"
}, },
"dependencies": { "dependencies": {
"@discordapp/twemoji": "15.0.2", "@discordapp/twemoji": "15.0.3",
"@github/webauthn-json": "2.1.1", "@github/webauthn-json": "2.1.1",
"@mcaptcha/vanilla-glue": "0.1.0-alpha-3", "@mcaptcha/vanilla-glue": "0.1.0-alpha-3",
"@misskey-dev/browser-image-resizer": "2024.1.0", "@misskey-dev/browser-image-resizer": "2024.1.0",
@ -25,23 +25,23 @@
"@rollup/plugin-replace": "5.0.5", "@rollup/plugin-replace": "5.0.5",
"@rollup/pluginutils": "5.1.0", "@rollup/pluginutils": "5.1.0",
"@syuilo/aiscript": "0.18.0", "@syuilo/aiscript": "0.18.0",
"@tabler/icons-webfont": "2.44.0", "@tabler/icons-webfont": "3.3.0",
"@twemoji/parser": "15.0.0", "@twemoji/parser": "15.1.1",
"@vitejs/plugin-vue": "5.0.4", "@vitejs/plugin-vue": "5.0.4",
"@vue/compiler-sfc": "3.4.21", "@vue/compiler-sfc": "3.4.26",
"aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.1.4", "aiscript-vscode": "github:aiscript-dev/aiscript-vscode#v0.1.4",
"astring": "1.8.6", "astring": "1.8.6",
"broadcast-channel": "7.0.0", "broadcast-channel": "7.0.0",
"buraha": "0.0.1", "buraha": "0.0.1",
"canvas-confetti": "1.9.2", "canvas-confetti": "1.9.3",
"chart.js": "4.4.2", "chart.js": "4.4.2",
"chartjs-adapter-date-fns": "3.0.0", "chartjs-adapter-date-fns": "3.0.0",
"chartjs-chart-matrix": "2.0.1", "chartjs-chart-matrix": "2.0.1",
"chartjs-plugin-gradient": "0.6.1", "chartjs-plugin-gradient": "0.6.1",
"chartjs-plugin-zoom": "2.0.1", "chartjs-plugin-zoom": "2.0.1",
"chromatic": "11.0.0", "chromatic": "11.3.0",
"compare-versions": "6.1.0", "compare-versions": "6.1.0",
"cropperjs": "2.0.0-beta.4", "cropperjs": "2.0.0-beta.5",
"date-fns": "2.30.0", "date-fns": "2.30.0",
"escape-regexp": "0.0.1", "escape-regexp": "0.0.1",
"estree-walker": "3.0.3", "estree-walker": "3.0.3",
@ -57,27 +57,27 @@
"misskey-reversi": "workspace:*", "misskey-reversi": "workspace:*",
"photoswipe": "5.4.3", "photoswipe": "5.4.3",
"punycode": "2.3.1", "punycode": "2.3.1",
"rollup": "4.12.0", "rollup": "4.17.2",
"sanitize-html": "2.12.1", "sanitize-html": "2.13.0",
"sass": "1.71.1", "sass": "1.76.0",
"shiki": "1.2.0", "shiki": "1.4.0",
"strict-event-emitter-types": "2.0.0", "strict-event-emitter-types": "2.0.0",
"textarea-caret": "3.1.0", "textarea-caret": "3.1.0",
"three": "0.162.0", "three": "0.164.1",
"throttle-debounce": "5.0.0", "throttle-debounce": "5.0.0",
"tinycolor2": "1.6.0", "tinycolor2": "1.6.0",
"tsc-alias": "1.8.8", "tsc-alias": "1.8.8",
"tsconfig-paths": "4.2.0", "tsconfig-paths": "4.2.0",
"typescript": "5.3.3", "typescript": "5.4.5",
"uuid": "9.0.1", "uuid": "9.0.1",
"v-code-diff": "1.9.0", "v-code-diff": "1.11.0",
"vite": "5.1.4", "vite": "5.2.11",
"vue": "3.4.21", "vue": "3.4.26",
"vuedraggable": "next" "vuedraggable": "next"
}, },
"devDependencies": { "devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0", "@misskey-dev/eslint-plugin": "1.0.0",
"@misskey-dev/summaly": "5.0.3", "@misskey-dev/summaly": "5.1.0",
"@storybook/addon-actions": "8.0.9", "@storybook/addon-actions": "8.0.9",
"@storybook/addon-essentials": "8.0.9", "@storybook/addon-essentials": "8.0.9",
"@storybook/addon-interactions": "8.0.9", "@storybook/addon-interactions": "8.0.9",
@ -96,46 +96,46 @@
"@storybook/types": "8.0.9", "@storybook/types": "8.0.9",
"@storybook/vue3": "8.0.9", "@storybook/vue3": "8.0.9",
"@storybook/vue3-vite": "8.0.9", "@storybook/vue3-vite": "8.0.9",
"@testing-library/vue": "8.0.2", "@testing-library/vue": "8.0.3",
"@types/escape-regexp": "0.0.3", "@types/escape-regexp": "0.0.3",
"@types/estree": "1.0.5", "@types/estree": "1.0.5",
"@types/matter-js": "0.19.6", "@types/matter-js": "0.19.6",
"@types/micromatch": "4.0.6", "@types/micromatch": "4.0.7",
"@types/node": "20.11.22", "@types/node": "20.12.7",
"@types/punycode": "2.1.4", "@types/punycode": "2.1.4",
"@types/sanitize-html": "2.11.0", "@types/sanitize-html": "2.11.0",
"@types/throttle-debounce": "5.0.2", "@types/throttle-debounce": "5.0.2",
"@types/tinycolor2": "1.4.6", "@types/tinycolor2": "1.4.6",
"@types/uuid": "9.0.8", "@types/uuid": "9.0.8",
"@types/ws": "8.5.10", "@types/ws": "8.5.10",
"@typescript-eslint/eslint-plugin": "7.1.0", "@typescript-eslint/eslint-plugin": "7.7.1",
"@typescript-eslint/parser": "7.1.0", "@typescript-eslint/parser": "7.7.1",
"@vitest/coverage-v8": "0.34.6", "@vitest/coverage-v8": "0.34.6",
"@vue/runtime-core": "3.4.21", "@vue/runtime-core": "3.4.26",
"acorn": "8.11.3", "acorn": "8.11.3",
"cross-env": "7.0.3", "cross-env": "7.0.3",
"cypress": "13.6.6", "cypress": "13.8.1",
"eslint": "8.57.0", "eslint": "8.57.0",
"eslint-plugin-import": "2.29.1", "eslint-plugin-import": "2.29.1",
"eslint-plugin-vue": "9.22.0", "eslint-plugin-vue": "9.25.0",
"fast-glob": "3.3.2", "fast-glob": "3.3.2",
"happy-dom": "13.6.2", "happy-dom": "14.7.1",
"intersection-observer": "0.12.2", "intersection-observer": "0.12.2",
"micromatch": "4.0.5", "micromatch": "4.0.5",
"msw": "2.1.7", "msw": "2.2.14",
"msw-storybook-addon": "2.0.0-beta.1", "msw-storybook-addon": "2.0.1",
"nodemon": "3.1.0", "nodemon": "3.1.0",
"prettier": "3.2.5", "prettier": "3.2.5",
"react": "18.2.0", "react": "18.3.1",
"react-dom": "18.2.0", "react-dom": "18.3.1",
"start-server-and-test": "2.0.3", "start-server-and-test": "2.0.3",
"storybook": "8.0.9", "storybook": "8.0.9",
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme", "storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
"vite-plugin-turbosnap": "1.0.3", "vite-plugin-turbosnap": "1.0.3",
"vitest": "0.34.6", "vitest": "0.34.6",
"vitest-fetch-mock": "0.2.2", "vitest-fetch-mock": "0.2.2",
"vue-component-type-helpers": "1.8.27", "vue-component-type-helpers": "2.0.16",
"vue-eslint-parser": "9.4.2", "vue-eslint-parser": "9.4.2",
"vue-tsc": "1.8.27" "vue-tsc": "2.0.16"
} }
} }

View File

@ -6,7 +6,7 @@
// devモードで起動される際index.htmlを使うときはrouterが暴発してしまってうまく読み込めない。 // devモードで起動される際index.htmlを使うときはrouterが暴発してしまってうまく読み込めない。
// よって、devモードとして起動されるときはビルド時に組み込む形としておく。 // よって、devモードとして起動されるときはビルド時に組み込む形としておく。
// (pnpm start時はpugファイルの中で静的リソースとして読み込むようになっており、この問題は起こっていない) // (pnpm start時はpugファイルの中で静的リソースとして読み込むようになっており、この問題は起こっていない)
import '@tabler/icons-webfont/tabler-icons.scss'; import '@tabler/icons-webfont/dist/tabler-icons.scss';
await main(); await main();

View File

@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
<div class="detail"> <div class="detail">
<div> <div>
<Mfm :text="report.comment" :linkBehavior="'window'"/> <Mfm :text="report.comment" :linkNavigationBehavior="'window'"/>
</div> </div>
<hr/> <hr/>
<div>{{ i18n.ts.reporter }}: <MkA :to="`/admin/user/${report.reporter.id}`" class="_link" :behavior="'window'">@{{ report.reporter.username }}</MkA></div> <div>{{ i18n.ts.reporter }}: <MkA :to="`/admin/user/${report.reporter.id}`" class="_link" :behavior="'window'">@{{ report.reporter.username }}</MkA></div>

View File

@ -44,6 +44,8 @@ SPDX-License-Identifier: AGPL-3.0-only
:instant="true" :instant="true"
:initialText="c.form?.text" :initialText="c.form?.text"
:initialCw="c.form?.cw" :initialCw="c.form?.cw"
:initialVisibility="c.form?.visibility"
:initialLocalOnly="c.form?.localOnly"
/> />
</div> </div>
<MkFolder v-else-if="c.type === 'folder'" :defaultOpen="c.opened"> <MkFolder v-else-if="c.type === 'folder'" :defaultOpen="c.opened">
@ -111,6 +113,8 @@ function openPostForm() {
os.post({ os.post({
initialText: form.text, initialText: form.text,
initialCw: form.cw, initialCw: form.cw,
initialVisibility: form.visibility,
initialLocalOnly: form.localOnly,
instant: true, instant: true,
}); });
} }

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template> <template>
<component <component
:is="self ? 'MkA' : 'a'" ref="el" style="word-break: break-all;" class="_link" :[attr]="self ? url.substring(local.length) : url" :rel="rel ?? 'nofollow noopener'" :target="target" :is="self ? 'MkA' : 'a'" ref="el" style="word-break: break-all;" class="_link" :[attr]="self ? url.substring(local.length) : url" :rel="rel ?? 'nofollow noopener'" :target="target"
:behavior="props.behavior" :behavior="props.navigationBehavior"
:title="url" :title="url"
> >
<slot></slot> <slot></slot>
@ -25,7 +25,7 @@ import { MkABehavior } from '@/components/global/MkA.vue';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
url: string; url: string;
rel?: null | string; rel?: null | string;
behavior?: MkABehavior; navigationBehavior?: MkABehavior;
}>(), { }>(), {
}); });

View File

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
--> -->
<template> <template>
<MkA v-user-preview="canonical" :class="[$style.root, { [$style.isMe]: isMe }]" :to="url" :style="{ background: bgCss }" :behavior="behavior"> <MkA v-user-preview="canonical" :class="[$style.root, { [$style.isMe]: isMe }]" :to="url" :style="{ background: bgCss }" :behavior="navigationBehavior">
<img :class="$style.icon" :src="avatarUrl" alt=""> <img :class="$style.icon" :src="avatarUrl" alt="">
<span> <span>
<span>@{{ username }}</span> <span>@{{ username }}</span>
@ -26,7 +26,7 @@ import { MkABehavior } from '@/components/global/MkA.vue';
const props = defineProps<{ const props = defineProps<{
username: string; username: string;
host: string; host: string;
behavior?: MkABehavior; navigationBehavior?: MkABehavior;
}>(); }>();
const canonical = props.host === localHost ? `@${props.username}` : `@${props.username}@${toUnicode(props.host)}`; const canonical = props.host === localHost ? `@${props.username}` : `@${props.username}@${toUnicode(props.host)}`;

View File

@ -14,7 +14,7 @@ export type MkABehavior = 'window' | 'browser' | null;
</script> </script>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, shallowRef } from 'vue'; import { computed, inject, shallowRef } from 'vue';
import * as os from '@/os.js'; import * as os from '@/os.js';
import copyToClipboard from '@/scripts/copy-to-clipboard.js'; import copyToClipboard from '@/scripts/copy-to-clipboard.js';
import { url } from '@/config.js'; import { url } from '@/config.js';
@ -30,7 +30,7 @@ const props = withDefaults(defineProps<{
behavior: null, behavior: null,
}); });
const linkBehaviour = props.behavior; const behavior = props.behavior ?? inject<MkABehavior>('linkNavigationBehavior', null);
const el = shallowRef<HTMLElement>(); const el = shallowRef<HTMLElement>();
@ -86,15 +86,13 @@ function openWindow() {
} }
function nav(ev: MouseEvent) { function nav(ev: MouseEvent) {
if (props.behavior === 'browser') { if (behavior === 'browser') {
location.href = props.to; location.href = props.to;
return; return;
} }
if (props.behavior) { if (behavior === 'window') {
if (props.behavior === 'window') { return openWindow();
return openWindow();
}
} }
if (ev.shiftKey) { if (ev.shiftKey) {

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-only * SPDX-License-Identifier: AGPL-3.0-only
*/ */
import { VNode, h, SetupContext } from 'vue'; import { VNode, h, SetupContext, provide } from 'vue';
import * as mfm from 'mfm-js'; import * as mfm from 'mfm-js';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import MkUrl from '@/components/global/MkUrl.vue'; import MkUrl from '@/components/global/MkUrl.vue';
@ -43,7 +43,7 @@ type MfmProps = {
parsedNodes?: mfm.MfmNode[] | null; parsedNodes?: mfm.MfmNode[] | null;
enableEmojiMenu?: boolean; enableEmojiMenu?: boolean;
enableEmojiMenuReaction?: boolean; enableEmojiMenuReaction?: boolean;
linkBehavior?: MkABehavior; linkNavigationBehavior?: MkABehavior;
}; };
type MfmEvents = { type MfmEvents = {
@ -52,6 +52,8 @@ type MfmEvents = {
// eslint-disable-next-line import/no-default-export // eslint-disable-next-line import/no-default-export
export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEvents>['emit'] }) { export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEvents>['emit'] }) {
provide('linkNavigationBehavior', props.linkNavigationBehavior);
const isNote = props.isNote ?? true; const isNote = props.isNote ?? true;
const shouldNyaize = props.nyaize ? props.nyaize === 'respect' ? props.author?.isCat : false : false; const shouldNyaize = props.nyaize ? props.nyaize === 'respect' ? props.author?.isCat : false : false;
@ -343,7 +345,6 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
key: Math.random(), key: Math.random(),
url: token.props.url, url: token.props.url,
rel: 'nofollow noopener', rel: 'nofollow noopener',
behavior: props.linkBehavior,
})]; })];
} }
@ -352,7 +353,6 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
key: Math.random(), key: Math.random(),
url: token.props.url, url: token.props.url,
rel: 'nofollow noopener', rel: 'nofollow noopener',
behavior: props.linkBehavior,
}, genEl(token.children, scale, true))]; }, genEl(token.children, scale, true))];
} }
@ -361,7 +361,6 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
key: Math.random(), key: Math.random(),
host: (token.props.host == null && props.author && props.author.host != null ? props.author.host : token.props.host) ?? host, host: (token.props.host == null && props.author && props.author.host != null ? props.author.host : token.props.host) ?? host,
username: token.props.username, username: token.props.username,
behavior: props.linkBehavior,
})]; })];
} }
@ -370,7 +369,6 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
key: Math.random(), key: Math.random(),
to: isNote ? `/tags/${encodeURIComponent(token.props.hashtag)}` : `/user-tags/${encodeURIComponent(token.props.hashtag)}`, to: isNote ? `/tags/${encodeURIComponent(token.props.hashtag)}` : `/user-tags/${encodeURIComponent(token.props.hashtag)}`,
style: 'color:var(--hashtag);', style: 'color:var(--hashtag);',
behavior: props.linkBehavior,
}, `#${token.props.hashtag}`)]; }, `#${token.props.hashtag}`)];
} }

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template> <template>
<component <component
:is="self ? 'MkA' : 'a'" ref="el" :class="$style.root" class="_link" :[attr]="self ? props.url.substring(local.length) : props.url" :rel="rel ?? 'nofollow noopener'" :target="target" :is="self ? 'MkA' : 'a'" ref="el" :class="$style.root" class="_link" :[attr]="self ? props.url.substring(local.length) : props.url" :rel="rel ?? 'nofollow noopener'" :target="target"
:behavior = "props.behavior" :behavior="props.navigationBehavior"
@contextmenu.stop="() => {}" @contextmenu.stop="() => {}"
> >
<template v-if="!self"> <template v-if="!self">
@ -38,7 +38,7 @@ const props = withDefaults(defineProps<{
url: string; url: string;
rel?: string; rel?: string;
showUrlPreview?: boolean; showUrlPreview?: boolean;
behavior?: MkABehavior; navigationBehavior?: MkABehavior;
}>(), { }>(), {
showUrlPreview: true, showUrlPreview: true,
}); });

View File

@ -416,7 +416,7 @@ async function assignRole() {
if (canceled) return; if (canceled) return;
const { canceled: canceled2, result: period } = await os.select({ const { canceled: canceled2, result: period } = await os.select({
title: i18n.ts.period, title: i18n.ts.period + ': ' + roles.find(r => r.id === roleId)!.name,
items: [{ items: [{
value: 'indefinitely', text: i18n.ts.indefinitely, value: 'indefinitely', text: i18n.ts.indefinitely,
}, { }, {

View File

@ -119,7 +119,7 @@ async function assign() {
const user = await os.selectUser({ includeSelf: true }); const user = await os.selectUser({ includeSelf: true });
const { canceled: canceled2, result: period } = await os.select({ const { canceled: canceled2, result: period } = await os.select({
title: i18n.ts.period, title: i18n.ts.period + ': ' + role.name,
items: [{ items: [{
value: 'indefinitely', text: i18n.ts.indefinitely, value: 'indefinitely', text: i18n.ts.indefinitely,
}, { }, {

View File

@ -6,6 +6,7 @@
import { utils, values } from '@syuilo/aiscript'; import { utils, values } from '@syuilo/aiscript';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import { ref, Ref } from 'vue'; import { ref, Ref } from 'vue';
import * as Misskey from 'misskey-js';
export type AsUiComponentBase = { export type AsUiComponentBase = {
id: string; id: string;
@ -115,23 +116,24 @@ export type AsUiFolder = AsUiComponentBase & {
opened?: boolean; opened?: boolean;
}; };
type PostFormPropsForAsUi = {
text: string;
cw?: string;
visibility?: (typeof Misskey.noteVisibilities)[number];
localOnly?: boolean;
};
export type AsUiPostFormButton = AsUiComponentBase & { export type AsUiPostFormButton = AsUiComponentBase & {
type: 'postFormButton'; type: 'postFormButton';
text?: string; text?: string;
primary?: boolean; primary?: boolean;
rounded?: boolean; rounded?: boolean;
form?: { form?: PostFormPropsForAsUi;
text: string;
cw?: string;
};
}; };
export type AsUiPostForm = AsUiComponentBase & { export type AsUiPostForm = AsUiComponentBase & {
type: 'postForm'; type: 'postForm';
form?: { form?: PostFormPropsForAsUi;
text: string;
cw?: string;
};
}; };
export type AsUiComponent = AsUiRoot | AsUiContainer | AsUiText | AsUiMfm | AsUiButton | AsUiButtons | AsUiSwitch | AsUiTextarea | AsUiTextInput | AsUiNumberInput | AsUiSelect | AsUiFolder | AsUiPostFormButton | AsUiPostForm; export type AsUiComponent = AsUiRoot | AsUiContainer | AsUiText | AsUiMfm | AsUiButton | AsUiButtons | AsUiSwitch | AsUiTextarea | AsUiTextInput | AsUiNumberInput | AsUiSelect | AsUiFolder | AsUiPostFormButton | AsUiPostForm;
@ -447,6 +449,24 @@ function getFolderOptions(def: values.Value | undefined): Omit<AsUiFolder, 'id'
}; };
} }
function getPostFormProps(form: values.VObj): PostFormPropsForAsUi {
const text = form.value.get('text');
utils.assertString(text);
const cw = form.value.get('cw');
if (cw) utils.assertString(cw);
const visibility = form.value.get('visibility');
if (visibility) utils.assertString(visibility);
const localOnly = form.value.get('localOnly');
if (localOnly) utils.assertBoolean(localOnly);
return {
text: text.value,
cw: cw?.value,
visibility: (visibility?.value && (Misskey.noteVisibilities as readonly string[]).includes(visibility.value)) ? visibility.value as typeof Misskey.noteVisibilities[number] : undefined,
localOnly: localOnly?.value,
};
}
function getPostFormButtonOptions(def: values.Value | undefined, call: (fn: values.VFn, args: values.Value[]) => Promise<values.Value>): Omit<AsUiPostFormButton, 'id' | 'type'> { function getPostFormButtonOptions(def: values.Value | undefined, call: (fn: values.VFn, args: values.Value[]) => Promise<values.Value>): Omit<AsUiPostFormButton, 'id' | 'type'> {
utils.assertObject(def); utils.assertObject(def);
@ -459,22 +479,11 @@ function getPostFormButtonOptions(def: values.Value | undefined, call: (fn: valu
const form = def.value.get('form'); const form = def.value.get('form');
if (form) utils.assertObject(form); if (form) utils.assertObject(form);
const getForm = () => {
const text = form!.value.get('text');
utils.assertString(text);
const cw = form!.value.get('cw');
if (cw) utils.assertString(cw);
return {
text: text.value,
cw: cw?.value,
};
};
return { return {
text: text?.value, text: text?.value,
primary: primary?.value, primary: primary?.value,
rounded: rounded?.value, rounded: rounded?.value,
form: form ? getForm() : { form: form ? getPostFormProps(form) : {
text: '', text: '',
}, },
}; };
@ -486,19 +495,8 @@ function getPostFormOptions(def: values.Value | undefined, call: (fn: values.VFn
const form = def.value.get('form'); const form = def.value.get('form');
if (form) utils.assertObject(form); if (form) utils.assertObject(form);
const getForm = () => {
const text = form!.value.get('text');
utils.assertString(text);
const cw = form!.value.get('cw');
if (cw) utils.assertString(cw);
return {
text: text.value,
cw: cw?.value,
};
};
return { return {
form: form ? getForm() : { form: form ? getPostFormProps(form) : {
text: '', text: '',
}, },
}; };

View File

@ -272,7 +272,7 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter
text: r.name, text: r.name,
action: async () => { action: async () => {
const { canceled, result: period } = await os.select({ const { canceled, result: period } = await os.select({
title: i18n.ts.period, title: i18n.ts.period + ': ' + r.name,
items: [{ items: [{
value: 'indefinitely', text: i18n.ts.indefinitely, value: 'indefinitely', text: i18n.ts.indefinitely,
}, { }, {

View File

@ -33,13 +33,13 @@
"url": "git+https://github.com/misskey-dev/misskey.js.git" "url": "git+https://github.com/misskey-dev/misskey.js.git"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/api-extractor": "7.39.1", "@microsoft/api-extractor": "7.43.1",
"@misskey-dev/eslint-plugin": "1.0.0", "@misskey-dev/eslint-plugin": "1.0.0",
"@swc/jest": "0.2.31", "@swc/jest": "0.2.36",
"@types/jest": "29.5.12", "@types/jest": "29.5.12",
"@types/node": "20.11.22", "@types/node": "20.12.7",
"@typescript-eslint/eslint-plugin": "7.1.0", "@typescript-eslint/eslint-plugin": "7.7.1",
"@typescript-eslint/parser": "7.1.0", "@typescript-eslint/parser": "7.7.1",
"eslint": "8.57.0", "eslint": "8.57.0",
"jest": "29.7.0", "jest": "29.7.0",
"jest-fetch-mock": "3.0.3", "jest-fetch-mock": "3.0.3",
@ -49,9 +49,9 @@
"nodemon": "3.1.0", "nodemon": "3.1.0",
"execa": "8.0.1", "execa": "8.0.1",
"tsd": "0.30.7", "tsd": "0.30.7",
"typescript": "5.3.3", "typescript": "5.4.5",
"esbuild": "0.19.11", "esbuild": "0.19.11",
"glob": "10.3.10" "glob": "10.3.12"
}, },
"files": [ "files": [
"built" "built"

View File

@ -9,18 +9,18 @@
"lint": "pnpm typecheck && pnpm eslint" "lint": "pnpm typecheck && pnpm eslint"
}, },
"dependencies": { "dependencies": {
"esbuild": "0.19.11", "esbuild": "0.20.2",
"idb-keyval": "6.2.1", "idb-keyval": "6.2.1",
"misskey-js": "workspace:*" "misskey-js": "workspace:*"
}, },
"devDependencies": { "devDependencies": {
"@misskey-dev/eslint-plugin": "1.0.0", "@misskey-dev/eslint-plugin": "1.0.0",
"@typescript-eslint/parser": "7.1.0", "@typescript-eslint/parser": "7.7.1",
"@typescript/lib-webworker": "npm:@types/serviceworker@0.0.67", "@typescript/lib-webworker": "npm:@types/serviceworker@0.0.67",
"eslint": "8.57.0", "eslint": "8.57.0",
"eslint-plugin-import": "2.29.1", "eslint-plugin-import": "2.29.1",
"nodemon": "3.1.0", "nodemon": "3.1.0",
"typescript": "5.3.3" "typescript": "5.4.5"
}, },
"type": "module" "type": "module"
} }

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@ async function copyFrontendFonts() {
} }
async function copyFrontendTablerIcons() { async function copyFrontendTablerIcons() {
await fs.cp('./packages/frontend/node_modules/@tabler/icons-webfont', './built/_frontend_dist_/tabler-icons', { dereference: true, recursive: true }); await fs.cp('./packages/frontend/node_modules/@tabler/icons-webfont/dist', './built/_frontend_dist_/tabler-icons', { dereference: true, recursive: true });
} }
async function copyFrontendLocales() { async function copyFrontendLocales() {