From 37615772e0d171d80d39defe13efcd9514b300ff Mon Sep 17 00:00:00 2001 From: sugar Date: Sun, 12 Jan 2025 04:27:55 +0100 Subject: [PATCH 01/14] Update action workflows to work for this fork Fixes #31. --- .../workflows/check-misskey-js-version.yml | 4 +- .github/workflows/docker-beta.yml | 52 ------------------ .github/workflows/docker-host.yml | 54 ------------------- .github/workflows/docker-io.yml | 54 ------------------- .github/workflows/dockle.yml | 38 ------------- .github/workflows/labeler.yml | 16 ------ .github/workflows/lint.yml | 4 +- .github/workflows/test-backend.yml | 18 ++----- .github/workflows/test-frontend.yml | 7 +-- .github/workflows/test-misskey-js.yml | 10 +--- .github/workflows/test-production.yml | 4 +- .github/workflows/validate-api-json.yml | 4 +- 12 files changed, 9 insertions(+), 256 deletions(-) delete mode 100644 .github/workflows/docker-beta.yml delete mode 100644 .github/workflows/docker-host.yml delete mode 100644 .github/workflows/docker-io.yml delete mode 100644 .github/workflows/dockle.yml delete mode 100644 .github/workflows/labeler.yml diff --git a/.github/workflows/check-misskey-js-version.yml b/.github/workflows/check-misskey-js-version.yml index 6a70cc0fe..26c4b654b 100644 --- a/.github/workflows/check-misskey-js-version.yml +++ b/.github/workflows/check-misskey-js-version.yml @@ -3,9 +3,7 @@ name: Check Misskey JS version on: push: branches: - - beta - - io - - host + - main paths: - packages/misskey-js/package.json - package.json diff --git a/.github/workflows/docker-beta.yml b/.github/workflows/docker-beta.yml deleted file mode 100644 index 2198ea7d5..000000000 --- a/.github/workflows/docker-beta.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Publish Docker image (beta) - -on: - push: - branches: - - beta - workflow_dispatch: - -jobs: - push_to_registry: - name: Push Docker image to GitHub Container Registry - runs-on: ubuntu-22.04 - if: github.repository == 'MisskeyIO/misskey' - steps: - - name: Check out the repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/amd64 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/misskeyio/misskey - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Prepare image tags - run: | - echo "FORMATTED_BRANCH_NAME=$(echo ${{ github.ref_name }} | sed -e 's/\//-/g' )" >> $GITHUB_ENV - - name: Build and Push to GitHub Container Registry - uses: docker/build-push-action@v6 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - push: true - platforms: ${{ steps.buildx.outputs.platforms }} - provenance: false - labels: ${{ env.FORMATTED_BRANCH_NAME }} - cache-from: type=registry,ref=ghcr.io/misskeyio/misskey:io-buildcache - cache-to: type=registry,ref=ghcr.io/misskeyio/misskey:io-buildcache,mode=max - tags: | - ghcr.io/misskeyio/misskey:beta - ghcr.io/misskeyio/misskey:${{ env.FORMATTED_BRANCH_NAME }} diff --git a/.github/workflows/docker-host.yml b/.github/workflows/docker-host.yml deleted file mode 100644 index 80928ff02..000000000 --- a/.github/workflows/docker-host.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Publish Docker image (host) - -on: - push: - branches: - - host - tags: - - '**-host.*' - workflow_dispatch: - -jobs: - push_to_registry: - name: Push Docker image to GitHub Container Registry - runs-on: ubuntu-22.04 - if: github.repository == 'MisskeyIO/misskey' - steps: - - name: Check out the repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/amd64 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/misskeyio/misskey - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Prepare image tags - run: | - echo "FORMATTED_BRANCH_NAME=$(echo ${{ github.ref_name }} | sed -e 's/\//-/g' )" >> $GITHUB_ENV - - name: Build and Push to GitHub Container Registry - uses: docker/build-push-action@v6 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - push: true - platforms: ${{ steps.buildx.outputs.platforms }} - provenance: false - labels: ${{ env.FORMATTED_BRANCH_NAME }} - cache-from: type=registry,ref=ghcr.io/misskeyio/misskey:host-buildcache - cache-to: type=registry,ref=ghcr.io/misskeyio/misskey:host-buildcache,mode=max - tags: | - ghcr.io/misskeyio/misskey:host - ghcr.io/misskeyio/misskey:${{ env.FORMATTED_BRANCH_NAME }} diff --git a/.github/workflows/docker-io.yml b/.github/workflows/docker-io.yml deleted file mode 100644 index 578cb56d3..000000000 --- a/.github/workflows/docker-io.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Publish Docker image (io) - -on: - push: - branches: - - io - tags: - - '**-io.*' - workflow_dispatch: - -jobs: - push_to_registry: - name: Push Docker image to GitHub Container Registry - runs-on: ubuntu-22.04 - if: github.repository == 'MisskeyIO/misskey' - steps: - - name: Check out the repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/amd64 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ghcr.io/misskeyio/misskey - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Prepare image tags - run: | - echo "FORMATTED_BRANCH_NAME=$(echo ${{ github.ref_name }} | sed -e 's/\//-/g' )" >> $GITHUB_ENV - - name: Build and Push to GitHub Container Registry - uses: docker/build-push-action@v6 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - push: true - platforms: ${{ steps.buildx.outputs.platforms }} - provenance: false - labels: ${{ env.FORMATTED_BRANCH_NAME }} - cache-from: type=registry,ref=ghcr.io/misskeyio/misskey:io-buildcache - cache-to: type=registry,ref=ghcr.io/misskeyio/misskey:io-buildcache,mode=max - tags: | - ghcr.io/misskeyio/misskey:latest - ghcr.io/misskeyio/misskey:${{ env.FORMATTED_BRANCH_NAME }} diff --git a/.github/workflows/dockle.yml b/.github/workflows/dockle.yml deleted file mode 100644 index 39f32557f..000000000 --- a/.github/workflows/dockle.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Dockle - -on: - push: - branches: - - beta - - io - - host - pull_request: - -jobs: - dockle: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - name: Build an image from Dockerfile - uses: docker/build-push-action@v6 - with: - context: . - push: false - provenance: false - cache-from: type=registry,ref=ghcr.io/misskeyio/misskey:io-buildcache - tags: | - misskey:scan - - name: Run dockle - uses: docker://goodwithtech/dockle:v0.4.14 - env: - DOCKLE_OUTPUT_FORMAT: list - DOCKLE_EXIT_CODE: 1 - DOCKLE_EXIT_LEVEL: WARN - DOCKLE_IGNORES: CIS-DI-0005,CIS-DI-0010 - DOCKLE_DEBUG: true - with: - args: 'misskey:scan' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index 88e2aceae..000000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: "Pull Request Labeler" -on: - pull_request_target: - branches-ignore: - - 'l10n_develop' - -jobs: - triage: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v5 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 91e318480..b77761e16 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,9 +3,7 @@ name: Lint on: push: branches: - - beta - - io - - host + - main paths: - packages/backend/** - packages/frontend/** diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml index 26c352699..842d5d289 100644 --- a/.github/workflows/test-backend.yml +++ b/.github/workflows/test-backend.yml @@ -3,9 +3,7 @@ name: Test (backend) on: push: branches: - - beta - - io - - host + - main paths: - packages/backend/** # for permissions @@ -71,12 +69,7 @@ jobs: - name: Build run: pnpm build - name: Test - run: pnpm --filter backend test-and-coverage - - name: Upload to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./packages/backend/coverage/coverage-final.json + run: pnpm --filter backend test e2e: runs-on: ubuntu-latest @@ -130,9 +123,4 @@ jobs: - name: Build run: pnpm build - name: Test - run: pnpm --filter backend test-and-coverage:e2e - - name: Upload to Codecov - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./packages/backend/coverage/coverage-final.json + run: pnpm --filter backend test:e2e diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index 53b486e3a..5e8dad486 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -51,9 +51,4 @@ jobs: - name: Build run: pnpm build - name: Test - run: pnpm --filter frontend test-and-coverage - - name: Upload Coverage - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./packages/frontend/coverage/coverage-final.json + run: pnpm --filter frontend test diff --git a/.github/workflows/test-misskey-js.yml b/.github/workflows/test-misskey-js.yml index 7acd72fa1..eb3db8af4 100644 --- a/.github/workflows/test-misskey-js.yml +++ b/.github/workflows/test-misskey-js.yml @@ -6,9 +6,7 @@ name: Test (misskey.js) on: push: branches: - - beta - - io - - host + - main paths: - packages/misskey-js/** pull_request: @@ -56,9 +54,3 @@ jobs: run: pnpm --filter misskey-js test env: CI: true - - - name: Upload Coverage - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./packages/misskey-js/coverage/coverage-final.json diff --git a/.github/workflows/test-production.yml b/.github/workflows/test-production.yml index dd397b550..0debef5f6 100644 --- a/.github/workflows/test-production.yml +++ b/.github/workflows/test-production.yml @@ -3,9 +3,7 @@ name: Test (production install and build) on: push: branches: - - beta - - io - - host + - main pull_request: env: diff --git a/.github/workflows/validate-api-json.yml b/.github/workflows/validate-api-json.yml index af590fe67..5017a7d42 100644 --- a/.github/workflows/validate-api-json.yml +++ b/.github/workflows/validate-api-json.yml @@ -3,9 +3,7 @@ name: Test (backend) on: push: branches: - - beta - - io - - host + - main paths: - packages/backend/** pull_request: From 33077ed48efbf6a0763e411558c93167de4cb702 Mon Sep 17 00:00:00 2001 From: Caramel Date: Mon, 13 Jan 2025 18:15:07 +0100 Subject: [PATCH 02/14] Rename .github directory to .forgejo Fixes #34. --- .dockerignore | 2 +- {.github => .forgejo}/FUNDING.yml | 0 {.github => .forgejo}/ISSUE_TEMPLATE/01_bug-report.yml | 0 {.github => .forgejo}/ISSUE_TEMPLATE/02_feature-request.yml | 0 {.github => .forgejo}/ISSUE_TEMPLATE/config.yml | 0 {.github => .forgejo}/PULL_REQUEST_TEMPLATE/01_bug.md | 0 {.github => .forgejo}/PULL_REQUEST_TEMPLATE/02_enhance.md | 0 {.github => .forgejo}/PULL_REQUEST_TEMPLATE/03_release.md | 0 {.github => .forgejo}/dependabot.yml | 0 {.github => .forgejo}/labeler.yml | 0 {.github => .forgejo}/misskey/test.yml | 0 {.github => .forgejo}/pull_request_template.md | 0 {.github => .forgejo}/workflows/api-misskey-js.yml | 0 .../workflows/check-misskey-js-version.yml | 0 {.github => .forgejo}/workflows/lint.yml | 0 {.github => .forgejo}/workflows/test-backend.yml | 4 ++-- {.github => .forgejo}/workflows/test-frontend.yml | 2 +- {.github => .forgejo}/workflows/test-misskey-js.yml | 0 {.github => .forgejo}/workflows/test-production.yml | 2 +- {.github => .forgejo}/workflows/validate-api-json.yml | 0 CONTRIBUTING.md | 6 +++--- 21 files changed, 8 insertions(+), 8 deletions(-) rename {.github => .forgejo}/FUNDING.yml (100%) rename {.github => .forgejo}/ISSUE_TEMPLATE/01_bug-report.yml (100%) rename {.github => .forgejo}/ISSUE_TEMPLATE/02_feature-request.yml (100%) rename {.github => .forgejo}/ISSUE_TEMPLATE/config.yml (100%) rename {.github => .forgejo}/PULL_REQUEST_TEMPLATE/01_bug.md (100%) rename {.github => .forgejo}/PULL_REQUEST_TEMPLATE/02_enhance.md (100%) rename {.github => .forgejo}/PULL_REQUEST_TEMPLATE/03_release.md (100%) rename {.github => .forgejo}/dependabot.yml (100%) rename {.github => .forgejo}/labeler.yml (100%) rename {.github => .forgejo}/misskey/test.yml (100%) rename {.github => .forgejo}/pull_request_template.md (100%) rename {.github => .forgejo}/workflows/api-misskey-js.yml (100%) rename {.github => .forgejo}/workflows/check-misskey-js-version.yml (100%) rename {.github => .forgejo}/workflows/lint.yml (100%) rename {.github => .forgejo}/workflows/test-backend.yml (96%) rename {.github => .forgejo}/workflows/test-frontend.yml (95%) rename {.github => .forgejo}/workflows/test-misskey-js.yml (100%) rename {.github => .forgejo}/workflows/test-production.yml (92%) rename {.github => .forgejo}/workflows/validate-api-json.yml (100%) diff --git a/.dockerignore b/.dockerignore index c628b85ec..5ab61d98b 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,7 @@ **/.git .autogen -.github +.forgejo .travis .vscode .config diff --git a/.github/FUNDING.yml b/.forgejo/FUNDING.yml similarity index 100% rename from .github/FUNDING.yml rename to .forgejo/FUNDING.yml diff --git a/.github/ISSUE_TEMPLATE/01_bug-report.yml b/.forgejo/ISSUE_TEMPLATE/01_bug-report.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/01_bug-report.yml rename to .forgejo/ISSUE_TEMPLATE/01_bug-report.yml diff --git a/.github/ISSUE_TEMPLATE/02_feature-request.yml b/.forgejo/ISSUE_TEMPLATE/02_feature-request.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/02_feature-request.yml rename to .forgejo/ISSUE_TEMPLATE/02_feature-request.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.forgejo/ISSUE_TEMPLATE/config.yml similarity index 100% rename from .github/ISSUE_TEMPLATE/config.yml rename to .forgejo/ISSUE_TEMPLATE/config.yml diff --git a/.github/PULL_REQUEST_TEMPLATE/01_bug.md b/.forgejo/PULL_REQUEST_TEMPLATE/01_bug.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE/01_bug.md rename to .forgejo/PULL_REQUEST_TEMPLATE/01_bug.md diff --git a/.github/PULL_REQUEST_TEMPLATE/02_enhance.md b/.forgejo/PULL_REQUEST_TEMPLATE/02_enhance.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE/02_enhance.md rename to .forgejo/PULL_REQUEST_TEMPLATE/02_enhance.md diff --git a/.github/PULL_REQUEST_TEMPLATE/03_release.md b/.forgejo/PULL_REQUEST_TEMPLATE/03_release.md similarity index 100% rename from .github/PULL_REQUEST_TEMPLATE/03_release.md rename to .forgejo/PULL_REQUEST_TEMPLATE/03_release.md diff --git a/.github/dependabot.yml b/.forgejo/dependabot.yml similarity index 100% rename from .github/dependabot.yml rename to .forgejo/dependabot.yml diff --git a/.github/labeler.yml b/.forgejo/labeler.yml similarity index 100% rename from .github/labeler.yml rename to .forgejo/labeler.yml diff --git a/.github/misskey/test.yml b/.forgejo/misskey/test.yml similarity index 100% rename from .github/misskey/test.yml rename to .forgejo/misskey/test.yml diff --git a/.github/pull_request_template.md b/.forgejo/pull_request_template.md similarity index 100% rename from .github/pull_request_template.md rename to .forgejo/pull_request_template.md diff --git a/.github/workflows/api-misskey-js.yml b/.forgejo/workflows/api-misskey-js.yml similarity index 100% rename from .github/workflows/api-misskey-js.yml rename to .forgejo/workflows/api-misskey-js.yml diff --git a/.github/workflows/check-misskey-js-version.yml b/.forgejo/workflows/check-misskey-js-version.yml similarity index 100% rename from .github/workflows/check-misskey-js-version.yml rename to .forgejo/workflows/check-misskey-js-version.yml diff --git a/.github/workflows/lint.yml b/.forgejo/workflows/lint.yml similarity index 100% rename from .github/workflows/lint.yml rename to .forgejo/workflows/lint.yml diff --git a/.github/workflows/test-backend.yml b/.forgejo/workflows/test-backend.yml similarity index 96% rename from .github/workflows/test-backend.yml rename to .forgejo/workflows/test-backend.yml index 842d5d289..0f38bdf06 100644 --- a/.github/workflows/test-backend.yml +++ b/.forgejo/workflows/test-backend.yml @@ -65,7 +65,7 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .github/misskey/test.yml .config + run: cp .forgejo/misskey/test.yml .config - name: Build run: pnpm build - name: Test @@ -119,7 +119,7 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .github/misskey/test.yml .config + run: cp .forgejo/misskey/test.yml .config - name: Build run: pnpm build - name: Test diff --git a/.github/workflows/test-frontend.yml b/.forgejo/workflows/test-frontend.yml similarity index 95% rename from .github/workflows/test-frontend.yml rename to .forgejo/workflows/test-frontend.yml index 5e8dad486..4533cceb7 100644 --- a/.github/workflows/test-frontend.yml +++ b/.forgejo/workflows/test-frontend.yml @@ -47,7 +47,7 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .github/misskey/test.yml .config + run: cp .forgejo/misskey/test.yml .config - name: Build run: pnpm build - name: Test diff --git a/.github/workflows/test-misskey-js.yml b/.forgejo/workflows/test-misskey-js.yml similarity index 100% rename from .github/workflows/test-misskey-js.yml rename to .forgejo/workflows/test-misskey-js.yml diff --git a/.github/workflows/test-production.yml b/.forgejo/workflows/test-production.yml similarity index 92% rename from .github/workflows/test-production.yml rename to .forgejo/workflows/test-production.yml index 0debef5f6..36eede611 100644 --- a/.github/workflows/test-production.yml +++ b/.forgejo/workflows/test-production.yml @@ -35,6 +35,6 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .github/misskey/test.yml .config/default.yml + run: cp .forgejo/misskey/test.yml .config/default.yml - name: Build run: pnpm build diff --git a/.github/workflows/validate-api-json.yml b/.forgejo/workflows/validate-api-json.yml similarity index 100% rename from .github/workflows/validate-api-json.yml rename to .forgejo/workflows/validate-api-json.yml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dcb625626..87e8b407a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -161,7 +161,7 @@ pnpm dev ### Run test Create a config file. ``` -cp .github/misskey/test.yml .config/ +cp .forgejo/misskey/test.yml .config/ ``` Prepare DB/Redis for testing. ``` @@ -188,8 +188,8 @@ TODO - `MISSKEY_WEBFINGER_USE_HTTP`: If it's set true, WebFinger requests will be http instead of https, useful for testing federation between servers in localhost. NEVER USE IN PRODUCTION. ## Continuous integration -Misskey uses GitHub Actions for executing automated tests. -Configuration files are located in [`/.github/workflows`](/.github/workflows). +Misskey uses Forgejo Actions for executing automated tests. +Configuration files are located in [`/.forgejo/workflows`](/.forgejo/workflows). ## Vue Misskey uses Vue(v3) as its front-end framework. From 5ede011bf0e48b27b276ef977f0eeb11910de2c9 Mon Sep 17 00:00:00 2001 From: sugar Date: Thu, 16 Jan 2025 20:32:16 +0100 Subject: [PATCH 03/14] Use pnpm/action-setup@v4.0.0 in Actions It's not possible to use v4, as action-setup doesn't have v4 tag, and unlike GitHub Actions, Forgejo Actions doesn't try to automatically convert refs like v4 into full tags like v4.0.0. --- .forgejo/workflows/api-misskey-js.yml | 2 +- .forgejo/workflows/lint.yml | 6 +++--- .forgejo/workflows/test-backend.yml | 4 ++-- .forgejo/workflows/test-frontend.yml | 2 +- .forgejo/workflows/test-misskey-js.yml | 2 +- .forgejo/workflows/test-production.yml | 2 +- .forgejo/workflows/validate-api-json.yml | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/api-misskey-js.yml b/.forgejo/workflows/api-misskey-js.yml index 620f1415b..0dcd3d889 100644 --- a/.forgejo/workflows/api-misskey-js.yml +++ b/.forgejo/workflows/api-misskey-js.yml @@ -21,7 +21,7 @@ jobs: submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v4.0.0 with: run_install: false diff --git a/.forgejo/workflows/lint.yml b/.forgejo/workflows/lint.yml index b77761e16..5aea45df0 100644 --- a/.forgejo/workflows/lint.yml +++ b/.forgejo/workflows/lint.yml @@ -26,7 +26,7 @@ jobs: with: fetch-depth: 0 submodules: true - - uses: pnpm/action-setup@v4 + - uses: pnpm/action-setup@v4.0.0 with: run_install: false - uses: actions/setup-node@v4.1.0 @@ -51,7 +51,7 @@ jobs: with: fetch-depth: 0 submodules: true - - uses: pnpm/action-setup@v4 + - uses: pnpm/action-setup@v4.0.0 with: run_install: false - uses: actions/setup-node@v4.1.0 @@ -75,7 +75,7 @@ jobs: with: fetch-depth: 0 submodules: true - - uses: pnpm/action-setup@v4 + - uses: pnpm/action-setup@v4.0.0 with: run_install: false - uses: actions/setup-node@v4.1.0 diff --git a/.forgejo/workflows/test-backend.yml b/.forgejo/workflows/test-backend.yml index 0f38bdf06..a94b0afda 100644 --- a/.forgejo/workflows/test-backend.yml +++ b/.forgejo/workflows/test-backend.yml @@ -51,7 +51,7 @@ jobs: fetch-depth: 0 submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v4.0.0 with: run_install: false - name: Install FFmpeg @@ -107,7 +107,7 @@ jobs: fetch-depth: 0 submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v4.0.0 with: run_install: false - name: Use Node.js ${{ matrix.node-version }} diff --git a/.forgejo/workflows/test-frontend.yml b/.forgejo/workflows/test-frontend.yml index 4533cceb7..66f90179b 100644 --- a/.forgejo/workflows/test-frontend.yml +++ b/.forgejo/workflows/test-frontend.yml @@ -35,7 +35,7 @@ jobs: fetch-depth: 0 submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v4.0.0 with: run_install: false - name: Use Node.js ${{ matrix.node-version }} diff --git a/.forgejo/workflows/test-misskey-js.yml b/.forgejo/workflows/test-misskey-js.yml index eb3db8af4..db90b80c0 100644 --- a/.forgejo/workflows/test-misskey-js.yml +++ b/.forgejo/workflows/test-misskey-js.yml @@ -31,7 +31,7 @@ jobs: submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v4.0.0 with: run_install: false diff --git a/.forgejo/workflows/test-production.yml b/.forgejo/workflows/test-production.yml index 36eede611..776341249 100644 --- a/.forgejo/workflows/test-production.yml +++ b/.forgejo/workflows/test-production.yml @@ -23,7 +23,7 @@ jobs: fetch-depth: 0 submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v4.0.0 with: run_install: false - name: Use Node.js ${{ matrix.node-version }} diff --git a/.forgejo/workflows/validate-api-json.yml b/.forgejo/workflows/validate-api-json.yml index 5017a7d42..f72371d52 100644 --- a/.forgejo/workflows/validate-api-json.yml +++ b/.forgejo/workflows/validate-api-json.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 submodules: true - name: Install pnpm - uses: pnpm/action-setup@v4 + uses: pnpm/action-setup@v4.0.0 with: run_install: false - name: Use Node.js ${{ matrix.node-version }} From f531171c59f552e46955dc152ec3a5f4be7fc4d6 Mon Sep 17 00:00:00 2001 From: sugar Date: Thu, 16 Jan 2025 20:33:07 +0100 Subject: [PATCH 04/14] Get setup-ffmpeg action from github.com It's not mirrored by code.forgejo.org. --- .forgejo/workflows/test-backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/test-backend.yml b/.forgejo/workflows/test-backend.yml index a94b0afda..652ff178d 100644 --- a/.forgejo/workflows/test-backend.yml +++ b/.forgejo/workflows/test-backend.yml @@ -55,7 +55,7 @@ jobs: with: run_install: false - name: Install FFmpeg - uses: FedericoCarboni/setup-ffmpeg@v3 + uses: https://github.com/FedericoCarboni/setup-ffmpeg@v3 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4.1.0 with: From 56dcf2c95623d59f81d93b5377f4962809439625 Mon Sep 17 00:00:00 2001 From: sugar Date: Thu, 16 Jan 2025 20:34:25 +0100 Subject: [PATCH 05/14] fix backend linting errors --- packages/backend/src/server/api/SignupApiService.ts | 6 +++--- .../backend/src/server/api/endpoints/admin/decline-user.ts | 2 -- .../backend/src/server/api/endpoints/following/create.ts | 6 +++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/backend/src/server/api/SignupApiService.ts b/packages/backend/src/server/api/SignupApiService.ts index 252920e58..3386c29d4 100644 --- a/packages/backend/src/server/api/SignupApiService.ts +++ b/packages/backend/src/server/api/SignupApiService.ts @@ -244,14 +244,14 @@ export class SignupApiService { } else { try { const { account, secret } = await this.signupService.signup({ - username, password, host, reason + username, password, host, reason, }); if (instance.approvalRequiredForSignup) { if (emailAddress) { this.emailService.sendEmail(emailAddress, 'Approval pending', - 'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.', - 'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.'); + 'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.', + 'Congratulations! Your account is now pending approval. You will get notified when you have been accepted.'); } } diff --git a/packages/backend/src/server/api/endpoints/admin/decline-user.ts b/packages/backend/src/server/api/endpoints/admin/decline-user.ts index 4c8ccb98b..04b2fc5f7 100644 --- a/packages/backend/src/server/api/endpoints/admin/decline-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/decline-user.ts @@ -63,12 +63,10 @@ export default class extends Endpoint { // eslint- await this.usedUsernamesRepository.delete({ username: user.username }); - //Actually delete it since the last function doesnt actually delete the account //Note: Before approval these accounts wont federate so this is totally fine. await this.usersRepository.delete(user.id); - this.moderationLogService.log(me, 'decline', { userId: user.id, userUsername: user.username, diff --git a/packages/backend/src/server/api/endpoints/following/create.ts b/packages/backend/src/server/api/endpoints/following/create.ts index 5340901d3..eab638062 100644 --- a/packages/backend/src/server/api/endpoints/following/create.ts +++ b/packages/backend/src/server/api/endpoints/following/create.ts @@ -37,9 +37,9 @@ export const meta = { unapprovedUser: { message: 'The user has not been approved yet.', - code: 'UNAPPROVED_USER', - id: '8d66f136-b3e1-48fd-92c4-30ecfd7fdb7a', - }, + code: 'UNAPPROVED_USER', + id: '8d66f136-b3e1-48fd-92c4-30ecfd7fdb7a', + }, followeeIsYourself: { message: 'Followee is yourself.', From 453bece1845b6b97f05b8be67565c9602c3f212b Mon Sep 17 00:00:00 2001 From: sugar Date: Thu, 16 Jan 2025 20:40:28 +0100 Subject: [PATCH 06/14] fix frontend linting errors --- packages/frontend/src/pages/admin/approvals.vue | 4 ++-- packages/frontend/src/router/definition.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/frontend/src/pages/admin/approvals.vue b/packages/frontend/src/pages/admin/approvals.vue index ad76a988c..6119fa7fc 100644 --- a/packages/frontend/src/pages/admin/approvals.vue +++ b/packages/frontend/src/pages/admin/approvals.vue @@ -46,8 +46,8 @@ const pagination = { function deleted(id: string) { if (paginationComponent.value) { paginationComponent.value.items = paginationComponent.value.items.filter( - (item: any) => item.id !== id - ); + (item: any) => item.id !== id, + ); } } diff --git a/packages/frontend/src/router/definition.ts b/packages/frontend/src/router/definition.ts index 3a3f646e8..14b5fa961 100644 --- a/packages/frontend/src/router/definition.ts +++ b/packages/frontend/src/router/definition.ts @@ -484,13 +484,13 @@ const routes: RouteDef[] = [{ component: page(() => import('@/pages/admin/invites.vue')), }, { path: '/approvals', - name: 'approvals', - component: page(() => import('@/pages/admin/approvals.vue')), - }, { + name: 'approvals', + component: page(() => import('@/pages/admin/approvals.vue')), + }, { path: '/', component: page(() => import('@/pages/_empty_.vue')), }], -},{ +}, { path: '/my/notifications', component: page(() => import('@/pages/notifications.vue')), loginRequired: true, From 2951162865b3b7d1782173d3038fde5303c1e4e0 Mon Sep 17 00:00:00 2001 From: sugar Date: Thu, 16 Jan 2025 20:51:12 +0100 Subject: [PATCH 07/14] use different test configuration file for forgejo forgejo currently doesn't support port redirection, so it's necessary for services to use their normal ports the old file is kept for local usage --- .forgejo/misskey/test-forgejo.yml | 16 ++++++++++++++++ .forgejo/workflows/test-backend.yml | 12 ++---------- .forgejo/workflows/test-frontend.yml | 2 +- .forgejo/workflows/test-production.yml | 2 +- 4 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 .forgejo/misskey/test-forgejo.yml diff --git a/.forgejo/misskey/test-forgejo.yml b/.forgejo/misskey/test-forgejo.yml new file mode 100644 index 000000000..32cd9861d --- /dev/null +++ b/.forgejo/misskey/test-forgejo.yml @@ -0,0 +1,16 @@ +# Workaround for Forgejo not supporting port redirection + +url: 'http://misskey.local' + +port: 61812 + +db: + host: postgres + port: 5432 + db: test-misskey + user: postgres + pass: '' +redis: + host: dragonfly + port: 6379 +id: aidx diff --git a/.forgejo/workflows/test-backend.yml b/.forgejo/workflows/test-backend.yml index 652ff178d..cc5ae6d33 100644 --- a/.forgejo/workflows/test-backend.yml +++ b/.forgejo/workflows/test-backend.yml @@ -25,8 +25,6 @@ jobs: services: postgres: image: postgres:15 - ports: - - 54312:5432 env: POSTGRES_DB: test-misskey POSTGRES_HOST_AUTH_METHOD: trust @@ -42,8 +40,6 @@ jobs: DFLY_conn_io_threads: 4 DFLY_epoll_file_threads: 4 DFLY_proactor_threads: 4 - ports: - - 56312:6379 steps: - uses: actions/checkout@v4 @@ -65,7 +61,7 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .forgejo/misskey/test.yml .config + run: cp .forgejo/misskey/test-forgejo.yml .config/test.yml - name: Build run: pnpm build - name: Test @@ -81,8 +77,6 @@ jobs: services: postgres: image: postgres:15 - ports: - - 54312:5432 env: POSTGRES_DB: test-misskey POSTGRES_HOST_AUTH_METHOD: trust @@ -98,8 +92,6 @@ jobs: DFLY_conn_io_threads: 4 DFLY_epoll_file_threads: 4 DFLY_proactor_threads: 4 - ports: - - 56312:6379 steps: - uses: actions/checkout@v4 @@ -119,7 +111,7 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .forgejo/misskey/test.yml .config + run: cp .forgejo/misskey/test-forgejo.yml .config/test.yml - name: Build run: pnpm build - name: Test diff --git a/.forgejo/workflows/test-frontend.yml b/.forgejo/workflows/test-frontend.yml index 66f90179b..d7baf4b32 100644 --- a/.forgejo/workflows/test-frontend.yml +++ b/.forgejo/workflows/test-frontend.yml @@ -47,7 +47,7 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .forgejo/misskey/test.yml .config + run: cp .forgejo/misskey/test-forgejo.yml .config/test.yml - name: Build run: pnpm build - name: Test diff --git a/.forgejo/workflows/test-production.yml b/.forgejo/workflows/test-production.yml index 776341249..56c075577 100644 --- a/.forgejo/workflows/test-production.yml +++ b/.forgejo/workflows/test-production.yml @@ -35,6 +35,6 @@ jobs: - name: Check pnpm-lock.yaml run: git diff --exit-code pnpm-lock.yaml - name: Copy Configure - run: cp .forgejo/misskey/test.yml .config/default.yml + run: cp .forgejo/misskey/test-forgejo.yml .config/default.yml - name: Build run: pnpm build From 1c8a2cfa46f2c693d0e963e77ec0d164ef63f7a5 Mon Sep 17 00:00:00 2001 From: sugar Date: Thu, 16 Jan 2025 22:07:34 +0100 Subject: [PATCH 08/14] update tests to handle signup requests --- packages/backend/src/models/json-schema/user.ts | 8 ++++++++ packages/backend/test/e2e/users.ts | 2 ++ packages/misskey-js/src/autogen/types.ts | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/packages/backend/src/models/json-schema/user.ts b/packages/backend/src/models/json-schema/user.ts index 7aa4350b3..1fc71c2ac 100644 --- a/packages/backend/src/models/json-schema/user.ts +++ b/packages/backend/src/models/json-schema/user.ts @@ -651,6 +651,14 @@ export const packedMeDetailedOnlySchema = { type: 'boolean', nullable: true, optional: true, }, + approved: { + type: 'boolean', + nullable: false, optional: true, + }, + signupReason: { + type: 'string', + nullable: true, optional: true, + }, securityKeysList: { type: 'array', nullable: false, optional: true, diff --git a/packages/backend/test/e2e/users.ts b/packages/backend/test/e2e/users.ts index 2df28ada4..c7aca5958 100644 --- a/packages/backend/test/e2e/users.ts +++ b/packages/backend/test/e2e/users.ts @@ -151,6 +151,8 @@ describe('ユーザー', () => { ...(security ? { email: user.email, emailVerified: user.emailVerified, + approved: user.approved, + signupReason: user.signupReason, securityKeysList: user.securityKeysList, } : {}), }); diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 4f234263d..a3d105d06 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -4103,6 +4103,8 @@ export type components = { policies: components['schemas']['RolePolicies']; email?: string | null; emailVerified?: boolean | null; + approved?: boolean; + signupReason?: string | null; securityKeysList?: { /** * Format: id @@ -15517,6 +15519,8 @@ export type operations = { type?: string | null; /** @enum {string|null} */ sort?: '+createdAt' | '-createdAt' | '+name' | '-name' | '+size' | '-size' | null; + /** @default */ + searchQuery?: string; }; }; }; @@ -16116,6 +16120,8 @@ export type operations = { * @default null */ folderId?: string | null; + /** @default */ + searchQuery?: string; }; }; }; From e6872e4f3b2652a89f347631cde5dfd1d0a32190 Mon Sep 17 00:00:00 2001 From: sugar Date: Sun, 12 Jan 2025 11:31:46 +0100 Subject: [PATCH 09/14] use uniform sampling in secure-rndstr the current implementation is biased towards making some characters 25% more common, with the default alphabet the more common characters being '0', '8', 'h', 'q', 'z', 'I', 'R', and 'Z' this changes the probability of all letters to be equal --- packages/backend/src/misc/secure-rndstr.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/backend/src/misc/secure-rndstr.ts b/packages/backend/src/misc/secure-rndstr.ts index 7853100d8..3da67826a 100644 --- a/packages/backend/src/misc/secure-rndstr.ts +++ b/packages/backend/src/misc/secure-rndstr.ts @@ -9,17 +9,9 @@ export const L_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz'; const LU_CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; export function secureRndstr(length = 32, { chars = LU_CHARS } = {}): string { - const chars_len = chars.length; - let str = ''; - for (let i = 0; i < length; i++) { - let rand = Math.floor((crypto.randomBytes(1).readUInt8(0) / 0xFF) * chars_len); - if (rand === chars_len) { - rand = chars_len - 1; - } - str += chars.charAt(rand); + str += chars.charAt(crypto.randomInt(chars.length)); } - return str; } From 36bfe2fb8568953e7ce883806c644cdcc31fd7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=82=8F=E3=82=8F=E3=82=8F=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:21:50 +0900 Subject: [PATCH 10/14] =?UTF-8?q?fix(MisskeyIO#866):=20=E3=83=A6=E3=83=BC?= =?UTF-8?q?=E3=82=B6=E3=83=BC=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=8B?= =?UTF-8?q?=E3=82=89=E3=83=AD=E3=83=BC=E3=83=AB=E3=81=AE=E5=89=B2=E3=82=8A?= =?UTF-8?q?=E5=BD=93=E3=81=A6=E6=99=82=E3=83=A1=E3=83=A2=E3=82=92=E5=85=A5?= =?UTF-8?q?=E5=8A=9B=E3=81=97=E3=81=AA=E3=81=84=E3=81=A8=E3=82=AD=E3=83=A3?= =?UTF-8?q?=E3=83=B3=E3=82=BB=E3=83=AB=E6=89=B1=E3=81=84=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(Missk?= =?UTF-8?q?eyIO#877)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/scripts/get-user-menu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts index 758a04d37..753a4ee8b 100644 --- a/packages/frontend/src/scripts/get-user-menu.ts +++ b/packages/frontend/src/scripts/get-user-menu.ts @@ -298,7 +298,7 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter const { canceled: canceled3, result: memo } = await os.inputText({ title: i18n.ts.addMemo, type: 'textarea', - placeholder: i18n.ts.memo, + default: '', }); if (canceled3) return; From 2de6c63dcbd74fee764fa71bfe6a84376a826ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=82=8F=E3=82=8F=E3=82=8F=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:17:14 +0900 Subject: [PATCH 11/14] =?UTF-8?q?fix(frontend/mobile):=20=E3=83=A2?= =?UTF-8?q?=E3=83=90=E3=82=A4=E3=83=AB=E3=81=A7kawaii=E3=83=A2=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=8C=E9=81=A9=E7=94=A8=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3=20(Missk?= =?UTF-8?q?eyIO#878)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/ui/_common_/navbar-for-mobile.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/ui/_common_/navbar-for-mobile.vue b/packages/frontend/src/ui/_common_/navbar-for-mobile.vue index 5d0e065f0..3f4e5bad6 100644 --- a/packages/frontend/src/ui/_common_/navbar-for-mobile.vue +++ b/packages/frontend/src/ui/_common_/navbar-for-mobile.vue @@ -8,7 +8,8 @@ SPDX-License-Identifier: AGPL-3.0-only
@@ -57,7 +58,9 @@ import { $i, openAccountMenu as openAccountMenu_ } from '@/account.js'; import { defaultStore } from '@/store.js'; import { i18n } from '@/i18n.js'; import { instance } from '@/instance.js'; +import { miLocalStorage } from "@/local-storage.js"; +const kawaiiMode = miLocalStorage.getItem('kawaii') === 'true'; const menu = toRef(defaultStore.state, 'menu'); const otherMenuItemIndicated = computed(() => { for (const def in navbarItemDef) { @@ -120,6 +123,11 @@ function more() { aspect-ratio: 1; } +.instanceIconAlt { + display: inline-block; + width: 85%; +} + .bottom { position: sticky; bottom: 0; From 1683945e78cc29a5ddecdb554ebb4a58da12cbdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=82=8F=E3=82=8F=E3=82=8F=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Fri, 10 Jan 2025 14:54:32 +0900 Subject: [PATCH 12/14] =?UTF-8?q?spec(notes/create):=20=E6=8A=95=E7=A8=BF?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9Fnote=E3=82=92=E8=BF=94=E3=81=95?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(MisskeyIO#879)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/src/server/api/endpoints/notes/create.ts | 9 ++++++--- packages/backend/src/server/web/cli.js | 3 ++- packages/frontend/src/components/MkPostForm.vue | 1 + packages/frontend/src/pages/reversi/game.vue | 1 + packages/frontend/src/scripts/get-note-menu.ts | 3 +++ packages/misskey-js/src/autogen/types.ts | 6 ++++++ packages/sw/src/sw.ts | 2 +- 7 files changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 5bff7f718..963f3bbfd 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -40,7 +40,7 @@ export const meta = { res: { type: 'object', - optional: false, nullable: false, + optional: true, nullable: false, properties: { createdNote: { type: 'object', @@ -207,6 +207,7 @@ export const paramDef = { }, required: ['choices'], }, + noCreatedNote: { type: 'boolean', default: false }, }, // (re)note with text, files and poll are optional if: { @@ -281,7 +282,8 @@ export default class extends Endpoint { // eslint- const note = await this.notesRepository.findOneBy({ id: idempotent }); if (note) { logger.info('The request has already been processed.', { noteId: note.id }); - return { createdNote: await this.noteEntityService.pack(note, me) }; + if (ps.noCreatedNote) return; + else return { createdNote: await this.noteEntityService.pack(note, me) }; } } @@ -453,7 +455,8 @@ export default class extends Endpoint { // eslint- await this.redisForTimelines.set(`note:idempotent:${me.id}:${hash}`, note.id, 'EX', 60); logger.info('Successfully created a note.', { noteId: note.id }); - return { + if (ps.noCreatedNote) return; + else return { createdNote: await this.noteEntityService.pack(note, me), }; } catch (err) { diff --git a/packages/backend/src/server/web/cli.js b/packages/backend/src/server/web/cli.js index 30ee77f4d..2cffd6063 100644 --- a/packages/backend/src/server/web/cli.js +++ b/packages/backend/src/server/web/cli.js @@ -41,7 +41,8 @@ window.onload = async () => { document.getElementById('submit').addEventListener('click', () => { api('notes/create', { - text: document.getElementById('text').value + text: document.getElementById('text').value, + noCreatedNote: true, }).then(() => { location.reload(); }); diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 27dc8a5f4..464371543 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -798,6 +798,7 @@ async function post(ev?: MouseEvent) { visibility: visibility.value, visibleUserIds: visibility.value === 'specified' ? visibleUsers.value.map(u => u.id) : undefined, reactionAcceptance: reactionAcceptance.value, + noCreatedNote: true, }; if (withHashtags.value && hashtags.value && hashtags.value.trim() !== '') { diff --git a/packages/frontend/src/pages/reversi/game.vue b/packages/frontend/src/pages/reversi/game.vue index d95dce18a..865b8425d 100644 --- a/packages/frontend/src/pages/reversi/game.vue +++ b/packages/frontend/src/pages/reversi/game.vue @@ -46,6 +46,7 @@ function start(_game: Misskey.entities.ReversiGameDetailed) { misskeyApi('notes/create', { text: i18n.ts._reversi.iStartedAGame + '\n' + location.href, visibility: 'home', + noCreatedNote: true, }); } diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 92e421cda..b7d3c1abf 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -543,6 +543,7 @@ export function getRenoteMenu(props: { misskeyApi('notes/create', { renoteId: appearNote.id, channelId: appearNote.channelId, + noCreatedNote: true, }).then(() => { os.toast(i18n.ts.renoted); }); @@ -589,6 +590,7 @@ export function getRenoteMenu(props: { localOnly, visibility, renoteId: appearNote.id, + noCreatedNote: true, }).then(() => { os.toast(i18n.ts.renoted); }); @@ -630,6 +632,7 @@ export function getRenoteMenu(props: { misskeyApi('notes/create', { renoteId: appearNote.id, channelId: channel.id, + noCreatedNote: true, }).then(() => { os.toast(i18n.tsx.renotedToX({ name: channel.name })); }); diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index a3d105d06..6c563ea2c 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -23465,6 +23465,8 @@ export type operations = { expiresAt?: number | null; expiredAfter?: number | null; }) | null; + /** @default false */ + noCreatedNote?: boolean; }; }; }; @@ -23477,6 +23479,10 @@ export type operations = { }; }; }; + /** @description OK (without any results) */ + 204: { + content: never; + }; /** @description Client error */ 400: { content: { diff --git a/packages/sw/src/sw.ts b/packages/sw/src/sw.ts index cc79d8871..e2f6ab86c 100644 --- a/packages/sw/src/sw.ts +++ b/packages/sw/src/sw.ts @@ -114,7 +114,7 @@ globalThis.addEventListener('notificationclick', (ev: ServiceWorkerGlobalScopeEv if ('note' in data.body) client = await swos.openPost({ reply: data.body.note }, loginId); break; case 'renote': - if ('note' in data.body) await swos.api('notes/create', loginId, { renoteId: data.body.note.id }); + if ('note' in data.body) await swos.api('notes/create', loginId, { renoteId: data.body.note.id, noCreatedNote: true }); break; case 'accept': switch (data.body.type) { From fedc06d7d06a00a7dda7173a23c750ab81001666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=82=8F=E3=82=8F=E3=82=8F=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Fri, 10 Jan 2025 15:16:28 +0900 Subject: [PATCH 13/14] Sync charts one-at-a-time to reduce database contention and timeouts (MisskeyIO#880) (cherry picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/830) Co-authored-by: Hazelnoot --- .../src/core/chart/ChartManagementService.ts | 10 +++---- .../processors/CleanChartsProcessorService.ts | 26 +++++++++---------- .../ResyncChartsProcessorService.ts | 8 +++--- .../processors/TickChartsProcessorService.ts | 26 +++++++++---------- 4 files changed, 32 insertions(+), 38 deletions(-) diff --git a/packages/backend/src/core/chart/ChartManagementService.ts b/packages/backend/src/core/chart/ChartManagementService.ts index 79681370a..f04c56106 100644 --- a/packages/backend/src/core/chart/ChartManagementService.ts +++ b/packages/backend/src/core/chart/ChartManagementService.ts @@ -58,9 +58,9 @@ export class ChartManagementService implements OnApplicationShutdown { @bindThis public async start() { // 20分おきにメモリ情報をDBに書き込み - this.saveIntervalId = setInterval(() => { + this.saveIntervalId = setInterval(async () => { for (const chart of this.charts) { - chart.save(); + await chart.save(); } }, 1000 * 60 * 20); } @@ -69,9 +69,9 @@ export class ChartManagementService implements OnApplicationShutdown { public async dispose(): Promise { clearInterval(this.saveIntervalId); if (process.env.NODE_ENV !== 'test') { - await Promise.all( - this.charts.map(chart => chart.save()), - ); + for (const chart of this.charts) { + await chart.save(); + } } } diff --git a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts index 110468801..19f98c0d5 100644 --- a/packages/backend/src/queue/processors/CleanChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/CleanChartsProcessorService.ts @@ -48,20 +48,18 @@ export class CleanChartsProcessorService { public async process(): Promise { this.logger.info('Clean charts...'); - await Promise.all([ - this.federationChart.clean(), - this.notesChart.clean(), - this.usersChart.clean(), - this.activeUsersChart.clean(), - this.instanceChart.clean(), - this.perUserNotesChart.clean(), - this.perUserPvChart.clean(), - this.driveChart.clean(), - this.perUserReactionsChart.clean(), - this.perUserFollowingChart.clean(), - this.perUserDriveChart.clean(), - this.apRequestChart.clean(), - ]); + await this.federationChart.clean(); + await this.notesChart.clean(); + await this.usersChart.clean(); + await this.activeUsersChart.clean(); + await this.instanceChart.clean(); + await this.perUserNotesChart.clean(); + await this.perUserPvChart.clean(); + await this.driveChart.clean(); + await this.perUserReactionsChart.clean(); + await this.perUserFollowingChart.clean(); + await this.perUserDriveChart.clean(); + await this.apRequestChart.clean(); this.logger.succ('All charts successfully cleaned.'); } diff --git a/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts b/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts index 570cdf9a7..46e1adf17 100644 --- a/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/ResyncChartsProcessorService.ts @@ -31,11 +31,9 @@ export class ResyncChartsProcessorService { // TODO: ユーザーごとのチャートも更新する // TODO: インスタンスごとのチャートも更新する - await Promise.all([ - this.driveChart.resync(), - this.notesChart.resync(), - this.usersChart.resync(), - ]); + await this.driveChart.resync(); + await this.notesChart.resync(); + await this.usersChart.resync(); this.logger.succ('All charts successfully resynced.'); } diff --git a/packages/backend/src/queue/processors/TickChartsProcessorService.ts b/packages/backend/src/queue/processors/TickChartsProcessorService.ts index 93ec34162..c09cbccc5 100644 --- a/packages/backend/src/queue/processors/TickChartsProcessorService.ts +++ b/packages/backend/src/queue/processors/TickChartsProcessorService.ts @@ -48,20 +48,18 @@ export class TickChartsProcessorService { public async process(): Promise { this.logger.info('Tick charts...'); - await Promise.all([ - this.federationChart.tick(false), - this.notesChart.tick(false), - this.usersChart.tick(false), - this.activeUsersChart.tick(false), - this.instanceChart.tick(false), - this.perUserNotesChart.tick(false), - this.perUserPvChart.tick(false), - this.driveChart.tick(false), - this.perUserReactionsChart.tick(false), - this.perUserFollowingChart.tick(false), - this.perUserDriveChart.tick(false), - this.apRequestChart.tick(false), - ]); + await this.federationChart.tick(false); + await this.notesChart.tick(false); + await this.usersChart.tick(false); + await this.activeUsersChart.tick(false); + await this.instanceChart.tick(false); + await this.perUserNotesChart.tick(false); + await this.perUserPvChart.tick(false); + await this.driveChart.tick(false); + await this.perUserReactionsChart.tick(false); + await this.perUserFollowingChart.tick(false); + await this.perUserDriveChart.tick(false); + await this.apRequestChart.tick(false); this.logger.succ('All charts successfully ticked.'); } From 0de5cbc88700e00e80021fce6754d575ed1f9720 Mon Sep 17 00:00:00 2001 From: sugar Date: Sun, 12 Jan 2025 00:33:38 +0100 Subject: [PATCH 14/14] =?UTF-8?q?Revert=20"fix(frontend/mobile):=20?= =?UTF-8?q?=E3=83=A2=E3=83=90=E3=82=A4=E3=83=AB=E3=81=A7kawaii=E3=83=A2?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=8C=E9=81=A9=E7=94=A8=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(MisskeyIO#878)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change was about kawaii mode, which doesn't exist in Forkey. This reverts commit 8bd78848736672cb85371f3f4c0290eb9d442fe1. --- .../frontend/src/ui/_common_/navbar-for-mobile.vue | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/frontend/src/ui/_common_/navbar-for-mobile.vue b/packages/frontend/src/ui/_common_/navbar-for-mobile.vue index 3f4e5bad6..5d0e065f0 100644 --- a/packages/frontend/src/ui/_common_/navbar-for-mobile.vue +++ b/packages/frontend/src/ui/_common_/navbar-for-mobile.vue @@ -8,8 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
@@ -58,9 +57,7 @@ import { $i, openAccountMenu as openAccountMenu_ } from '@/account.js'; import { defaultStore } from '@/store.js'; import { i18n } from '@/i18n.js'; import { instance } from '@/instance.js'; -import { miLocalStorage } from "@/local-storage.js"; -const kawaiiMode = miLocalStorage.getItem('kawaii') === 'true'; const menu = toRef(defaultStore.state, 'menu'); const otherMenuItemIndicated = computed(() => { for (const def in navbarItemDef) { @@ -123,11 +120,6 @@ function more() { aspect-ratio: 1; } -.instanceIconAlt { - display: inline-block; - width: 85%; -} - .bottom { position: sticky; bottom: 0;