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