Commit Graph
30 Commits
Author SHA1 Message Date
Reditus 0f173dc107 feat: separate dashboard database + launcher repair/cleanup options
- Move dashboard tables (bans, player_ips, audit_log, chat_history,
  settings, player_actions) to a dedicated 'dashboard' database to
  prevent pg_dump conflicts during game updates
- Add DashboardDatabaseService (legacy + backend) with auto-migration
  from old dashboard schema on first startup
- Add launcher option 9: Repair Game Database (fixes schema ownership)
- Add launcher option 10: Clean up Old Dashboard Schema (drops old schema)
- Update PlayerService to fetch IPs from dashboard DB separately
- Update all routes and services to use dash_db for dashboard tables
- Add dashboard_database_name config option to settings.yaml.example
- Update README with new menu options
2026-05-27 01:02:39 +01:00
Reditus 011ba8c8b4 refactor: ChakraUI v3 frontend + direct SQL backend services
Frontend:
- Replace Tailwind CSS with ChakraUI v3 (react, recharts, fontsource)
- 24 themes (12 Dune factions x day/night variants)
- Collapsible sidebar navigation with 6 groups
- Recharts AreaChart/PieChart for CPU/RAM/metrics
- New Experimental page (ports legacy admin_experimental.html)
- Common components: DataTable, Modal, Badge, Toaster

Backend:
- Fix services to use direct SQL (dune.* schema) instead of stored procedures
- PlayerService, EconomyService, GuildService, WorldService rewritten
- Auto-login for SPA development in factory.py
- Fix settings.yaml path resolution

Launcher:
- Add option [7] Start New Dashboard in launcher.ps1 and start.sh
- Auto-installs pip + npm dependencies
- Sets up SSH tunnels + kubectl port-forwards
- Starts backend API + frontend Vite dev server

Security:
- Sanitize hardcoded RMQ password in config.py
- Add frontend/dist/ to .gitignore
2026-05-25 03:08:02 +01:00
Reditus d7ac8a6641 fix: allow cross-origin SocketIO when host is 0.0.0.0 2026-05-23 13:07:20 +01:00
Reditus fd90b6cd46 feat(dashboard): Refactor database schema to dashboard namespace 2026-05-21 16:48:00 +01:00
Reditus e18395e710 Persist firewall rules across VM reboots: re-apply iptables on startup and after SSH reconnect, checking current state to avoid duplicates 2026-05-21 14:00:18 +01:00
Reditus 6fe4384d91 Add db_owner setting to reassign table ownership to game server DB user for backup compatibility 2026-05-21 06:37:31 +01:00
Reditus 5f26621744 Revert "Add db_owner setting to reassign table ownership to game server DB user for backup compatibility"
This reverts commit 18a3253879.
2026-05-21 06:36:16 +01:00
Reditus c57e6572a9 Experimental branch cleanup and fixes
- Removed miner protection module, config, API routes, and UI
- Removed block_postgres firewall feature from dashboard + launcher
- Fixed SSH host key policy (WarningPolicy → AutoAddPolicy)
- Fixed kick race condition (threading.Lock for iptables)
- Tuned Argon2 password parameters (time_cost=3, memory_cost=65536)
- Added login rate-limit (10/min) + IP cooldown after 5 failed attempts
- Created scripts/db_check.py for launcher pre-flight DB check
- Updated README and .gitignore for sanitized repo state
2026-05-21 06:33:48 +01:00
Reditus 18a3253879 Add db_owner setting to reassign table ownership to game server DB user for backup compatibility 2026-05-21 06:28:17 +01:00
Reditus f8e08608e2 Experimental: Auto-reconnect on server restart, rate limiting disabled, inventory edit bug fixes 2026-05-20 03:10:13 +01:00
Reditus 23a7392bcd Fix debug mode: preserve debug when called from option 6 2026-05-19 07:21:03 +01:00
Reditus 16bdb2d778 Fix parameter names in create_debug_log_handler call 2026-05-19 07:10:38 +01:00
Reditus 00288d93a6 Add debug logging system with full request/response logging and sanitization
- New debug logging system with auto-sanitization of sensitive data (passwords, tokens, JWTs, keys)
- Debug mode can be enabled via launcher (option 6) or Server page UI
- Debug logs written to logs/debug.log with full HTTP request/response details
- Added comprehensive page access logging (overview, players, vehicles, server, director)
- Added SSH, K8s, database, and service initialization debug logging
- Fixed miner protection console spam (now uses DEBUG level)
- Removed admin management section from server page
- Updated README with debug mode documentation
2026-05-19 06:59:46 +01:00
Reditus 6e7a850ba2 Fix setup flow: ask remote access first, auto-detect VM IP, validate local_ip
- Ask 'Enable remote access?' before any IP questions
- Default to local-only (n) for simpler setup
- Skip SSL questions when local-only
- Fix Hyper-V VM IP detection (handle single-element arrays properly)
- Validate local_ip in config.py before using as host override
- Fix factory.py to use settings['server']['host'] instead of local_ip
- VM Host prompt shows '(detected)' when auto-detected IP is found
2026-05-19 02:57:50 +01:00
Reditus 8c195c2db0 Fix: import current_user for request logging 2026-05-18 04:27:15 +01:00
Reditus 3dc98c2fc3 Add audit logging expansion, health endpoint, and request logging
- Expand audit logging: server actions (restart, scale), login/logout with success/failure tracking
- Add sensitive data filtering to audit logs before file writes (passwords, keys, tokens)
- Add /api/health endpoint for monitoring (checks DB, SSH, K8s, miner protection, uptime)
- Add request logging middleware with timing for API/server routes
- Add X-Response-Time header to responses
2026-05-18 04:22:39 +01:00
Reditus b4023fb341 Add global exception handler and audit log viewer
- Global exception handler in factory.py (404, 405, unhandled exceptions return JSON)
- AuditService for tracking admin actions (miner cleanup, toggles)
- Audit Log Viewer UI section in server.html
- Updated .gitignore to exclude app/logs/
2026-05-18 04:12:44 +01:00
Reditus ab8d0d922a Add miner protection feature with auto-cleanup and log viewer 2026-05-18 02:39:38 +01:00
Reditus 56361b7a11 Fix DirectorService to use localhost instead of VM IP for SSH tunnel port-forward 2026-05-15 18:38:39 +01:00
Reditus ac43d14b75 Merge setup into launcher, fix DB connection, add CA cert management, and clean up redundant scripts
- Consolidate setup.ps1, setup.bat, setup.sh into launcher.ps1 (option 2)
- Merge install-ca-cert.bat and clean-ca-certs.bat into launcher.ps1 (options 4-5)
- Remove broken local VM direct DB connection path (DB is inside Kubernetes)
- Fix factory.py overriding database.host with server.local_ip
- Add password masking (Read-Host -AsSecureString) in setup flow
- Fix SSH key detection to prioritize battlegroup key path
- Fix SSH test output redirect (*> -> 2>)
- Delete redundant scripts and debug helpers
- Update .gitignore with new patterns
2026-05-15 17:58:03 +01:00
Reditus 1959a013ab Major refactor: unified launcher, paramiko SSH, DirectorService, diagnostics, and map warning banner
- Merge setup and start scripts into unified launcher (launcher.ps1 / start.sh)
  with menu: Start Dashboard, Run Setup, Run Diagnostics, Quit
