Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ EOF
"STUDIO_PG_META_URL=http://" + utils.PgmetaId + ":8080",
"POSTGRES_PASSWORD=" + dbConfig.Password,
"SUPABASE_URL=http://" + utils.KongId + ":8000",
"SUPABASE_PUBLIC_URL=" + utils.Config.Studio.ApiUrl,
"SUPABASE_PUBLIC_URL=" + utils.Config.Api.ExternalUrl,
"AUTH_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value,
"SUPABASE_ANON_KEY=" + utils.Config.Auth.AnonKey.Value,
"SUPABASE_SERVICE_KEY=" + utils.Config.Auth.ServiceRoleKey.Value,
Expand Down
11 changes: 5 additions & 6 deletions pkg/config/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ type (
ExtraSearchPath []string `toml:"extra_search_path" json:"extra_search_path"`
MaxRows uint `toml:"max_rows" json:"max_rows"`
// Local only config
Image string `toml:"-" json:"-"`
KongImage string `toml:"-" json:"-"`
Port uint16 `toml:"port" json:"port"`
Tls tlsKong `toml:"tls" json:"tls"`
// TODO: replace [auth|studio].api_url
ExternalUrl string `toml:"external_url" json:"external_url"`
Image string `toml:"-"`
KongImage string `toml:"-"`
Port uint16 `toml:"port"`
Tls tlsKong `toml:"tls"`
ExternalUrl string `toml:"external_url"`
}

tlsKong struct {
Expand Down
6 changes: 0 additions & 6 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ type (
Enabled bool `toml:"enabled" json:"enabled"`
Image string `toml:"-" json:"-"`
Port uint16 `toml:"port" json:"port"`
ApiUrl string `toml:"api_url" json:"api_url"`
OpenaiApiKey Secret `toml:"openai_api_key" json:"openai_api_key"`
PgmetaImage string `toml:"-" json:"-"`
}
Expand Down Expand Up @@ -857,11 +856,6 @@ func (c *config) Validate(fsys fs.FS) error {
if c.Studio.Port == 0 {
return errors.New("Missing required field in config: studio.port")
}
if parsed, err := url.Parse(c.Studio.ApiUrl); err != nil {
return errors.Errorf("Invalid config for studio.api_url: %w", err)
} else if parsed.Host == "" || parsed.Host == c.Hostname {
c.Studio.ApiUrl = c.Api.ExternalUrl
}
}
// Validate smtp config
if c.Inbucket.Enabled {
Expand Down
4 changes: 2 additions & 2 deletions pkg/config/templates/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ extra_search_path = ["public", "extensions"]
# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size
# for accidental or malicious requests.
max_rows = 1000
# External URL of the API server that frontend connects to. Defaults to http(s)://hostname:api.port when empty.
# external_url = ""

[api.tls]
# Enable HTTPS endpoints locally using a self-signed certificate.
Expand Down Expand Up @@ -89,8 +91,6 @@ enabled = true
enabled = true
# Port to use for Supabase Studio.
port = 54323
# External URL of the API server that frontend connects to.
api_url = "http://127.0.0.1"
# OpenAI API Key to use for Supabase AI in the Supabase Studio.
openai_api_key = "env(OPENAI_API_KEY)"

Expand Down
2 changes: 0 additions & 2 deletions pkg/config/testdata/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ max_header_length = 8192
enabled = true
# Port to use for Supabase Studio.
port = 54323
# External URL of the API server that frontend connects to.
api_url = "http://127.0.0.1"
# OpenAI API Key to use for Supabase AI in the Supabase Studio.
openai_api_key = "env(OPENAI_API_KEY)"

Expand Down
Loading