From 8603e4ce188d9946f70fe2bb9a8b3faf67d3246f Mon Sep 17 00:00:00 2001 From: tremor021 Date: Tue, 21 Apr 2026 10:24:03 +0200 Subject: [PATCH] fireshare: add update function --- ct/fireshare.sh | 32 ++++++++++++++++++++++++++++++++ install/fireshare-install.sh | 1 + 2 files changed, 33 insertions(+) diff --git a/ct/fireshare.sh b/ct/fireshare.sh index 2ac13684..ffadff12 100644 --- a/ct/fireshare.sh +++ b/ct/fireshare.sh @@ -28,7 +28,39 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi + + if check_for_gh_release "fireshare" "ShaneIsrael/fireshare"; then + msg_info "Stopping Service" + systemctl stop fireshare + msg_ok "Stopped Service" + + mv /opt/fireshare/fireshare.env /opt + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "fireshare" "ShaneIsrael/fireshare" "tarball" + mv /opt/fireshare.env /opt/fireshare + rm -f /usr/local/bin/fireshare + + msg_info "Updating Fireshare" + cd /opt/fireshare + $STD uv venv + $STD .venv/bin/python -m ensurepip --upgrade + $STD .venv/bin/python -m pip install --upgrade --break-system-packages pip + $STD .venv/bin/python -m pip install --no-cache-dir --break-system-packages --ignore-installed app/server + cp .venv/bin/fireshare /usr/local/bin/fireshare + export FLASK_APP="/opt/fireshare/app/server/fireshare:create_app()" + export DATA_DIRECTORY=/opt/fireshare-data + export IMAGE_DIRECTORY=/opt/fireshare-images + export VIDEO_DIRECTORY=/opt/fireshare-videos + export PROCESSED_DIRECTORY=/opt/fireshare-processed + $STD uv run flask db upgrade + msg_ok "Ran Database Migrations" + + msg_info "Starting Service" + systemctl start fireshare + msg_ok "Started Service" + msg_ok "Updated successfully!" + fi cleanup_lxc + exit } diff --git a/install/fireshare-install.sh b/install/fireshare-install.sh index c5f720c4..17e2fd7f 100644 --- a/install/fireshare-install.sh +++ b/install/fireshare-install.sh @@ -109,6 +109,7 @@ $STD .venv/bin/python -m pip install --no-cache-dir --break-system-packages --ig cp .venv/bin/fireshare /usr/local/bin/fireshare export FLASK_APP="/opt/fireshare/app/server/fireshare:create_app()" export DATA_DIRECTORY=/opt/fireshare-data +export IMAGE_DIRECTORY=/opt/fireshare-images export VIDEO_DIRECTORY=/opt/fireshare-videos export PROCESSED_DIRECTORY=/opt/fireshare-processed $STD uv run flask db upgrade