mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
feat(logging): strengthen secret redaction and add admin controls (#12151)
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('application_settings', function (Blueprint $table) {
|
||||
$table->boolean('redact_all_env_values_in_logs')->default(true);
|
||||
});
|
||||
Schema::table('services', function (Blueprint $table) {
|
||||
$table->boolean('redact_all_env_values_in_logs')->default(true);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('application_settings', function (Blueprint $table) {
|
||||
$table->dropColumn('redact_all_env_values_in_logs');
|
||||
});
|
||||
Schema::table('services', function (Blueprint $table) {
|
||||
$table->dropColumn('redact_all_env_values_in_logs');
|
||||
});
|
||||
}
|
||||
};
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if (Schema::hasIndex('application_settings', ['application_id'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('application_settings', function (Blueprint $table) {
|
||||
$table->index('application_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if (! Schema::hasIndex('application_settings', ['application_id'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
Schema::table('application_settings', function (Blueprint $table) {
|
||||
$table->dropIndex(['application_id']);
|
||||
});
|
||||
}
|
||||
};
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
private array $tables = [
|
||||
'standalone_postgresqls',
|
||||
'standalone_redis',
|
||||
'standalone_mongodbs',
|
||||
'standalone_mysqls',
|
||||
'standalone_mariadbs',
|
||||
'standalone_keydbs',
|
||||
'standalone_dragonflies',
|
||||
'standalone_clickhouses',
|
||||
'standalone_sqlites',
|
||||
];
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
foreach ($this->tables as $table) {
|
||||
if (Schema::hasColumn($table, 'redact_all_env_values_in_logs')) {
|
||||
continue;
|
||||
}
|
||||
Schema::table($table, function (Blueprint $table) {
|
||||
$table->boolean('redact_all_env_values_in_logs')->default(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
foreach ($this->tables as $table) {
|
||||
if (! Schema::hasColumn($table, 'redact_all_env_values_in_logs')) {
|
||||
continue;
|
||||
}
|
||||
Schema::table($table, function (Blueprint $table) {
|
||||
$table->dropColumn('redact_all_env_values_in_logs');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user