generated from eblume/project-template
All checks were successful
Build / validate (pull_request) Successful in 5m45s
`heph daemon start`/`restart` previously hardcoded `hephd --mode local` and only wired the bare `--self-update` bool — the poll interval and all spoke/hub sync config (`--hub-url`, `--http-addr`, `--oidc-*`) could not be set on the managed service without hand-editing the plist/unit (which a later start/restart would clobber). Generate the hephd arg vector from a DaemonConfig and add the corresponding `heph daemon start/restart` flags: --mode, --hub-url, --http-addr, --oidc-issuer, --oidc-audience, --oidc-client-id, and --self-update-interval-secs. Regenerating now reads the existing service file and preserves any flags not passed (start as well as restart), so a bare invocation never silently drops baked config. Closes the "pass through --self-update-interval-secs" and "bake hub/spoke config into the generated service" backlog tasks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
64 lines
2.1 KiB
Markdown
64 lines
2.1 KiB
Markdown
---
|
|
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`. Override the 6h poll cadence with
|
|
`--self-update-interval-secs <secs>`:
|
|
|
|
```bash
|
|
heph daemon start --self-update # default: poll every 6h
|
|
heph daemon start --self-update --self-update-interval-secs 3600
|
|
```
|
|
|
|
Both `start` and `restart` preserve an already-baked setting (the flag and its
|
|
interval), so a bare invocation won't silently disable it — pass `--self-update`
|
|
again only 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
|