From cc6219ef28246df84ab32dc73aaf45b9f3e9d43a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 25 Sep 2025 15:01:40 +0200 Subject: [PATCH] Refine install and update scripts for Warracker Standardized messaging in update script to use 'Warracker' instead of variable. Updated install script to use 'apt' instead of 'apt-get', improved PostgreSQL setup messaging, and added 'apt clean' to cleanup steps. --- ct/warracker.sh | 6 +++--- install/warracker-install.sh | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ct/warracker.sh b/ct/warracker.sh index c435c60a..19c41280 100644 --- a/ct/warracker.sh +++ b/ct/warracker.sh @@ -37,13 +37,13 @@ function update_script() { fetch_and_deploy_gh_release "warracker" "sassanix/Warracker" "tarball" "latest" "/opt/warracker" - msg_info "Updating $APP" + msg_info "Updating Warracker" cd /opt/warracker/backend $STD uv venv .venv $STD source .venv/bin/activate $STD uv pip install -r requirements.txt - msg_ok "Updated $APP" - + msg_ok "Updated Warracker" + msg_info "Starting Services" systemctl start warracker systemctl start nginx diff --git a/install/warracker-install.sh b/install/warracker-install.sh index c10fc723..26d9d524 100644 --- a/install/warracker-install.sh +++ b/install/warracker-install.sh @@ -14,7 +14,7 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y \ +$STD apt install -y \ build-essential \ libpq-dev \ nginx @@ -23,13 +23,12 @@ msg_ok "Installed Dependencies" PYTHON_VERSION="3.12" setup_uv PG_VERSION="17" setup_postgresql -msg_info "Installing Postgresql" +msg_info "Setup PostgreSQL" DB_NAME="warranty_db" DB_USER="warranty_user" DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) DB_ADMIN_USER="warracker_admin" DB_ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) -systemctl start postgresql $STD sudo -u postgres psql -c "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS';" $STD sudo -u postgres psql -c "CREATE USER $DB_ADMIN_USER WITH PASSWORD '$DB_ADMIN_PASS' SUPERUSER;" $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME OWNER $DB_ADMIN_USER;" @@ -44,7 +43,7 @@ $STD sudo -u postgres psql -d "$DB_NAME" -c "ALTER DEFAULT PRIVILEGES IN SCHEMA echo "DB_ADMIN_USER: $DB_ADMIN_USER" echo "DB_ADMIN_PASS: $DB_ADMIN_PASS" } >>~/warracker.creds -msg_ok "Installed PostgreSQL" +msg_ok "Setup PostgreSQL" fetch_and_deploy_gh_release "warracker" "sassanix/Warracker" "tarball" "latest" "/opt/warracker" @@ -114,6 +113,7 @@ motd_ssh customize msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean +$STD apt -y autoremove +$STD apt -y autoclean +$STD apt -y clean msg_ok "Cleaned"