From 2c46695b7239d59ce29b57278faa4abbdc9f66d2 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Tue, 22 Apr 2025 19:48:13 +0200 Subject: [PATCH] reactive-resume (#3980) * 'Add new script' * Update reactive-resume.sh * Update reactive-resume-install.sh * fssl * fssl * date --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Co-authored-by: CanbiZ <47820557+MickLesk@users.noreply.github.com> --- ct/reactive-resume.sh | 106 ++++++++++++ frontend/public/json/reactive-resume.json | 34 ++++ install/reactive-resume-install.sh | 190 ++++++++++++++++++++++ 3 files changed, 330 insertions(+) create mode 100644 ct/reactive-resume.sh create mode 100644 frontend/public/json/reactive-resume.json create mode 100644 install/reactive-resume-install.sh diff --git a/ct/reactive-resume.sh b/ct/reactive-resume.sh new file mode 100644 index 000000000..4a81e9d16 --- /dev/null +++ b/ct/reactive-resume.sh @@ -0,0 +1,106 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: vhsdream +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://rxresu.me + +APP="Reactive-Resume" +var_tags="${var_tags:-documents}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-3072}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -f /etc/systemd/system/Reactive-Resume.service ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -fsSL https://api.github.com/repos/AmruthPillai/Reactive-Resume/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') + if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then + msg_info "Stopping services" + systemctl stop Reactive-Resume + msg_ok "Stopped services" + + msg_info "Updating $APP to v${RELEASE}" + cp /opt/${APP}/.env /opt/rxresume.env + res_tmp=$(mktemp) + rm -rf /opt/${APP} + curl -fsSL "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} + export PUPPETEER_SKIP_DOWNLOAD="true" + export NEXT_TELEMETRY_DISABLED=1 + export CI="true" + export NODE_ENV="production" + $STD pnpm install --frozen-lockfile + $STD pnpm run build + $STD pnpm run prisma:generate + mv /opt/rxresume.env /opt/${APP}/.env + msg_ok "Updated $APP to v${RELEASE}" + + msg_info "Updating Minio" + systemctl stop minio + cd /tmp + curl -fsSL https://dl.min.io/server/minio/release/linux-amd64/minio.deb -o minio.deb + $STD dpkg -i minio.deb + msg_ok "Updated Minio" + + msg_info "Updating Browserless (Patience)" + systemctl stop browserless + cp /opt/browserless/.env /opt/browserless.env + rm -rf browserless + brwsr_tmp=$(mktemp) + TAG=$(curl -fsSL https://api.github.com/repos/browserless/browserless/tags?per_page=1 | grep "name" | awk '{print substr($2, 3, length($2)-4) }') + curl -fsSL 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 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 "Restarting services" + systemctl start minio Reactive-Resume browserless + msg_ok "Restarted services" + + msg_info "Cleaning Up" + rm -f /tmp/minio.deb + rm -f $brwsr_tmp + rm -f $res_tmp + msg_ok "Cleanup Completed" + + echo "${RELEASE}" >/opt/${APP}_version.txt + msg_ok "Update Successful" + else + msg_ok "No update required. ${APP} is already at v${RELEASE}" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}" diff --git a/frontend/public/json/reactive-resume.json b/frontend/public/json/reactive-resume.json new file mode 100644 index 000000000..9ea032e33 --- /dev/null +++ b/frontend/public/json/reactive-resume.json @@ -0,0 +1,34 @@ +{ + "name": "Reactive Resume", + "slug": "reactive-resume", + "categories": [ + 12 + ], + "date_created": "2025-04-22", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 3000, + "documentation": "https://docs.rxresu.me/", + "website": "https://rxresu.me", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/png/reactive-resume-light.png", + "description": "A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever.", + "install_methods": [ + { + "type": "default", + "script": "ct/reactive-resume.sh", + "resources": { + "cpu": 2, + "ram": 3072, + "hdd": 8, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [] +} diff --git a/install/reactive-resume-install.sh b/install/reactive-resume-install.sh new file mode 100644 index 000000000..0e0a53235 --- /dev/null +++ b/install/reactive-resume-install.sh @@ -0,0 +1,190 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: vhsdream +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://rxresu.me + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get install -y \ + gnupg \ + unzip \ + postgresql-common +msg_ok "Installed Dependencies" + +msg_info "Installing Additional Dependencies" +mkdir -p /etc/apt/keyrings +curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg +echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list +echo "YES" | /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh &>/dev/null +$STD apt-get install -y postgresql-16 nodejs +cd /tmp +curl -fsSL https://dl.min.io/server/minio/release/linux-amd64/minio.deb -o minio.deb +$STD dpkg -i minio.deb + +msg_info "Setting up Database" +DB_USER="rxresume" +DB_NAME="rxresume" +DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13) +$STD sudo -u postgres psql -c "CREATE USER $DB_USER WITH ENCRYPTED PASSWORD '$DB_PASS';" +$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" +$STD sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_USER;" +$STD sudo -u postgres psql -c "ALTER USER $DB_USER WITH SUPERUSER;" +msg_ok "Set up Database" + +msg_info "Installing ${APPLICATION}" +MINIO_PASS=$(openssl rand -base64 48) +ACCESS_TOKEN=$(openssl rand -base64 48) +REFRESH_TOKEN=$(openssl rand -base64 48) +CHROME_TOKEN=$(openssl rand -hex 32) +LOCAL_IP=$(hostname -I | awk '{print $1}') +TAG=$(curl -fsSL https://api.github.com/repos/browserless/browserless/tags?per_page=1 | grep "name" | awk '{print substr($2, 3, length($2)-4) }') +RELEASE=$(curl -fsSL https://api.github.com/repos/AmruthPillai/Reactive-Resume/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') +curl -fsSL "https://github.com/AmruthPillai/Reactive-Resume/archive/refs/tags/v${RELEASE}.zip" -o v${RELEASE}.zip +unzip -q v${RELEASE}.zip +mv ${APPLICATION}-${RELEASE}/ /opt/${APPLICATION} +cd /opt/${APPLICATION} +corepack enable +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 +curl -fsSL https://github.com/browserless/browserless/archive/refs/tags/v${TAG}.zip -o v${TAG}.zip +unzip -q v${TAG}.zip +mv browserless-${TAG} /opt/browserless +cd /opt/browserless +$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 +msg_ok "Installed Browserless" + +msg_info "Configuring applications" +mkdir -p /opt/minio +cat </opt/minio/.env +MINIO_ROOT_USER="storageadmin" +MINIO_ROOT_PASSWORD="${MINIO_PASS}" +MINIO_VOLUMES=/opt/minio +MINIO_OPTS="--address :9000 --console-address 127.0.0.1:9001" +EOF +cat </opt/${APPLICATION}/.env +NODE_ENV=production +PORT=3000 +PUBLIC_URL=http://${LOCAL_IP}:3000 +STORAGE_URL=http://${LOCAL_IP}:9000/rxresume +DATABASE_URL=postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}?schema=public +ACCESS_TOKEN_SECRET=${ACCESS_TOKEN} +REFRESH_TOKEN_SECRET=${REFRESH_TOKEN} +CHROME_PORT=8080 +CHROME_TOKEN=${CHROME_TOKEN} +CHROME_URL=ws://localhost:8080 +CHROME_IGNORE_HTTPS_ERRORS=true +MAIL_FROM=noreply@locahost +# SMTP_URL=smtp://username:password@smtp.server.mail:587 # +STORAGE_ENDPOINT=localhost +STORAGE_PORT=9000 +STORAGE_REGION=us-east-1 +STORAGE_BUCKET=rxresume +STORAGE_ACCESS_KEY=storageadmin +STORAGE_SECRET_KEY=${MINIO_PASS} +STORAGE_USE_SSL=false +STORAGE_SKIP_BUCKET_CHECK=false + +# GitHub (OAuth, Optional) +# GITHUB_CLIENT_ID= +# GITHUB_CLIENT_SECRET= +# GITHUB_CALLBACK_URL=http://localhost:5173/api/auth/github/callback + +# Google (OAuth, Optional) +# GOOGLE_CLIENT_ID= +# GOOGLE_CLIENT_SECRET= +# GOOGLE_CALLBACK_URL=http://localhost:5173/api/auth/google/callback +EOF +cat </opt/browserless/.env +DEBUG=browserless*,-**:verbose +HOST=localhost +PORT=8080 +TOKEN=${CHROME_TOKEN} +EOF +echo "${RELEASE}" >/opt/${APPLICATION}_version.txt +{ + echo "${APPLICATION} Credentials" + echo "Database User: $DB_USER" + echo "Database Password: $DB_PASS" + echo "Database Name: $DB_NAME" + echo "Minio Root Password: ${MINIO_PASS}" +} >>~/${APPLICATION}.creds +msg_ok "Configured applications" + +msg_info "Creating Services" +mkdir -p /etc/systemd/system/minio.service.d/ +cat </etc/systemd/system/minio.service.d/override.conf +[Service] +User=root +Group=root +WorkingDirectory=/usr/local/bin +EnvironmentFile=/opt/minio/.env +EOF + +cat </etc/systemd/system/${APPLICATION}.service +[Unit] +Description=${APPLICATION} Service +After=network.target postgresql.service minio.service +Wants=postgresql.service minio.service + +[Service] +WorkingDirectory=/opt/${APPLICATION} +EnvironmentFile=/opt/${APPLICATION}/.env +ExecStart=/usr/bin/pnpm run start +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + +cat </etc/systemd/system/browserless.service +[Unit] +Description=Browserless service +After=network.target ${APPLICATION}.service + +[Service] +WorkingDirectory=/opt/browserless +EnvironmentFile=/opt/browserless/.env +ExecStart=/usr/bin/npm run start +Restart=unless-stopped + +[Install] +WantedBy=multi-user.target +EOF +systemctl daemon-reload +systemctl enable -q --now minio.service ${APPLICATION}.service browserless.service +msg_ok "Created Services" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -f /tmp/v${RELEASE}.zip +rm -f /tmp/v${TAG}.zip +rm -f /tmp/minio.deb +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned"