diff --git a/.github/workflows/check-misskey-js-autogen.yml b/.github/workflows/check-misskey-js-autogen.yml new file mode 100644 index 0000000000..0b34cdc202 --- /dev/null +++ b/.github/workflows/check-misskey-js-autogen.yml @@ -0,0 +1,127 @@ +name: Check Misskey JS autogen + +on: + pull_request: + branches: + - master + - develop + paths: + - packages/backend/** + +jobs: + check-misskey-js-autogen: + runs-on: ubuntu-latest + permissions: + pull-requests: write + + env: + api_json_names: "api-base.json api-head.json" + + steps: + - name: checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: setup node + id: setup-node + uses: actions/setup-node@v4 + with: + node-version-file: '.node-version' + cache: pnpm + + - name: install dependencies + run: pnpm i --frozen-lockfile + + - name: wait get-api-diff + uses: lewagon/wait-on-check-action@v1.3.3 + with: + ref: ${{ github.event.pull_request.head.sha }} + check-regexp: get-from-misskey .+ + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 30 + + - name: Download artifact + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + + const workflows = await github.rest.actions.listWorkflowRunsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + head_sha: `${{ github.event.pull_request.head.sha }}` + }).then(x => x.data.workflow_runs); + + console.log(workflows.map(x => ({name: x.name, title: x.display_title}))); + + const run_id = workflows.find(x => x.name.includes("Get api.json from Misskey")).id; + + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: run_id, + }); + + let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name.startsWith("api-artifact-") || artifact.name == "api-artifact" + }); + + await Promise.all(matchArtifacts.map(async (artifact) => { + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact.id, + archive_format: 'zip', + }); + await fs.promises.writeFile(`${process.env.GITHUB_WORKSPACE}/${artifact.name}.zip`, Buffer.from(download.data)); + })); + + - name: unzip artifacts + run: |- + find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d . ';' + ls -la + + - name: build autogen + run: |- + for name in $(echo $api_json_names) + do + checksum=$(mktemp) + mv $name packages/misskey-js/generator/api.json + + cd packages/misskey-js/generator + pnpm run generate + find built -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum + cd ../../.. + cp $checksum ${name}_checksum + done + + - name: check update for type definitions + run: diff $(echo -n ${api_json_names} | awk -v RS=" " '{ printf "%s_checksum ", $0 }') + + - name: send message + if: failure() + uses: thollander/actions-comment-pull-request@v2 + with: + comment_tag: check-misskey-js-autogen + message: |- + Thank you for sending us a great Pull Request! ๐Ÿ‘ + Please regenerate misskey-js type definitions! ๐Ÿ™ + + example: + ```sh + pnpm run build-misskey-js-with-types + ``` + + - name: send message + if: success() + uses: thollander/actions-comment-pull-request@v2 + with: + comment_tag: check-misskey-js-autogen + mode: delete + message: "Thank you!" diff --git a/CHANGELOG.md b/CHANGELOG.md index 65e34266d4..23fb00d747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - Enhance: AiScriptใ‚’0.17.0ใซๆ›ดๆ–ฐใ€€[CHANGELOG](https://github.com/aiscript-dev/aiscript/blob/bb89d132b633a622d3cb0eff0d0cc7e476c0cfdd/CHANGELOG.md) - ้…ๅˆ—ใฎ็ฏ„ๅ›ฒๅค–ใƒป้žๆ•ดๆ•ฐใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใธใฎไปฃๅ…ฅใŒๅฎŒๅ…จ็ฆๆญขใซใชใ‚‹ใฎใงๆณจๆ„ - Enhance: ็ตตๆ–‡ๅญ—ใƒ”ใƒƒใ‚ซใƒผใƒปใ‚ชใƒผใƒˆใ‚ณใƒณใƒ—ใƒชใƒผใƒˆใงใ€ๅฎŒๅ…จไธ€่‡ดใ—ใŸ็ตตๆ–‡ๅญ—ใ‚’ๅ„ชๅ…ˆ็š„ใซ่กจ็คบใ™ใ‚‹ใ‚ˆใ†ใซ +- Enhance: Playใฎ่ชฌๆ˜Žๆฌ„ใซMFMใ‚’ไฝฟใˆใ‚‹ใ‚ˆใ†ใซ - Fix: ใƒใ‚คใƒ†ใ‚ฃใƒ–ใƒขใƒผใƒ‰ใฎ็ตตๆ–‡ๅญ—ใŒใƒขใƒŽใ‚ฏใƒญใซใชใ‚‰ใชใ„ใ‚ˆใ†ใซ - Fix: v2023.12.0ใง่ฟฝๅŠ ใ•ใ‚ŒใŸใ€Œใƒขใƒ‡ใƒฌใƒผใ‚ฟใƒผใŒใƒฆใƒผใ‚ถใƒผใฎใ‚ขใ‚คใ‚ณใƒณใ‚‚ใ—ใใฏใƒใƒŠใƒผ็”ปๅƒใ‚’ๆœช่จญๅฎš็Šถๆ…‹ใซใงใใ‚‹ๆฉŸ่ƒฝใ€ใŒ็ฎก็†็”ป้ขไธŠใงๆญฃใ—ใ่กจ็คบใ•ใ‚Œใฆใ„ใชใ„ๅ•้กŒใ‚’ไฟฎๆญฃ - Fix: AiScriptใฎ`readline`้–ขๆ•ฐใŒไธๆญฃใชๅ€คใ‚’่ฟ”ใ™ใ“ใจใŒใ‚ใ‚‹ๅ•้กŒใฎv2023.12.0ๆ™‚็‚นใงใฎไฟฎๆญฃใŒPlayไปฅๅค–ใซ้ฉ็”จใ•ใ‚Œใฆใ„ใชใ„ใฎใ‚’ไฟฎๆญฃ @@ -41,6 +42,7 @@ - Fix: `drive/files/update`ใงใƒ•ใ‚กใ‚คใƒซๅใฎใƒใƒชใƒ‡ใƒผใ‚ทใƒงใƒณใŒๆฉŸ่ƒฝใ—ใฆใ„ใชใ„ๅ•้กŒใ‚’ไฟฎๆญฃ - Fix: `notes/create`ใงใ€`text`ใŒ็ฉบ็™ฝๆ–‡ๅญ—ใฎใฟใงๆง‹ๆˆใ•ใ‚Œใฆใ„ใ‚‹ใ‹`null`ใงใ‚ใฃใฆใ€ใ‹ใค`text`ใ ใ‘ใงใ‚ใ‚‹ใƒชใ‚ฏใ‚จใ‚นใƒˆใซๅฏพใ™ใ‚‹ใƒฌใ‚นใƒใƒณใ‚นใŒ400ใซใชใ‚‹ใ‚ˆใ†ใซๅค‰ๆ›ด - Fix: `notes/create`ใงใ€`text`ใŒ็ฉบ็™ฝๆ–‡ๅญ—ใฎใฟใงๆง‹ๆˆใ•ใ‚Œใฆใ„ใฆใ‹ใคใƒชใƒŽใƒผใƒˆใ€ใƒ•ใ‚กใ‚คใƒซใพใŸใฏๆŠ•็ฅจใ‚’ๅซใ‚“ใงใ„ใ‚‹ใƒชใ‚ฏใ‚จใ‚นใƒˆใซๅฏพใ™ใ‚‹ใƒฌใ‚นใƒใƒณใ‚นใฎ`text`ใŒ`""`ใ‹ใ‚‰`null`ใซใชใ‚‹ใ‚ˆใ†ใซๅค‰ๆ›ด +- Fix: ipv4ใจipv6ใฎไธกๆ–นใŒๅˆฉ็”จๅฏ่ƒฝใช็’ฐๅขƒใงallowedPrivateNetworksใŒ่จญๅฎšใ•ใ‚Œใฆใ„ใŸๅ ดๅˆใƒ—ใƒฉใ‚คใƒ™ใƒผใƒˆipใฎๆคœ่จผใŒใงใใฆใ„ใชใ‹ใฃใŸๅ•้กŒใ‚’ไฟฎๆญฃ ## 2023.12.2 diff --git a/packages/backend/src/core/DownloadService.ts b/packages/backend/src/core/DownloadService.ts index 5474272b00..5e196e83dd 100644 --- a/packages/backend/src/core/DownloadService.ts +++ b/packages/backend/src/core/DownloadService.ts @@ -145,7 +145,8 @@ export class DownloadService { const parsedIp = ipaddr.parse(ip); for (const net of this.config.allowedPrivateNetworks ?? []) { - if (parsedIp.match(ipaddr.parseCIDR(net))) { + const cidr = ipaddr.parseCIDR(net); + if (cidr[0].kind() === parsedIp.kind() && parsedIp.match(ipaddr.parseCIDR(net))) { return false; } } diff --git a/packages/frontend/src/components/MkFlashPreview.vue b/packages/frontend/src/components/MkFlashPreview.vue index ab435585d9..1be8a6d8f7 100644 --- a/packages/frontend/src/components/MkFlashPreview.vue +++ b/packages/frontend/src/components/MkFlashPreview.vue @@ -9,7 +9,9 @@ SPDX-License-Identifier: AGPL-3.0-only

{{ flash.title }}

-

{{ flash.summary.length > 85 ? flash.summary.slice(0, 85) + 'โ€ฆ' : flash.summary }}

+

+ +