mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-17 04:25:28 +00:00
feat(proxy): add database-backed config storage with disk backups
- Store proxy configuration in database as primary source for faster access - Implement automatic timestamped backups when configuration changes - Add backfill migration logic to recover configs from disk for legacy servers - Simplify UI by removing loading states (config now readily available) - Add comprehensive logging for debugging configuration generation and recovery - Include unit tests for config recovery scenarios
This commit is contained in:
@@ -4,6 +4,7 @@ use App\Actions\Proxy\SaveProxyConfiguration;
|
||||
use App\Enums\ProxyTypes;
|
||||
use App\Models\Application;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
|
||||
/**
|
||||
@@ -215,6 +216,13 @@ function extractCustomProxyCommands(Server $server, string $existing_config): ar
|
||||
}
|
||||
function generateDefaultProxyConfiguration(Server $server, array $custom_commands = [])
|
||||
{
|
||||
Log::info('Generating default proxy configuration', [
|
||||
'server_id' => $server->id,
|
||||
'server_name' => $server->name,
|
||||
'custom_commands_count' => count($custom_commands),
|
||||
'caller' => debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3)[1]['class'] ?? 'unknown',
|
||||
]);
|
||||
|
||||
$proxy_path = $server->proxyPath();
|
||||
$proxy_type = $server->proxyType();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user