Fix user and password for the app
This commit is contained in:
parent
af515c587d
commit
6496b13d49
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
tasko-chart/
|
tasko-chart/
|
||||||
invy-chart/
|
invy-chart/
|
||||||
|
invy/
|
||||||
values.yaml
|
values.yaml
|
||||||
@ -62,7 +62,9 @@ COPY --from=build /app/dist /usr/share/nginx/html
|
|||||||
# Create entrypoint script for runtime config
|
# Create entrypoint script for runtime config
|
||||||
RUN echo '#!/bin/sh' > /docker-entrypoint.sh && \
|
RUN echo '#!/bin/sh' > /docker-entrypoint.sh && \
|
||||||
echo 'echo "window.ENV = {" > /usr/share/nginx/html/config.js' >> /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 'echo "}" >> /usr/share/nginx/html/config.js' >> /docker-entrypoint.sh && \
|
||||||
echo 'exec nginx -g "daemon off;"' >> /docker-entrypoint.sh && \
|
echo 'exec nginx -g "daemon off;"' >> /docker-entrypoint.sh && \
|
||||||
chmod +x /docker-entrypoint.sh
|
chmod +x /docker-entrypoint.sh
|
||||||
|
|||||||
@ -12,9 +12,9 @@ function Login({ onLogin }) {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
setError('')
|
setError('')
|
||||||
|
|
||||||
// Simple authentication - you can change these credentials
|
// Get credentials from runtime config (set via Helm values)
|
||||||
const ADMIN_USERNAME = 'admin'
|
const ADMIN_USERNAME = window.ENV?.VITE_ADMIN_USERNAME || import.meta.env.VITE_ADMIN_USERNAME || 'admin'
|
||||||
const ADMIN_PASSWORD = 'wedding2025'
|
const ADMIN_PASSWORD = window.ENV?.VITE_ADMIN_PASSWORD || import.meta.env.VITE_ADMIN_PASSWORD || 'wedding2025'
|
||||||
|
|
||||||
if (credentials.username === ADMIN_USERNAME && credentials.password === ADMIN_PASSWORD) {
|
if (credentials.username === ADMIN_USERNAME && credentials.password === ADMIN_PASSWORD) {
|
||||||
localStorage.setItem('isAuthenticated', 'true')
|
localStorage.setItem('isAuthenticated', 'true')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user