mirror of
https://github.com/MvDevsUnion/WPetition.git
synced 2026-07-18 05:20:13 +00:00
fix hardcoded cf site key thingie, now a env
This commit is contained in:
@@ -10,6 +10,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ../../
|
context: ../../
|
||||||
dockerfile: .build/prod/frontend.Dockerfile
|
dockerfile: .build/prod/frontend.Dockerfile
|
||||||
|
args:
|
||||||
|
VITE_TURNSTILE_SITEKEY: ${VITE_TURNSTILE_SITEKEY}
|
||||||
hostname: frontend
|
hostname: frontend
|
||||||
image: git.shihaam.dev/mvdevsunion/wpetition/frontend
|
image: git.shihaam.dev/mvdevsunion/wpetition/frontend
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Build stage - compile the React/Vite app
|
# Build stage - compile the React/Vite app
|
||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
|
ARG VITE_TURNSTILE_SITEKEY
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files first for better caching
|
# Copy package files first for better caching
|
||||||
@@ -12,8 +14,8 @@ RUN npm ci
|
|||||||
# Copy source files
|
# Copy source files
|
||||||
COPY frontend-react/ ./
|
COPY frontend-react/ ./
|
||||||
|
|
||||||
# Build the production bundle
|
# Build the production bundle with env vars baked in
|
||||||
RUN npm run build
|
RUN VITE_TURNSTILE_SITEKEY=$VITE_TURNSTILE_SITEKEY npm run build
|
||||||
|
|
||||||
# Production stage - serve with Nginx
|
# Production stage - serve with Nginx
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ riderModule.iml
|
|||||||
/.vs/ProjectEvaluation
|
/.vs/ProjectEvaluation
|
||||||
/Submission.Api/Petitions
|
/Submission.Api/Petitions
|
||||||
/Submission.Api/appsettings.json
|
/Submission.Api/appsettings.json
|
||||||
|
.env
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ export function SignatureForm({ language, onSubmit }: SignatureFormProps) {
|
|||||||
{/* Turnstile and Submit */}
|
{/* Turnstile and Submit */}
|
||||||
<div className="flex flex-col items-center sm:items-start gap-4">
|
<div className="flex flex-col items-center sm:items-start gap-4">
|
||||||
<Turnstile
|
<Turnstile
|
||||||
siteKey="0x4AAAAAACHH4QC3wIhkCuhd"
|
siteKey={import.meta.env.VITE_TURNSTILE_SITEKEY}
|
||||||
onSuccess={setTurnstileToken}
|
onSuccess={setTurnstileToken}
|
||||||
onError={() => setTurnstileToken(null)}
|
onError={() => setTurnstileToken(null)}
|
||||||
onExpire={() => setTurnstileToken(null)}
|
onExpire={() => setTurnstileToken(null)}
|
||||||
|
|||||||
Reference in New Issue
Block a user