diff --git a/ct/vikunja.sh b/ct/vikunja.sh index b0612ff64..33a1a5050 100644 --- a/ct/vikunja.sh +++ b/ct/vikunja.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) # Copyright (c) 2021-2026 community-scripts ORG -# Author: MickLesk (Canbiz) +# Author: MickLesk (Canbiz) | Co-Author: CrazyWolf13 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://vikunja.io/ @@ -27,30 +27,37 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - RELEASE=$(curl -fsSL https://dl.vikunja.io/vikunja/ | grep -oP 'href="/vikunja/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) - if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then + + RELEASE="$( [[ -f "$HOME/.vikunja" ]] && cat "$HOME/.vikunja" 2>/dev/null || [[ -f /opt/Vikunja_version ]] && cat /opt/Vikunja_version 2>/dev/null || true)" + if [[ -z "$RELEASE" ]] || [[ "$RELEASE" == "unstable" ]] || dpkg --compare-versions "${RELEASE:-0.0.0}" lt "1.0.0"; then + msg_warn "You are upgrading from Vikunja '$RELEASE'." + msg_warn "This requires MANUAL config changes in /etc/vikunja/config.yml." + msg_warn "See: https://vikunja.io/changelog/whats-new-in-vikunja-1.0.0/#config-changes" + + read -rp "Continue with update? (y to proceed): " -t 30 CONFIRM1 || exit 1 + [[ "$CONFIRM1" =~ ^[yY]$ ]] || exit 0 + + echo + msg_warn "Vikunja may not start after the update until you manually adjust the config." + msg_warn "Details: https://vikunja.io/changelog/whats-new-in-vikunja-1.0.0/#config-changes" + + read -rp "Acknowledge and continue? (y): " -t 30 CONFIRM2 || exit 1 + [[ "$CONFIRM2" =~ ^[yY]$ ]] || exit 0 + fi + + if check_for_gh_release "vikunja" "go-vikunja/vikunja"; then msg_info "Stopping Service" systemctl stop vikunja msg_ok "Stopped Service" - msg_info "Updating ${APP} to ${RELEASE}" - cd /opt - rm -rf /opt/vikunja/vikunja - curl -fsSL "https://dl.vikunja.io/vikunja/$RELEASE/vikunja-$RELEASE-amd64.deb" -o $(basename "https://dl.vikunja.io/vikunja/$RELEASE/vikunja-$RELEASE-amd64.deb") - export DEBIAN_FRONTEND=noninteractive - $STD dpkg -i vikunja-"$RELEASE"-amd64.deb - rm -rf /opt/vikunja-"$RELEASE"-amd64.deb - echo "${RELEASE}" >/opt/${APP}_version.txt - msg_ok "Updated ${APP}" + fetch_and_deploy_gh_release "vikunja" "go-vikunja/vikunja" "binary" msg_info "Starting Service" systemctl start vikunja msg_ok "Started Service" msg_ok "Updated successfully!" - else - msg_ok "No update required. ${APP} is already at ${RELEASE}" fi - exit + exit 0 } start diff --git a/install/vikunja-install.sh b/install/vikunja-install.sh index 1d13609b9..3307fd04c 100644 --- a/install/vikunja-install.sh +++ b/install/vikunja-install.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Copyright (c) 2021-2026 community-scripts ORG -# Author: MickLesk (Canbiz) +# Author: MickLesk (Canbiz) | Co-Author: CrazyWolf13 # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://vikunja.io/ @@ -13,22 +13,14 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt install -y make -msg_ok "Installed Dependencies" +fetch_and_deploy_gh_release "vikunja" "go-vikunja/vikunja" "binary" -msg_info "Setup Vikunja (Patience)" -cd /opt -RELEASE=$(curl -fsSL https://dl.vikunja.io/vikunja/ | grep -oP 'href="/vikunja/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) -curl -fsSL "https://dl.vikunja.io/vikunja/$RELEASE/vikunja-$RELEASE-amd64.deb" -o vikunja-"$RELEASE"-amd64.deb -$STD dpkg -i vikunja-"$RELEASE"-amd64.deb -sed -i 's|^ timezone: .*| timezone: UTC|' /etc/vikunja/config.yml -sed -i 's|"./vikunja.db"|"/etc/vikunja/vikunja.db"|' /etc/vikunja/config.yml -sed -i 's|./files|/etc/vikunja/files|' /etc/vikunja/config.yml -systemctl start vikunja.service -rm -rf /opt/vikunja-"$RELEASE"-amd64.deb -echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt -msg_ok "Installed Vikunja" +msg_info "Setting up Vikunja" +sed -i 's|^# \(service:\)|\1|' /etc/vikunja/config.yml +sed -i "s|^ # \(publicurl: \).*| \1\"http://$LOCAL_IP\"|" /etc/vikunja/config.yml +sed -i "0,/^ # \(timezone: \).*/s|| \1${tz}|" /etc/vikunja/config.yml +systemctl enable -q --now vikunja +msg_ok "Set up Vikunja" motd_ssh customize