[#321] Resolve "support captcha token in registration flow"
Closes #321 (closed)
context
- problem:
- we are starting to get captcha required errors on prod
- this is bad b/c it blocks us from: (1) registering new phone numbers, (2) re-registering old phone numbers to recover from a corrupted keystore
- solution:
- introduce a
-c
argument toboost register
that accepts a captcha token, which may be obtained from https://signalcaptchas.org/registration/generate.html - introduce an optional
captchaToken
field into the/phoneNumbers/register
endpoint hit byboost register
-- and pass it down the callstack tosignald.register
, as per: https://gitlab.com/thefinn93/signald/-/wikis/Captchas
- introduce a
changes
support captchaToken
argument in register
endpoint
- allow optional
captchaToken
argument in/phoneNumbers/register
- if present, pass it to
phoneNumberService.register
andsignal.register
add captcha token arg (-c
) to boost register
side-effects:
modify signal configs
- decrease registration batch size from 5 to 4 (to avoid triggering rate limit errors on excessive registrations)
- increase signaldRequestTimeout from 10 to 20 (since this is now effectively the timeout for verifications)
fix _check-env
bug causing non-deterministic ngrok discovery
- symptom: sometimes _check-env incorrectly deletes the first
character from the ngrok tunnel url assigned to
SIGNALBOOST_HOST_URL
in dev mode, with the result that twilio numbers are created with incorrect callback urls and we can never receive sms'es sent to this number and thus never successfully verify new numbers with signal - cause: we wrongly assumed that ngroks
tunnels
endpoint would always return the http and https tunnels in the same order and based our sub-string finding command off of this assumption -- stripping the first 8 digits from thepublic_url
field in the first tunnel on the assumption that this tunnel's url would always start withhttps://
. however, sometimes it starts withhttp://
, and in those cases, we trim the first digit from the tunnel url - fix: use sed to deterministically strip either
http://
orhttps://
from the tunnel url so that the ordering doesn't matter
Edited by aguestuser