mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-31 04:54:43 +00:00
6181e5aad4
@aws-sdk/client-s3 has a pathologically deep pnpm virtual store symlink tree; cp -rL follows the chain into thousands of nested client-s3 dirs causing 'File name too long' errors. S3 is an optional storage backend so skip it. bcrypt, sharp, linkedom and ioredis are unaffected.
133 lines
3.5 KiB
Bash
133 lines
3.5 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"
|
|
RT_MODS="/opt/reactive-resume/packages/runtime-externals/node_modules"
|
|
WEB_MODS="/opt/reactive-resume/apps/web/node_modules"
|
|
for pkg in bcrypt sharp linkedom ioredis; do
|
|
[ -d "${RT_MODS}/${pkg}" ] && cp -rL "${RT_MODS}/${pkg}" "${WEB_MODS}/${pkg}"
|
|
done
|
|
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)
|
|
|
|
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}
|
|
|
|
# Printer (headless Chromium for PDF generation)
|
|
PRINTER_ENDPOINT=http://127.0.0.1:9222
|
|
|
|
# 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=
|
|
|
|
# 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
|