Repository navigation
feat: bitkit staging without blocktank - #36
Conversation
Adds staging/, a deployable public regtest staging with VSS, LNURL-auth, bitcoind, mempool with its electrs, a faucet and miner at Blocktank's regtest paths, the fx-rates relay and the RN backup server behind one Caddy, keeping stag0's paths. docs/staging.md has the stag0 inventory, settings, migration checklist and deploy steps.
|
Pushed b113492: the faucet now takes optional HTTP basic auth ( |
|
Pushed e9a9b23:
|
talosmachina
left a comment
There was a problem hiding this comment.
No findings. Adds staging/, a self-contained regtest staging (VSS, LNURL-auth, bitcoind, mempool and electrs, an authenticated faucet and miner at Blocktank's regtest paths, fx relay, RN backups) behind one Caddy, plus docs/staging.md. Reviewed e9a9b23, full tier, static.
What I checked, and 5 candidates I ruled out
Read in full: staging/compose.yml, staging/Caddyfile, staging/faucet/server.mjs, staging/init.sh, staging/.env.example, both Dockerfiles, docs/staging.md, the README and CHANGELOG hunks
Cross-checked: vss/Dockerfile and the root compose's VSS_JWT_PUBLIC_KEY_FILE usage; the rnBackupServerHost callers in bitkit-android and bitkit-ios for the /backups-ldk path
CI: none on this repository
Not run here: my sandboxed runner could not confirm the author's permission and refused to run the branch, so nothing was brought up; the review is from the code
Ruled out
- Rate limit keyed on a spoofed
X-Forwarded-For: Caddy only trusts an incomingX-Forwarded-Forfrom configuredtrusted_proxies, none are set, so it overwrites the header with the peer address. - Unauthenticated body or limiter growth: the auth check runs before
readJsonand beforelimited, so an unauthenticated caller neither reaches the body parser nor fills thehitsmap. - bitcoind
rpcallowip=0.0.0.0/0,whitelist=0.0.0.0/0: no port is published for it; only Caddy publishes 80, 443 and 9999. - Faucet amounts:
Number.isIntegerand the caps reject fractions and overflow, and bitcoind's invalid-address error (-5) maps to 400. init.shLDK key extraction: ran the private-key pipeline 1,500 times on OpenSSL 3.0, always 64 hex characters.
Merge confidence: 4/5, a deploy stack and a cross-repo contract with no CI, reviewed without bringing it up.
pwltr
left a comment
There was a problem hiding this comment.
Reviewed commit 9dbf50f. The new staging/ stack replaces stag0 with a public regtest backend behind one Caddy: only Caddy publishes ports, images are pinned, every password and key is generated on the deploy host, and the faucet requires basic auth and a per-client rate limit. The README now covers the clone layout the build expects and a health check.
Low — init.sh can write an empty backup public key that a rerun never repairs (staging/init.sh:27).
The public key is written with echo "LDK_BACKUP_PUBLIC_KEY=$(… | xxd -p -c 33)" after the secret key is saved. A failing command inside that substitution does not stop the set -euo pipefail script, so on a host without xxd the line is written empty and the script still reports ready; a rerun skips the block because the secret key is set, and the listed prerequisites do not mention xxd. Checking for xxd up front, deriving the hex with od, or failing on an empty value would avoid it.
Review details
General review
Model: Claude Opus 5.5
Reasoning effort: high
@pwltr Fixed in 57c11c0: |
…bitkit-staging # Conflicts: # CHANGELOG.md
|
Merging with a merge commit: @pwltr approved the current head and no review threads are open. |
Refs:
Description
staging/, a deployable public regtest staging with no Blocktank part, so Bitkit's staging builds and E2E runs stop depending on*.stag0.blocktank.to. It goes with the Blocktank sunset, and its outage broke every new staging wallet and the E2E runs.vss-serversubmodule and synonymdev/lnurl-auth-server), a regtest bitcoind, mempool (frontend, backend, its electrs fork) as explorer, Esplora REST and Electrum, the fx-rates relay and the RN backup server, behind one Caddy. Caddy also serves Electrum over TLS on 9999./vss_rs_auth,/lnurl_auth/auth,/fx/rates/btc,/backups-ldk,/electrs, mempool's/api), so an app or test moves by changing the host./regtest/chain/depositand/regtest/chain/minecontract (with or without the/blocktank/api/v2prefix), so the E2E scripts only changeBLOCKTANK_URL.FAUCET_AUTH, generated byinit.sh, kept by callers as a CI secret) ondepositandmine, refuses to start without it, and rate-limits each client (FAUCET_RATE_PER_MIN) on top of per-call caps. stag0's openmineendpoint is what stalled its chain, Electrum and VSS.init.shgenerates the passwords and keys on the deploy host. The repository holds no credentials, and only Caddy publishes ports.docs/staging.mdwith what the five Bitkit repositories still call on stag0, which of those must outlive Blocktank, the settings to change, a migration checklist for a fresh build that reuses nothing from stag0 (new hostnames, credentials, chain and data; staging wallets start fresh) and the deploy and smoke steps.docs/staging.mdnotes that split as an open call.Out of Scope
regtest/channel/pay), RGS and scorer: they go with Blocktank and LDK.docs/staging.md, made in their own repositories once DevOps picks the hostnames.docker-compose.ymland its services: unchanged.Design
N/A — no UI changes.
Preview
N/A — no user-visible changes.
QA Notes
Journeys
N/A
Manual Tests
cd staging && ./init.sh, set the hostnames in.env,docker compose up -d --build→ all services up, faucet logsfaucet ready— deploy host with DNS and ports 80, 443, 9999docs/staging.mdagainst the deployed hosts → each answers — needs the public deploymentAutomated Checks
CADDY_GLOBAL_OPTIONS=local_certs):fund-address.shandmine-blocks.shwithBLOCKTANK_URLon the faucet, with and without the/blocktank/api/v2prefix (plain-text txid, 2 blocks mined; bad address and over-cap counts give 400)blocks/tip/height,address/…/utxo,tx/…/raw,tx/…/merkle-proofandblock-heightunder/electrsand on the mempool host/api/v1/fees/recommendedand/api/blocks/tip/heightserver.versionandblockchain.headers.subscribeover TLS on 9999/fx/rates/btcrelay/backups-ldk(same response as stag0 for an unsigned challenge)putObjectsandgetObjectthrough/vss_rs_auth; a bad token gives 401FAUCET_AUTH;/healthstays opendocker compose downandup: VSS data, chain and faucet wallet persist