From ab33f85d9d658b87b4e77b871847c3dcdbf6bfdb Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 15 Jan 2026 13:48:10 +0100 Subject: [PATCH] Refactor: FreshRSS + Bump to Debian 13 (#10824) * Refactor: FreshRSS + Bump to Debian 13 * update_script --- ct/freshrss.sh | 43 ++++++++++++++++++++++++++---- frontend/public/json/freshrss.json | 2 +- install/freshrss-install.sh | 19 +++---------- 3 files changed, 42 insertions(+), 22 deletions(-) diff --git a/ct/freshrss.sh b/ct/freshrss.sh index 0cb5c40f5..45769bf0b 100644 --- a/ct/freshrss.sh +++ b/ct/freshrss.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-2}" var_ram="${var_ram:-1024}" var_disk="${var_disk:-4}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -33,11 +33,44 @@ function update_script() { chmod +x /opt/freshrss/cli/sensitive-log.sh systemctl restart apache2 msg_ok "Fixed wrong permissions" - exit - else - msg_error "FreshRSS should be updated via the user interface." - exit fi + + if check_for_gh_release "freshrss" "FreshRSS/FreshRSS"; then + msg_info "Stopping Apache2" + systemctl stop apache2 + msg_ok "Stopped Apache2" + + msg_info "Backing up FreshRSS" + mv /opt/freshrss /opt/freshrss-backup + msg_ok "Backup Created" + + fetch_and_deploy_gh_release "freshrss" "FreshRSS/FreshRSS" "tarball" + + msg_info "Restoring data and configuration" + if [[ -d /opt/freshrss-backup/data ]]; then + cp -a /opt/freshrss-backup/data/. /opt/freshrss/data/ + fi + if [[ -d /opt/freshrss-backup/extensions ]]; then + cp -a /opt/freshrss-backup/extensions/. /opt/freshrss/extensions/ + fi + msg_ok "Data Restored" + + msg_info "Setting permissions" + chown -R www-data:www-data /opt/freshrss + chmod -R g+rX /opt/freshrss + chmod -R g+w /opt/freshrss/data/ + msg_ok "Permissions Set" + + msg_info "Starting Apache2" + systemctl start apache2 + msg_ok "Started Apache2" + + msg_info "Cleaning up backup" + rm -rf /opt/freshrss-backup + msg_ok "Cleaned up backup" + msg_ok "Updated successfully!" + fi + exit } start diff --git a/frontend/public/json/freshrss.json b/frontend/public/json/freshrss.json index 108f53c2f..af4552f6e 100644 --- a/frontend/public/json/freshrss.json +++ b/frontend/public/json/freshrss.json @@ -23,7 +23,7 @@ "ram": 1024, "hdd": 4, "os": "debian", - "version": "12" + "version": "13" } } ], diff --git a/install/freshrss-install.sh b/install/freshrss-install.sh index 4ae8f17bc..e8605711a 100644 --- a/install/freshrss-install.sh +++ b/install/freshrss-install.sh @@ -13,22 +13,9 @@ setting_up_container network_check update_os -PHP_VERSION="8.2" PHP_MODULE="curl,xml,mbstring,intl,zip,pgsql,gmp" PHP_APACHE="YES" setup_php +PHP_VERSION="8.4" PHP_MODULE="curl,common,xml,mbstring,intl,zip,pgsql,gmp,zlib" PHP_APACHE="YES" setup_php PG_VERSION="16" setup_postgresql - -msg_info "Setting up PostgreSQL" -DB_NAME=freshrss -DB_USER=freshrss -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 TEMPLATE template0;" -{ - echo "FreshRSS Credentials" - echo "FreshRSS Database User: $DB_USER" - echo "FreshRSS Database Password: $DB_PASS" - echo "FreshRSS Database Name: $DB_NAME" -} >>~/freshrss.creds -msg_ok "Set up PostgreSQL" +PG_DB_NAME="freshrss" PG_DB_USER="freshrss_usr" setup_postgresql_db fetch_and_deploy_gh_release "freshrss" "FreshRSS/FreshRSS" "tarball" @@ -65,7 +52,7 @@ cat </etc/apache2/sites-available/freshrss.conf EOF $STD a2ensite freshrss -$STD a2enmod rewrite +$STD a2enmod rewrite deflate expires headers mime setenvif $STD a2dissite 000-default.conf $STD systemctl reload apache2 msg_ok "Created Service"