caprover / caprover-cli

Command Line Interface for https://github.com/caprover/caprover
72 stars 40 forks source link

Caprover Login Can't resolve local machine #76

Closed obizbu closed 3 years ago

obizbu commented 3 years ago

My setup: Ubuntu Server 20.04, with Caprover installed using the local install instructions Macbook Pro Client machine

Caprover installed successfully and I was able to access :3000 and successfully get the Caprover admin interface. I was able to successfully update the root domain to be captain.localhost I succesffully installed caprover cli tool on my server I ran caprover login:

? CapRover machine URL address, it is "[http[s]://][captain.]your-captain-root.domain": http://captain.captain.localhost
? CapRover machine password: [hidden]
? CapRover machine name, with whom the login credentials are stored locally: <SERVERNAME>

I get the following response:

Something bad happened: cannot save <SERVERNAME> at http://captain.captain.localhost.
Error: getaddrinfo EAI_AGAIN captain.captain.localhost captain.captain.localhost:80

I've tried the above replacing 'localhost' with the , but get the same error (or in some cases a getaddrinfo ENOTFOUND error)

On the client machine obviously if I go to captain.localhost, it's not found. If I go to captain. that also fails... the only way I can access caprover is through :3000

Question: How do I get Caprover setup correctly, and access the caprover subdomains from the client machine?

obizbu commented 3 years ago

PS: LOVE this project, can't wait to actually start using it.

obizbu commented 3 years ago

OK - I believe I've solved this issue and am now able to successfully login via the CLI tool.

Steps I took were: 1) Install resolvconf 2) Add nameserver 127.0.0.1 to head in the resolvconf directory 3) uninistall/reinstall caprover 4) update caprover domain (in browser) to captain.localhost 5) Login using the CLI tool with http://captain.captain.localhost (note - using captain.localhost did NOT work)

So I'll close this issue

githubsaturn commented 3 years ago

Thanks for self-resolving the issue. For future reference, you cannot use caprover serversetup for internal installations where HTTPS cannot be activated. You have to setup the domain by accessing web GUI http://IP:3000

obizbu commented 3 years ago

Yep! That's what I did - I didn't use caprover serversetup. Per the docs - I went to the UI - added captain.localhost there, then went to my commandline and ran caprover login and made sure to enter the same value there.