diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 000000000..26c41372a --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,96 @@ +name: Publish prebuild + +on: + push: + branches: + - stable + release: + types: [published] + workflow_dispatch: + +jobs: + build_binaries: + name: Build & ship binaries + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x] + python-version: [3.11.x] + if: github.repository == 'transfem-org/Sharkey' + permissions: + contents: read + packages: write + + steps: + - name: Check out the repo + uses: actions/checkout@v4.1.0 + with: + lfs: true + submodules: 'recursive' + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Setup Python + uses: actions/setup-python@v4.7.1 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache APT Packages + uses: awalsh128/cache-apt-pkgs-action@v1.3.0 + with: + packages: "build-essential binfmt-support qemu-user-static ffmpeg tini curl libjemalloc-dev libjemalloc2 uuid-dev libx11-dev libxkbfile-dev execstack libgconf-2-4 libsecret-1-dev" + + - name: Cache node modules + uses: actions/cache@v3 + with: + path: ~/.npm + key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }} + restore-keys: v1-npm-deps- + + - uses: MOZGIII/install-ldid-action@v1 + with: + tag: v2.1.5-procursus2 + + - name: Build + run: | + corepack enable + corepack prepare pnpm@latest --activate + pnpm install + npm install -g pkg + npm install -g rollup + npm install -g @rollup/plugin-node-resolve + pnpm run build + cd packages/backend + mkdir dist + rollup ./built/boot/entry.js --file ./dist/bundle.js --format cjs -p @rollup/plugin-node-resolve + pkg --debug --public ./dist/bundle.js --targets latest-linuxstatic-x64,latest-linuxstatic-arm64,latest-macos-x64,latest-macos-arm64,latest-win-x64 + ls + - name: Upload linux x64 + uses: actions/upload-artifact@v3.1.3 + with: + name: sharkey-linux-x64 + path: packages/backend/bundle-linuxstatic-x64 + - name: Upload linux arm64 + uses: actions/upload-artifact@v3.1.3 + with: + name: sharkey-linux-arm64 + path: packages/backend/bundle-linuxstatic-arm64 + - name: Upload mac arm64 + uses: actions/upload-artifact@v3.1.3 + with: + name: sharkey-macos-arm64 + path: packages/backend/bundle-macos-arm64 + - name: Upload mac x64 + uses: actions/upload-artifact@v3.1.3 + with: + name: sharkey-macos-arm64 + path: packages/backend/bundle-macos-x64 + - name: Upload Windows + uses: actions/upload-artifact@v3.1.3 + with: + name: sharkey-win-x64.exe + path: packages/backend/bundle-win-x64.exe + diff --git a/.github/workflows/pr-preview-deploy.yml b/.github/workflows/pr-preview-deploy.yml index 44f97645d..5b0e5e726 100644 --- a/.github/workflows/pr-preview-deploy.yml +++ b/.github/workflows/pr-preview-deploy.yml @@ -13,7 +13,7 @@ jobs: github.event.client_payload.slash_command.sha != '' && contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.sha) steps: - - uses: actions/github-script@v6.3.3 + - uses: actions/github-script@v6.4.1 id: check-id env: number: ${{ github.event.client_payload.pull_request.number }} @@ -37,7 +37,7 @@ jobs: return check[0].id; - - uses: actions/github-script@v6.3.3 + - uses: actions/github-script@v6.4.1 env: check_id: ${{ steps.check-id.outputs.result }} details_url: ${{ github.server_url }}/${{ github.repository }}/runs/${{ github.run_id }} @@ -72,7 +72,7 @@ jobs: timeout: 15m # Update check run called "integration-fork" - - uses: actions/github-script@v6.3.3 + - uses: actions/github-script@v6.4.1 id: update-check-run if: ${{ always() }} env: diff --git a/.github/workflows/pr-preview-destroy.yml b/.github/workflows/pr-preview-destroy.yml index 8adfad9da..f7357a4d0 100644 --- a/.github/workflows/pr-preview-destroy.yml +++ b/.github/workflows/pr-preview-destroy.yml @@ -10,7 +10,7 @@ jobs: destroy-preview-environment: runs-on: ubuntu-latest steps: - - uses: actions/github-script@v6.3.3 + - uses: actions/github-script@v6.4.1 id: check-conclusion env: number: ${{ github.event.number }} diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index e67b51654..1b69229f1 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -108,12 +108,12 @@ jobs: wait-on: 'http://localhost:61812' headed: true browser: ${{ matrix.browser }} - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 if: failure() with: name: ${{ matrix.browser }}-cypress-screenshots path: cypress/screenshots - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 if: always() with: name: ${{ matrix.browser }}-cypress-videos diff --git a/.github/workflows/welcome.yml b/.github/workflows/welcome.yml new file mode 100644 index 000000000..ada3db2d5 --- /dev/null +++ b/.github/workflows/welcome.yml @@ -0,0 +1,25 @@ +name: Welcome +on: + pull_request: + types: [opened] + issues: + types: [opened] +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/first-interaction@v1.2.0 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: | + 👋 @{{ author }} + Thanks for opening your first issue here! If you are reporting a bug, please make sure to include steps on how to reproduce it! :D + + pr-message: | + 👋 @{{ author }} + Thanks for opening this pull request! We will review it as soon as we can :3 + Please check out our contributing guidelines in the meantime. + + # FIRST_PR_MERGED: | + # 🎉 @{{ author }} + # Congrats on getting your first pull request merged! We are proud of you :3 ❤️ diff --git a/docker-compose.yml.example b/docker-compose.yml.example index a9a2ff5d9..287a23cab 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -61,7 +61,8 @@ services: # volumes: # - ./meili_data:/meili_data + networks: shonk: web: - external: true + external: true diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index f0145a864..08c1bde73 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -164,6 +164,8 @@ flagAsBot: "Botとして設定" flagAsBotDescription: "このアカウントがプログラムによって運用される場合は、このフラグをオンにします。オンにすると、反応の連鎖を防ぐためのフラグとして他の開発者に役立ったり、Sharkeyのシステム上での扱いがBotに合ったものになります。" flagAsCat: "にゃああああああああああああああ!!!!!!!!!!!!" flagAsCatDescription: "にゃにゃにゃ??" +flagSpeakAsCat: "猫語で話す" +flagSpeakAsCatDescription: "有効にすると、あなたの投稿の 「な」を「にゃ」にします。" flagShowTimelineReplies: "タイムラインにノートへの返信を表示する" flagShowTimelineRepliesDescription: "オンにすると、タイムラインにユーザーのノート以外にもそのユーザーの他のノートへの返信を表示します。" autoAcceptFollowed: "フォロー中ユーザーからのフォロリクを自動承認" diff --git a/locales/ja-KS.yml b/locales/ja-KS.yml index 32367453b..abcf3bff9 100644 --- a/locales/ja-KS.yml +++ b/locales/ja-KS.yml @@ -163,6 +163,8 @@ flagAsBot: "Botにするで" flagAsBotDescription: "もしこのアカウントをプログラム使うて運用するんやったら、このフラグをオンにしてや。オンにすれば、反応がバーッて連鎖せんように開発者が使うたり、Sharkeyのシステム上での扱いがBotに合ったもんになるからな。" flagAsCat: "Catやで" flagAsCatDescription: "ワレ、猫ちゃんならこのフラグをつけてみ?" +flagSpeakAsCat: "猫語で話すで" +flagSpeakAsCatDescription: "有効にすると、あなたの投稿の 「な」を「にゃ」にするでー。" flagShowTimelineReplies: "タイムラインにノートへの返信を表示するで" flagShowTimelineRepliesDescription: "オンにしたら、タイムラインにユーザーのノートの他にもそのユーザーの他のノートへの返信を表示するで。" autoAcceptFollowed: "フォローしとるユーザーからのフォローリクエストを勝手に許可しとく" diff --git a/packages/backend/src/boot/entry.ts b/packages/backend/src/boot/entry.ts index fc8fc2ffb..bd0ed29fc 100644 --- a/packages/backend/src/boot/entry.ts +++ b/packages/backend/src/boot/entry.ts @@ -27,60 +27,63 @@ const logger = new Logger('core', 'cyan'); const clusterLogger = logger.createSubLogger('cluster', 'orange', false); const ev = new Xev(); -//#region Events +// We wrap this in a main function, that gets called, +// because not all platforms support top level await :/ -// Listen new workers -cluster.on('fork', worker => { - clusterLogger.debug(`Process forked: [${worker.id}]`); -}); +async function main() { + //#region Events + // Listen new workers + cluster.on('fork', worker => { + clusterLogger.debug(`Process forked: [${worker.id}]`); + }); -// Listen online workers -cluster.on('online', worker => { - clusterLogger.debug(`Process is now online: [${worker.id}]`); -}); + // Listen online workers + cluster.on('online', worker => { + clusterLogger.debug(`Process is now online: [${worker.id}]`); + }); -// Listen for dying workers -cluster.on('exit', worker => { - // Replace the dead worker, - // we're not sentimental - clusterLogger.error(chalk.red(`[${worker.id}] died :(`)); - cluster.fork(); -}); + // Listen for dying workers + cluster.on('exit', worker => { + // Replace the dead worker, + // we're not sentimental + clusterLogger.error(chalk.red(`[${worker.id}] died :(`)); + cluster.fork(); + }); -// Display detail of unhandled promise rejection -if (!envOption.quiet) { - process.on('unhandledRejection', console.dir); -} + // Display detail of unhandled promise rejection + if (!envOption.quiet) { + process.on('unhandledRejection', console.dir); + } -// Display detail of uncaught exception -process.on('uncaughtException', err => { - try { - logger.error(err); - console.trace(err); - } catch { } -}); + // Display detail of uncaught exception + process.on('uncaughtException', err => { + try { + logger.error(err); + console.trace(err); + } catch { } + }); -// Dying away... -process.on('exit', code => { - logger.info(`The process is going to exit with code ${code}`); -}); + // Dying away... + process.on('exit', code => { + logger.info(`The process is going to exit with code ${code}`); + }); + //#endregion -//#endregion + if (cluster.isPrimary || envOption.disableClustering) { + await masterMain(); + if (cluster.isPrimary) { + ev.mount(); + } + } + if (cluster.isWorker || envOption.disableClustering) { + await workerMain(); + } -if (cluster.isPrimary || envOption.disableClustering) { - await masterMain(); - - if (cluster.isPrimary) { - ev.mount(); + // ユニットテスト時にMisskeyが子プロセスで起動された時のため + // それ以外のときは process.send は使えないので弾く + if (process.send) { + process.send('ok'); } } -if (cluster.isWorker || envOption.disableClustering) { - await workerMain(); -} - -// ユニットテスト時にMisskeyが子プロセスで起動された時のため -// それ以外のときは process.send は使えないので弾く -if (process.send) { - process.send('ok'); -} +main(); diff --git a/packages/frontend/src/pages/user/home.vue b/packages/frontend/src/pages/user/home.vue index 163ad22a5..39227f726 100644 --- a/packages/frontend/src/pages/user/home.vue +++ b/packages/frontend/src/pages/user/home.vue @@ -355,8 +355,8 @@ onUnmounted(() => { pointer-events: none; filter: blur(8px) opacity(0.6); // Funny CSS schenanigans to make background escape container - top: -100%; left: -100%; + top: -100%; right: -100%; background-attachment: fixed; } diff --git a/packages/frontend/src/ui/visitor.vue b/packages/frontend/src/ui/visitor.vue index 4d2678a4c..d7aa87471 100644 --- a/packages/frontend/src/ui/visitor.vue +++ b/packages/frontend/src/ui/visitor.vue @@ -185,6 +185,7 @@ defineExpose({ width: 500px; height: 100vh; background: var(--accent); + z-index: 1; > .banner { position: absolute; @@ -213,6 +214,8 @@ defineExpose({ > .header { background: var(--panel); + position: relative; + z-index: 1; > .wide { line-height: 50px;