Skip to content

0.2.0

Choose a tag to compare

@NetHorror NetHorror released this 10 Dec 07:35
· 8 commits to main since this release
9f25f7c

✨ What’s new in 0.2.0

This release turns the Linux helper into a proper sibling of the Windows and macOS
delayed update scripts:

  • dedicated main script netbird-delayed-update-linux.sh;
  • JSON state file with candidate version and timestamps;
  • per-run log files with retention;
  • optional script self-update from GitHub releases;
  • CLI-based systemd installation and uninstall;
  • default delay increased to 10 days.

🚀 Added

  • Main script netbird-delayed-update-linux.sh:

    • implements delayed / staged rollout using the APT candidate version of netbird;
    • stores state in /var/lib/netbird-delayed-update/state.json with:
      • CandidateVersion
      • FirstSeenUtc
      • LastCheckUtc;
    • writes per-run logs under:
      /var/lib/netbird-delayed-update/netbird-delayed-update-YYYYMMDD-HHMMSS.log
      
    • supports --log-retention-days (default: 60, 0 disables cleanup).
  • Script self-update (optional):

    • queries the latest GitHub release of this repository;
    • compares the release tag (X.Y.Z) to SCRIPT_VERSION (currently 0.2.0);
    • if newer:
      • tries git pull --ff-only when the script lives inside a git checkout;
      • otherwise downloads netbird-delayed-update-linux.sh from the tagged version
        on raw.githubusercontent.com and overwrites the local script;
    • the updated script is used on the next run.
  • Systemd integration via CLI:

    • --install / -i creates or updates:
      • /etc/systemd/system/netbird-delayed-update.service
      • /etc/systemd/system/netbird-delayed-update.timer;
    • --uninstall / -u removes these units;
    • --remove-state additionally removes:
      • /usr/local/sbin/netbird-delayed-update.sh
      • /var/lib/netbird-delayed-update;
    • configuration options:
      • --delay-days
      • --max-random-delay-seconds
      • --daily-time "HH:MM"
      • --log-retention-days.

🔧 Changed

  • Default delay for new NetBird versions is now 10 days:
    • when you run --install without extra flags, the timer will only allow
      upgrades after the candidate version has stayed in the APT repo unchanged
      for at least 10 days;
    • you can override this with --delay-days N during installation.
  • state.json handling no longer uses python3:
    • the script writes a small JSON file itself and reads it back via grep,
      which simplifies runtime dependencies;
    • Python is no longer required to run the delayed-update logic.
  • Age calculation between FirstSeenUtc and the current time is clamped to
    >= 0 days to avoid negative values when the system clock moves backwards.
  • Version comparison is now based on dpkg --compare-versions, which correctly
    handles Debian/Ubuntu-style version strings.
  • The README and examples now use netbird-delayed-update-linux.sh directly as the main
    entry point for:
    • one-off runs,
    • installing the systemd service and timer,
    • uninstalling them later.

🐛 Fixed

  • More robust behaviour when:
    • the netbird package is not installed locally (no silent auto-install);
    • APT reports Candidate: (none) or no candidate at all;
    • the optional netbird-ui package is missing from the repository
      (upgrade falls back to netbird only).
  • Log creation and cleanup are now consistent across runs:
    • each run creates a new timestamped log file;
    • old log files are removed based on --log-retention-days when configured.

🧪 Upgrade / install notes

For new installations, follow the updated README:

git clone https://github.com/NetHorror/netbird-delayed-auto-update-linux.git
cd netbird-delayed-auto-update-linux
chmod +x ./netbird-delayed-update-linux.sh
sudo ./netbird-delayed-update-linux.sh --install

This will:

  • copy the script to /usr/local/sbin/netbird-delayed-update.sh;
  • install netbird-delayed-update.service and netbird-delayed-update.timer;
  • reload systemd and enable the timer;
  • schedule a daily delayed-update check with version aging and log retention.

To keep the previous behaviour with a shorter delay (e.g. 3 days), install with:

sudo ./netbird-delayed-update-linux.sh --install \
  --delay-days 3 \
  --max-random-delay-seconds 3600 \
  --daily-time "04:00"

Existing setups based on the previous installer script can be migrated by:

  • dropping the old systemd units, and
  • reinstalling them via netbird-delayed-update-linux.sh --install with the desired
    parameters.

See CHANGELOG.md for the full list of changes.