| Crates.io | distronomicon |
| lib.rs | distronomicon |
| version | 0.2.0 |
| created_at | 2025-11-01 21:51:52.875585+00 |
| updated_at | 2025-11-03 02:32:13.836767+00 |
| description | GitHub release updater for Linux binaries |
| homepage | |
| repository | https://github.com/jtdowney/distronomicon |
| max_upload_size | |
| id | 1912476 |
| size | 326,339 |
A Linux tool that checks GitHub for repository releases and performs atomic updates under /opt/<app>. Designed for use with systemd timers.
cargo install distronomicon
cargo build --release
sudo cp target/release/distronomicon /usr/local/bin/
All commands require --app <name> to specify the application being managed.
Query GitHub for the latest release without installing:
distronomicon --app myapp check \
--repo owner/repo \
--state-directory /var/lib/distronomicon
Prints up-to-date: v1.2.3, update-available: v1.2.3 -> v1.2.4, or install-available: v1.2.4.
Download, verify, and install the latest release:
distronomicon --app myapp update \
--repo owner/repo \
--pattern 'myapp-.*\.tar\.gz' \
--checksum-pattern 'SHA256SUMS' \
--state-directory /var/lib/distronomicon \
--restart-command 'systemctl restart myapp'
This will:
/opt/myapp/releases/<tag>/opt/myapp/bin--retain)distronomicon --app myapp version
Prints the currently installed tag (e.g., v1.2.3), derived from symlinks in the bin directory.
/opt/<app>/
bin/ # Symlinks to current release binaries
myapp -> ../releases/v1.2.3/myapp
releases/
v1.2.2/ # Previous release
v1.2.3/ # Current release
staging/ # Temporary extraction (cleaned after install)
/var/lib/distronomicon/<app>/state.json # Tracks latest tag, ETag, Last-Modified
The --install-root flag changes the base from /opt to another location.
For private repositories or higher rate limits, provide a token:
export GITHUB_TOKEN=ghp_...
distronomicon --app myapp update ...
Or use --github-token flag.
Example service and timer files are in the systemd/ directory.
sudo cp systemd/distronomicon@.{service,timer} /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl edit distronomicon@myapp.service
[Service]
Environment="DISTRONOMICON_REPO=owner/repo"
Environment="DISTRONOMICON_PATTERN=myapp-.*\.tar\.gz"
sudo systemctl enable --now distronomicon@myapp.timer
Required:
DISTRONOMICON_REPO - GitHub repository in owner/repo formatDISTRONOMICON_PATTERN - Regex pattern to match release assetsOptional:
GITHUB_TOKEN - GitHub API token (for private repos or higher rate limits)GITHUB_HOST - GitHub Enterprise host (default: https://api.github.com)STATE_DIRECTORY - State directory (auto-set by systemd via StateDirectory=)DISTRONOMICON_CHECKSUM_PATTERN - Checksum file pattern (e.g., SHA256SUMS)DISTRONOMICON_RESTART_COMMAND - Command to run after update (e.g., systemctl restart myapp)DISTRONOMICON_RETAIN - Number of old releases to keep (default: 3)DISTRONOMICON_INSTALL_ROOT - Install base directory (default: /opt)DISTRONOMICON_ALLOW_PRERELEASE - Include prereleases (set to true)⚠️ Note: If you change DISTRONOMICON_INSTALL_ROOT, you must also override ReadWritePaths in your drop-in configuration to grant write access to the custom location (required by ProtectSystem=strict).
Example with optional variables:
[Service]
Environment="DISTRONOMICON_REPO=owner/repo"
Environment="DISTRONOMICON_PATTERN=myapp-.*\.tar\.gz"
Environment="GITHUB_TOKEN=ghp_..."
Environment="DISTRONOMICON_CHECKSUM_PATTERN=SHA256SUMS"
Environment="DISTRONOMICON_RESTART_COMMAND=systemctl restart myapp"
Environment="DISTRONOMICON_RETAIN=5"
Environment="DISTRONOMICON_INSTALL_ROOT=/custom/opt"
ReadWritePaths=/custom/opt
By default, the timer checks every 3 minutes. To change the interval:
sudo systemctl edit distronomicon@myapp.timer
[Timer]
OnBootSec=5m
OnUnitActiveSec=10m
Check status:
systemctl status distronomicon@myapp.timer
systemctl list-timers distronomicon@*
journalctl -u distronomicon@myapp.service
--install-root - Change base directory (default: /opt)--skip-verification - Skip checksum verification (not recommended)--retain N - Keep N old releases after update (default: 3)--allow-prerelease - Include prerelease versions--github-host - Use GitHub Enterprise (default: https://api.github.com)-v, -vv - Increase logging verbosityFeatures under consideration for future development
--dry-run)MIT