Skip to content

Commit 64facde

Browse files
authored
feat: allow deno version in config (#3304)
1 parent 67ac74e commit 64facde

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

pkg/config/config.go

+11
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ type (
225225
Policy RequestPolicy `toml:"policy"`
226226
InspectorPort uint16 `toml:"inspector_port"`
227227
Secrets SecretsConfig `toml:"secrets"`
228+
DenoVersion uint `toml:"deno_version"`
228229
}
229230

230231
SecretsConfig map[string]Secret
@@ -827,6 +828,16 @@ func (c *config) Validate(fsys fs.FS) error {
827828
return err
828829
}
829830
}
831+
switch c.EdgeRuntime.DenoVersion {
832+
case 0:
833+
return errors.New("Missing required field in config: edge_runtime.deno_version")
834+
case 1:
835+
break
836+
case 2:
837+
c.EdgeRuntime.Image = deno2
838+
default:
839+
return errors.Errorf("Failed reading config: Invalid %s: %v.", "edge_runtime.deno_version", c.EdgeRuntime.DenoVersion)
840+
}
830841
// Validate logflare config
831842
if c.Analytics.Enabled {
832843
if c.Analytics.Backend == LogflareBigQuery {

pkg/config/constants.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import (
99
)
1010

1111
const (
12-
pg13 = "supabase/postgres:13.3.0"
13-
pg14 = "supabase/postgres:14.1.0.89"
12+
pg13 = "supabase/postgres:13.3.0"
13+
pg14 = "supabase/postgres:14.1.0.89"
14+
deno2 = "supabase/edge-runtime:v1.68.0-develop.8"
1415
)
1516

1617
type images struct {

pkg/config/templates/config.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ sign_in_sign_ups = 30
141141
# Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address.
142142
token_verifications = 30
143143

144-
145144
# Configure one of the supported captcha providers: `hcaptcha`, `turnstile`.
146145
# [auth.captcha]
147146
# enabled = true
@@ -283,6 +282,8 @@ enabled = true
283282
policy = "oneshot"
284283
# Port to attach the Chrome inspector for debugging edge functions.
285284
inspector_port = 8083
285+
# The Deno major version to use.
286+
deno_version = 1
286287

287288
# [edge_runtime.secrets]
288289
# secret_key = "env(SECRET_VALUE)"

pkg/config/testdata/config.toml

+1
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ enabled = true
259259
# Use `oneshot` for hot reload, or `per_worker` for load testing.
260260
policy = "per_worker"
261261
inspector_port = 8083
262+
deno_version = 2
262263

263264
[edge_runtime.secrets]
264265
test_key = "test_value"

0 commit comments

Comments
 (0)