From 427ce771d709b9f593543f94a186a0673b16b8d3 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Sun, 6 Apr 2025 16:00:08 +0200 Subject: [PATCH] Actual: Add git dependency & change yarn commands (#3703) --- ct/actualbudget.sh | 11 ++++++++++- install/actualbudget-install.sh | 16 +++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ct/actualbudget.sh b/ct/actualbudget.sh index 53d4d5fdc..075a90c87 100644 --- a/ct/actualbudget.sh +++ b/ct/actualbudget.sh @@ -35,6 +35,13 @@ function update_script() { systemctl stop actualbudget msg_ok "${APP} Stopped" + if ! command -v git &>/dev/null; then + msg_info "Installing git" + $STD apt-get update + $STD apt-get install -y git + msg_ok "Installed git" + fi + msg_info "Updating ${APP} to ${RELEASE}" cd /tmp || exit curl -fsSL "https://github.com/actualbudget/actual/archive/refs/tags/v${RELEASE}.tar.gz" -o "v${RELEASE}.tar.gz" @@ -77,7 +84,9 @@ ACTUAL_HTTPS_CERT=/opt/actualbudget/selfhost.crt EOF fi cd /opt/actualbudget || exit - $STD yarn workspaces focus @actual-app/sync-server --production + $STD yarn install + $STD yarn run build:server + #$STD yarn workspaces focus @actual-app/sync-server --production echo "${RELEASE}" >/opt/actualbudget_version.txt msg_ok "Updated ${APP}" diff --git a/install/actualbudget-install.sh b/install/actualbudget-install.sh index 24f412596..57509a2a4 100644 --- a/install/actualbudget-install.sh +++ b/install/actualbudget-install.sh @@ -17,7 +17,8 @@ msg_info "Installing Dependencies" $STD apt-get install -y \ tini \ gpg \ - build-essential + build-essential \ + git msg_ok "Installed Dependencies" msg_info "Setting up Node.js Repository" @@ -33,11 +34,11 @@ $STD npm install --global yarn msg_ok "Installed Node.js" msg_info "Installing Actual Budget" -cd /opt +cd /opt || exit RELEASE=$(curl -fsSL https://api.github.com/repos/actualbudget/actual/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') curl -fsSL "https://github.com/actualbudget/actual/archive/refs/tags/v${RELEASE}.tar.gz" -o $(basename "https://github.com/actualbudget/actual/archive/refs/tags/v${RELEASE}.tar.gz") -tar -xzf v${RELEASE}.tar.gz -mv actual-${RELEASE} /opt/actualbudget +tar -xzf v"${RELEASE}".tar.gz +mv actual-"${RELEASE}" /opt/actualbudget mkdir -p /opt/actualbudget-data/{server-files,upload,migrate,user-files,migrations,config} chown -R root:root /opt/actualbudget-data @@ -53,8 +54,9 @@ ACTUAL_TRUSTED_PROXIES="10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1/32,::1 ACTUAL_HTTPS_KEY=/opt/actualbudget/selfhost.key ACTUAL_HTTPS_CERT=/opt/actualbudget/selfhost.crt EOF -cd /opt/actualbudget -$STD yarn workspaces focus @actual-app/sync-server --production +cd /opt/actualbudget || exit +$STD yarn install +$STD yarn run build:server $STD openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout selfhost.key -out selfhost.crt <