Server hubs (optional)
needs-you has three parts: the Needs You app on your Mac shows alerts, a hub stores them, and senders post them (App, hubs and senders). The app has a hub built in, which is all most setups need. This page is about the other place a hub can run: a server hub, the same hub, always on, on a Linux server you run. Add one when:
- you want items to land somewhere while the Mac sleeps (otherwise they wait in each sender's outbox until it wakes), or
- you run many servers, or senders that can't wait (CI with short-lived runners).
A hub is one Python file (hub/needs_you_hub.py, standard library and SQLite only) on stock
python3 3.9+ (Ubuntu 22.04+, Debian 12+, macOS). Hubs replicate every write to each other,
the app's built-in hub included once a server joins it, so a sender, the
Mac or an invite link can use any of them. The wire contract is in API.
Two hubs in 10 minutes #
You need two always-on Linux machines with systemd and Tailscale (MagicDNS on), called
hub-a and hub-b below, and this repo cloned on each. Everything installs under your home
directory; no root except one loginctl command. Each hub then updates itself
from GitHub releases, which needs gh 2.64 or later logged in as your user (gh auth login);
pass --no-auto-update to stay on the checkout's code.
1. Hub A, with a new peer secret:
git clone <this repo> ~/needs-you && cd ~/needs-you
./scripts/install-hub.sh --user --peer http://hub-b.example.ts.net:8765 --generate-peer-secretIt prints the peer secret once. Save it to a file on hub B (over the tailnet, e.g.
ssh hub-b 'umask 077; cat > ~/ny-secret', then paste), and keep it out of git and chat logs.
2. Hub B, with A as its peer and the same secret:
git clone <this repo> ~/needs-you && cd ~/needs-you
./scripts/install-hub.sh --user --peer http://hub-a.example.ts.net:8765 \
--peer-secret-file ~/ny-secret --no-invite
rm ~/ny-secret3. Linger. If the installer says lingering is off, run the command it prints on each hub, so the hub keeps running after you log out and starts at boot:
sudo loginctl enable-linger "$USER"4. The first invite. Hub A printed an owner invite (needsyou://connect?...). Open it on
the Mac and NeedsYou.app adds the hub. Then make a link for your servers on either hub:
needs-you-admin invite create my-servers --role sender --uses 5 --ttl 72It prints the join URL, the one-liner, and a prompt to paste to an agent. Each machine that
redeems the link gets its own token and is told about both hubs (NEEDS_YOU_URLS), so it
fails over between them.
5. Check replication:
curl -s http://hub-b.example.ts.net:8765/v1/health # stats, no token needed
needs-you-admin token list # on hub B: tokens made on A show upWith a token, /v1/health also lists each peer's outbox_pending, last_push_ok,
last_pull_ok and last_error. A healthy pair has outbox_pending 0 and a recent
last_pull_ok. skipped_push and skipped_pull count replicated items one side couldn't
read (usually a hub running an older version than its peer: upgrade it), with the last one in
last_skipped; replication carries on past them, and the hub that skipped them applies them
at its next start once it can read them. The hub's log names each one. A non-null blocked
means a token or invite record (a revocation, say) one side can't read: those are never
skipped, so replication in that direction waits for it (the log says BLOCKED). Upgrade the
older hub; replication then resumes by itself.
With the app's built-in hub #
A server joins the app's built-in hub with a peer invite: a one-use link the Mac makes, which the server redeems for the pair's own replication secret. Nothing to copy by hand, and the secret never shows on a screen (ADR 0012).
1. On the Mac, make the link: **Settings → Built-in hub → Always-on hub → Add an always-on hub** shows the lines to run on the server and the link to paste, each with a copy button. The Mac must be on the tailnet; the link lasts an hour. From a terminal on the Mac instead:
python3 /Applications/NeedsYou.app/Contents/Resources/hub/needs_you_admin.py \
--db ~/Library/Application\ Support/NeedsYou/hub.db \
--public-url http://<this-mac>.<tailnet>.ts.net:8765 invite create my-server --role peer2. On the server (Linux with systemd, python3 and Tailscale), the lines Settings showed (Copy), then the link when the installer asks for it (Copy link):
cd
curl -fsSLo install-hub.sh https://github.com/tayharris/needs-you/releases/download/vX.Y.Z/install-hub.sh
sudo bash install-hub.sh --join -
# Paste the peer invite link: http://<this-mac>.<tailnet>.ts.net:8765/join/nyi_...They have no quote, bracket or pipe, so they survive a browser console that types a paste key by
key. Logged in as root, leave out sudo. The installer reads the link at its prompt, so the
invite code is in no command line: not in ps, not in the command sudo logs, not in your shell
history. It's saved in your home folder on purpose: run from a file, the installer treats the
folder above it as a checkout when that holds hub code, and above a home folder only root can
write. It ends with needs-you-hub is up; the Mac's Always-on hub list shows the server within
a minute. The hub's invite carries the same lines (install_steps, also on the link's page and
in needs-you-admin invite create), plus one line for scripts and agents, with no one to paste
the link: (curl -fsSL <install-hub.sh URL> && echo '<link>') | sudo bash -s -- --join -.
vX.Y.Z is the release the Mac app runs. The installer comes from that GitHub release, and so
does all the code it installs: it downloads the release's server tarball for its own version,
checks it against the release's SHA256SUMS and release-manifest.json (and, when gh is
installed, that manifest's build provenance; without gh it talks to GitHub's own hosts over
https only), refuses a tarball for any other version, and installs nothing if a check fails or
GitHub can't be reached. The Mac's hub supplies only the link: no code comes from it, so a hub
can't make a server install anything else. It installs and starts a system-wide hub, pairs it
with the Mac's hub, and prints no secret. The hub then updates itself from
GitHub releases, which needs gh 2.64 or later logged in as root (sudo gh auth login, or
GH_TOKEN in a drop-in); until then each update run logs why it installed nothing. Add
--no-auto-update after --join - to opt out. A development build of the app has no matching
release: install from a checkout then. From a checkout (or the release's server tarball),
./scripts/install-hub.sh --user --join - does the same as your user: paste the link when it
asks (from a script, pipe the link in on stdin). Run as root, a
checkout is first copied to a private directory, refusing symlinks and anything another user
could write (the files or any directory above them), and only that copy is installed. On a server
that already runs a hub (alone, or in a mesh with its own peer_secret), run
needs-you-admin peer join - instead and paste the link when it asks; the running hub picks it up within 5 seconds and
its other peers are left as they are.
Then:
- Every item posted to either hub shows on both, with its question and answer: an answer clicked on the Mac reaches a sender that asked through the server, and the other way round.
- Sender invites made on the Mac list both URLs (
hub_urls), so those senders fail over to the server while the Mac sleeps, and the Mac catches up when it wakes (within seconds: a hub that notices it slept retries at once). - Settings shows the server's state (connected, last sync, behind by N changes). Or:
needs-you-admin peer liston the server,GET /v1/peerswith the owner token. - To stop: Remove in Settings (or
DELETE /v1/peers/<hub id>) andneeds-you-admin peer remove <mac hub id>on the server. Removing deletes that pair's secret.
The server's public_url must be its MagicDNS name (the installer's default with Tailscale),
so the Mac reaches it by name whatever its tailnet IP. The Mac's hub is named the same way.
A Mac that sleeps for days still learns what was resolved meanwhile: a closed item's text is purged a day after it closed, but a text-free tombstone stays for 30 days (housekeeping), and the Mac's hub pulls it when it wakes. Only after 30 days away can an item resolved on the server stay open on the Mac until you close it.
Joining one server to another works the same way: needs-you-admin invite create hub-b --role peer on one, the lines it prints (install-hub.sh --join -, or needs-you-admin peer join -,
then the link when it asks) on the other.
A pairing can't be taken over: a peer invite redeemed with the URL or hub id of a hub that is
already paired is refused (409), and so is a join whose answer names another paired hub. To
pair the same hub again, or under a new URL, remove it first (Remove in Settings,
needs-you-admin peer remove), then make a new peer invite. Both sides accept a peer only at
https, or plain http to a tailnet name or address (or loopback).
What install-hub.sh --user sets up #
| Path | What |
|---|---|
~/.local/share/needs-you/ | The code: hub/, cli/ and the integration files the hub serves at /dl/ |
~/.config/needs-you/hub.json | Config, mode 600 (holds the peer secret) |
~/.local/state/needs-you/hub.db | SQLite database (WAL, incremental auto-vacuum) |
~/.config/systemd/user/needs-you-hub.service | systemctl --user unit, Restart=always |
~/.local/bin/needs-you-admin | The admin tool, preset to this config |
~/.config/needs-you/hub-update.json | Automatic update settings, mode 600 |
~/.config/systemd/user/needs-you-hub-update.{service,timer} | The automatic updater, every 6 hours |
~/.local/state/needs-you/hub-update.lock, hub-update-failed.json | The updater's lock, and the releases that failed to install |
~/.local/share/needs-you.previous | The code from before the last automatic update, for a rollback |
~/.config/systemd/user/needs-you-hub-update.path | Starts the updater when the owner asks for an update (below) |
Options:
| Option | Default | Meaning |
|---|---|---|
--user | system install | Install for the current user (recommended). |
--bind ADDR | 127.0.0.1 + tailscale ip -4 | Listen addresses, repeatable or comma-separated. 0.0.0.0/:: are refused. |
--port N | 8765 | TCP port. |
--hub-id ID | hostname -s | Unique per hub (letters, digits, ., _, -). |
--public-url URL | http://<MagicDNS name>:PORT | How others reach this hub. Used in invite links and hub_urls. |
--peer URL | none | Another hub's public URL. Repeatable; replaces the peer list. |
--peer-secret-file F | The shared replication secret, from a file. | |
--peer-secret S | The same, inline (visible in ps; prefer the file). | |
--generate-peer-secret | Make a new secret and print it once. | |
--join - | Pair with the hub that made this peer invite (above), reading its link from stdin. No owner invite is printed. --join LINK works too, but puts the code in ps and sudo's log. | |
--reconfigure | off | Rebuild the config from defaults + flags (keeps the secret). |
--no-start | off | Install files and config only. |
--no-invite | off | Don't print the first owner invite. |
--no-auto-update / --auto-update | on | Turn automatic updates off or on. |
--update-channel C | stable | stable, or prerelease to take pre-releases too. |
--update-soak-hours N | 24 | Wait this long after a release is published before installing it (0–720). |
--update-gh PATH | gh on PATH | The gh that checks each release (2.64 or later, logged in). |
Re-running upgrades in place: the code and units (hub and updater) are replaced, hub.json and
hub-update.json are kept with only the flags you passed applied to them, the update timer is
turned on or off to match, the database is untouched, and the service restarts. The owner
invite is printed only when the config is first created.
Logs go to the journal only (journalctl --user -u needs-you-hub -f); the hub writes no log
files.
System-wide install (alternative) #
sudo ./scripts/install-hub.sh --peer http://hub-b.example.ts.net:8765 --generate-peer-secretSame options without --user. It creates a needs-you system user and uses
/opt/needs-you (code), /etc/needs-you/hub.json (config, 640 root:needs-you),
/var/lib/needs-you/hub.db, the sandboxed unit /etc/systemd/system/needs-you-hub.service
(read-only system, no home access, no capabilities, syscall filter), and the wrapper
/usr/local/bin/needs-you-admin, which runs the admin tool as needs-you. Logs:
journalctl -u needs-you-hub. It also installs the automatic updater:
/etc/systemd/system/needs-you-hub-update.{service,timer} (run as root, since it re-runs the
installer), its settings in /etc/needs-you/hub-update.json, and its lock and failed-release
record in /etc/needs-you/; the code from before an update is kept in /opt/needs-you.previous.
It needs gh 2.64 or later logged in as root. Its log: journalctl -u needs-you-hub-update.
Config reference #
hub.json is plain JSON (see deploy/hub.example.json). Every key can also be set by a flag
on needs_you_hub.py, so no file is required: the named flags, or --set KEY=VALUE for
anything else (VALUE is parsed as JSON when it can be). Every key, with its flag, default and
what it takes, is in Configuration → hub.json, with
hub-update.json and every environment variable. The hub refuses to start with a value of the
wrong type or out of range (naming the key), and warns about a key it doesn't know. Check a
config without starting anything:
python3 ~/.local/share/needs-you/hub/needs_you_hub.py --check-config --config ~/.config/needs-you/hub.jsonRestart after editing: systemctl --user restart needs-you-hub (or sudo systemctl restart needs-you-hub).
Use the MagicDNS name, not the IP #
Everything that talks to a hub uses its public_url, a MagicDNS name over plain http such as
http://hub-a.example.ts.net:8765, not http://100.x.y.z:8765. The Mac app only allows plain
http to *.ts.net and local names, and the name survives the tailnet IP changing. Traffic is
still encrypted by WireGuard. The IP belongs only in bind.
Invites and tokens #
needs-you-admin invite create my-server --role sender --uses 3 --ttl 72 # servers and agents
needs-you-admin invite create mac --role owner # a Mac app
needs-you-admin invite list # live invites: uses left, expiry
needs-you-admin invite revoke my-server
needs-you-admin token list # name, role, state, open items
needs-you-admin token revoke my-server-build-1
needs-you-admin token add ci-myrepo --role sender # a bare token, printed once
needs-you-admin invite create hub-b --role peer # another hub joins this one (one use, 1 h)
needs-you-admin peer join - # this hub joins another (paste the link)
needs-you-admin peer list # peers: config and invite, never secrets
needs-you-admin peer remove hub-b # by hub id, URL or name (invite peers)Roles: sender posts and resolves; reader reads, resolves, dismisses and answers a card's
question by picking its options; owner is a reader that can also create invites and type an
answer's own words ("Other…") (the Mac app). Codes and tokens are stored as sha256 hashes and
printed once. Revoking an invite doesn't revoke tokens it already minted. A peer invite is
for another hub, not a machine: it stays on this hub (it isn't replicated) and mints no token.
The admin tool writes straight to the database (safe while the hub runs, thanks to WAL) and queues the change for replication, so an invite or token made on one hub works on all of them within seconds. A link from one hub can be redeemed on any; see API for the small double-spend window.
Housekeeping #
The hub keeps itself small and keeps little: a closed item's text (title, body, links, steps,
question, answer, source) is purged text_retention_hours (24) after it closed, leaving a
tombstone (id, key, status, times, origin hub) so peers and clients that were away still learn it
closed; tombstones are deleted after retention_days (30). The purge runs on the hub's own clock,
a peer's copy can't bring purged text back, freed space is overwritten (secure_delete), and the
backups made before a migration (hub.db.bak-N) are purged the same way. Stale peer
outbox rows go after 7 days, expired invites at the next pass and revoked ones a day after the
revocation (so it replicates), with a WAL checkpoint and incremental
vacuum every 10 minutes and a full VACUUM at most daily. Replicated records older than the
cutoff are refused, so a peer can't bring purged items back. GET /v1/health shows
db_bytes, item counts and outbox depth.
Resource use #
Measured 2026-10-07. The Mac numbers are the running app and its bundled hub on an Apple Silicon MacBook Pro (macOS 15, Python 3.9), after a day of normal use. The server numbers are a throwaway hub on a desktop Linux machine (8-core AMD Ryzen, Python 3.12, no peers).
| What | Measured | How |
|---|---|---|
| Mac app, idle | 0.4% of one core (0.46 s of CPU in 120 s), 55 MB memory footprint | ps CPU time over two idle minutes; footprint |
| Mac's hub, idle | 0.2% of one core (0.21 s in 120 s), 27 MB footprint | same |
Mac's hub.db | 0.9 MB with 138 items (0.2 MB database + 0.7 MB WAL) | ls |
| Server hub, idle | under 0.1% of one core (0.03%), 33 MB RSS | /proc CPU time over 60 s |
| 1,000 posts, one after another | 1.2 s (about 850 a second); 1.1 ms median, 2.2 ms p99; hub at 77% of one core during the burst; RSS 33 to 34 MB | POST /v1/items over urllib |
| Database growth | about 600 bytes per item (realistic title, body, one link); the WAL reached 4.8 MB during the burst and is truncated at the next maintenance pass | file size after wal_checkpoint(TRUNCATE) |
| Mac poll, nothing new | 82 bytes, 1 ms | GET /v1/items?since= |
| Mac full poll, 1,000 open items | 630 KB, 36 ms | GET /v1/items?status=open |
needs-you add | about 120 ms per call (Python start-up and imports), the same when failing over from a refused hub or queuing offline (210 bytes per queued request) | wall time of 20 calls |
Nothing else runs: no Docker, no database server, no pip packages, no cloud account. Network
use is a poll every 30 seconds (NEEDS_YOU_POLL_SECONDS), a full snapshot every 10th poll,
and one /v1/stream connection that carries a 15-second ping when idle. Peered hubs push
writes as they happen and pull each peer once a minute. Disk stays bounded by the
housekeeping above and by max_open_per_token (60 open items per sender
token); a failover that waits on an unreachable (not refused) hub costs up to
NEEDS_YOU_TIMEOUT (3 s) per hub.
Upgrading #
Upgrades never lose config or data. A hub installed by install-hub.sh 0.5.1 or later upgrades
itself (automatic updates, on by default; it needs gh 2.64 or later,
logged in). An older hub gets the updater the next time a 0.5.1 or later install-hub.sh runs
on it. To upgrade by hand from a checkout:
cd ~/needs-you && git pull && ./scripts/install-hub.sh --user # or: sudo ./scripts/install-hub.shA hub installed from a release (the --join - command above) has no
checkout: run the newer release's install-hub.sh the same way, without --join (the config and
database are kept).
- Code in
~/.local/share/needs-you(or/opt/needs-you) is replaced in place, and the service is restarted. The installer says which version it replaced: "Upgraded the needs-you hub from 0.2.1 to 0.3.0", or "Reinstalled ... (the same version)". - Config (
hub.json) is kept. Only the flags you pass on the re-run are applied to it; new config keys have defaults, so an old file keeps working unchanged. - Database: the schema is versioned (
PRAGMA user_version). On start, a hub that finds an older schema first copies the database with SQLite's online backup API tohub.db.bak-<old version>(mode 600; the newest 2 backups are kept), then applies the missing migrations, each in its own transaction. Migrations only add tables, columns and indexes; they never drop or rewrite rows. Databases from before versioning (version 0) are adopted as-is and also converted to incremental auto-vacuum. A hub refuses to open a database written by a newer version and exits without touching it, so a rollback can't corrupt data: restore the matchinghub.db.bak-<n>(with the hub stopped) if you need to go back. - Tokens and invites live in the database, so they survive. Senders keep their
~/.config/needs-you/envand outbox; both formats are unchanged (an env file with onlyNEEDS_YOU_URLstill works). Update senders withneeds-you update(Keeping up to date). - Peered hubs: upgrade all of them (and the Mac app) together when moving from a version
without invites. Older hubs ignore invite records and refuse a replication batch that
contains an
ownertoken, so they fall behind until upgraded. Nothing is lost: the outbox retries for up to 7 days, and anti-entropy catches up after that. - Item steps (schema 3): a hub without them accepts replicated items and drops their
steps. When it later resolves, dismisses or marks such an item seen, the upgraded hubs keep their steps; only a re-post that changes the title, body or priority on the old hub clears them. Upgrade peers together to avoid the gap. - Item question (schema 7): the same for an agent's
question(API): a hub without it drops the field from replicated items, and keeps nothing to hand back; the upgraded hubs keep theirs through its resolves and seen marks. An older hub refuses a database at schema 7 (it backs up before migrating), so upgrade every hub together. - Answers (schema 8): the same for an item's
answer,answered_atandanswered_by(API): a hub without them drops them from replicated items, and the upgraded hubs keep theirs through its resolves and seen marks. Upgrade every hub together. - Peer links (schema 9): a new local table for peers joined by a peer invite; nothing that
replicates changes. A hub refuses a peer invite from a hub with an older schema
(
peer_outdated), so upgrade the server before joining it to a newer Mac app. - Short retention (schema 10): a
purged_atcolumn, and two defaults change: a closed item's text goes aftertext_retention_hours(24), tombstones afterretention_days(now 30, was 7). Ahub.jsonwritten by an older installer says"retention_days": 7: tombstones then go after 7 days; set 30 (or delete the line) to keep them as long as the new default. A hub up to 0.2.1 skips the tombstones it receives (their title is empty) and keeps its own copy's text.
Automatic updates #
15 minutes after boot and then every 6 hours, each run up to 30 minutes late at random
(needs-you-hub-update.timer), the updater (hub/needs_you_hub_update.py) asks
GitHub, through gh, for the newest release on the hub's channel. When one is newer than the
installed hub and was published at least the soak time ago (24 hours by default), it:
- downloads that release's
install-hub.sh,SHA256SUMSandrelease-manifest.json, and checks the installer against both and its build provenance: built by this repo's release workflow, from that tag, on a GitHub-hosted runner (gh attestation verify --deny-self-hosted-runners); - runs that installer the way the hub was installed (
--useror system-wide), which checks the release's server tarball the same way, keepshub.json, the update settings and the database, and restarts the hub; - waits up to a minute for
/v1/healthto answer with the new version. If it doesn't, it stops the hub, puts the previous code back (it keeps a copy next to it,~/.local/share/needs-you.previousor/opt/needs-you.previoussystem-wide), restores the database from the hub's own pre-migration backup (hub.db.bak-<schema>) if the new version had already migrated it, restarts the hub and checks it answers. A release that failed is remembered (hub-update-failed.jsonin~/.local/state/needs-you/, or/etc/needs-you/system-wide) and not tried again: until a newer release is out, each run logs that it's skipped and exits non-zero; the next newer one is tried. Delete that file to retry the failed one.
Nothing is installed without build provenance, so automatic updates need **gh 2.64 or later,
logged in** (gh auth login; system-wide installs: logged in as root, or GH_TOKEN in a
drop-in). With no gh, or an older one (Ubuntu 24.04 ships 2.45), the updater installs nothing and
says why in its log; point it at a newer one with --update-gh PATH. It never reads or prints a
token, peer secret or invite code.
The settings live in hub-update.json next to hub.json; change them by re-running the installer
with the flags above (a re-run without them keeps them):
{"auto_update": true, "channel": "stable", "soak_hours": 24, "gh": ""}A file that can't be read, or has a value out of range, turns automatic updates off.
journalctl --user -u needs-you-hub-update # what each run did (system: without --user)
python3 ~/.local/share/needs-you/hub/needs_you_hub_update.py --mode user --check # what it would install now
systemctl --user start needs-you-hub-update.service # update now (respects the soak)
./scripts/install-hub.sh --user --no-auto-update # offSystem-wide: sudo systemctl start needs-you-hub-update.service, and the installer without
--user. Turning it off by re-running the installer also installs that checkout's (or release's)
code, so pull first: an older checkout is a downgrade. Or set "auto_update": false in
hub-update.json: the next run does nothing, and a re-run of the installer without
--auto-update keeps it off.
Update now from the Mac #
Settings → Updates → Machines and hubs on the Mac lists each server hub with its version and
a Request update button (ADR 0013,
POST /v1/hub/update, owner token only). The request carries nothing: the
hub drops a flag file, hub-update-request, next to its database, and
needs-you-hub-update.path starts the updater, which removes the flag and runs exactly as on its
timer except that it doesn't wait out the soak. Every check (channel, sums, manifest, build
provenance, failed releases, rollback) stays. Each run writes hub-update-status.json next to
hub.json (what it did, one log line, no secrets), which is how the Mac shows "Updated to 0.5.2"
or why it failed. One request per 15 minutes is accepted; the updater honours one per 10 minutes.
It needs automatic updates on. The same from a shell on the server:
touch <the database's directory>/hub-update-request.
A hub installed from a checkout updates from GitHub releases too, replacing the checkout's code
at the next newer release; pass --no-auto-update to keep tracking the checkout. Peered hubs
each update on their own schedule; keep them on the same channel so they stay a version apart at
most (see the schema notes above).
Operations #
- Backup:
sqlite3 ~/.local/state/needs-you/hub.db ".backup $HOME/hub-$(date +%F).db"(safe while running), orpython3 -c "import sqlite3; s=sqlite3.connect('$HOME/.local/state/needs-you/hub.db'); s.backup(sqlite3.connect('$HOME/hub-backup.db'))"where thesqlite3CLI isn't installed. With two or more hubs, each is a live backup of the others. - A hub dies: senders and the Mac fail over to the other hubs on their own. To replace it,
install a fresh hub with the same
--public-urland peers (or a new name, then update the peers on the others). An empty database pulls everything from its peers; its newepochmakes the peers re-pull from it from the start. Tokens and invites come back with the rest. - A hub was off for longer than
retention_days: stop it, delete itshub.db*files, and start it empty, so it can't push stale open versions of items the others resolved and purged. - Removing a peer: one that joined by a peer invite:
needs-you-admin peer remove <hub id>on both sides (its secret is deleted, so it can't replicate with this hub any more). One inpeers: take it out on the others (install-hub.sh --user --peer ...with the remaining ones) and restart; queued rows for it are dropped at start-up. - Moving a hub: keep the MagicDNS name, or update
peerson the other hubs. Senders pick up new URLs when they re-run an invite with--force, or by editingNEEDS_YOU_URLS. - Clocks: keep hubs on NTP (systemd-timesyncd is enough); replication is last-writer-wins on timestamps.
- ACL (optional): tag hubs
tag:needs-youand allowtcp:8765to them only from your devices and tagged servers. Hubs must reach each other on that port too.
Development #
python3 hub/needs_you_hub.py --db /tmp/ny.db --owner-token-file <(echo dev-owner-token-123456)
python3 hub/needs_you_admin.py --db /tmp/ny.db invite create me
/usr/bin/python3 -m unittest discover -s tests # also with macOS /usr/bin/python3 (3.9)Code must stay Python 3.9-compatible and standard-library only: from __future__ import annotations, no match, no runtime X | Y unions, no tomllib.
This page is docs/HUB.md in the repo. View or edit it on GitHub.