Skip to content

Commit

Permalink
Merge tag '2024.5.0-io.8' into host
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid committed Feb 1, 2025
2 parents 538563a + a55ee2c commit 9e2fbb4
Show file tree
Hide file tree
Showing 68 changed files with 2,233 additions and 2,114 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-misskey-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4.2.0
with:
node-version-file: '.node-version'
cache: 'pnpm'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4.1.0
- uses: actions/setup-node@v4.2.0
with:
node-version-file: '.node-version'
cache: 'pnpm'
Expand All @@ -56,7 +56,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4.1.0
- uses: actions/setup-node@v4.2.0
with:
node-version-file: '.node-version'
cache: 'pnpm'
Expand All @@ -80,7 +80,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4.1.0
- uses: actions/setup-node@v4.2.0
with:
node-version-file: '.node-version'
cache: 'pnpm'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Install FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4.2.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4.2.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4.2.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-misskey-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run_install: false

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4.2.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4.2.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-api-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
run_install: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4.1.0
uses: actions/setup-node@v4.2.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
Expand Down
19 changes: 2 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,25 +115,10 @@ pnpm dev
command.

- Server-side source files and automatically builds them if they are modified. Automatically start the server process(es).
- Vite HMR (just the `vite` command) is available. The behavior may be different from production.
- Service Worker is watched by esbuild.
- The front end can be viewed by accessing `http://localhost:5173`.
- The backend listens on the port configured with `port` in .config/default.yml.
If you have not changed it from the default, it will be "http://localhost:3000".
If "port" in .config/default.yml is set to something other than 3000, you need to change the proxy settings in packages/frontend/vite.config.local-dev.ts.

### `MK_DEV_PREFER=backend pnpm dev`
pnpm dev has another mode with `MK_DEV_PREFER=backend`.

```
MK_DEV_PREFER=backend pnpm dev
```

- This mode is closer to the production environment than the default mode.
- Vite runs behind the backend (the backend will proxy Vite at /vite).
- Vite HMR (just the `vite` command) is available. The behavior may be different from production.
- Vite runs behind the backend (the backend will proxy Vite at /vite except for websocket used for HMR).
- You can see Misskey by accessing `http://localhost:3000` (Replace `3000` with the port configured with `port` in .config/default.yml).
- To change the port of Vite, specify with `VITE_PORT` environment variable.
- HMR may not work in some environments such as Windows.

