Files
ProxmoxVE/install/reactive-resume-install.sh
MickLesk 87c26b56bd fix(reactive-resume): update for v5.1.4 compatibility
- Replace obsolete PRINTER_ENDPOINT with ENCRYPTION_SECRET in .env
  (PDF generation moved client-side in v5.1.0; AI providers require
  ENCRYPTION_SECRET since v5.1.4)
- Add commented REDIS_URL for the new AI Agent workspace (optional)
- Inject ENCRYPTION_SECRET into existing installs on update if missing
2026-05-19 10:21:22 +02:00

135 lines
3.6 KiB
Bash

#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: vhsdream | Rewrite: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://rxresume.org | Github: https://github.com/amruthpillai/reactive-resume
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
PG_VERSION="16" setup_postgresql
PG_DB_NAME="reactive_resume" PG_DB_USER="reactive_resume" setup_postgresql_db
NODE_VERSION="24" setup_nodejs
msg_info "Installing Dependencies"
$STD apt install -y \
chromium \
git
msg_ok "Installed Dependencies"
fetch_and_deploy_gh_release "reactive-resume" "amruthpillai/reactive-resume" "tarball"
msg_info "Building Reactive Resume (Patience)"
cd /opt/reactive-resume
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
corepack enable
corepack prepare --activate
export NODE_ENV="production"
export CI="true"
$STD pnpm install --frozen-lockfile
$STD pnpm run build
msg_info "Deploying Nitro Runtime Externals"
$STD pnpm --filter=@reactive-resume/runtime-externals deploy --prod --legacy /tmp/rr-runtime
cp -r /tmp/rr-runtime/node_modules/. /opt/reactive-resume/apps/web/node_modules/
rm -rf /tmp/rr-runtime
msg_ok "Deployed Nitro Runtime Externals"
mkdir -p /opt/reactive-resume/data
msg_ok "Built Reactive Resume"
msg_info "Configuring Reactive Resume"
AUTH_SECRET=$(openssl rand -hex 32)
ENCRYPTION_SECRET=$(openssl rand -hex 32)
cat <<EOF >/opt/reactive-resume/.env
# Reactive Resume v5 Configuration
NODE_ENV=production
PORT=3000
# Public URL (change to your FQDN when using a reverse proxy)
APP_URL=http://${LOCAL_IP}:3000
# Database
DATABASE_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}
# Authentication Secret (do not change after initial setup)
AUTH_SECRET=${AUTH_SECRET}
# Encryption Secret (required for saved AI providers, do not change after initial setup)
ENCRYPTION_SECRET=${ENCRYPTION_SECRET}
# Storage: uses local filesystem (/opt/reactive-resume/data) when S3 is not configured
# S3_ACCESS_KEY_ID=
# S3_SECRET_ACCESS_KEY=
# S3_REGION=us-east-1
# S3_ENDPOINT=
# S3_BUCKET=
# S3_FORCE_PATH_STYLE=false
# Email (optional, logs to console if not configured)
# SMTP_HOST=
# SMTP_PORT=465
# SMTP_USER=
# SMTP_PASS=
# SMTP_FROM=Reactive Resume <noreply@localhost>
# OAuth (optional)
# GITHUB_CLIENT_ID=
# GITHUB_CLIENT_SECRET=
# GOOGLE_CLIENT_ID=
# GOOGLE_CLIENT_SECRET=
# AI Agent (optional, required for the Agent workspace feature)
# REDIS_URL=redis://localhost:6379
# Feature Flags
# FLAG_DISABLE_SIGNUPS=false
# FLAG_DISABLE_EMAIL_AUTH=false
EOF
msg_ok "Configured Reactive Resume"
msg_info "Creating Services"
cat <<EOF >/etc/systemd/system/chromium-printer.service
[Unit]
Description=Headless Chromium for Reactive Resume PDF generation
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/chromium --headless --disable-gpu --no-sandbox --no-zygote --disable-dev-shm-usage --remote-debugging-address=127.0.0.1 --remote-debugging-port=9222
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/reactive-resume.service
[Unit]
Description=Reactive Resume
After=network.target postgresql.service chromium-printer.service
Wants=postgresql.service chromium-printer.service
[Service]
WorkingDirectory=/opt/reactive-resume/apps/web
EnvironmentFile=/opt/reactive-resume/.env
ExecStart=/usr/bin/node .output/server/index.mjs
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable -q --now chromium-printer.service reactive-resume.service
msg_ok "Created Services"
motd_ssh
customize
cleanup_lxc