mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-05-14 11:25:04 +00:00
Add dashboard audit log and configuration management
- Implemented dashboard audit logging with InsertAuditLog, GetRecentAuditLogs, GetAuditLogsByIP, and CleanupOldAuditLogs methods. - Created dashboard configuration management with GetDashboardConfig and SetDashboardConfig methods. - Added new tables for dashboard_audit_log and dashboard_config in both MySQL and SQLite migrations. - Updated CMakeLists to include Crow and ASIO for dashboard server functionality. - Enhanced existing database classes to support new dashboard features, including character, play key, and property management. - Added new methods for retrieving and managing play keys, properties, and pet names. - Updated TestSQLDatabase to include stubs for new dashboard-related methods. - Modified shared and dashboard configuration files for new settings.
This commit is contained in:
19
migrations/dlu/sqlite/10_dashboard.sql
Normal file
19
migrations/dlu/sqlite/10_dashboard.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE IF NOT EXISTS dashboard_audit_log (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
timestamp INTEGER NOT NULL,
|
||||
ip_address TEXT NOT NULL,
|
||||
endpoint TEXT NOT NULL,
|
||||
method TEXT NOT NULL,
|
||||
user_agent TEXT,
|
||||
response_code INTEGER NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS dashboard_config (
|
||||
config_key TEXT PRIMARY KEY,
|
||||
config_value TEXT NOT NULL
|
||||
);
|
||||
|
||||
INSERT OR IGNORE INTO dashboard_config (config_key, config_value) VALUES ('rate_limit_enabled', '1');
|
||||
INSERT OR IGNORE INTO dashboard_config (config_key, config_value) VALUES ('rate_limit_requests', '100');
|
||||
INSERT OR IGNORE INTO dashboard_config (config_key, config_value) VALUES ('rate_limit_window', '60');
|
||||
INSERT OR IGNORE INTO dashboard_config (config_key, config_value) VALUES ('audit_retention_days', '90');
|
||||
Reference in New Issue
Block a user