### Dev Container
Instead of running `pnpm` locally, you can use Dev Container to set up your development environment.
Expand Down
4 changes: 3 additions & 1 deletion locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,9 @@ _accountMigration:
migrationConfirm: "Really migrate this account to {account}? Once started, this process cannot be stopped or taken back, and you will not be able to use this account in its original state anymore."
movedAndCannotBeUndone: "\nThis account has been migrated.\nMigration cannot be reversed."
postMigrationNote: "This account will unfollow all accounts it is currently following 24 hours after migration finishes.\nBoth the number of follows and followers will then become zero. To avoid your followers from being unable to see followers only posts of this account, they will however continue following this account."
movedTo: "New account:"
movedTo: "Migrated account:"
movedToServer: "Migrated server"
movedFromServer: "Original server"
_achievements:
earnedAt: "Unlocked at"
_types:
Expand Down
8 changes: 8 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6004,6 +6004,14 @@ export interface Locale extends ILocale {
* 移行先のアカウント:
*/
"movedTo": string;
/**
* 移行先のサーバー
*/
"movedToServer": string;
/**
* 移行元のサーバー
*/
"movedFromServer": string;
};
"_achievements": {
/**
Expand Down
2 changes: 2 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1511,6 +1511,8 @@ _accountMigration:
movedAndCannotBeUndone: "\nアカウントは移行されています。\n移行を取り消すことはできません。"
postMigrationNote: "このアカウントからのフォロー解除は移行操作から24時間後に実行されます。\nこのアカウントのフォロー・フォロワー数は0になっています。フォロワーの解除はされないため、あなたのフォロワーはこのアカウントのフォロワー向け投稿を引き続き閲覧できます。"
movedTo: "移行先のアカウント:"
movedToServer: "移行先のサーバー"
movedFromServer: "移行元のサーバー"

_achievements:
earnedAt: "獲得日時"
Expand Down
2 changes: 2 additions & 0 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,8 @@ _accountMigration:
movedAndCannotBeUndone: "\n이사한 계정입니다.\n이사는 취소할 수 없습니다."
postMigrationNote: "이 계정의 팔로잉 해제는 이사 후 24시간 뒤에 실행됩니다.\n이 계정의 팔로우 및 팔로워 수는 0으로 표시됩니다. 팔로워 해제는 이루어지지 않으므로, 당신의 팔로워는 이 계정의 팔로워 한정 게시물을 계속해서 열람할 수 있습니다."
movedTo: "이사할 계정:"
movedToServer: "이사한 서버"
movedFromServer: "기존 서버"
_achievements:
earnedAt: "달성 일시"
_types:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "2024.5.0-host.7c",
"version": "2024.5.0-host.8",
"codename": "nasubi",
"repository": {
"type": "git",
Expand Down Expand Up @@ -68,11 +68,11 @@
"typescript": "5.7.3"
},
"devDependencies": {
"@types/node": "22.10.7",
"@types/node": "22.13.0",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"cross-env": "7.0.3",
"cypress": "13.17.0",
"cypress": "14.0.1",
"eslint": "8.57.1",
"ncp": "2.0.0",
"start-server-and-test": "2.0.10"
Expand Down
62 changes: 31 additions & 31 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
"generate-api-json": "pnpm build && node ./scripts/generate_api_json.js"
},
"optionalDependencies": {
"@swc/core-darwin-arm64": "1.10.7",
"@swc/core-darwin-x64": "1.10.7",
"@swc/core-linux-arm-gnueabihf": "1.10.7",
"@swc/core-linux-arm64-gnu": "1.10.7",
"@swc/core-linux-arm64-musl": "1.10.7",
"@swc/core-linux-x64-gnu": "1.10.7",
"@swc/core-linux-x64-musl": "1.10.7",
"@swc/core-win32-arm64-msvc": "1.10.7",
"@swc/core-win32-ia32-msvc": "1.10.7",
"@swc/core-win32-x64-msvc": "1.10.7",
"@swc/core-darwin-arm64": "1.10.12",
"@swc/core-darwin-x64": "1.10.12",
"@swc/core-linux-arm-gnueabihf": "1.10.12",
"@swc/core-linux-arm64-gnu": "1.10.12",
"@swc/core-linux-arm64-musl": "1.10.12",
"@swc/core-linux-x64-gnu": "1.10.12",
"@swc/core-linux-x64-musl": "1.10.12",
"@swc/core-win32-arm64-msvc": "1.10.12",
"@swc/core-win32-ia32-msvc": "1.10.12",
"@swc/core-win32-x64-msvc": "1.10.12",
"@tensorflow/tfjs": "4.22.0",
"@tensorflow/tfjs-node": "4.22.0",
"bufferutil": "4.0.9",
Expand All @@ -63,11 +63,11 @@
},
"dependencies": {
"@authenio/samlify-node-xmllint": "2.0.0",
"@aws-sdk/client-s3": "3.729.0",
"@aws-sdk/lib-storage": "3.729.0",
"@bull-board/api": "6.6.2",
"@bull-board/fastify": "6.6.2",
"@bull-board/ui": "6.6.2",
"@aws-sdk/client-s3": "3.740.0",
"@aws-sdk/lib-storage": "3.740.0",
"@bull-board/api": "6.7.4",
"@bull-board/fastify": "6.7.4",
"@bull-board/ui": "6.7.4",
"@discordapp/twemoji": "15.1.0",
"@elastic/elasticsearch": "8.17.0",
"@fastify/accepts": "5.0.2",
Expand All @@ -76,21 +76,21 @@
"@fastify/express": "4.0.2",
"@fastify/formbody": "8.0.2",
"@fastify/http-proxy": "11.0.1",
"@fastify/multipart": "9.0.2",
"@fastify/multipart": "9.0.3",
"@fastify/static": "8.0.4",
"@fastify/view": "10.0.2",
"@misskey-dev/sharp-read-bmp": "1.2.0",
"@misskey-dev/summaly": "github:MisskeyIO/summaly#5.1.3",
"@napi-rs/canvas": "0.1.65",
"@nestjs/common": "10.4.15",
"@nestjs/core": "10.4.15",
"@nestjs/testing": "10.4.15",
"@nestjs/common": "11.0.7",
"@nestjs/core": "11.0.7",
"@nestjs/testing": "11.0.7",
"@peertube/http-signature": "1.7.0",
"@simplewebauthn/server": "13.1.0",
"@simplewebauthn/server": "13.1.1",
"@sinonjs/fake-timers": "11.3.1",
"@smithy/node-http-handler": "4.0.2",
"@swc/cli": "0.6.0",
"@swc/core": "1.10.7",
"@swc/core": "1.10.12",
"@twemoji/parser": "15.1.1",
"accepts": "1.3.8",
"ajv": "8.17.1",
Expand All @@ -99,7 +99,7 @@
"bcryptjs": "2.4.3",
"blurhash": "2.0.5",
"body-parser": "1.20.3",
"bullmq": "5.34.10",
"bullmq": "5.39.1",
"cacheable-lookup": "7.0.0",
"cbor": "10.0.3",
"chalk": "5.4.1",
Expand All @@ -114,7 +114,7 @@
"fastify-http-errors-enhanced": "6.0.1",
"fastify-raw-body": "5.0.0",
"feed": "4.2.2",
"file-type": "20.0.0",
"file-type": "20.0.1",
"fluent-ffmpeg": "2.1.3",
"form-data": "4.0.1",
"got": "14.4.5",
Expand All @@ -131,7 +131,7 @@
"json5": "2.2.3",
"jsonld": "8.3.3",
"jsrsasign": "11.1.0",
"meilisearch": "0.48.0",
"meilisearch": "0.48.2",
"mfm-js": "0.24.0",
"microformats-parser": "2.0.2",
"mime-types": "2.1.35",
Expand All @@ -142,7 +142,7 @@
"nested-property": "4.0.0",
"node-fetch": "3.3.2",
"node-forge": "1.3.1",
"nodemailer": "6.9.16",
"nodemailer": "6.10.0",
"nsfwjs": "4.2.0",
"oauth": "0.10.0",
"oauth2orize": "1.12.0",
Expand Down Expand Up @@ -191,7 +191,7 @@
"devDependencies": {
"@jest/globals": "29.7.0",
"@misskey-dev/eslint-plugin": "1.0.0",
"@nestjs/platform-express": "10.4.15",
"@nestjs/platform-express": "11.0.7",
"@swc/jest": "0.2.37",
"@types/accepts": "1.3.7",
"@types/archiver": "6.0.3",
Expand All @@ -208,14 +208,14 @@
"@types/jsonld": "1.5.15",
"@types/jsrsasign": "10.5.15",
"@types/mime-types": "2.1.4",
"@types/ms": "0.7.34",
"@types/node": "22.10.7",
"@types/ms": "2.1.0",
"@types/node": "22.13.0",
"@types/node-forge": "1.3.11",
"@types/nodemailer": "6.4.17",
"@types/oauth": "0.9.6",
"@types/oauth2orize": "1.11.5",
"@types/oauth2orize-pkce": "0.1.2",
"@types/pg": "8.11.10",
"@types/pg": "8.11.11",
"@types/psl": "1.1.3",
"@types/pug": "2.0.10",
"@types/punycode.js": "npm:@types/[email protected]",
Expand All @@ -231,7 +231,7 @@
"@types/tmp": "0.2.6",
"@types/vary": "1.1.3",
"@types/web-push": "3.6.4",
"@types/ws": "8.5.13",
"@types/ws": "8.5.14",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"aws-sdk-client-mock": "4.1.0",
Expand All @@ -243,7 +243,7 @@
"jest": "29.7.0",
"jest-mock": "29.7.0",
"nodemon": "3.1.9",
"pid-port": "1.0.0",
"pid-port": "1.0.2",
"simple-oauth2": "5.1.0"
}
}
19 changes: 16 additions & 3 deletions packages/backend/src/core/RoleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
* 指定ユーザーのバッジロール一覧取得
*/
@bindThis
public async getUserBadgeRoles(userId: MiUser['id']) {
public async getUserBadgeRoles(userId: MiUser['id'], publicOnly: boolean) {
const now = Date.now();
let assigns = await this.roleAssignmentByUserIdCache.fetch(userId, () => this.roleAssignmentsRepository.findBy({ userId }));
// 期限切れのロールを除外
Expand All @@ -362,12 +362,25 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
if (badgeCondRoles.length > 0) {
const user = roles.some(r => r.target === 'conditional') ? await this.cacheService.findUserById(userId) : null;
const matchedBadgeCondRoles = badgeCondRoles.filter(r => this.evalCond(user!, assignedRoles, r.condFormula));
return [...assignedBadgeRoles, ...matchedBadgeCondRoles];
return this.sortAndMapBadgeRoles([...assignedBadgeRoles, ...matchedBadgeCondRoles], publicOnly);
} else {
return assignedBadgeRoles;
return this.sortAndMapBadgeRoles(assignedBadgeRoles, publicOnly);
}
}

@bindThis
private sortAndMapBadgeRoles(roles: MiRole[], publicOnly: boolean) {
return roles
.filter((r) => r.isPublic || !publicOnly)
.sort((a, b) => b.displayOrder - a.displayOrder)
.map((r) => ({
name: r.name,
iconUrl: r.iconUrl,
displayOrder: r.displayOrder,
behavior: r.badgeBehavior ?? undefined,
}));
}

@bindThis
public async getUserPolicies(userId: MiUser['id'] | null): Promise<RolePolicies> {
const meta = await this.metaService.fetch();
Expand Down
3 changes: 1 addition & 2 deletions packages/backend/src/core/entities/DriveFileEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ export class DriveFileEntityService {
@bindThis
private getProxiedUrl(url: string, mode?: 'static' | 'avatar'): string {
return appendQuery(
`${this.config.mediaProxy}/${mode ?? 'image'}.webp`,
`${this.config.mediaProxy}/${mode ?? 'image'}/${encodeURIComponent(url)}`,
query({
url,
...(mode ? { [mode]: '1' } : {}),
}),
);
Expand Down
Loading

0 comments on commit 9e2fbb4

Please sign in to comment.