Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error message for bad user input, maybe? #14

Open
joshstrange opened this issue Mar 17, 2019 · 2 comments
Open

Better error message for bad user input, maybe? #14

joshstrange opened this issue Mar 17, 2019 · 2 comments
Labels
enhancement Something could be done better

Comments

@joshstrange
Copy link

Maybe I'm incredibly stupid and dense but I took the prompt of It is captain.[your-captain-root-domain] : to mean I should not include the "captain" part. I know after reading it a closely it doesn't say that but I'd like to think at least one other person had this issue. The error you get is:

I've replaced the actual values with placeholders. Assume I have a caprover instance at captain.example.com with a wildcard DNS on *.example.com

❯❯❯ caprover login
Login to a CapRover Machine
?
Enter address of the CapRover machine.
It is captain.[your-captain-root-domain] : example.com
? Is HTTPS activated for this CapRover machine? Yes
? Enter your password: [hidden]
? Enter a name for this Captain machine: dev1
Something bad happened. Cannot save "dev1"
Error: Hostname/IP doesn't match certificate's altnames: "Host: example.com. is not in the cert's altnames: DNS:captain.example.com"

I started to think login.ts could be edited to check for "captain." at the start of the URL but I'm not sure if it's possible to change the url caprover admin is served over and if it could be changed it would break the CLI for those people. Maybe not if you just showed a warning message 1 time on login "Warning: Most CapRover installations start with 'captain.' or something like that. The other option that comes to mind is catch that specific error and only then show the warning (or silently add it yourself to see if that works after you see that error).

The obvious "third option" is to do nothing, which is perfectly reasonable seeing how "login" happens only once, or handful of times at most per person and once you know you won't make the same mistake twice.

As someone used this back when it was called Captain Duck Duck (but never used the cli till now) I was starting to think it was some issue in the update/migration (I've had enough issues with Ghost blog's updates...). I was close to uninstalled CR and reinstalling it fresh to see if that helped. Thankfully I found a post about this error, not related to CR, and attempted to suppress it only to get a different error that triggered something in my brain to attempt throwing "captain" on the front of my URL.

If you do pick the third option at least this issue should point people in the right direction if they are similarly challenged at stopping to full read a prompt before continuing.

@githubsaturn
Copy link
Collaborator

Great feedback. Definitely something that has to be fixed. I think we need to do 2 things:

  • Change captain.[your-captain-root-domain] to captain.root.domain.com in the prompt.
  • Add an error if the url doesn't start with captain.

@githubsaturn githubsaturn added the enhancement Something could be done better label Mar 18, 2019
@Hazzard17h
Copy link
Contributor

I think this is resolved from #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something could be done better
Projects
None yet
Development

No branches or pull requests

3 participants