From 693ae94e7d585c40d0e35e84af6390cf9f23eef8 Mon Sep 17 00:00:00 2001 From: Spyros Roum Date: Sun, 5 Jan 2025 14:06:43 +0200 Subject: [PATCH] Install/update ActualBudget based on releases, not latest main --- ct/actualbudget.sh | 6 ++++-- install/actualbudget-install.sh | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ct/actualbudget.sh b/ct/actualbudget.sh index 8bad74dc..c2f959f1 100644 --- a/ct/actualbudget.sh +++ b/ct/actualbudget.sh @@ -34,11 +34,13 @@ function update_script() { fi msg_info "Updating ${APP}" systemctl stop actualbudget.service + RELEASE=$(curl -s https://api.github.com/repos/actualbudget/actual-server/tags | jq '.[0].name') cd /opt/actualbudget git pull &>/dev/null + git checkout "$RELEASE" yarn install &>/dev/null systemctl start actualbudget.service - msg_ok "Successfully Updated ${APP}" + msg_ok "Successfully Updated ${APP} to ${RELEASE}" exit } @@ -49,4 +51,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5006${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:5006${CL}" diff --git a/install/actualbudget-install.sh b/install/actualbudget-install.sh index 64995d5a..1ece7d1a 100644 --- a/install/actualbudget-install.sh +++ b/install/actualbudget-install.sh @@ -35,7 +35,8 @@ $STD apt-get install -y nodejs $STD npm install --global yarn msg_ok "Installed Node.js" -msg_info "Installing Actual Budget" +RELEASE=$(curl -s https://api.github.com/repos/actualbudget/actual-server/tags | jq '.[0].name') +msg_info "Installing Actual Budget $RELEASE" $STD git clone https://github.com/actualbudget/actual-server.git /opt/actualbudget mkdir -p /opt/actualbudget/server-files chown -R root:root /opt/actualbudget/server-files @@ -45,6 +46,7 @@ ACTUAL_UPLOAD_DIR=/opt/actualbudget/server-files PORT=5006 EOF cd /opt/actualbudget +$STD git checkout "$RELEASE" $STD yarn install msg_ok "Installed Actual Budget"