Describe the bug
In theory, the api.external_url config.toml field allows the user to tell a Supabase instance what URL its API will be accessible at when it's created. This URL should be used as the base by Supabase Auth endpoints like "POST /admin/generate_link", which needs to use the base URL in the URLs it generates.
However, in practice, the value supplied for external_url in config.toml is always overwritten by the following code:
|
// Update external api url |
|
apiUrl := url.URL{Host: net.JoinHostPort(c.Hostname, |
|
strconv.FormatUint(uint64(c.Api.Port), 10), |
|
)} |
|
if c.Api.Tls.Enabled { |
|
apiUrl.Scheme = "https" |
|
} else { |
|
apiUrl.Scheme = "http" |
|
} |
|
c.Api.ExternalUrl = apiUrl.String() |
To Reproduce
Steps to reproduce the behavior:
- Supply an
external_url string under the [api] section in config.toml.
- Start a new Supabase instance with
supabase start.
- Generate a link through the Supabase Auth API.
- The link will start with 127.0.0.1, in spite of whatever you supplied as the
external_url.
Expected behavior
I expect the generated link to start with the external_url I supplied.
System information
Rerun the failing command with --create-ticket flag.
There is no specific failing command, only a failure to use the config.
Describe the bug
In theory, the
api.external_urlconfig.toml field allows the user to tell a Supabase instance what URL its API will be accessible at when it's created. This URL should be used as the base by Supabase Auth endpoints like "POST /admin/generate_link", which needs to use the base URL in the URLs it generates.However, in practice, the value supplied for
external_urlin config.toml is always overwritten by the following code:cli/pkg/config/config.go
Lines 547 to 556 in 9142412
To Reproduce
Steps to reproduce the behavior:
external_urlstring under the[api]section in config.toml.supabase start.external_url.Expected behavior
I expect the generated link to start with the
external_urlI supplied.System information
Rerun the failing command with
--create-ticketflag.There is no specific failing command, only a failure to use the config.