From 8e7dc349ac73f4dac444d9b3dad54690014a0114 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 29 Jan 2026 12:43:54 +0100 Subject: [PATCH] core: Add config file handling options | Fix Vikunja update with interactive overwrite (#11317) --- ct/vikunja.sh | 14 ++++++++++++++ misc/tools.func | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ct/vikunja.sh b/ct/vikunja.sh index 33a1a5050..bd692ace7 100644 --- a/ct/vikunja.sh +++ b/ct/vikunja.sh @@ -46,6 +46,20 @@ function update_script() { fi if check_for_gh_release "vikunja" "go-vikunja/vikunja"; then + echo + msg_warn "The package update may include config file changes." + echo -e "${TAB}${YW}How do you want to handle /etc/vikunja/config.yml?${CL}" + echo -e "${TAB} 1) Keep your current config" + echo -e "${TAB} 2) Install the new package maintainer's config" + read -rp " Choose [1/2] (default: 1): " -t 60 CONFIG_CHOICE || CONFIG_CHOICE="1" + [[ -z "$CONFIG_CHOICE" ]] && CONFIG_CHOICE="1" + + if [[ "$CONFIG_CHOICE" == "2" ]]; then + export DPKG_FORCE_CONFNEW="1" + else + export DPKG_FORCE_CONFOLD="1" + fi + msg_info "Stopping Service" systemctl stop vikunja msg_ok "Stopped Service" diff --git a/misc/tools.func b/misc/tools.func index 42cc5b8a9..29efe61db 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -1846,7 +1846,11 @@ function fetch_and_deploy_gh_release() { chmod 644 "$tmpdir/$filename" # SYSTEMD_OFFLINE=1 prevents systemd-tmpfiles failures in unprivileged LXC (Debian 13+/systemd 257+) - SYSTEMD_OFFLINE=1 $STD apt install -y "$tmpdir/$filename" || { + # Support DPKG_CONFOLD/DPKG_CONFNEW env vars for config file handling during .deb upgrades + local dpkg_opts="" + [[ "${DPKG_FORCE_CONFOLD:-}" == "1" ]] && dpkg_opts="-o Dpkg::Options::=--force-confold" + [[ "${DPKG_FORCE_CONFNEW:-}" == "1" ]] && dpkg_opts="-o Dpkg::Options::=--force-confnew" + DEBIAN_FRONTEND=noninteractive SYSTEMD_OFFLINE=1 $STD apt install -y $dpkg_opts "$tmpdir/$filename" || { SYSTEMD_OFFLINE=1 $STD dpkg -i "$tmpdir/$filename" || { msg_error "Both apt and dpkg installation failed" rm -rf "$tmpdir"