From cc4ceee5ab99c1c729738a3dca508c62120bd7c8 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 29 Sep 2025 14:08:07 +0200 Subject: [PATCH] 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. --- ct/ghostfolio.sh | 52 +++++++++++++++-------------------- install/ghostfolio-install.sh | 50 +++++++++++---------------------- install/warracker-install.sh | 2 +- 3 files changed, 39 insertions(+), 65 deletions(-) diff --git a/ct/ghostfolio.sh b/ct/ghostfolio.sh index 5acd7f6a..63c9be00 100644 --- a/ct/ghostfolio.sh +++ b/ct/ghostfolio.sh @@ -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" - systemctl stop ghostfolio - msg_ok "Stopped $APP" + if check_for_gh_release "ghostfolio" "ghostfolio/ghostfolio"; then + msg_info "Stopping Service" + systemctl stop ghostfolio + msg_ok "Stopped Service" - msg_info "Creating Backup" - tar -czf "/opt/ghostfolio_backup_$(date +%F).tar.gz" /opt/ghostfolio - msg_ok "Backup Created" + 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 + msg_info "Updating Ghostfolio" + mv /opt/env.backup /opt/ghostfolio/.env + cd /opt/ghostfolio + $STD npm ci + $STD npm run build:production + $STD prisma migrate deploy + msg_ok "Updated Ghostfolio" - if fetch_and_deploy_gh_release "ghostfolio" "ghostfolio/ghostfolio" "tarball" "latest" "/opt/ghostfolio"; then - 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 - - 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 } diff --git a/install/ghostfolio-install.sh b/install/ghostfolio-install.sh index 090b209b..9c02175b 100644 --- a/install/ghostfolio-install.sh +++ b/install/ghostfolio-install.sh @@ -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" diff --git a/install/warracker-install.sh b/install/warracker-install.sh index 26d9d524..a3f4d13c 100644 --- a/install/warracker-install.sh +++ b/install/warracker-install.sh @@ -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"