Compare commits

..

2 Commits

5 changed files with 25 additions and 22 deletions

16
.codegraph/.gitignore vendored
View File

@@ -1,16 +0,0 @@
# CodeGraph data files
# These are local to each machine and should not be committed
# Database
*.db
*.db-wal
*.db-shm
# Cache
cache/
# Logs
*.log
# Hook markers
.dirty

View File

@@ -53,7 +53,7 @@ function update_script() {
msg_ok "Updated Reactive Resume"
msg_info "Updating Service"
sed -i 's|WorkingDirectory=/opt/reactive-resume$|WorkingDirectory=/opt/reactive-resume/apps/web|' /etc/systemd/system/reactive-resume.service
sed -i 's|WorkingDirectory=/opt/reactive-resume/apps/web|WorkingDirectory=/opt/reactive-resume/apps/server|; s|ExecStart=/usr/bin/node .output/server/index.mjs|ExecStart=/usr/bin/node dist/index.mjs|' /etc/systemd/system/reactive-resume.service
systemctl daemon-reload
msg_ok "Updated Service"

View File

@@ -17,7 +17,7 @@ msg_info "Installing Dependencies"
$STD apt install -y build-essential
msg_ok "Installed Dependencies"
NODE_VERSION="22" setup_nodejs
NODE_VERSION="26" setup_nodejs
msg_info "Setup Cross-Seed"
$STD npm install cross-seed@latest -g

View File

@@ -20,13 +20,29 @@ $STD apt install -y \
msg_ok "Installed Dependencies"
PG_VERSION="16" setup_postgresql
PG_DB_NAME="onlyoffice" PG_DB_USER="onlyoffice_user" setup_postgresql_db
msg_info "Setup Database"
DB_NAME=onlyoffice
DB_USER=onlyoffice_user
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
$STD sudo -u postgres psql -c "CREATE ROLE $DB_USER WITH LOGIN 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 "ALTER ROLE $DB_USER SET client_encoding TO 'utf8';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET default_transaction_isolation TO 'read committed';"
$STD sudo -u postgres psql -c "ALTER ROLE $DB_USER SET timezone TO 'UTC'"
{
echo "ONLYOFFICE-Credentials"
echo "ONLYOFFICE Database User: $DB_USER"
echo "ONLYOFFICE Database Password: $DB_PASS"
echo "ONLYOFFICE Database Name: $DB_NAME"
} >>~/onlyoffice.creds
msg_ok "Set up Database"
msg_info "Adding ONLYOFFICE GPG Key"
GPG_TMP="/tmp/onlyoffice.gpg"
KEY_URL="https://download.onlyoffice.com/GPG-KEY-ONLYOFFICE"
TMP_KEY_CONTENT=$(mktemp)
if curl_with_retry "$KEY_URL" "$TMP_KEY_CONTENT" && grep -q "BEGIN PGP PUBLIC KEY BLOCK" "$TMP_KEY_CONTENT"; then
if curl -fsSL "$KEY_URL" -o "$TMP_KEY_CONTENT" && grep -q "BEGIN PGP PUBLIC KEY BLOCK" "$TMP_KEY_CONTENT"; then
gpg --quiet --batch --yes --no-default-keyring --keyring "gnupg-ring:$GPG_TMP" --import "$TMP_KEY_CONTENT" >/dev/null 2>&1
chmod 644 "$GPG_TMP"
chown root:root "$GPG_TMP"
@@ -65,6 +81,9 @@ echo onlyoffice-documentserver onlyoffice/rabbitmq-pwd password $RMQ_PASS | debc
echo onlyoffice-documentserver onlyoffice/jwt-enabled boolean true | debconf-set-selections
echo onlyoffice-documentserver onlyoffice/jwt-secret password $JWT_SECRET | debconf-set-selections
echo "RabbitMQ User: $RMQ_USER" >>~/onlyoffice.creds
echo "RabbitMQ Password: $RMQ_PASS" >>~/onlyoffice.creds
echo "JWT Secret: $JWT_SECRET" >>~/onlyoffice.creds
{
echo ""
echo "ONLYOFFICE RabbitMQ Credentials"

View File

@@ -107,9 +107,9 @@ After=network.target postgresql.service chromium-printer.service
Wants=postgresql.service chromium-printer.service
[Service]
WorkingDirectory=/opt/reactive-resume/apps/web
WorkingDirectory=/opt/reactive-resume/apps/server
EnvironmentFile=/opt/reactive-resume/.env
ExecStart=/usr/bin/node .output/server/index.mjs
ExecStart=/usr/bin/node dist/index.mjs
Restart=always
RestartSec=5