mirror of
https://github.com/Patiun/com.gregkilmer.www.git
synced 2026-11-07 19:58:24 +00:00
Updated key import
This commit is contained in:
@@ -56,12 +56,14 @@ const social = [
|
||||
},
|
||||
];
|
||||
|
||||
// Turnstile site key. Public per Cloudflare (safe to ship to the client), but
|
||||
// read here server-side and passed as a prop so it never needs the PUBLIC_
|
||||
// prefix and stays consistent with TURNSTILE_SECRET_KEY. Undefined when
|
||||
// Turnstile is not configured, which makes ContactForm skip the widget entirely.
|
||||
const turnstileSiteKey = import.meta.env.TURNSTILE_SITE_KEY as
|
||||
string | undefined;
|
||||
// Turnstile site key. Public per Cloudflare (safe to ship to the client).
|
||||
// IMPORTANT: read from process.env at request time, NOT import.meta.env.
|
||||
// Astro/Vite statically replaces import.meta.env.* at BUILD time, so the value
|
||||
// baked in at build would be "" when the key is supplied at runtime via the
|
||||
// container's env_file. process.env is read on each request, so the Docker
|
||||
// container picks up the key from .env at runtime. Undefined when Turnstile is
|
||||
// not configured, which makes ContactForm skip the widget entirely.
|
||||
const turnstileSiteKey = process.env.TURNSTILE_SITE_KEY;
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
|
||||
Reference in New Issue
Block a user