instantdb / instant

Instant is a modern Firebase. We make you productive by giving your frontend a real-time database.
https://instantdb.com
Apache License 2.0
6.58k stars 175 forks source link

`npx instant-cli login` unable to login with self-hosted server #168

Open fivestones opened 1 month ago

fivestones commented 1 month ago

I have the instantdb server running on localhost. I should be able to use instant-cli to login to this self-hosted instance, but there is no way to do this (unless maybe there is some undocumented way) and instead it only makes use of instantdb.com.

I guess this is more of a feature request than a bug.

Thanks so much for looking into this!

fivestones commented 1 month ago

I figured this out after digging around in the code for instant-cli. I first pulled changes from github that had been committed over the past week (didn't work without doing this). Then I was able to do DEV=1 npx instant-cli login and it let me login on my localhost server. Horay!

However, I would like to leave this issue as a feature request because at the moment when the DEV environment variable is set, while it lets you use localhost to login, localhost is also hardcoded and preferrablly it should let you add any IP address or url to use for logging in with a command line option.

G2Jose commented 1 month ago

This actually explains the issue I'm facing in https://github.com/instantdb/instant/issues/167

I have DEV=true set in my shell for other reasons, and this was causing InstantDB to try to connect to a local instance.

IMO instant-cli should take an explicit argument to connect to local vs cloud instances, as opposed to a very generic environment variable.