From 09e6fd6aa378a9da69a97a75fe3816164ee700e5 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Sun, 9 Mar 2025 22:00:36 -0600 Subject: [PATCH] refactor: Simplify Supabase and Teable blueprint JWT and port configurations --- blueprints/supabase/template.yml | 6 ++++-- blueprints/teable/template.yml | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/blueprints/supabase/template.yml b/blueprints/supabase/template.yml index 7dda2ff..f7bbf88 100644 --- a/blueprints/supabase/template.yml +++ b/blueprints/supabase/template.yml @@ -4,6 +4,8 @@ variables: jwt_secret: ${base64:32} dashboard_password: ${password:32} logflare_api_key: ${password:32} + anon_key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogImFub24iLAogICJpc3MiOiAic3VwYWJhc2UiLAogICJpYXQiOiAxNzQxNTAwMDAwLAogICJleHAiOiAxODk5MjY2NDAwCn0.muKe0Nrvkf5bMyLoFqAuFypRu3jHAcTYU08SYKrgRQo + service_role_key: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJyb2xlIjogInNlcnZpY2Vfcm9sZSIsCiAgImlzcyI6ICJzdXBhYmFzZSIsCiAgImlhdCI6IDE3NDE1MDAwMDAsCiAgImV4cCI6IDE4OTkyNjY0MDAKfQ.1KoSiJVueKJNkF59uc84BLqk7h8VdAoVp6Gozqr_vGc config: domains: @@ -15,8 +17,8 @@ config: SUPABASE_HOST: ${main_domain} POSTGRES_PASSWORD: ${postgres_password} JWT_SECRET: ${jwt_secret} - ANON_KEY: ${generateJWT({ role: "anon", iss: "supabase", iat: Math.floor(Date.now() / 1000), exp: Math.floor(Date.now() / 1000) + 100 * 365 * 24 * 60 * 60 }, jwt_secret)} - SERVICE_ROLE_KEY: ${generateJWT({ role: "service_role", iss: "supabase", iat: Math.floor(Date.now() / 1000), exp: Math.floor(Date.now() / 1000) + 100 * 365 * 24 * 60 * 60 }, jwt_secret)} + ANON_KEY: ${anon_key} + SERVICE_ROLE_KEY: ${service_role_key} DASHBOARD_USERNAME: "supabase" DASHBOARD_PASSWORD: ${dashboard_password} POSTGRES_HOSTNAME: "db" diff --git a/blueprints/teable/template.yml b/blueprints/teable/template.yml index 5ae4cf7..eda0529 100644 --- a/blueprints/teable/template.yml +++ b/blueprints/teable/template.yml @@ -1,7 +1,7 @@ variables: main_domain: ${randomDomain} db_password: ${password} - public_db_port: ${Math.round(Math.random() * (65534 - 32769) + 32769)} + public_db_port: ${randomPort} config: domains: @@ -22,7 +22,7 @@ config: # App PUBLIC_ORIGIN: https://${main_domain} PRISMA_DATABASE_URL: postgresql://teable:${db_password}@teable-db:5432/teable - PUBLIC_DATABASE_PROXY: ${main_domain}:${public_db_port} + PUBLIC_DATABASE_PROXY: ${TEABLE_HOST}:${TEABLE_DB_PORT} # Need to support sending emails to enable the following configurations # You need to modify the configuration according to the actual situation, otherwise it will not be able to send emails correctly. #BACKEND_MAIL_HOST: "smtp.teable.io"