From bb7a90ea74c95c84ed0e1fd6b2d0c92468effb81 Mon Sep 17 00:00:00 2001 From: Lago Date: Fri, 17 Apr 2026 22:58:14 +0200 Subject: [PATCH] fix: remove all hardcoded localhost, cache-bust config.js, gitignore generated config.js --- .gitignore | 3 +++ frontend/admin.html | 4 ++-- frontend/admin.js | 2 +- frontend/app.js | 2 +- frontend/config.js | 4 ---- frontend/index.html | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 frontend/config.js diff --git a/.gitignore b/.gitignore index 2e70312..741a790 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ Thumbs.db .idea/ docker-compose.override.yml + +# Generated at container start by 99-config.sh — never commit +frontend/config.js diff --git a/frontend/admin.html b/frontend/admin.html index 700729b..bc30746 100644 --- a/frontend/admin.html +++ b/frontend/admin.html @@ -6,7 +6,7 @@ Admin · MC Cars - + @@ -62,7 +62,7 @@

MC Cars · Admin

Website - Supabase Studio + diff --git a/frontend/admin.js b/frontend/admin.js index 84833f2..6e6ef0d 100644 --- a/frontend/admin.js +++ b/frontend/admin.js @@ -1,6 +1,6 @@ import { createClient } from "https://esm.sh/@supabase/supabase-js@2.45.4"; -const SUPA_URL = window.MCCARS_CONFIG?.SUPABASE_URL || "http://localhost:54321"; +const SUPA_URL = window.MCCARS_CONFIG?.SUPABASE_URL ?? ""; const SUPA_KEY = window.MCCARS_CONFIG?.SUPABASE_ANON_KEY || ""; // Only the public anon key lives here. Write access is gated by RLS policies diff --git a/frontend/app.js b/frontend/app.js index e6dd670..2a87c26 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1,7 +1,7 @@ import { createClient } from "https://esm.sh/@supabase/supabase-js@2.45.4"; import { translations, REVIEWS, getLang, setLang, t, applyI18n } from "./i18n.js"; -const SUPA_URL = window.MCCARS_CONFIG?.SUPABASE_URL || "http://localhost:54321"; +const SUPA_URL = window.MCCARS_CONFIG?.SUPABASE_URL ?? ""; const SUPA_KEY = window.MCCARS_CONFIG?.SUPABASE_ANON_KEY || ""; export const supabase = createClient(SUPA_URL, SUPA_KEY, { diff --git a/frontend/config.js b/frontend/config.js deleted file mode 100644 index 0f6def9..0000000 --- a/frontend/config.js +++ /dev/null @@ -1,4 +0,0 @@ -window.MCCARS_CONFIG = { - SUPABASE_URL: "http://localhost:55521", - SUPABASE_ANON_KEY: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0" -}; diff --git a/frontend/index.html b/frontend/index.html index 0c7b2aa..8cc9dcf 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -9,7 +9,7 @@ - +