Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): update kong image to address vulnerability #2806

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
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
1 change: 0 additions & 1 deletion .github/workflows/mirror-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
mirror:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
Expand Down
18 changes: 9 additions & 9 deletions internal/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ var (
//go:embed templates/custom_nginx.template
nginxConfigEmbed string
// Hardcoded configs which match nginxConfigEmbed
nginxEmailTemplateDir = "/home/kong/templates/email"
nginxEmailTemplateDir = "/etc/kong/templates/email"
nginxTemplateServerPort = 8088
)

Expand Down Expand Up @@ -400,7 +400,7 @@ EOF
Image: utils.Config.Api.KongImage,
Env: []string{
"KONG_DATABASE=off",
"KONG_DECLARATIVE_CONFIG=/home/kong/kong.yml",
"KONG_DECLARATIVE_CONFIG=/etc/kong/kong.yml",
"KONG_DNS_ORDER=LAST,A,CNAME", // https://github.com/supabase/cli/issues/14
"KONG_PLUGINS=request-transformer,cors",
fmt.Sprintf("KONG_PORT_MAPS=%d:8000", utils.Config.Api.Port),
Expand All @@ -411,14 +411,14 @@ EOF
"KONG_NGINX_PROXY_PROXY_BUFFERS=64 160k",
"KONG_NGINX_WORKER_PROCESSES=1",
// Use modern TLS certificate
"KONG_SSL_CERT=/home/kong/localhost.crt",
"KONG_SSL_CERT_KEY=/home/kong/localhost.key",
"KONG_SSL_CERT=/etc/kong/localhost.crt",
"KONG_SSL_CERT_KEY=/etc/kong/localhost.key",
},
Entrypoint: []string{"sh", "-c", `cat <<'EOF' > /home/kong/kong.yml && \
cat <<'EOF' > /home/kong/custom_nginx.template && \
cat <<'EOF' > /home/kong/localhost.crt && \
cat <<'EOF' > /home/kong/localhost.key && \
./docker-entrypoint.sh kong docker-start --nginx-conf /home/kong/custom_nginx.template
Entrypoint: []string{"sh", "-c", `cat <<'EOF' > /etc/kong/kong.yml && \
cat <<'EOF' > /etc/kong/custom_nginx.template && \
cat <<'EOF' > /etc/kong/localhost.crt && \
cat <<'EOF' > /etc/kong/localhost.key && \
./docker-entrypoint.sh kong docker-start --nginx-conf /etc/kong/custom_nginx.template
` + kongConfigBuf.String() + `
EOF
` + nginxConfigEmbed + `
Expand Down
9 changes: 8 additions & 1 deletion internal/start/templates/custom_nginx.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ error_log logs/error.log ${{LOG_LEVEL}}; # can be set by kong.conf
daemon ${{NGINX_DAEMON}}; # can be set by kong.conf
worker_processes ${{NGINX_WORKER_PROCESSES}}; # can be set by kong.conf

# https://github.com/Kong/kong/discussions/9548#discussioncomment-6174906
lmdb_environment_path dbless.lmdb;
lmdb_map_size 128m;

events {
# Must be greater or equal to the default value of lua_max_pending_timers
# https://github.com/openresty/lua-nginx-module?tab=readme-ov-file#lua_max_pending_timers
worker_connections 1024;
multi_accept on;
}

Expand All @@ -20,7 +27,7 @@ http {

location /email {
autoindex on;
root /home/kong/templates;
root /etc/kong/templates;
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const (
Pg15Image = "supabase/postgres:15.1.1.78"
// Append to ServiceImages when adding new dependencies below
// TODO: try https://github.com/axllent/mailpit
kongImage = "library/kong:2.8.1"
kongImage = "library/kong:3.8.0"
inbucketImage = "inbucket/inbucket:3.0.3"
postgrestImage = "postgrest/postgrest:v12.2.0"
pgmetaImage = "supabase/postgres-meta:v0.84.2"
Expand Down
Loading