hephaestus/docs/how-to/self-update.md

56 lines
1.8 KiB
Markdown
Raw Normal View History

---
title: hephd self-update
modified: 2026-06-04
tags:
- how-to
---
# hephd self-update
`hephd` can keep itself current: it polls the forge for a newer release and, when
one appears, rebuilds and restarts onto it — unattended. It is **opt-in and off
by default**.
## Enable it
On the managed service:
```bash
heph daemon start --self-update
```
That generates a launchd/systemd service that runs `hephd --self-update` and
gives it a `PATH` that can find `cargo`. `heph daemon restart` preserves the
setting (pass `--self-update` again to turn it on later). To run the daemon
directly instead:
```bash
hephd --self-update # default: poll every 6h
hephd --self-update --self-update-interval-secs 3600
```
## How it works
1. Each interval, `hephd` GETs the forge's `releases/latest` and compares the tag
against its own version (the one `heph --version` reports).
2. On a newer release it runs `cargo install --locked --git <public-https-url>
--tag vX.Y.Z` for `heph`/`hephd`/`heph-tui`/`heph-quickadd`. hephaestus is a
public repo, so this is an anonymous clone — **no credentials**.
3. On a successful install it exits cleanly; the service manager (launchd
`KeepAlive` / systemd `Restart=always`) brings the new binary up.
A failed poll or build is logged and the daemon keeps running on its current
version — self-update never takes the daemon down.
## Requirements & notes
- The **Rust toolchain** (`cargo`) must be installed for the service user; the
update builds from source.
- Off by default — nothing happens unless `--self-update` is passed.
- The first real cross-version upgrade is observable on the first release cut
after enabling it.
## Related
- [[run-the-daemon]] — running `hephd` as an OS service
- [[install-heph]] — installing the binaries