From 57c0468070e3a4180be594d6493f8b434fb9833f Mon Sep 17 00:00:00 2001 From: vhsdream Date: Fri, 4 Apr 2025 01:46:57 -0400 Subject: [PATCH 1/2] Reactive-Resume: Browserless fix to only install Chromium; remove Python/playwright dep If we simply delete the unneeded browser dirs in `src/routes` then we don't need to install them. This will save compiling time and a lot of disk space. It's late for me so I haven't tested fully. --- ct/reactive-resume.sh | 41 ++++++++++++++---------------- install/reactive-resume-install.sh | 15 +++++------ 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/ct/reactive-resume.sh b/ct/reactive-resume.sh index 1091a1d..8ebcb84 100644 --- a/ct/reactive-resume.sh +++ b/ct/reactive-resume.sh @@ -37,15 +37,14 @@ function update_script() { msg_info "Updating $APP to v${RELEASE}" cp /opt/${APP}/.env /opt/rxresume.env - cd /tmp - wget -q "https://github.com/AmruthPillai/Reactive-Resume/archive/refs/tags/v${RELEASE}.zip" - unzip -q v${RELEASE}.zip - cp -r ${APP}-${RELEASE}/* /opt/${APP} + res_tmp=$(mktemp) + rm -rf /opt/${APP} + wget -q "https://github.com/AmruthPillai/Reactive-Resume/archive/refs/tags/v${RELEASE}.zip" -O $res_tmp + unzip -q $res_tmp + mv ${APP}-${RELEASE}/ /opt/${APP} cd /opt/${APP} - corepack enable export PUPPETEER_SKIP_DOWNLOAD="true" export NEXT_TELEMETRY_DISABLED=1 - export CI="true" $STD pnpm install --frozen-lockfile $STD pnpm run build $STD pnpm run prisma:generate @@ -59,35 +58,33 @@ function update_script() { $STD dpkg -i minio.deb msg_ok "Updated Minio" - msg_info "Updating Playwright" - $STD python3 -m pip install playwright --upgrade - msg_ok "Updated Playwright" - msg_info "Updating Browserless (Patience)" systemctl stop browserless + cp /opt/browserless/.env /opt/browserless.env + rm -rf browserless + brwsr_tmp=$(mktemp) TAG=$(curl -s https://api.github.com/repos/browserless/browserless/tags?per_page=1 | grep "name" | awk '{print substr($2, 3, length($2)-4) }') - wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip - unzip -q v${TAG}.zip - cp -r browserless-${TAG}/* /opt/browserless + wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip -O $brwsr_tmp + unzip -q $brwsr_tmp + mv browserless-${TAG}/ /opt/browserless cd /opt/browserless - $STD npm update - $STD node_modules/playwright-core/cli.js install --with-deps chromium firefox webkit - $STD node_modules/playwright-core/cli.js install --force chrome msedge + $STD npm install + rm -rf src/routes/{chrome,edge,firefox,webkit} + $STD node_modules/playwright-core/cli.js install --with-deps chromium $STD npm run build $STD npm run build:function $STD npm prune production + mv /opt/browserless.env /opt/browserless/.env msg_ok "Updated Browserless" - msg_info "Starting services" + msg_info "Restarting services" systemctl start minio Reactive-Resume browserless - msg_ok "Started services" + msg_ok "Restarted services" msg_info "Cleaning Up" rm -f /tmp/minio.deb - rm -f /tmp/v${RELEASE}.zip - rm -f /tmp/v${TAG}.zip - rm -rf /tmp/${APP}-${RELEASE} - rm -rf /tmp/browserless-${TAG} + rm -f $brwsr_tmp + rm -f $res_tmp msg_ok "Cleanup Completed" echo "${RELEASE}" >/opt/${APP}_version.txt diff --git a/install/reactive-resume-install.sh b/install/reactive-resume-install.sh index f9a25eb..5210cf4 100644 --- a/install/reactive-resume-install.sh +++ b/install/reactive-resume-install.sh @@ -20,9 +20,7 @@ $STD apt-get install -y \ mc \ gnupg \ unzip \ - postgresql-common \ - python3-pip -rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED + postgresql-common msg_ok "Installed Dependencies" msg_info "Installing Additional Dependencies" @@ -58,24 +56,25 @@ unzip -q v${RELEASE}.zip mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION} cd /opt/${APPLICATION} corepack enable -export PUPPETEER_SKIP_DOWNLOAD="true" -export NEXT_TELEMETRY_DISABLED=1 export CI="true" +export PUPPETEER_SKIP_DOWNLOAD="true" +export NODE_ENV="production" +export NEXT_TELEMETRY_DISABLED=1 $STD pnpm install --frozen-lockfile $STD pnpm run build +$STD pnpm install --prod --frozen-lockfile $STD pnpm run prisma:generate msg_ok "Installed ${APPLICATION}" msg_info "Installing Browserless (Patience)" cd /tmp -$STD python3 -m pip install playwright wget -q https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip unzip -q v${TAG}.zip mv browserless-${TAG} /opt/browserless cd /opt/browserless $STD npm install -$STD node_modules/playwright-core/cli.js install --with-deps chromium firefox webkit -$STD node_modules/playwright-core/cli.js install --force chrome msedge +rm -rf src/routes/{chrome,edge,firefox,webkit} +$STD node_modules/playwright-core/cli.js install --with-deps chromium $STD npm run build $STD npm run build:function $STD npm prune production From 794939d205e2362ad1f1cb18e982130d971632d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 16:16:15 +0000 Subject: [PATCH 2/2] Bump vite in /frontend in the npm_and_yarn group across 1 directory Bumps the npm_and_yarn group with 1 update in the /frontend directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). Updates `vite` from 6.2.4 to 6.2.5 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v6.2.5/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v6.2.5/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 6.2.5 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- frontend/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index b4bf3c3..1125ea9 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9665,9 +9665,9 @@ "license": "MIT" }, "node_modules/vite": { - "version": "6.2.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.4.tgz", - "integrity": "sha512-veHMSew8CcRzhL5o8ONjy8gkfmFJAd5Ac16oxBUjlwgX3Gq2Wqr+qNC3TjPIpy7TPV/KporLga5GT9HqdrCizw==", + "version": "6.2.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.5.tgz", + "integrity": "sha512-j023J/hCAa4pRIUH6J9HemwYfjB5llR2Ps0CWeikOtdR8+pAURAk0DoJC5/mm9kd+UgdnIy7d6HE4EAvlYhPhA==", "dev": true, "license": "MIT", "dependencies": {