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.

feat: enable/disable log drain by service

Andras Bacsai3b20eee90955
diff --git a/app/Actions/Database/StartMariadb.php b/app/Actions/Database/StartMariadb.php
index 3e32c24816..c6b243381e 100644
--- a/app/Actions/Database/StartMariadb.php
+++ b/app/Actions/Database/StartMariadb.php
@@ -69,7 +69,7 @@ class StartMariadb
]
]
];
- if ($this->database->destination->server->isDrainLogActivated()) {
+ if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [
diff --git a/app/Actions/Database/StartMongodb.php b/app/Actions/Database/StartMongodb.php
index 4ebbb9ec42..9eb884dbe5 100644
--- a/app/Actions/Database/StartMongodb.php
+++ b/app/Actions/Database/StartMongodb.php
@@ -76,7 +76,7 @@ class StartMongodb
]
]
];
- if ($this->database->destination->server->isDrainLogActivated()) {
+ if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [
diff --git a/app/Actions/Database/StartMysql.php b/app/Actions/Database/StartMysql.php
index c3f04dc9f6..761832525b 100644
--- a/app/Actions/Database/StartMysql.php
+++ b/app/Actions/Database/StartMysql.php
@@ -69,7 +69,7 @@ class StartMysql
]
]
];
- if ($this->database->destination->server->isDrainLogActivated()) {
+ if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [
diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.php
index 1acdcf9572..b88da5e4fa 100644
--- a/app/Actions/Database/StartPostgresql.php
+++ b/app/Actions/Database/StartPostgresql.php
@@ -79,7 +79,8 @@ class StartPostgresql
]
]
];
- if ($this->database->destination->server->isDrainLogActivated()) {
+ if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
+ ray('Log Drain Enabled');
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [
diff --git a/app/Actions/Database/StartRedis.php b/app/Actions/Database/StartRedis.php
index 0cbd01f63f..fab055f20e 100644
--- a/app/Actions/Database/StartRedis.php
+++ b/app/Actions/Database/StartRedis.php
@@ -78,7 +78,7 @@ class StartRedis
]
]
];
- if ($this->database->destination->server->isDrainLogActivated()) {
+ if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) {
$docker_compose['services'][$container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [
@@ -166,6 +166,5 @@ class StartRedis
$content = $this->database->redis_conf;
$content_base64 = base64_encode($content);
$this->commands[] = "echo '{$content_base64}' | base64 -d > $this->configuration_dir/{$filename}";
-
}
}
diff --git a/app/Actions/Server/InstallLogDrain.php b/app/Actions/Server/InstallLogDrain.php
index 5ea1d5e439..4db355aa86 100644
--- a/app/Actions/Server/InstallLogDrain.php
+++ b/app/Actions/Server/InstallLogDrain.php
@@ -127,6 +127,7 @@ services:
- ./parsers.conf:/parsers.conf
ports:
- 127.0.0.1:24224:24224
+ restart: unless-stopped
");
$readme = base64_encode('# New Relic Log Drain
This log drain is based on [Fluent Bit](https://fluentbit.io/) and New Relic Log Forwarder.
diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php
index bc853108fb..63dbeba23d 100644
--- a/app/Http/Livewire/Project/Application/General.php
+++ b/app/Http/Livewire/Project/Application/General.php
@@ -32,7 +32,7 @@ class General extends Component
public bool $is_preview_deployments_enabled;
public bool $is_auto_deploy_enabled;
public bool $is_force_https_enabled;
-
+ public bool $is_log_drain_enabled;
protected $rules = [
'application.name' => 'required',
@@ -101,6 +101,7 @@ class General extends Component
$this->is_preview_deployments_enabled = $this->application->settings->is_preview_deployments_enabled;
$this->is_auto_deploy_enabled = $this->application->settings->is_auto_deploy_enabled;
$this->is_force_https_enabled = $this->application->settings->is_force_https_enabled;
+ $this->is_log_drain_enabled = $this->application->settings->is_log_drain_enabled;
}
$this->checkLabelUpdates();
}
@@ -136,6 +137,14 @@ class General extends Component
$this->application->settings->is_preview_deployments_enabled = $this->is_preview_deployments_enabled;
$this->application->settings->is_auto_deploy_enabled = $this->is_auto_deploy_enabled;
$this->application->settings->is_force_https_enabled = $this->is_force_https_enabled;
+ $this->application->settings->is_log_drain_enabled = $this->is_log_drain_enabled;
+ if ($this->is_log_drain_enabled) {
+ if (!$this->application->destination->server->isLogDrainEnabled()) {
+ $this->application->settings->is_log_drain_enabled = $this->is_log_drain_enabled = false;
+ $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.');
+ return;
+ }
+ }
$this->application->settings->save();
$this->application->save();
$this->application->refresh();
diff --git a/app/Http/Livewire/Project/Database/Mariadb/General.php b/app/Http/Livewire/Project/Database/Mariadb/General.php
index 173e9290fe..455f1b4ca4 100644
--- a/app/Http/Livewire/Project/Database/Mariadb/General.php
+++ b/app/Http/Livewire/Project/Database/Mariadb/General.php
@@ -28,6 +28,7 @@ class General extends Component
'database.ports_mappings' => 'nullable',
'database.is_public' => 'nullable|boolean',
'database.public_port' => 'nullable|integer',
+ 'database.is_log_drain_enabled' => 'nullable|boolean',
];
protected $validationAttributes = [
'database.name' => 'Name',
@@ -50,6 +51,20 @@ class General extends Component
$this->db_url_public = $this->database->getDbUrl();
}
}
+ public function instantSaveAdvanced() {
+ try {
+ if (!$this->database->destination->server->isLogDrainEnabled()) {
+ $this->database->is_log_drain_enabled = false;
+ $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.');
+ return;
+ }
+ $this->database->save();
+ $this->emit('success', 'Database updated successfully.');
+ $this->emit('success', 'You need to restart the service for the changes to take effect.');
+ } catch (Exception $e) {
+ return handleError($e, $this);
+ }
+ }
public function submit()
{
try {
diff --git a/app/Http/Livewire/Project/Database/Mongodb/General.php b/app/Http/Livewire/Project/Database/Mongodb/General.php
index 189f2632ea..84669a019c 100644
--- a/app/Http/Livewire/Project/Database/Mongodb/General.php
+++ b/app/Http/Livewire/Project/Database/Mongodb/General.php
@@ -27,6 +27,7 @@ class General extends Component
'database.ports_mappings' => 'nullable',
'database.is_public' => 'nullable|boolean',
'database.public_port' => 'nullable|integer',
+ 'database.is_log_drain_enabled' => 'nullable|boolean',
];
protected $validationAttributes = [
'database.name' => 'Name',
@@ -48,7 +49,21 @@ class General extends Component
$this->db_url_public = $this->database->getDbUrl();
}
}
-
+ public function instantSaveAdvanced()
+ {
+ try {
+ if (!$this->database->destination->server->isLogDrainEnabled()) {
+ $this->database->is_log_drain_enabled = false;
+ $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.');
+ return;
+ }
+ $this->database->save();
+ $this->emit('success', 'Database updated successfully.');
+ $this->emit('success', 'You need to restart the service for the changes to take effect.');
+ } catch (Exception $e) {
+ return handleError($e, $this);
+ }
+ }
public function submit()
{
try {
diff --git a/app/Http/Livewire/Project/Database/Mysql/General.php b/app/Http/Livewire/Project/Database/Mysql/General.php
index cb1a063dbc..c63cea2932 100644
--- a/app/Http/Livewire/Project/Database/Mysql/General.php
+++ b/app/Http/Livewire/Project/Database/Mysql/General.php
@@ -28,6 +28,7 @@ class General extends Component
'database.ports_mappings' => 'nullable',
'database.is_public' => 'nullable|boolean',
'database.public_port' => 'nullable|integer',
+ 'database.is_log_drain_enabled' => 'nullable|boolean',
];
protected $validationAttributes = [
'database.name' => 'Name',
@@ -50,6 +51,21 @@ class General extends Component
$this->db_url_public = $this->database->getDbUrl();
}
}
+ public function instantSaveAdvanced()
+ {
+ try {
+ if (!$this->database->destination->server->isLogDrainEnabled()) {
+ $this->database->is_log_drain_enabled = false;
+ $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.');
+ return;
+ }
+ $this->database->save();
+ $this->emit('success', 'Database updated successfully.');
+ $this->emit('success', 'You need to restart the service for the changes to take effect.');
+ } catch (Exception $e) {
+ return handleError($e, $this);
+ }
+ }
public function submit()
{
try {
diff --git a/app/Http/Livewire/Project/Database/Postgresql/General.php b/app/Http/Livewire/Project/Database/Postgresql/General.php
index ebc69a1bcf..1804953eeb 100644
--- a/app/Http/Livewire/Project/Database/Postgresql/General.php
+++ b/app/Http/Livewire/Project/Database/Postgresql/General.php
@@ -34,6 +34,7 @@ class General extends Component
'database.ports_mappings' => 'nullable',
'database.is_public' => 'nullable|boolean',
'database.public_port' => 'nullable|integer',
+ 'database.is_log_drain_enabled' => 'nullable|boolean',
];
protected $validationAttributes = [
'database.name' => 'Name',
@@ -57,6 +58,20 @@ class General extends Component
$this->db_url_public = $this->database->getDbUrl();
}
}
+ public function instantSaveAdvanced() {
+ try {
+ if (!$this->database->destination->server->isLogDrainEnabled()) {
+ $this->database->is_log_drain_enabled = false;
+ $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.');
+ return;
+ }
+ $this->database->save();
+ $this->emit('success', 'Database updated successfully.');
+ $this->emit('success', 'You need to restart the service for the changes to take effect.');
+ } catch (Exception $e) {
+ return handleError($e, $this);
+ }
+ }
public function instantSave()
{
try {
diff --git a/app/Http/Livewire/Project/Database/Redis/General.php b/app/Http/Livewire/Project/Database/Redis/General.php
index 834a9f3812..c2a28eef85 100644
--- a/app/Http/Livewire/Project/Database/Redis/General.php
+++ b/app/Http/Livewire/Project/Database/Redis/General.php
@@ -25,6 +25,7 @@ class General extends Component
'database.ports_mappings' => 'nullable',
'database.is_public' => 'nullable|boolean',
'database.public_port' => 'nullable|integer',
+ 'database.is_log_drain_enabled' => 'nullable|boolean',
];
protected $validationAttributes = [
'database.name' => 'Name',
@@ -43,6 +44,20 @@ class General extends Component
$this->db_url_public = $this->database->getDbUrl();
}
}
+ public function instantSaveAdvanced() {
+ try {
+ if (!$this->database->destination->server->isLogDrainEnabled()) {
+ $this->database->is_log_drain_enabled = false;
+ $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.');
+ return;
+ }
+ $this->database->save();
+ $this->emit('success', 'Database updated successfully.');
+ $this->emit('success', 'You need to restart the service for the changes to take effect.');
+ } catch (Exception $e) {
+ return handleError($e, $this);
+ }
+ }
public function submit()
{
try {
diff --git a/app/Http/Livewire/Project/Service/Application.php b/app/Http/Livewire/Project/Service/Application.php
index 701a90c19b..8a785b9c65 100644
--- a/app/Http/Livewire/Project/Service/Application.php
+++ b/app/Http/Livewire/Project/Service/Application.php
@@ -16,6 +16,7 @@ class Application extends Component
'application.image' => 'required',
'application.exclude_from_status' => 'required|boolean',
'application.required_fqdn' => 'required|boolean',
+ 'application.is_log_drain_enabled' => 'nullable|boolean',
];
public function render()
{
@@ -25,7 +26,11 @@ class Application extends Component
{
$this->submit();
}
-
+ public function instantSaveAdvanced()
+ {
+ $this->submit();
+ $this->emit('success', 'You need to restart the service for the changes to take effect.');
+ }
public function delete()
{
try {
@@ -44,6 +49,11 @@ class Application extends Component
{
try {
$this->validate();
+ if (!$this->application->service->destination->server->isLogDrainEnabled()) {
+ $this->application->is_log_drain_enabled = false;
+ $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.');
+ return;
+ }
$this->application->save();
updateCompose($this->application);
$this->emit('success', 'Application saved successfully.');
diff --git a/app/Http/Livewire/Project/Service/Database.php b/app/Http/Livewire/Project/Service/Database.php
index dee2785ba9..6bf6098ad0 100644
--- a/app/Http/Livewire/Project/Service/Database.php
+++ b/app/Http/Livewire/Project/Service/Database.php
@@ -21,18 +21,31 @@ class Database extends Component
'database.exclude_from_status' => 'required|boolean',
'database.public_port' => 'nullable|integer',
'database.is_public' => 'required|boolean',
+ 'database.is_log_drain_enabled' => 'required|boolean',
];
public function render()
{
return view('livewire.project.service.database');
}
- public function mount() {
+ public function mount()
+ {
if ($this->database->is_public) {
$this->db_url_public = $this->database->getServiceDatabaseUrl();
}
$this->refreshFileStorages();
}
- public function instantSave() {
+ public function instantSaveAdvanced()
+ {
+ if (!$this->database->service->destination->server->isLogDrainEnabled()) {
+ $this->database->is_log_drain_enabled = false;
+ $this->emit('error', 'Log drain is not enabled on the server. Please enable it first.');
+ return;
+ }
+ $this->submit();
+ $this->emit('success', 'You need to restart the service for the changes to take effect.');
+ }
+ public function instantSave()
+ {
if ($this->database->is_public && !$this->database->public_port) {
$this->emit('error', 'Public port is required.');
$this->database->is_public = false;
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index 4e4f663015..dacdbf89b0 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -864,7 +864,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
]
]
];
- if ($this->server->isDrainLogActivated()) {
+ if ($this->server->isLogDrainEnabled() && $this->application->isLogDrainEnabled()) {
$docker_compose['services'][$this->container_name]['logging'] = [
'driver' => 'fluentd',
'options' => [
diff --git a/app/Models/Application.php b/app/Models/Application.php
index 27f34df341..cb3d85f94d 100644
--- a/app/Models/Application.php
+++ b/app/Models/Application.php
@@ -300,6 +300,9 @@ class Application extends BaseModel
}
return false;
}
+ public function isLogDrainEnabled() {
+ return data_get($this, 'settings.is_log_drain_enabled', false);
+ }
public function isConfigurationChanged($save = false)
{
$newConfigHash = $this->fqdn . $this->git_repository . $this->git_branch . $this->git_commit_sha . $this->build_pack . $this->static_image . $this->install_command . $this->build_command . $this->start_command . $this->port_exposes . $this->port_mappings . $this->base_directory . $this->publish_directory . $this->health_check_path . $this->health_check_port . $this->health_check_host . $this->health_check_method . $this->health_check_return_code . $this->health_check_scheme . $this->health_check_response_text . $this->health_check_interval . $this->health_check_timeout . $this->health_check_retries . $this->health_check_start_period . $this->health_check_enabled . $this->limits_memory . $this->limits_swap . $this->limits_swappiness . $this->limits_reservation . $this->limits_cpus . $this->limits_cpuset . $this->limits_cpu_shares . $this->dockerfile . $this->dockerfile_location . $this->custom_labels;
diff --git a/app/Models/Server.php b/app/Models/Server.php
index f00f772a89..9d91ea1239 100644
--- a/app/Models/Server.php
+++ b/app/Models/Server.php
@@ -304,7 +304,7 @@ class Server extends BaseModel
{
return $this->settings->is_reachable && $this->settings->is_usable;
}
- public function isDrainLogActivated()
+ public function isLogDrainEnabled()
{
return $this->settings->is_logdrain_newrelic_enabled || $this->settings->is_logdrain_highlight_enabled || $this->settings->is_logdrain_axiom_enabled;
}
diff --git a/app/Models/Service.php b/app/Models/Service.php
index 76c88eb856..cf78e8260c 100644
--- a/app/Models/Service.php
+++ b/app/Models/Service.php
@@ -797,7 +797,7 @@ class Service extends BaseModel
$serviceLabels = $serviceLabels->merge(fqdnLabelsForTraefik($this->uuid, $fqdns, true));
}
}
- if ($this->server->isDrainLogActivated()) {
+ if ($this->server->isLogDrainEnabled() && $savedService->isLogDrainEnabled()) {
data_set($service, 'logging', [
'driver' => 'fluentd',
'options' => [
diff --git a/app/Models/ServiceApplication.php b/app/Models/ServiceApplication.php
index b1db1c581b..b8e3f1a41b 100644
--- a/app/Models/ServiceApplication.php
+++ b/app/Models/ServiceApplication.php
@@ -18,6 +18,10 @@ class ServiceApplication extends BaseModel
$service->fileStorages()->delete();
});
}
+ public function isLogDrainEnabled()
+ {
+ return data_get($this, 'is_log_drain_enabled', false);
+ }
public function type()
{
return 'service';
diff --git a/app/Models/ServiceDatabase.php b/app/Models/ServiceDatabase.php
index 2feaeb9472..79c1dd176f 100644
--- a/app/Models/ServiceDatabase.php
+++ b/app/Models/ServiceDatabase.php
@@ -16,6 +16,10 @@ class ServiceDatabase extends BaseModel
$service->fileStorages()->delete();
});
}
+ public function isLogDrainEnabled()
+ {
+ return data_get($this, 'is_log_drain_enabled', false);
+ }
public function type()
{
return 'service';
diff --git a/app/Models/StandaloneMariadb.php b/app/Models/StandaloneMariadb.php
index f9f3ad1aee..cb9fa9aa28 100644
--- a/app/Models/StandaloneMariadb.php
+++ b/app/Models/StandaloneMariadb.php
@@ -41,6 +41,10 @@ class StandaloneMariadb extends BaseModel
$database->environment_variables()->delete();
});
}
+ public function isLogDrainEnabled()
+ {
+ return data_get($this, 'is_log_drain_enabled', false);
+ }
public function type(): string
{
return 'standalone-mariadb';
diff --git a/app/Models/StandaloneMongodb.php b/app/Models/StandaloneMongodb.php
index 628cb6942e..3a5b7a52a8 100644
--- a/app/Models/StandaloneMongodb.php
+++ b/app/Models/StandaloneMongodb.php
@@ -44,7 +44,10 @@ class StandaloneMongodb extends BaseModel
$database->environment_variables()->delete();
});
}
-
+ public function isLogDrainEnabled()
+ {
+ return data_get($this, 'is_log_drain_enabled', false);
+ }
public function mongoInitdbRootPassword(): Attribute
{
return Attribute::make(
diff --git a/app/Models/StandaloneMysql.php b/app/Models/StandaloneMysql.php
index d7314f59b4..6de57cb738 100644
--- a/app/Models/StandaloneMysql.php
+++ b/app/Models/StandaloneMysql.php
@@ -46,6 +46,11 @@ class StandaloneMysql extends BaseModel
return 'standalone-mysql';
}
+ public function isLogDrainEnabled()
+ {
+ return data_get($this, 'is_log_drain_enabled', false);
+ }
+
public function portsMappings(): Attribute
{
return Attribute::make(
diff --git a/app/Models/StandalonePostgresql.php b/app/Models/StandalonePostgresql.php
index ca19e7a879..1bef3b6c99 100644
--- a/app/Models/StandalonePostgresql.php
+++ b/app/Models/StandalonePostgresql.php
@@ -42,6 +42,11 @@ class StandalonePostgresql extends BaseModel
});
}
+ public function isLogDrainEnabled()
+ {
+ return data_get($this, 'is_log_drain_enabled', false);
+ }
+
public function portsMappings(): Attribute
{
return Attribute::make(
diff --git a/app/Models/StandaloneRedis.php b/app/Models/StandaloneRedis.php
index a0de53a3ec..fe1281c22b 100644
--- a/app/Models/StandaloneRedis.php
+++ b/app/Models/StandaloneRedis.php
@@ -37,6 +37,11 @@ class StandaloneRedis extends BaseModel
});
}
+ public function isLogDrainEnabled()
+ {
+ return data_get($this, 'is_log_drain_enabled', false);
+ }
+
public function portsMappings(): Attribute
{
return Attribute::make(
diff --git a/config/sentry.php b/config/sentry.php
index d1111bbd42..0c8ab1b305 100644
--- a/config/sentry.php
+++ b/config/sentry.php
@@ -7,7 +7,7 @@ return [
// The release version of your application
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
- 'release' => '4.0.0-beta.143',
+ 'release' => '4.0.0-beta.144',
// When left empty or `null` the Laravel environment will be used
'environment' => config('app.env'),
diff --git a/config/version.php b/config/version.php
index 318484b792..a4a00caab0 100644
--- a/config/version.php
+++ b/config/version.php
@@ -1,3 +1,3 @@
<?php
-return '4.0.0-beta.143';
+return '4.0.0-beta.144';
diff --git a/database/migrations/2023_11_17_160437_add_drain_log_enable_by_service.php b/database/migrations/2023_11_17_160437_add_drain_log_enable_by_service.php
new file mode 100644
index 0000000000..f68a268b19
--- /dev/null
+++ b/database/migrations/2023_11_17_160437_add_drain_log_enable_by_service.php
@@ -0,0 +1,72 @@
+<?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('is_log_drain_enabled')->default(false);
+ });
+ Schema::table('standalone_redis', function (Blueprint $table) {
+ $table->boolean('is_log_drain_enabled')->default(false);
+ });
+ Schema::table('standalone_mysqls', function (Blueprint $table) {
+ $table->boolean('is_log_drain_enabled')->default(false);
+ });
+ Schema::table('standalone_mariadbs', function (Blueprint $table) {
+ $table->boolean('is_log_drain_enabled')->default(false);
+ });
+ Schema::table('standalone_postgresqls', function (Blueprint $table) {
+ $table->boolean('is_log_drain_enabled')->default(false);
+ });
+ Schema::table('standalone_mongodbs', function (Blueprint $table) {
+ $table->boolean('is_log_drain_enabled')->default(false);
+ });
+ Schema::table('service_applications', function (Blueprint $table) {
+ $table->boolean('is_log_drain_enabled')->default(false);
+ });
+ Schema::table('service_databases', function (Blueprint $table) {
+ $table->boolean('is_log_drain_enabled')->default(false);
+ });
+
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::table('application_settings', function (Blueprint $table) {
+ $table->dropColumn('is_log_drain_enabled');
+ });
+ Schema::table('standalone_redis', function (Blueprint $table) {
+ $table->dropColumn('is_log_drain_enabled');
+ });
+ Schema::table('standalone_mysqls', function (Blueprint $table) {
+ $table->dropColumn('is_log_drain_enabled');
+ });
+ Schema::table('standalone_mariadbs', function (Blueprint $table) {
+ $table->dropColumn('is_log_drain_enabled');
+ });
+ Schema::table('standalone_postgresqls', function (Blueprint $table) {
+ $table->dropColumn('is_log_drain_enabled');
+ });
+ Schema::table('standalone_mongodbs', function (Blueprint $table) {
+ $table->dropColumn('is_log_drain_enabled');
+ });
+ Schema::table('service_applications', function (Blueprint $table) {
+ $table->dropColumn('is_log_drain_enabled');
+ });
+ Schema::table('service_databases', function (Blueprint $table) {
+ $table->dropColumn('is_log_drain_enabled');
+ });
+
+ }
+};
diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php
index 2753b4bf75..7d7b9c9990 100644
--- a/resources/views/livewire/project/application/general.blade.php
+++ b/resources/views/livewire/project/application/general.blade.php
@@ -114,6 +114,8 @@
</div>
<h3>Advanced</h3>
<div class="flex flex-col">
+ <x-forms.checkbox helper="Drain logs to your configured log drain endpoint in your Server settings." instantSave
+ id="is_log_drain_enabled" label="Drain Logs" />
<x-forms.checkbox
helper="Your application will be available only on https if your domain starts with https://..."
instantSave id="is_force_https_enabled" label="Force Https" />
diff --git a/resources/views/livewire/project/database/mariadb/general.blade.php b/resources/views/livewire/project/database/mariadb/general.blade.php
index 520e29eaaa..361f476df6 100644
--- a/resources/views/livewire/project/database/mariadb/general.blade.php
+++ b/resources/views/livewire/project/database/mariadb/general.blade.php
@@ -59,5 +59,10 @@
@endif
</div>
<x-forms.textarea label="Custom MariaDB Configuration" rows="10" id="database.mariadb_conf" />
+ <h3 class="pt-4">Advanced</h3>
+ <div class="flex flex-col">
+ <x-forms.checkbox helper="Drain logs to your configured log drain endpoint in your Server settings."
+ instantSave="instantSaveAdvanced" id="database.is_log_drain_enabled" label="Drain Logs" />
+ </div>
</form>
</div>
diff --git a/resources/views/livewire/project/database/mongodb/general.blade.php b/resources/views/livewire/project/database/mongodb/general.blade.php
index 8aab8dd421..f55140bf27 100644
--- a/resources/views/livewire/project/database/mongodb/general.blade.php
+++ b/resources/views/livewire/project/database/mongodb/general.blade.php
@@ -16,8 +16,8 @@
<div class="flex gap-2">
<x-forms.input label="Initial Username" id="database.mongo_initdb_root_username"
placeholder="If empty: postgres" readonly helper="You can only change this in the database." />
- <x-forms.input label="Initial Password" id="database.mongo_initdb_root_password" type="password" required
- readonly helper="You can only change this in the database." />
+ <x-forms.input label="Initial Password" id="database.mongo_initdb_root_password" type="password"
+ required readonly helper="You can only change this in the database." />
<x-forms.input label="Initial Database" id="database.mongo_initdb_database"
placeholder="If empty, it will be the same as Username." readonly
helper="You can only change this in the database." />
@@ -44,14 +44,19 @@
<x-forms.checkbox instantSave id="database.is_public" label="Accessible over the internet" />
</div>
<x-forms.input label="Mongo URL (internal)"
- helper="If you change the user/password/port, this could be different. This is with the default values."
+ helper="If you change the user/password/port, this could be different. This is with the default values."
type="password" readonly wire:model="db_url" />
@if ($db_url_public)
- <x-forms.input label="Mongo URL (public)"
- helper="If you change the user/password/port, this could be different. This is with the default values."
- type="password" readonly wire:model="db_url_public" />
+ <x-forms.input label="Mongo URL (public)"
+ helper="If you change the user/password/port, this could be different. This is with the default values."
+ type="password" readonly wire:model="db_url_public" />
@endif
</div>
<x-forms.textarea label="Custom MongoDB Configuration" rows="10" id="database.mongo_conf" />
+ <h3 class="pt-4">Advanced</h3>
+ <div class="flex flex-col">
+ <x-forms.checkbox helper="Drain logs to your configured log drain endpoint in your Server settings."
+ instantSave="instantSaveAdvanced" id="database.is_log_drain_enabled" label="Drain Logs" />
+ </div>
</form>
</div>
diff --git a/resources/views/livewire/project/database/mysql/general.blade.php b/resources/views/livewire/project/database/mysql/general.blade.php
index 6db2fd8eb9..aef1b006dd 100644
--- a/resources/views/livewire/project/database/mysql/general.blade.php
+++ b/resources/views/livewire/project/database/mysql/general.blade.php
@@ -59,5 +59,10 @@
@endif
</div>
<x-forms.textarea label="Custom Mysql Configuration" rows="10" id="database.mysql_conf" />
+ <h3 class="pt-4">Advanced</h3>
+ <div class="flex flex-col">
+ <x-forms.checkbox helper="Drain logs to your configured log drain endpoint in your Server settings."
+ instantSave="instantSaveAdvanced" id="database.is_log_drain_enabled" label="Drain Logs" />
+ </div>
</form>
</div>
diff --git a/resources/views/livewire/project/database/postgresql/general.blade.php b/resources/views/livewire/project/database/postgresql/general.blade.php
index 3116620eaa..7554ae17f3 100644
--- a/resources/views/livewire/project/database/postgresql/general.blade.php
+++ b/resources/views/livewire/project/database/postgresql/general.blade.php
@@ -74,6 +74,11 @@
</div>
<x-forms.textarea label="Custom PostgreSQL Configuration" rows="10" id="database.postgres_conf" />
</form>
+ <h3 class="pt-4">Advanced</h3>
+ <div class="flex flex-col">
+ <x-forms.checkbox helper="Drain logs to your configured log drain endpoint in your Server settings." instantSave="instantSaveAdvanced"
+ id="database.is_log_drain_enabled" label="Drain Logs" />
+ </div>
<div class="pb-16">
<div class="flex gap-2 pt-4 pb-2">
<h3>Initialization scripts</h3>
@@ -87,4 +92,5 @@
@endforelse
</div>
</div>
+
</div>
diff --git a/resources/views/livewire/project/database/redis/general.blade.php b/resources/views/livewire/project/database/redis/general.blade.php
index 9f709b6565..0d2b7bb42d 100644
--- a/resources/views/livewire/project/database/redis/general.blade.php
+++ b/resources/views/livewire/project/database/redis/general.blade.php
@@ -33,5 +33,10 @@
<x-forms.textarea
helper="<a target='_blank' class='text-white underline' href='https://raw.githubusercontent.com/redis/redis/7.2/redis.conf'>Redis Default Configuration</a>"
label="Custom Redis Configuration" rows="10" id="database.redis_conf" />
+ <h3 class="pt-4">Advanced</h3>
+ <div class="flex flex-col">
+ <x-forms.checkbox helper="Drain logs to your configured log drain endpoint in your Server settings."
+ instantSave="instantSaveAdvanced" id="database.is_log_drain_enabled" label="Drain Logs" />
+ </div>
</form>
</div>
diff --git a/resources/views/livewire/project/service/application.blade.php b/resources/views/livewire/project/service/application.blade.php
index db1329f81e..f8809686cc 100644
--- a/resources/views/livewire/project/service/application.blade.php
+++ b/resources/views/livewire/project/service/application.blade.php
@@ -36,6 +36,8 @@
<x-forms.checkbox instantSave label="Exclude from service status"
helper="If you do not need to monitor this resource, enable. Useful if this service is optional."
id="application.exclude_from_status"></x-forms.checkbox>
+ <x-forms.checkbox helper="Drain logs to your configured log drain endpoint in your Server settings."
+ instantSave="instantSaveAdvanced" id="application.is_log_drain_enabled" label="Drain Logs" />
</div>
</form>
</div>
diff --git a/resources/views/livewire/project/service/database.blade.php b/resources/views/livewire/project/service/database.blade.php
index e9318e13c9..7868c5b073 100644
--- a/resources/views/livewire/project/service/database.blade.php
+++ b/resources/views/livewire/project/service/database.blade.php
@@ -32,6 +32,8 @@
<x-forms.checkbox instantSave label="Exclude from service status"
helper="If you do not need to monitor this resource, enable. Useful if this service is optional."
id="database.exclude_from_status"></x-forms.checkbox>
+ <x-forms.checkbox helper="Drain logs to your configured log drain endpoint in your Server settings."
+ instantSave="instantSaveAdvanced" id="database.is_log_drain_enabled" label="Drain Logs" />
</div>
</form>
</div>
diff --git a/versions.json b/versions.json
index 394ef8d40c..ae88d16177 100644
--- a/versions.json
+++ b/versions.json
@@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
- "version": "4.0.0-beta.143"
+ "version": "4.0.0-beta.144"
}
}
}