Fix user and password for the app

This commit is contained in:
dvirlabs 2026-02-02 20:45:54 +02:00
parent af515c587d
commit 6496b13d49
3 changed files with 7 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
tasko-chart/
invy-chart/
invy/
values.yaml

View File

@ -62,7 +62,9 @@ COPY --from=build /app/dist /usr/share/nginx/html
# Create entrypoint script for runtime config
RUN echo '#!/bin/sh' > /docker-entrypoint.sh && \
echo 'echo "window.ENV = {" > /usr/share/nginx/html/config.js' >> /docker-entrypoint.sh && \
echo 'echo " VITE_API_URL: \"${VITE_API_URL:-http://localhost:8000}\"" >> /usr/share/nginx/html/config.js' >> /docker-entrypoint.sh && \
echo 'echo " VITE_API_URL: \"${VITE_API_URL:-http://localhost:8000}\"," >> /usr/share/nginx/html/config.js' >> /docker-entrypoint.sh && \
echo 'echo " VITE_ADMIN_USERNAME: \"${VITE_ADMIN_USERNAME:-admin}\"," >> /usr/share/nginx/html/config.js' >> /docker-entrypoint.sh && \
echo 'echo " VITE_ADMIN_PASSWORD: \"${VITE_ADMIN_PASSWORD:-wedding2025}\"" >> /usr/share/nginx/html/config.js' >> /docker-entrypoint.sh && \
echo 'echo "}" >> /usr/share/nginx/html/config.js' >> /docker-entrypoint.sh && \
echo 'exec nginx -g "daemon off;"' >> /docker-entrypoint.sh && \
chmod +x /docker-entrypoint.sh

View File

@ -12,9 +12,9 @@ function Login({ onLogin }) {
e.preventDefault()
setError('')
// Simple authentication - you can change these credentials
const ADMIN_USERNAME = 'admin'
const ADMIN_PASSWORD = 'wedding2025'
// Get credentials from runtime config (set via Helm values)
const ADMIN_USERNAME = window.ENV?.VITE_ADMIN_USERNAME || import.meta.env.VITE_ADMIN_USERNAME || 'admin'
const ADMIN_PASSWORD = window.ENV?.VITE_ADMIN_PASSWORD || import.meta.env.VITE_ADMIN_PASSWORD || 'wedding2025'
if (credentials.username === ADMIN_USERNAME && credentials.password === ADMIN_PASSWORD) {
localStorage.setItem('isAuthenticated', 'true')