diff --git a/.env.example b/.env.example index 3fd410d..ea29e00 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ -PUBLIC_FIREBASE_API_KEY= -PUBLIC_FIREBASE_AUTH_DOMAIN=gdg-platform-cochabamba.firebaseapp.com -PUBLIC_FIREBASE_PROJECT_ID=gdg-platform-cochabamba -PUBLIC_FIREBASE_STORAGE_BUCKET=gdg-platform-cochabamba.firebasestorage.app -PUBLIC_FIREBASE_MESSAGING_SENDER_ID= -PUBLIC_FIREBASE_APP_ID= +PUBLIC_FIREBASE_API_KEY=AIzaSyCFWM4dS64m-MJOLVTemsHcpT8HDbVATMo +PUBLIC_FIREBASE_AUTH_DOMAIN=gdg-cbba-bo.firebaseapp.com +PUBLIC_FIREBASE_PROJECT_ID=gdg-cbba-bo +PUBLIC_FIREBASE_STORAGE_BUCKET=gdg-cbba-bo.appspot.com +PUBLIC_FIREBASE_MESSAGING_SENDER_ID=37363473996 +PUBLIC_FIREBASE_APP_ID=1:37363473996:web:27fb07d725c3486073dee9 PUBLIC_EVENT_SLUG=devfest-2025 diff --git a/src/lib/firebase.ts b/src/lib/firebase.ts index 0c1345c..d2507e0 100644 --- a/src/lib/firebase.ts +++ b/src/lib/firebase.ts @@ -16,7 +16,9 @@ export function getDb(): Firestore { messagingSenderId: import.meta.env.PUBLIC_FIREBASE_MESSAGING_SENDER_ID, appId: import.meta.env.PUBLIC_FIREBASE_APP_ID, }); - db = getFirestore(app); + // DevFest 2025 is a past event: its data is frozen in the read-only "legacy" + // database of gdg-cbba-bo. New events live in the (default) database. + db = getFirestore(app, "legacy"); } return db; } diff --git a/src/pages/index.astro b/src/pages/index.astro index ce4932f..4c3d730 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -19,6 +19,8 @@ import { const slug = import.meta.env.PUBLIC_EVENT_SLUG ?? "devfest-2025"; const event = await getEventBySlug(slug); +// Never publish an empty landing: fail the build if the event isn't in the database. +if (!event) throw new Error(`Event "${slug}" not found in Firestore`); let speakers: Awaited> = []; let team: Awaited> = [];