Switch auth to plain-text password env var (remove bcrypt)

- Replace ADMIN_PASSWORD_HASH with ADMIN_PASSWORD in auth route and docker-compose
- Remove bcryptjs / @types/bcryptjs dependencies
- Delete scripts/hashPassword.ts (no longer needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-21 22:05:42 -05:00
parent 7ef0509f2b
commit bcb8a95fae
16 changed files with 407 additions and 156 deletions
@@ -1,4 +1,4 @@
import { useState, type FormEvent } from 'react';
import { useState, useEffect, type FormEvent } from 'react';
import { toast } from 'sonner';
import type { ModuleType } from '../../types';
import { Modal } from '../ui/Modal';
@@ -17,6 +17,8 @@ interface AddModuleModalProps {
onClose: () => void;
rackId: string;
uPosition: number;
/** Pre-select a type (e.g. from a palette drag) — skips the type picker step. */
initialType?: ModuleType;
}
const ALL_TYPES: ModuleType[] = [
@@ -24,17 +26,29 @@ const ALL_TYPES: ModuleType[] = [
'MODEM', 'SERVER', 'NAS', 'PDU', 'AP', 'BLANK', 'OTHER',
];
export function AddModuleModal({ open, onClose, rackId, uPosition }: AddModuleModalProps) {
export function AddModuleModal({ open, onClose, rackId, uPosition, initialType }: AddModuleModalProps) {
const { addModule } = useRackStore();
const [selectedType, setSelectedType] = useState<ModuleType | null>(null);
const [name, setName] = useState('');
const [uSize, setUSize] = useState(1);
const [portCount, setPortCount] = useState(0);
const [selectedType, setSelectedType] = useState<ModuleType | null>(initialType ?? null);
const [name, setName] = useState(initialType ? MODULE_TYPE_LABELS[initialType] : '');
const [uSize, setUSize] = useState(initialType ? MODULE_U_DEFAULTS[initialType] : 1);
const [portCount, setPortCount] = useState(initialType ? MODULE_PORT_DEFAULTS[initialType] : 0);
const [ipAddress, setIpAddress] = useState('');
const [manufacturer, setManufacturer] = useState('');
const [model, setModel] = useState('');
const [loading, setLoading] = useState(false);
// Sync state when modal opens with a new initialType (e.g. drag-drop reuse)
useEffect(() => {
if (open && initialType) {
setSelectedType(initialType);
setName(MODULE_TYPE_LABELS[initialType]);
setUSize(MODULE_U_DEFAULTS[initialType]);
setPortCount(MODULE_PORT_DEFAULTS[initialType]);
} else if (!open) {
reset();
}
}, [open, initialType]); // eslint-disable-line react-hooks/exhaustive-deps
function handleTypeSelect(type: ModuleType) {
setSelectedType(type);
setName(MODULE_TYPE_LABELS[type]);