Commit Graph

5 Commits

Author SHA1 Message Date
02219a9aa2 add a small delay when logging in to reduce confusion 2025-06-22 21:33:47 -04:00
503b0f750b further security improvments 2025-06-16 14:38:44 -04:00
e92790383d remove logger 2025-06-16 14:25:25 -04:00
697785d9fc Enhance security and fix issues in secure-auth.js
This commit significantly improves the security and reliability of the
authentication module while maintaining all original functionality. Key changes:

- Security: Added input sanitization (sanitize-html, validator), rate limiting
  (rate-limiter-flexible), CSRF protection (csurf), secure headers (helmet),
  and logging (winston). Implemented secure token generation with HMAC-SHA256.
- Bug Fixes: Fixed username validation to allow underscores. Relaxed IP and
  user-agent checks for local IPs to resolve "Invalid session" errors. Fixed
  CSP violation for inline scripts using a nonce-based approach.
- Client-Side: Added debug logging, fallback meta refresh, and improved error
  handling in the auto-login script.
- Logging: Enhanced logging for debugging (user-agent mismatches, invalid inputs).
- Config: Added STRICT_USER_AGENT_CHECK env var for production flexibility.
2025-06-16 14:19:54 -04:00
d38e2ad1f1 Refactor: Initial code split into includes directory for modularity
- Reorganized backend logic by moving API, authentication, Docker, status, and WebSocket handling into separate modules (api.js, auth.js, docker.js, status.js, websocket.js) within ./includes/
- Converted codebase to ES modules with import/export syntax for modern JavaScript
- Updated index.js to serve as main entry point, importing from ./includes/
- Reduced code duplication and improved readability with modularized functions
- Ensured full functionality preservation, including Docker stats and WebSocket communication
- Updated README to reflect new folder structure and ES module setup
2025-06-16 12:30:18 -04:00