Refactor Caddy configuration management to include security settings

- Updated `GenerateConfig` function calls in tests to include additional security parameters.
- Enhanced `Manager` struct to hold a `SecurityConfig` instance for managing security-related settings.
- Implemented `computeEffectiveFlags` method to determine the effective state of security features based on both static configuration and runtime database settings.
- Added comprehensive tests for the new security configuration handling, ensuring correct behavior for various scenarios including ACL and CrowdSec settings.
- Adjusted existing tests to accommodate the new structure and ensure compatibility with the updated configuration management.
This commit is contained in:
GitHub Actions
2025-12-01 16:18:50 +00:00
parent fd4555674d
commit c83928f628
24 changed files with 743 additions and 174 deletions
@@ -18,7 +18,7 @@ import (
func setupRemoteServerTest_New(t *testing.T) (*gin.Engine, *handlers.RemoteServerHandler) {
t.Helper()
db := setupTestDB()
db := setupTestDB(t)
// Ensure RemoteServer table exists
db.AutoMigrate(&models.RemoteServer{})