The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: Various fixes and improvements for the local build (#21560)
Ivan Vasilov49b945e7e518
diff --git a/apps/studio/Dockerfile b/apps/studio/Dockerfileindex ad0012db829..90534157187 100644--- a/apps/studio/Dockerfile+++ b/apps/studio/Dockerfile@@ -30,9 +30,11 @@ COPY --from=turbo /app/out/json ./COPY --from=turbo /app/out/package-lock.json ./# Install additional dependencies for arm64 build (required by bufferutil)ARG TARGETARCH+# TODO: Git is added because it's needed to build libpg, remove it once we move to a WASM buildRUN if [ "$TARGETARCH" = "arm64" ]; then \apt-get update && apt-get install -y --no-install-recommends \python3 \+ git \build-essential \&& rm -rf /var/lib/apt/lists/*; fi# No need to clean cache because production uses standalone builddiff --git a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeTokensPopover/index.tsx b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeTokensPopover/index.tsxindex 20b7df8106a..ea3020e5f07 100644--- a/apps/studio/components/interfaces/Realtime/Inspector/RealtimeTokensPopover/index.tsx+++ b/apps/studio/components/interfaces/Realtime/Inspector/RealtimeTokensPopover/index.tsx@@ -4,6 +4,7 @@ import toast from 'react-hot-toast'import { RoleImpersonationPopover } from 'components/interfaces/RoleImpersonationSelector'import { useProjectApiQuery } from 'data/config/project-api-query'import { useProjectPostgrestConfigQuery } from 'data/config/project-postgrest-config-query'+import { IS_PLATFORM } from 'lib/constants'import { getRoleImpersonationJWT } from 'lib/role-impersonation'import { useRoleImpersonationStateSnapshot } from 'state/role-impersonation-state'import { RealtimeConfig } from '../useRealtimeMessages'@@ -25,9 +26,12 @@ export const RealtimeTokensPopover = ({ config, onChangeConfig }: RealtimeTokens? apiService.serviceApiKey: undefined- const { data: postgrestConfig } = useProjectPostgrestConfigQuery({- projectRef: config.projectRef,- })+ const { data: postgrestConfig } = useProjectPostgrestConfigQuery(+ {+ projectRef: config.projectRef,+ },+ { enabled: IS_PLATFORM }+ )const jwtSecret = postgrestConfig?.jwt_secretconst snap = useRoleImpersonationStateSnapshot()diff --git a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsxindex 076268e978c..2b120dbb914 100644--- a/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx+++ b/apps/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.utils.tsx@@ -87,7 +87,7 @@ export const generateProductRoutes = (},]: []),- ...(IS_PLATFORM && realtimeEnabled+ ...(realtimeEnabled? [{key: 'realtime',diff --git a/apps/studio/next.config.js b/apps/studio/next.config.jsindex f163c115db7..97e2d661a6b 100644--- a/apps/studio/next.config.js+++ b/apps/studio/next.config.js@@ -10,11 +10,19 @@ const API_URL = process.env.NEXT_PUBLIC_API_URL? new URL(process.env.NEXT_PUBLIC_API_URL).origin: ''const SUPABASE_URL = process.env.SUPABASE_URL ? new URL(process.env.SUPABASE_URL).origin : ''-const GOTRUE_URL = process.env.NEXT_PUBLIC_API_URL+const GOTRUE_URL = process.env.NEXT_PUBLIC_GOTRUE_URL? new URL(process.env.NEXT_PUBLIC_GOTRUE_URL).origin: ''const SUPABASE_PROJECTS_URL = 'https://*.supabase.co'-const SUPABASE_PROJECTS_URL_WS = 'wss://*.supabase.co'++// construct the URL for the Websocket Local URLs+let SUPABASE_LOCAL_PROJECTS_URL_WS = ''+if (SUPABASE_URL) {+ const url = new URL(SUPABASE_URL)+ const wsUrl = `${url.hostname}:${url.port}`+ SUPABASE_LOCAL_PROJECTS_URL_WS = `ws://${wsUrl} wss://${wsUrl}`+}+const SUPABASE_STAGING_PROJECTS_URL = 'https://*.supabase.red'const SUPABASE_STAGING_PROJECTS_URL_WS = 'wss://*.supabase.red'const SUPABASE_COM_URL = 'https://supabase.com'@@ -37,7 +45,7 @@ const VERCEL_LIVE_URL = 'https://vercel.live'const PUSHER_URL = 'https://*.pusher.com'const PUSHER_URL_WS = 'wss://*.pusher.com'-const DEFAULT_SRC_URLS = `${API_URL} ${SUPABASE_URL} ${GOTRUE_URL} ${SUPABASE_PROJECTS_URL} ${SUPABASE_PROJECTS_URL_WS} ${HCAPTCHA_SUBDOMAINS_URL} ${CONFIGCAT_URL} ${STRIPE_SUBDOMAINS_URL} ${STRIPE_NETWORK_URL} ${CLOUDFLARE_URL} ${ONE_ONE_ONE_ONE_URL} ${VERCEL_INSIGHTS_URL} ${GITHUB_API_URL} ${GITHUB_USER_CONTENT_URL}`+const DEFAULT_SRC_URLS = `${API_URL} ${SUPABASE_URL} ${GOTRUE_URL} ${SUPABASE_PROJECTS_URL} ${SUPABASE_LOCAL_PROJECTS_URL_WS} ${HCAPTCHA_SUBDOMAINS_URL} ${CONFIGCAT_URL} ${STRIPE_SUBDOMAINS_URL} ${STRIPE_NETWORK_URL} ${CLOUDFLARE_URL} ${ONE_ONE_ONE_ONE_URL} ${VERCEL_INSIGHTS_URL} ${GITHUB_API_URL} ${GITHUB_USER_CONTENT_URL}`const SCRIPT_SRC_URLS = `${CLOUDFLARE_CDN_URL} ${HCAPTCHA_JS_URL} ${STRIPE_JS_URL}`const FRAME_SRC_URLS = `${HCAPTCHA_ASSET_URL} ${STRIPE_JS_URL}`const IMG_SRC_URLS = `${SUPABASE_URL} ${SUPABASE_COM_URL} ${SUPABASE_PROJECTS_URL}`