- Migrate SSHService from subprocess to paramiko for connection reuse
- Extract Director API into dedicated DirectorService class
- Centralize SSH key resolution in app/utils/ssh_key.py
- Add pagination to player list (50 per page)
- Add comprehensive diagnostics with port-forward troubleshooting guide
- Add 17 new tests (43 total, all passing)
- Fix Director page loading (point to local port-forward instead of remote IP)
- Add experimental warning banner to map page with Dune-themed joke
- Remove dead Flask-Talisman dependency, upgrade cryptography to >=42.0.0
- Fix PowerShell launcher parsing errors (Unicode chars, variable delimiters)
- Update start.bat/setup.bat to point to unified launcher
2026-05-15 14:57:36 +01:00
Reditus 9ddaa5f667 merge remote changes 2026-05-15 13:59:59 +01:00
Reditus 6161f36ea4 merge remote changes 2026-05-15 11:15:00 +01:00
Reditus 3d1fc8a638 Merge local changes 2026-05-15 09:12:35 +01:00
Reditus 9bc68c6d4f Security fixes: add authentication to unprotected endpoints, replace deprecated Flask-Talisman, fix session cookie, add WebSocket auth check, improve error handling 2026-05-14 23:04:18 +01:00
Reditus 9f56c3943e Security: Add @login_required to all API endpoints and CSRF protection
- Added @login_required decorator to all 38 unprotected API endpoints
- Initialized Flask-WTF CSRFProtect in app factory
- Added CSRF token meta tag to base.html
- Added JavaScript fetch interceptor to attach X-CSRFToken header to all non-GET requests
- Closes critical security vulnerability where any unauthenticated user could perform administrative actions
2026-05-14 09:03:14 +01:00
Reditus 99864b4d8f feat: implement player editing, security hardening, and director proxy
- Add 7 player-edit endpoints: faction, XP, tech knowledge, currency, item edit/delete/add
- Password hashing with Argon2 (setup.ps1, setup.sh, auth.py, config.py)
- Rate limiting on all sensitive endpoints (Flask-Limiter)
- IP validation for ban/unban/kick operations
- Audit logging for admin actions
- File browser path traversal protection
- Login_required on all debug endpoints
- Director API proxy via NodePort with _director_request helper
- SSH tunnel includes director port forward in start.ps1
- Currency editing now sets exact balance instead of delta
- Fix undefined values in success alert messages
2026-05-13 20:07:37 +01:00
Reditus 846b27e834 feat: Let's Encrypt integration, dual IP prompts, firewall checks, and CA utilities
- Add Let's Encrypt support in setup scripts with certbot auto-install (winget/pip/python -m fallbacks)
- Separate VM External IP and Host External IP prompts during setup
- Firewall rule creation only prompts when DuneDashboard rule doesn't exist
- HTTP redirect server tries 0.0.0.0:80 first, falls back to 127.0.0.1:80
- Cert monitor detects LE certs and runs certbot renew instead of local CA regeneration
- Add ssl_domain and ssl_email settings
- Add install-ca-cert.bat and clean-ca-certs.bat utilities for Windows CA management
- Update README with setup flow details, LE docs, and firewall notes
2026-05-12 09:07:51 +01:00
Reditus 8828de0e3c Restore missing updater service initialization in factory.py 2026-05-12 04:02:57 +01:00
Reditus 59cc98133c Initial release - Dune Awakening Dashboard beta 2026-05-12 01:02:58 +01:00