Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

refactor(http-basic-auth): rename 'http_basic_auth_enable' to 'http_basic_auth_enabled' across application files for consistency

Andras Bacsai9e608f7ba5af
diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.php
index a5c8fae885..b7cb693b61 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 cc69155cb1..3306510d19 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 40d4acc0df..05fef91f5b 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 bc8f2712a3..247300abd7 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 2c2cbde634..b6047d4be2 100644
--- a/resources/views/livewire/project/application/general.blade.php
+++ b/resources/views/livewire/project/application/general.blade.php
@@ -350,14 +350,15 @@
</div>
<h3 class="pt-8">HTTP Basic Authentication</h3>
- <div x-data="{enabled: {{ $application->http_basic_auth_enable ? "true" : "false" }}}">
+ <div x-data="{ enabled: {{ $application->http_basic_auth_enabled ? 'true' : 'false' }} }">
<div class="w-96">
- <x-forms.checkbox label="Enable" id="application.http_basic_auth_enable" x-model="enabled" />
+ <x-forms.checkbox helper="This will add the proper proxy labels to the container."
+ label="Enable" id="application.http_basic_auth_enabled" x-model="enabled" />
</div>
- <div class="w-96" x-show="enabled">
+ <div class="flex gap-2 py-2" x-show="enabled">
<x-forms.input id="application.http_basic_auth_username" label="Username" />
- <x-forms.input id="application.http_basic_auth_password" label="Password" />
+ <x-forms.input id="application.http_basic_auth_password" type="password" label="Password" />
</div>
</div>