Security: remove hardcoded credentials, require DB_PASSWORD, delete .bak file, warn on secrets template

This commit is contained in:
muken
2026-07-17 14:24:48 -05:00
parent 9286f3e323
commit 288767f6c0
4 changed files with 7 additions and 1282 deletions
+1
View File
@@ -1,3 +1,4 @@
# WARNING: Replace CHANGE_ME_* values before applying
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
+5 -1
View File
@@ -11,7 +11,11 @@ const pool = new Pool({
port: 5432, port: 5432,
database: 'lahuasca', database: 'lahuasca',
user: 'lahuasca', user: 'lahuasca',
password: process.env.DB_PASSWORD || 'lahuasca123', password: (() => {
const p = process.env.DB_PASSWORD;
if (!p) throw new Error('DB_PASSWORD env var is required');
return p;
})(),
}); });
async function convertToWebP(base64Data) { async function convertToWebP(base64Data) {
File diff suppressed because it is too large Load Diff
+1 -10
View File
@@ -18,17 +18,8 @@ export function useAuth() {
}, []); }, []);
const login = useCallback((username: string, password: string): boolean => { const login = useCallback((username: string, password: string): boolean => {
// TODO: Implement server-side authentication via API call
if (typeof window === 'undefined') return false; if (typeof window === 'undefined') return false;
if (username === 'admin' && password === 'admin') {
localStorage.setItem(ROLE_KEY, 'admin');
setRole('admin');
return true;
}
if (username === 'user' && password === 'user') {
localStorage.setItem(ROLE_KEY, 'user');
setRole('user');
return true;
}
return false; return false;
}, []); }, []);