Skip to content

Commit 588b473

Browse files
committed
fix(api): update kong image to address vulnerability
1 parent 39ce039 commit 588b473

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

internal/start/start.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ var (
127127
//go:embed templates/custom_nginx.template
128128
nginxConfigEmbed string
129129
// Hardcoded configs which match nginxConfigEmbed
130-
nginxEmailTemplateDir = "/home/kong/templates/email"
130+
nginxEmailTemplateDir = "/etc/kong/templates/email"
131131
nginxTemplateServerPort = 8088
132132
)
133133

@@ -400,7 +400,7 @@ EOF
400400
Image: utils.Config.Api.KongImage,
401401
Env: []string{
402402
"KONG_DATABASE=off",
403-
"KONG_DECLARATIVE_CONFIG=/home/kong/kong.yml",
403+
"KONG_DECLARATIVE_CONFIG=/etc/kong/kong.yml",
404404
"KONG_DNS_ORDER=LAST,A,CNAME", // https://github.com/supabase/cli/issues/14
405405
"KONG_PLUGINS=request-transformer,cors",
406406
fmt.Sprintf("KONG_PORT_MAPS=%d:8000", utils.Config.Api.Port),
@@ -411,14 +411,14 @@ EOF
411411
"KONG_NGINX_PROXY_PROXY_BUFFERS=64 160k",
412412
"KONG_NGINX_WORKER_PROCESSES=1",
413413
// Use modern TLS certificate
414-
"KONG_SSL_CERT=/home/kong/localhost.crt",
415-
"KONG_SSL_CERT_KEY=/home/kong/localhost.key",
414+
"KONG_SSL_CERT=/etc/kong/localhost.crt",
415+
"KONG_SSL_CERT_KEY=/etc/kong/localhost.key",
416416
},
417-
Entrypoint: []string{"sh", "-c", `cat <<'EOF' > /home/kong/kong.yml && \
418-
cat <<'EOF' > /home/kong/custom_nginx.template && \
419-
cat <<'EOF' > /home/kong/localhost.crt && \
420-
cat <<'EOF' > /home/kong/localhost.key && \
421-
./docker-entrypoint.sh kong docker-start --nginx-conf /home/kong/custom_nginx.template
417+
Entrypoint: []string{"sh", "-c", `cat <<'EOF' > /etc/kong/kong.yml && \
418+
cat <<'EOF' > /etc/kong/custom_nginx.template && \
419+
cat <<'EOF' > /etc/kong/localhost.crt && \
420+
cat <<'EOF' > /etc/kong/localhost.key && \
421+
./docker-entrypoint.sh kong docker-start --nginx-conf /etc/kong/custom_nginx.template
422422
` + kongConfigBuf.String() + `
423423
EOF
424424
` + nginxConfigEmbed + `

internal/start/templates/custom_nginx.template

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ error_log logs/error.log ${{LOG_LEVEL}}; # can be set by kong.conf
44
daemon ${{NGINX_DAEMON}}; # can be set by kong.conf
55
worker_processes ${{NGINX_WORKER_PROCESSES}}; # can be set by kong.conf
66

7+
# https://github.com/Kong/kong/discussions/9548#discussioncomment-6174906
8+
lmdb_environment_path dbless.lmdb;
9+
lmdb_map_size 128m;
10+
711
events {
12+
# Must be greater or equal to the default value of lua_max_pending_timers
13+
# https://github.com/openresty/lua-nginx-module?tab=readme-ov-file#lua_max_pending_timers
14+
worker_connections 1024;
815
multi_accept on;
916
}
1017

@@ -20,7 +27,7 @@ http {
2027

2128
location /email {
2229
autoindex on;
23-
root /home/kong/templates;
30+
root /etc/kong/templates;
2431
}
2532
}
2633

pkg/config/constants.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const (
66
Pg15Image = "supabase/postgres:15.1.1.78"
77
// Append to ServiceImages when adding new dependencies below
88
// TODO: try https://github.com/axllent/mailpit
9-
kongImage = "library/kong:2.8.1"
9+
kongImage = "library/kong:3.8.0"
1010
inbucketImage = "inbucket/inbucket:3.0.3"
1111
postgrestImage = "postgrest/postgrest:v12.2.0"
1212
pgmetaImage = "supabase/postgres-meta:v0.84.2"

0 commit comments

Comments
 (0)