cli icon indicating copy to clipboard operation
cli copied to clipboard

Allow configuration of SUPABASE_REST_URL when using Supabase Studio from CLI

Open EALNick opened this issue 3 years ago • 1 comments

Feature request

I'd like to be able to set SUPABASE_REST_URL when using Supabase Studio from CLI.

At the moment, I believe I can configure the port using the config.toml file but there doesn't seem to be a way to change the server address.

I think it has something to do with this line in https://github.com/supabase/cli/blob/main/internal/start/start.go:

fmt.Sprintf("SUPABASE_REST_URL=http://localhost:%v/rest/v1/", utils.Config.Api.Port),

CLI seems to assume that REST API is accessible from local host.

Is your feature request related to a problem? Please describe.

I installed Supabase via CLI on a linux server at work, which I can only access from shell.

When accessing Supabase studio at the network address, Supabase Studio can't connect to database.

It gets stuck at "Connecting to default project".

Looking in network tab of chrome developer tools, I can see Studio is sending a request to the localhost but does not receive a reply from: http://localhost:54321/rest/v1/

Describe the solution you'd like

I believe this has something to do with the way the server/docker itself is set up on my work network, so there may be another solution, but ideally I would like to be able to configure Studio to use a different server than localhost and to do this by editing the config.toml file.

Describe alternatives you've considered

It seems like it might be possible to change the .env variable for SUPABASE_REST_URL for the docker container but I have no idea how.

EALNick avatar May 26 '22 04:05 EALNick

@kiwicopple Thanks for moving this across to CLI

EALNick avatar Jun 02 '22 21:06 EALNick