Update Ghostfolio and Warracker install scripts

Bump default Debian and dependency versions for Ghostfolio and Warracker. Streamline Ghostfolio update and install logic, improve backup handling, and update commands to use latest Node.js, PostgreSQL, and Python versions. Clean up redundant steps and standardize output handling.
This commit is contained in:
CanbiZ 2025-09-29 14:08:07 +02:00
parent 01bccd8145
commit cc4ceee5ab
3 changed files with 39 additions and 65 deletions

View File

@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
@ -29,43 +29,35 @@ function update_script() {
exit
fi
msg_info "Stopping $APP"
if check_for_gh_release "ghostfolio" "ghostfolio/ghostfolio"; then
msg_info "Stopping Service"
systemctl stop ghostfolio
msg_ok "Stopped $APP"
msg_ok "Stopped Service"
msg_info "Creating Backup"
tar -czf "/opt/ghostfolio_backup_$(date +%F).tar.gz" /opt/ghostfolio
mv /opt/ghostfolio/.env /opt/env.backup
msg_ok "Backup Created"
msg_info "Updating $APP"
systemctl stop ghostfolio
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ghostfolio" "ghostfolio/ghostfolio" "tarball" "latest" "/opt/ghostfolio"
if [[ -d /opt/ghostfolio ]]; then
rm -rf /opt/ghostfolio_backup
mv /opt/ghostfolio /opt/ghostfolio_backup
fi
if fetch_and_deploy_gh_release "ghostfolio" "ghostfolio/ghostfolio" "tarball" "latest" "/opt/ghostfolio"; then
msg_info "Updating Ghostfolio"
mv /opt/env.backup /opt/ghostfolio/.env
cd /opt/ghostfolio
npm ci
npm run build:production
npx prisma migrate deploy
msg_ok "Updated $APP"
else
if [[ -d /opt/ghostfolio_backup ]]; then
rm -rf /opt/ghostfolio
mv /opt/ghostfolio_backup /opt/ghostfolio
fi
msg_ok "No update required or update failed. ${APP} is up to date"
fi
$STD npm ci
$STD npm run build:production
$STD prisma migrate deploy
msg_ok "Updated Ghostfolio"
msg_info "Starting $APP"
msg_info "Starting Service"
systemctl start ghostfolio
msg_ok "Started $APP"
msg_ok "Started Service"
msg_info "Cleaning Up"
npm cache clean --force
$STD npm cache clean --force
msg_ok "Cleanup Completed"
msg_ok "Updated Successfully"
fi
exit
}

View File

@ -14,20 +14,15 @@ network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
$STD apt install -y \
build-essential \
python3 \
openssl \
curl \
ca-certificates
ca-certificates \
redis-server
msg_ok "Installed Dependencies"
PG_VERSION="15" setup_postgresql
NODE_VERSION="22" setup_nodejs
msg_info "Installing Redis"
$STD apt-get install -y redis-server
msg_ok "Installed Redis"
PG_VERSION="17" setup_postgresql
NODE_VERSION="24" setup_nodejs
msg_info "Setting up Database"
DB_NAME=ghostfolio
@ -52,31 +47,17 @@ $STD sudo -u postgres psql -d $DB_NAME -c "ALTER DEFAULT PRIVILEGES IN SCHEMA pu
echo "Redis Password: $REDIS_PASS"
echo "Access Token Salt: $ACCESS_TOKEN_SALT"
echo "JWT Secret Key: $JWT_SECRET_KEY"
if [[ -n "${COINGECKO_DEMO_KEY:-}" ]]; then
echo "CoinGecko Demo API Key: $COINGECKO_DEMO_KEY"
fi
if [[ -n "${COINGECKO_PRO_KEY:-}" ]]; then
echo "CoinGecko Pro API Key: $COINGECKO_PRO_KEY"
fi
echo ""
echo "To add CoinGecko API keys later, edit: /opt/ghostfolio/.env"
} >>~/ghostfolio.creds
msg_ok "Set up Database"
msg_info "Configuring Redis"
sed -i "s/# requirepass foobared/requirepass $REDIS_PASS/" /etc/redis/redis.conf
systemctl restart redis-server
msg_ok "Configured Redis"
fetch_and_deploy_gh_release "ghostfolio" "ghostfolio/ghostfolio" "tarball" "latest" "/opt/ghostfolio"
msg_info "Installing Ghostfolio Dependencies"
msg_info "Setup Ghostfolio"
sed -i "s/# requirepass foobared/requirepass $REDIS_PASS/" /etc/redis/redis.conf
systemctl restart redis-server
cd /opt/ghostfolio
npm ci
msg_ok "Installed Dependencies"
msg_info "Building Ghostfolio (This may take several minutes)"
npm run build:production
$STD npm ci
$STD npm run build:production
msg_ok "Built Ghostfolio"
msg_ok "Optional CoinGecko API Configuration"
@ -111,8 +92,8 @@ msg_ok "Set up Environment"
msg_info "Running Database Migrations"
cd /opt/ghostfolio
npx prisma migrate deploy
npx prisma db seed
$STD npx prisma migrate deploy
$STD npx prisma db seed
msg_ok "Database Migrations Complete"
msg_info "Creating Service"
@ -143,7 +124,8 @@ motd_ssh
customize
msg_info "Cleaning up"
npm cache clean --force
$STD apt-get -y autoremove
$STD apt-get -y autoclean
$STD npm cache clean --force
$STD apt -y autoremove
$STD apt -y autoclean
$STD apt -y clean
msg_ok "Cleaned"

View File

@ -20,7 +20,7 @@ $STD apt install -y \
nginx
msg_ok "Installed Dependencies"
PYTHON_VERSION="3.12" setup_uv
PYTHON_VERSION="3.13" setup_uv
PG_VERSION="17" setup_postgresql
msg_info "Setup PostgreSQL"