Repository navigation
Adds one-liner for Host client install. - #557
Open
johnnymatthews wants to merge 17 commits into
Open
johnnymatthews wants to merge 17 commits into
johnnymatthews wants to merge 17 commits into
Conversation
Deploying docs with
|
| Latest commit: |
c22d0df
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://bf959237.docs-czv.pages.dev |
| Branch Preview URL: | https://add-host-client-one-liner.docs-czv.pages.dev |
The host reads defradb.keyring_secret from the config file and ignores DEFRA_KEYRING_SECRET, so every install was running on the image's default "pingpong" and --keyring-secret did nothing. Also chmods the generated config, since it now holds the secret.
A container found by its published port is only a guess - anything can publish 8080. A reachable container now has to answer /health with the expected p2p.self.id, otherwise the script falls back to the host gateway instead of pointing the Host at the wrong machine. Unreachable containers keep the benefit of the doubt, they may still be starting.
Images without a chains key get the block appended instead of a warning and a silently unpointed schema fetch. The libp2p memory budget now goes in via DEFRADB_P2P_RESOURCE_MEMORY_MIB, which every image layout honours, so the sed for resource_memory_mib is gone. The schema-fetch confirmation now prints for the chains layout too.
Running as root left SUDO unset (and the trailing fallback never ran), so a failed chown crashed with 'SUDO: unbound variable' instead of the actual error message.
On machines with IPv6 disabled the socket() call itself fails, which made every port look busy and the installer die with 'no free port found'.
The GiB-then-fix-up dance produced GOMEMLIMIT=0MiB for --memory 1g, which tells the Go runtime the memory limit is zero bytes. Works now. Kinda.
curl cannot parse http://::1:8080/health, and the bracketed-with-port form fell through the glob and misparsed. v6 input now survives into URLs.
A predictable /tmp name plus curl -o follows symlinks, so on a shared box another user could aim the write at a file the installer can touch.
Runs install-host.sh against stub docker/curl/sudo binaries - no daemon, no network. Covers the generator input forms, all three config layouts, the container adoption check, memory sizing, --force and port shifting, and CI now runs it. The container-guess regression fails 3 of these on the old script. Was fun.
The standard Generator compose stack fronts it with nginx, which proxies /health with the real peer ID but does not listen for P2P. The peer check alone passed there and built a bootstrap address pointing at the proxy. Now the container's own IP must also appear in its P2P listen addresses.
The health wait used to sit out the full 5 minutes even when the container was clearly restart-looping. Three restarts is enough to call it.
chmod 600 (from the keyring fix) made the file unreadable to the container, which runs as UID 1001 - it panic-looped with 'open config.yaml: permission denied'. Now chowned to 1001 like the data dirs, and the rewrite removes the file first so a non-root re-run can still replace it. Found in the field.
curl already prints 000 via -w when it fails, so the fallback echo doubled it.
Was only used while making this script. Dunno how it ended up in the workflows.
johnnymatthews
marked this pull request as ready for review
November 4, 2026 16:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #441