mirror of
https://github.com/Patiun/com.gregkilmer.www.git
synced 2026-11-08 04:08: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
|
// Turnstile site key. Public per Cloudflare (safe to ship to the client).
|
||||||
// read here server-side and passed as a prop so it never needs the PUBLIC_
|
// IMPORTANT: read from process.env at request time, NOT import.meta.env.
|
||||||
// prefix and stays consistent with TURNSTILE_SECRET_KEY. Undefined when
|
// Astro/Vite statically replaces import.meta.env.* at BUILD time, so the value
|
||||||
// Turnstile is not configured, which makes ContactForm skip the widget entirely.
|
// baked in at build would be "" when the key is supplied at runtime via the
|
||||||
const turnstileSiteKey = import.meta.env.TURNSTILE_SITE_KEY as
|
// container's env_file. process.env is read on each request, so the Docker
|
||||||
string | undefined;
|
// 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
|
<BaseLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user