diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php index a5c8fae88..b7cb693b6 100644 --- a/app/Livewire/Project/Application/General.php +++ b/app/Livewire/Project/Application/General.php @@ -94,7 +94,7 @@ class General extends Component 'application.settings.is_preserve_repository_enabled' => 'boolean|required', 'application.watch_paths' => 'nullable', 'application.redirect' => 'string|required', - 'application.http_basic_auth_enable' => 'boolean|required', + 'application.http_basic_auth_enabled' => 'boolean|required', 'application.http_basic_auth_username' => 'nullable', 'application.http_basic_auth_password' => 'nullable', ]; diff --git a/app/Models/Application.php b/app/Models/Application.php index cc69155cb..3306510d1 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -103,7 +103,7 @@ use Visus\Cuid2\Cuid2; 'deleted_at' => ['type' => 'string', 'format' => 'date-time', 'nullable' => true, 'description' => 'The date and time when the application was deleted.'], 'compose_parsing_version' => ['type' => 'string', 'description' => 'How Coolify parse the compose file.'], 'custom_nginx_configuration' => ['type' => 'string', 'nullable' => true, 'description' => 'Custom Nginx configuration base64 encoded.'], - 'http_basic_auth_enable' => ['type' => 'boolean', 'description' => 'HTTP Basic Authentication enabled.'], + 'http_basic_auth_enabled' => ['type' => 'boolean', 'description' => 'HTTP Basic Authentication enabled.'], 'http_basic_auth_username' => ['type' => 'string', 'nullable' => true, 'description' => 'Username for HTTP Basic Authentication'], 'http_basic_auth_password' => ['type' => 'string', 'nullable' => true, 'description' => 'Password for HTTP Basic Authentication'], ] diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.php index 40d4acc0d..05fef91f5 100644 --- a/bootstrap/helpers/docker.php +++ b/bootstrap/helpers/docker.php @@ -344,9 +344,6 @@ function fqdnLabelsForCaddy(string $network, string $uuid, Collection $domains, if ($redirect_direction === 'non-www' && str($host)->startsWith('www.')) { $labels->push("caddy_{$loop}.redir={$schema}://{$host_without_www}{uri}"); } - if (isDev()) { - // $labels->push("caddy_{$loop}.tls=internal"); - } if ($http_basic_auth_enabled) { $http_basic_auth_password = password_hash($http_basic_auth_password, PASSWORD_BCRYPT, ['cost' => 10]); $labels->push("caddy_{$loop}.basicauth.{$http_basic_auth_username}=\"{$http_basic_auth_password}\""); @@ -585,6 +582,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview if ($pull_request_id !== 0) { $appUuid = $appUuid.'-pr-'.$pull_request_id; } + ray($application); $labels = collect([]); if ($pull_request_id === 0) { if ($application->fqdn) { @@ -601,7 +599,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_gzip_enabled: $application->isGzipEnabled(), is_stripprefix_enabled: $application->isStripprefixEnabled(), redirect_direction: $application->redirect, - http_basic_auth_enabled: $application->http_basic_auth_enable, + http_basic_auth_enabled: $application->http_basic_auth_enabled, http_basic_auth_username: $application->http_basic_auth_username, http_basic_auth_password: $application->http_basic_auth_password, )); @@ -631,7 +629,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_gzip_enabled: $application->isGzipEnabled(), is_stripprefix_enabled: $application->isStripprefixEnabled(), redirect_direction: $application->redirect, - http_basic_auth_enabled: $application->http_basic_auth_enable, + http_basic_auth_enabled: $application->http_basic_auth_enabled, http_basic_auth_username: $application->http_basic_auth_username, http_basic_auth_password: $application->http_basic_auth_password, )); @@ -644,7 +642,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_gzip_enabled: $application->isGzipEnabled(), is_stripprefix_enabled: $application->isStripprefixEnabled(), redirect_direction: $application->redirect, - http_basic_auth_enabled: $application->http_basic_auth_enable, + http_basic_auth_enabled: $application->http_basic_auth_enabled, http_basic_auth_username: $application->http_basic_auth_username, http_basic_auth_password: $application->http_basic_auth_password, )); @@ -667,7 +665,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_force_https_enabled: $application->isForceHttpsEnabled(), is_gzip_enabled: $application->isGzipEnabled(), is_stripprefix_enabled: $application->isStripprefixEnabled(), - http_basic_auth_enabled: $application->http_basic_auth_enable, + http_basic_auth_enabled: $application->http_basic_auth_enabled, http_basic_auth_username: $application->http_basic_auth_username, http_basic_auth_password: $application->http_basic_auth_password, )); @@ -681,7 +679,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_force_https_enabled: $application->isForceHttpsEnabled(), is_gzip_enabled: $application->isGzipEnabled(), is_stripprefix_enabled: $application->isStripprefixEnabled(), - http_basic_auth_enabled: $application->http_basic_auth_enable, + http_basic_auth_enabled: $application->http_basic_auth_enabled, http_basic_auth_username: $application->http_basic_auth_username, http_basic_auth_password: $application->http_basic_auth_password, )); @@ -695,7 +693,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_force_https_enabled: $application->isForceHttpsEnabled(), is_gzip_enabled: $application->isGzipEnabled(), is_stripprefix_enabled: $application->isStripprefixEnabled(), - http_basic_auth_enabled: $application->http_basic_auth_enable, + http_basic_auth_enabled: $application->http_basic_auth_enabled, http_basic_auth_username: $application->http_basic_auth_username, http_basic_auth_password: $application->http_basic_auth_password, )); @@ -707,7 +705,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview is_force_https_enabled: $application->isForceHttpsEnabled(), is_gzip_enabled: $application->isGzipEnabled(), is_stripprefix_enabled: $application->isStripprefixEnabled(), - http_basic_auth_enabled: $application->http_basic_auth_enable, + http_basic_auth_enabled: $application->http_basic_auth_enabled, http_basic_auth_username: $application->http_basic_auth_username, http_basic_auth_password: $application->http_basic_auth_password, )); diff --git a/database/migrations/2025_04_17_110026_add_application_http_basic_auth_fields.php b/database/migrations/2025_04_17_110026_add_application_http_basic_auth_fields.php index bc8f2712a..247300abd 100644 --- a/database/migrations/2025_04_17_110026_add_application_http_basic_auth_fields.php +++ b/database/migrations/2025_04_17_110026_add_application_http_basic_auth_fields.php @@ -12,7 +12,7 @@ return new class extends Migration public function up(): void { Schema::table('applications', function (Blueprint $table) { - $table->boolean('http_basic_auth_enable')->default(false); + $table->boolean('http_basic_auth_enabled')->default(false); $table->string('http_basic_auth_username')->nullable(true)->default(null); $table->string('http_basic_auth_password')->nullable(true)->default(null); }); @@ -24,7 +24,7 @@ return new class extends Migration public function down(): void { Schema::table('applications', function (Blueprint $table) { - $table->dropColumn('http_basic_auth_enable'); + $table->dropColumn('http_basic_auth_enabled'); $table->dropColumn('http_basic_auth_username'); $table->dropColumn('http_basic_auth_password'); }); diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php index 2c2cbde63..b6047d4be 100644 --- a/resources/views/livewire/project/application/general.blade.php +++ b/resources/views/livewire/project/application/general.blade.php @@ -350,14 +350,15 @@

HTTP Basic Authentication

-
+
- +
-
+
- +