Say when --key - is waiting for the key (#75) #90

Merged
jcoffey-dev merged 1 commits from fix/75-key-prompt into main 2026-11-18 18:33:07 +00:00
Owner

Fixes #75 (reported in community t/232, post 34).

--key - and --token - read a line of standard input with no prompt, so inbuxa upgrade --key - looked stuck.

  • On a terminal it prints API key (paste it and press Enter): (or Relay token ...) to stderr and turns echo off while reading, so the pasted key isn't shown. Line editing and Ctrl-C still work.
  • Piped input is read as before, with no prompt.
  • One helper, readSecret, now does this for install/upgrade, join, certs, dns --refresh and relay --token; join, certs and dns had their own copies of the read.

Checked locally: gofmt, go vet (amd64 + arm64), go test -count=1 ./... (new test for the piped path).

Fixes #75 (reported in community t/232, post 34). `--key -` and `--token -` read a line of standard input with no prompt, so `inbuxa upgrade --key -` looked stuck. - On a terminal it prints `API key (paste it and press Enter): ` (or `Relay token ...`) to stderr and turns echo off while reading, so the pasted key isn't shown. Line editing and Ctrl-C still work. - Piped input is read as before, with no prompt. - One helper, `readSecret`, now does this for install/upgrade, join, certs, `dns --refresh` and relay `--token`; join, certs and dns had their own copies of the read. Checked locally: gofmt, go vet (amd64 + arm64), `go test -count=1 ./...` (new test for the piped path).
jcoffey-dev added 1 commit 2026-11-18 18:31:58 +00:00
Say when --key - is waiting for the key (#75)
ci / test (pull_request) Successful in 1m2s
238620e16b
`--key -` and `--token -` read a line of standard input with no prompt,
so `inbuxa upgrade --key -` looked stuck. On a terminal it now prints
"API key (paste it and press Enter): " to stderr and doesn't echo what's
pasted. Piped input is read as before.

One helper, readSecret, now reads it for install/upgrade, join, certs,
dns --refresh and relay --token, instead of three copies of the read.
jcoffey-dev merged commit e70556ded7 into main 2026-11-18 18:33:07 +00:00
jcoffey-dev deleted branch fix/75-key-prompt 2026-11-18 18:33:07 +00:00
Sign in to join this conversation.