mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-03 23:45:59 +00:00
@@ -33,12 +33,11 @@ function update_script() {
|
|||||||
systemctl stop Reactive-Resume
|
systemctl stop Reactive-Resume
|
||||||
msg_ok "Stopped services"
|
msg_ok "Stopped services"
|
||||||
|
|
||||||
cp /opt/"$APP"/.env /opt/rxresume.env
|
cp /opt/Reactive-Resume/.env /opt/rxresume.env
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "Reactive-Resume" "lazy-media/Reactive-Resume" "tarball" "latest" "/opt/Reactive-Resume"
|
fetch_and_deploy_gh_release "Reactive-Resume" "lazy-media/Reactive-Resume" "tarball" "latest" "/opt/Reactive-Resume"
|
||||||
|
|
||||||
msg_info "Updating $APP"
|
msg_info "Updating Reactive-Resume"
|
||||||
cd /opt/"$APP"
|
cd /opt/Reactive-Resume
|
||||||
export PUPPETEER_SKIP_DOWNLOAD="true"
|
export PUPPETEER_SKIP_DOWNLOAD="true"
|
||||||
export NEXT_TELEMETRY_DISABLED=1
|
export NEXT_TELEMETRY_DISABLED=1
|
||||||
export CI="true"
|
export CI="true"
|
||||||
@@ -46,8 +45,8 @@ function update_script() {
|
|||||||
$STD pnpm install --frozen-lockfile
|
$STD pnpm install --frozen-lockfile
|
||||||
$STD pnpm run build
|
$STD pnpm run build
|
||||||
$STD pnpm run prisma:generate
|
$STD pnpm run prisma:generate
|
||||||
mv /opt/rxresume.env /opt/"$APP"/.env
|
mv /opt/rxresume.env /opt/Reactive-Resume/.env
|
||||||
msg_ok "Updated $APP"
|
msg_ok "Updated Reactive-Resume"
|
||||||
|
|
||||||
msg_info "Updating Minio"
|
msg_info "Updating Minio"
|
||||||
systemctl stop minio
|
systemctl stop minio
|
||||||
|
|||||||
@@ -19,30 +19,19 @@ curl -fsSL https://dl.min.io/server/minio/release/linux-amd64/minio.deb -o minio
|
|||||||
$STD dpkg -i minio.deb
|
$STD dpkg -i minio.deb
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
import_local_ip
|
||||||
PG_VERSION="16" setup_postgresql
|
PG_VERSION="16" setup_postgresql
|
||||||
NODE_VERSION="22" NODE_MODULE="pnpm@latest" setup_nodejs
|
PG_DB_NAME="rxresume" PG_DB_USER="rxresume" PG_DB_GRANT_SUPERUSER="true" setup_postgresql_db
|
||||||
|
NODE_VERSION="24" NODE_MODULE="pnpm@latest" setup_nodejs
|
||||||
msg_info "Setting up Database"
|
fetch_and_deploy_gh_release "Reactive-Resume" "lazy-media/Reactive-Resume"
|
||||||
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 "Setting up Reactive-Resume"
|
||||||
MINIO_PASS=$(openssl rand -base64 48)
|
MINIO_PASS=$(openssl rand -base64 48)
|
||||||
ACCESS_TOKEN=$(openssl rand -base64 48)
|
ACCESS_TOKEN=$(openssl rand -base64 48)
|
||||||
REFRESH_TOKEN=$(openssl rand -base64 48)
|
REFRESH_TOKEN=$(openssl rand -base64 48)
|
||||||
CHROME_TOKEN=$(openssl rand -hex 32)
|
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) }')
|
TAG=$(curl -fsSL https://api.github.com/repos/browserless/browserless/tags?per_page=1 | grep "name" | awk '{print substr($2, 3, length($2)-4) }')
|
||||||
|
cd /opt/Reactive-Resume
|
||||||
fetch_and_deploy_gh_release "Reactive-Resume" "lazy-media/Reactive-Resume"
|
|
||||||
|
|
||||||
msg_info "Installing $APPLICATION"
|
|
||||||
cd /opt/"$APPLICATION"
|
|
||||||
export CI="true"
|
export CI="true"
|
||||||
export PUPPETEER_SKIP_DOWNLOAD="true"
|
export PUPPETEER_SKIP_DOWNLOAD="true"
|
||||||
export NODE_ENV="production"
|
export NODE_ENV="production"
|
||||||
@@ -50,7 +39,7 @@ export NEXT_TELEMETRY_DISABLED=1
|
|||||||
$STD pnpm install --frozen-lockfile
|
$STD pnpm install --frozen-lockfile
|
||||||
$STD pnpm run build
|
$STD pnpm run build
|
||||||
$STD pnpm run prisma:generate
|
$STD pnpm run prisma:generate
|
||||||
msg_ok "Installed $APPLICATION"
|
msg_ok "Setup Reactive-Resume"
|
||||||
|
|
||||||
msg_info "Installing Browserless (Patience)"
|
msg_info "Installing Browserless (Patience)"
|
||||||
cd /tmp
|
cd /tmp
|
||||||
@@ -76,13 +65,14 @@ MINIO_ROOT_PASSWORD="${MINIO_PASS}"
|
|||||||
MINIO_VOLUMES=/opt/minio
|
MINIO_VOLUMES=/opt/minio
|
||||||
MINIO_OPTS="--address :9000 --console-address 127.0.0.1:9001"
|
MINIO_OPTS="--address :9000 --console-address 127.0.0.1:9001"
|
||||||
EOF
|
EOF
|
||||||
cat <<EOF >/opt/"$APPLICATION"/.env
|
|
||||||
|
cat <<EOF >/opt/Reactive-Resume/.env
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
PORT=3000
|
PORT=3000
|
||||||
# for use behind a reverse proxy, use your FQDN for PUBLIC_URL and STORAGE_URL
|
# for use behind a reverse proxy, use your FQDN for PUBLIC_URL and STORAGE_URL
|
||||||
PUBLIC_URL=http://${LOCAL_IP}:3000
|
PUBLIC_URL=http://${LOCAL_IP}:3000
|
||||||
STORAGE_URL=http://${LOCAL_IP}:9000/rxresume
|
STORAGE_URL=http://${LOCAL_IP}:9000/rxresume
|
||||||
DATABASE_URL=postgresql://${DB_USER}:${DB_PASS}@localhost:5432/${DB_NAME}?schema=public
|
DATABASE_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}?schema=public
|
||||||
ACCESS_TOKEN_SECRET=${ACCESS_TOKEN}
|
ACCESS_TOKEN_SECRET=${ACCESS_TOKEN}
|
||||||
REFRESH_TOKEN_SECRET=${REFRESH_TOKEN}
|
REFRESH_TOKEN_SECRET=${REFRESH_TOKEN}
|
||||||
CHROME_PORT=8080
|
CHROME_PORT=8080
|
||||||
@@ -110,19 +100,13 @@ STORAGE_SKIP_BUCKET_CHECK=false
|
|||||||
# GOOGLE_CLIENT_SECRET=
|
# GOOGLE_CLIENT_SECRET=
|
||||||
# GOOGLE_CALLBACK_URL=http://localhost:5173/api/auth/google/callback
|
# GOOGLE_CALLBACK_URL=http://localhost:5173/api/auth/google/callback
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF >/opt/browserless/.env
|
cat <<EOF >/opt/browserless/.env
|
||||||
DEBUG=browserless*,-**:verbose
|
DEBUG=browserless*,-**:verbose
|
||||||
HOST=localhost
|
HOST=localhost
|
||||||
PORT=8080
|
PORT=8080
|
||||||
TOKEN=${CHROME_TOKEN}
|
TOKEN=${CHROME_TOKEN}
|
||||||
EOF
|
EOF
|
||||||
{
|
|
||||||
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
|
|
||||||
rm -f /tmp/v"$TAG".zip
|
rm -f /tmp/v"$TAG".zip
|
||||||
rm -f /tmp/minio.deb
|
rm -f /tmp/minio.deb
|
||||||
msg_ok "Configured applications"
|
msg_ok "Configured applications"
|
||||||
@@ -137,15 +121,15 @@ WorkingDirectory=/usr/local/bin
|
|||||||
EnvironmentFile=/opt/minio/.env
|
EnvironmentFile=/opt/minio/.env
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF >/etc/systemd/system/"$APPLICATION".service
|
cat <<EOF >/etc/systemd/system/Reactive-Resume.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=${APPLICATION} Service
|
Description=Reactive-Resume Service
|
||||||
After=network.target postgresql.service minio.service
|
After=network.target postgresql.service minio.service
|
||||||
Wants=postgresql.service minio.service
|
Wants=postgresql.service minio.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/${APPLICATION}
|
WorkingDirectory=/opt/Reactive-Resume
|
||||||
EnvironmentFile=/opt/${APPLICATION}/.env
|
EnvironmentFile=/opt/Reactive-Resume/.env
|
||||||
ExecStart=/usr/bin/pnpm run start
|
ExecStart=/usr/bin/pnpm run start
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
@@ -156,7 +140,7 @@ EOF
|
|||||||
cat <<EOF >/etc/systemd/system/browserless.service
|
cat <<EOF >/etc/systemd/system/browserless.service
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Browserless service
|
Description=Browserless service
|
||||||
After=network.target ${APPLICATION}.service
|
After=network.target Reactive-Resume.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/browserless
|
WorkingDirectory=/opt/browserless
|
||||||
@@ -168,7 +152,7 @@ Restart=unless-stopped
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl enable -q --now minio.service "$APPLICATION".service browserless.service
|
systemctl enable -q --now minio.service Reactive-Resume.service browserless.service
|
||||||
msg_ok "Created Services"
|
msg_ok "Created Services"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
|||||||
Reference in New Issue
Block a user