From 0e4245fb2516e5ecc0e0aa4fabe64f58b2774a17 Mon Sep 17 00:00:00 2001 From: DecDuck Date: Mon, 27 Apr 2026 13:06:36 +1000 Subject: [PATCH 1/2] Attempt fix monorepo build (#404) * add latest changes and fix launcher * add optional tag specify * fix client release * empty commit --- .dockerignore | 6 + .github/workflows/client-release.yml | 136 ++++++++++++++++++ server/Dockerfile => Dockerfile | 27 ++-- .../src-tauri/process/src/process_handlers.rs | 2 +- pnpm-lock.yaml | 28 +++- server/eslint.config.mjs | 7 +- server/package.json | 5 +- 7 files changed, 191 insertions(+), 20 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/workflows/client-release.yml rename server/Dockerfile => Dockerfile (69%) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..4dbc33aa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +/sites +/cli +/desktop +/backend # go backend + +node_modules \ No newline at end of file diff --git a/.github/workflows/client-release.yml b/.github/workflows/client-release.yml new file mode 100644 index 00000000..4ea49f1b --- /dev/null +++ b/.github/workflows/client-release.yml @@ -0,0 +1,136 @@ +name: "publish" + +on: + workflow_dispatch: + inputs: + tagName: + required: false + type: string + description: "Tag-name to be associated with this release." + release: + types: [published] + # This can be used to automatically publish nightlies at UTC nighttime +# schedule: +# - cron: "0 2 * * *" # run at 2 AM UTC + +# This workflow will trigger on each push to the `release` branch to create or update a GitHub release, build your app, and upload the artifacts to the release. + +jobs: + publish-tauri: + permissions: + contents: write + strategy: + fail-fast: false + matrix: + include: + - platform: "macos-14" # for Arm based macs (M1 and above). + args: "--target aarch64-apple-darwin" + - platform: "macos-14" # for Intel based macs. + args: "--target x86_64-apple-darwin" + - platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04. + args: "" + - platform: "ubuntu-22.04-arm" + args: "--target aarch64-unknown-linux-gnu" + - platform: "windows-latest" + args: "" + + runs-on: ${{ matrix.platform }} + defaults: + run: + working-directory: ./desktop + steps: + - uses: actions/checkout@v4 + with: + submodules: true + token: ${{ secrets.GITHUB_TOKEN }} + + - name: setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + run_install: false + + - name: setup node + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: pnpm + + + - name: install Rust nightly + uses: dtolnay/rust-toolchain@nightly + with: + # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. + targets: ${{ matrix.platform == 'macos-14' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} + + - name: Rust cache + uses: swatinem/rust-cache@v2 + with: + workspaces: './src-tauri -> target' + + - name: install dependencies (ubuntu only) + if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-22.04-arm' # This must match the platform value defined above. + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils + # webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2. + + - name: Import Apple Developer Certificate + if: matrix.platform == 'macos-14' + env: + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} + run: | + echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12 + security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain + security default-keychain -s build.keychain + security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain + security set-keychain-settings -t 3600 -u build.keychain + + + echo "Created keychain" + + curl https://droposs.org/drop.der --output drop.der + + # swiftc libs/appletrust/add-certificate.swift + # ./add-certificate drop.der + # rm add-certificate + + # echo "Added certificate to keychain using swift util" + + ## Script is equivalent to: + sudo security authorizationdb write com.apple.trust-settings.admin allow + sudo security add-trusted-cert -d -r trustRoot -k build.keychain -p codeSign -u -1 drop.der + sudo security authorizationdb remove com.apple.trust-settings.admin + + security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign + echo "Imported certificate" + security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain + security find-identity -v -p codesigning build.keychain + + - name: Verify Certificate + if: matrix.platform == 'macos-14' + run: | + CERT_INFO=$(security find-identity -v -p codesigning build.keychain | grep "Drop OSS") + CERT_ID=$(echo "$CERT_INFO" | awk -F'"' '{print $2}') + echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV + echo "Certificate imported. Using identity: $CERT_ID" + + - name: install frontend dependencies + run: pnpm install # change this to npm, pnpm or bun depending on which one you use. + + - uses: tauri-apps/tauri-action@v0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} + APPLE_SIGNING_IDENTITY: ${{ env.CERT_ID }} + NO_STRIP: true + with: + tagName: ${{ inputs.print_tags || 'v__VERSION__' }} # the action automatically replaces \_\_VERSION\_\_ with the app version. + releaseName: "Auto-release v__VERSION__" + releaseBody: "See the assets to download this version and install. This release was created automatically." + releaseDraft: false + prerelease: true + args: ${{ matrix.args }} \ No newline at end of file diff --git a/server/Dockerfile b/Dockerfile similarity index 69% rename from server/Dockerfile rename to Dockerfile index 59b919a0..a647d2bc 100644 --- a/server/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN corepack enable WORKDIR /app ## so corepack knows pnpm's version -COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ +COPY . . ## prevent prompt to download ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 ## setup for offline @@ -21,11 +21,11 @@ RUN pnpm install --frozen-lockfile --ignore-scripts ### BUILD TORRENTIAL FROM rustlang/rust:nightly-alpine AS torrential-build -RUN apk add musl-dev +RUN apk add musl-dev pkgconfig libarchive-dev libarchive WORKDIR /build -COPY torrential . +COPY . . RUN apk add protoc -RUN cargo build --release +RUN cargo build --release --manifest-path ./torrential/Cargo.toml ### BUILD APP FROM base AS build-system @@ -37,14 +37,15 @@ ENV NUXT_TELEMETRY_DISABLED=1 RUN apk add --no-cache git ## copy deps and rest of project files -COPY --from=deps /app/node_modules ./node_modules COPY . . +COPY --from=deps /app/node_modules ./node_modules + ARG BUILD_DROP_VERSION ARG BUILD_GIT_REF ## build -RUN pnpm run postinstall && pnpm run build +RUN pnpm run --filter=drop postinstall && pnpm run --filter=drop build # create run environment for Drop @@ -55,16 +56,16 @@ ENV NUXT_TELEMETRY_DISABLED=1 # RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn add --network-timeout 1000000 --no-lockfile --ignore-scripts prisma@6.11.1 RUN apk add --no-cache pnpm 7zip nginx -RUN pnpm install prisma@7.3.0 +RUN pnpm install prisma@7.3.0 --global # init prisma to download all required files RUN pnpm prisma init -COPY --from=build-system /app/prisma.config.ts ./ -COPY --from=build-system /app/.output ./app -COPY --from=build-system /app/prisma ./prisma -COPY --from=build-system /app/build ./startup -COPY --from=build-system /app/build/nginx.conf /nginx.conf -COPY --from=torrential-build /build/target/release/torrential /usr/bin/ +COPY --from=build-system /app/server/prisma.config.ts ./ +COPY --from=build-system /app/server/.output ./app +COPY --from=build-system /app/server/prisma ./prisma +COPY --from=build-system /app/server/build ./startup +COPY --from=build-system /app/server/build/nginx.conf /nginx.conf +COPY --from=torrential-build /build/torrential/target/release/torrential /usr/bin/ ENV LIBRARY="/library" ENV DATA="/data" diff --git a/desktop/src-tauri/process/src/process_handlers.rs b/desktop/src-tauri/process/src/process_handlers.rs index d89d896e..5491a81e 100644 --- a/desktop/src-tauri/process/src/process_handlers.rs +++ b/desktop/src-tauri/process/src/process_handlers.rs @@ -40,7 +40,7 @@ impl ProcessHandler for WindowsLauncher { _current_dir: &str, _database: &Database, ) -> Result { - Ok(format!("cmd /C \"{}\"", launch_command)) + Ok(format!("pwsh \"cmd /C \"{}\"\"", launch_command)) } fn valid_for_platform(&self, _db: &Database, _target: &Platform) -> bool { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 565f228a..7e447d95 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -209,8 +209,8 @@ importers: specifier: ^1.0.2 version: 1.0.2 pino: - specifier: ^9.7.0 - version: 9.14.0 + specifier: 9.7.0 + version: 9.7.0 pino-pretty: specifier: ^13.0.0 version: 13.1.3 @@ -5389,6 +5389,10 @@ packages: resolution: {integrity: sha512-71pTBPrA9WPPsJQ0Q06ZlTQQVJPYd87xZsvFwxFqru7a6kdriMVW1Hjd37W3W13ZuF/K/Zzq6eVlAHVoZCHuQw==} hasBin: true + fast-redact@3.5.0: + resolution: {integrity: sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A==} + engines: {node: '>=6'} + fast-safe-stringify@2.1.1: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} @@ -7780,6 +7784,10 @@ packages: resolution: {integrity: sha512-8OEwKp5juEvb/MjpIc4hjqfgCNysrS94RIOMXYvpYCdm/jglrKEiAYmiumbmGhCvs+IcInsphYDFwqrjr7398w==} hasBin: true + pino@9.7.0: + resolution: {integrity: sha512-vnMCM6xZTb1WDmLvtG2lE/2p+t9hDEIvTWJsu6FejkE62vB7gDhvzrpFR4Cw2to+9JNQxVnkAKVPA1KPB98vWg==} + hasBin: true + pkg-types@1.3.1: resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} @@ -16013,6 +16021,8 @@ snapshots: fast-npm-meta@1.5.0: {} + fast-redact@3.5.0: {} + fast-safe-stringify@2.1.1: {} fast-string-truncated-width@1.2.1: {} @@ -19323,6 +19333,20 @@ snapshots: sonic-boom: 4.2.1 thread-stream: 3.1.0 + pino@9.7.0: + dependencies: + atomic-sleep: 1.0.0 + fast-redact: 3.5.0 + on-exit-leak-free: 2.1.2 + pino-abstract-transport: 2.0.0 + pino-std-serializers: 7.1.0 + process-warning: 5.0.0 + quick-format-unescaped: 4.0.4 + real-require: 0.2.0 + safe-stable-stringify: 2.5.0 + sonic-boom: 4.2.1 + thread-stream: 3.1.0 + pkg-types@1.3.1: dependencies: confbox: 0.1.8 diff --git a/server/eslint.config.mjs b/server/eslint.config.mjs index ed2d5148..c012cfde 100644 --- a/server/eslint.config.mjs +++ b/server/eslint.config.mjs @@ -11,7 +11,9 @@ export default withNuxt([ eslintConfigPrettier, // vue-i18n plugin + // @ts-expect-error ...vueI18n.configs.recommended, + // @ts-expect-error { rules: { // Optional. @@ -34,8 +36,11 @@ export default withNuxt([ messageSyntaxVersion: "^11.0.0", }, }, + }, + // @ts-expect-error + { plugins: { drop: { rules: { "no-prisma-delete": noPrismaDelete } }, }, - }, + } ]); diff --git a/server/package.json b/server/package.json index efb3c411..e0e811eb 100644 --- a/server/package.json +++ b/server/package.json @@ -56,7 +56,7 @@ "nuxt-security": "2.2.0", "otp-io": "^1.2.7", "parse-cosekey": "^1.0.2", - "pino": "^9.7.0", + "pino": "9.7.0", "pino-pretty": "^13.0.0", "prisma": "7.3.0", "sanitize-filename": "^1.6.3", @@ -103,6 +103,5 @@ "vue3-carousel-nuxt": { "vue3-carousel": "^0.16.0" } - }, - "packageManager": "pnpm@10.29.1+sha512.48dae233635a645768a3028d19545cacc1688639eeb1f3734e42d6d6b971afbf22aa1ac9af52a173d9c3a20c15857cfa400f19994d79a2f626fcc73fccda9bbc" + } } From ea93cf781353d6125bb4829283680986639bf145 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 03:07:39 +0000 Subject: [PATCH 2/2] chore(deps): bump rustls-webpki from 0.103.8 to 0.103.13 in /torrential Bumps [rustls-webpki](https://github.com/rustls/webpki) from 0.103.8 to 0.103.13. - [Release notes](https://github.com/rustls/webpki/releases) - [Commits](https://github.com/rustls/webpki/compare/v/0.103.8...v/0.103.13) --- updated-dependencies: - dependency-name: rustls-webpki dependency-version: 0.103.13 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- torrential/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torrential/Cargo.lock b/torrential/Cargo.lock index e5bf530f..f620ce11 100644 --- a/torrential/Cargo.lock +++ b/torrential/Cargo.lock @@ -1926,9 +1926,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.8" +version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ "ring", "rustls-pki-types",