You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(auth): add auto-TLS and API token authentication
Add local security layer (lnd-inspired) to protect neutrino-api from
eavesdropping and unauthorized access by other processes on the same host.
- Auto-generate self-signed TLS certificate (EC P-256) on first start
- Auto-generate 32-byte random hex API token on first start
- Add Bearer token authentication middleware (constant-time comparison)
- Add --reset-auth flag to regenerate credentials and clear privacy data
- Add --no-auth / NO_AUTH=true for development/regtest (disables TLS+auth)
- Add ClearPrivacyData() to purge watched addresses and UTXOs on reset
- Set NO_AUTH=true in docker-compose.yml for regtest environment
Changelog: Add auto-TLS and API token authentication for local security
prefetchStart:=flag.Int("prefetchstart", getEnvInt("PREFETCH_START", 0), "Start height for background filter prefetch")
41
43
prefetchLookback:=flag.Int("prefetchlookback", getEnvInt("PREFETCH_LOOKBACK", 105120), "When >0 and prefetchstart=0, auto-compute prefetch start as tip minus this many blocks (~2 years default)")
42
44
clearnetInitialSync:=flag.Bool("clearnet-initial-sync", getEnvBool("CLEARNET_INITIAL_SYNC", true), "Sync block headers over clearnet before switching to Tor (safe: headers are public data)")
45
+
noAuth:=flag.Bool("no-auth", getEnvBool("NO_AUTH", false), "Disable TLS and token authentication (for development/regtest)")
46
+
resetAuth:=flag.Bool("reset-auth", false, "Regenerate TLS cert and auth token, clear watched addresses, then exit")
43
47
showVersion:=flag.Bool("version", false, "Show version and exit")
0 commit comments