mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-05-14 19:35:04 +00:00
- 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.
22 lines
992 B
SQL
22 lines
992 B
SQL
CREATE TABLE IF NOT EXISTS dashboard_audit_log (
|
|
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
|
timestamp BIGINT NOT NULL,
|
|
ip_address VARCHAR(45) NOT NULL,
|
|
endpoint VARCHAR(255) NOT NULL,
|
|
method VARCHAR(10) NOT NULL,
|
|
user_agent TEXT,
|
|
response_code INT NOT NULL,
|
|
INDEX idx_dashboard_audit_log_timestamp (timestamp),
|
|
INDEX idx_dashboard_audit_log_ip (ip_address)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
|
|
CREATE TABLE IF NOT EXISTS dashboard_config (
|
|
config_key VARCHAR(100) PRIMARY KEY,
|
|
config_value TEXT NOT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
|
|
INSERT IGNORE INTO dashboard_config (config_key, config_value) VALUES ('rate_limit_enabled', '1');
|
|
INSERT IGNORE INTO dashboard_config (config_key, config_value) VALUES ('rate_limit_requests', '100');
|
|
INSERT IGNORE INTO dashboard_config (config_key, config_value) VALUES ('rate_limit_window', '60');
|
|
INSERT IGNORE INTO dashboard_config (config_key, config_value) VALUES ('audit_retention_days', '90');
|