diff --git a/app/Console/Commands/Horizon.php b/app/Console/Commands/Horizon.php index 655729ec9..d3e35ca5a 100644 --- a/app/Console/Commands/Horizon.php +++ b/app/Console/Commands/Horizon.php @@ -13,7 +13,7 @@ class Horizon extends Command public function handle() { if (config('constants.horizon.is_horizon_enabled')) { - $this->info('[x]: Horizon is enabled. Starting.'); + $this->info('Horizon is enabled on this server.'); $this->call('horizon'); exit(0); } else { diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php index 216262819..cc9bee0a5 100644 --- a/app/Console/Commands/Init.php +++ b/app/Console/Commands/Init.php @@ -55,10 +55,8 @@ class Init extends Command } else { $this->cleanup_in_progress_application_deployments(); } - echo "[3]: Cleanup Redis keys.\n"; $this->call('cleanup:redis'); - echo "[4]: Cleanup stucked resources.\n"; $this->call('cleanup:stucked-resources'); try { @@ -114,7 +112,6 @@ class Init extends Command private function optimize() { - echo "[1]: Optimizing Laravel (caching config, routes, views).\n"; Artisan::call('optimize:clear'); Artisan::call('optimize'); } @@ -189,7 +186,6 @@ class Init extends Command } } if ($commands->isNotEmpty()) { - echo "Cleaning up unused networks from coolify proxy\n"; remote_process(command: $commands, type: ActivityTypes::INLINE->value, server: $server, ignore_errors: false); } } catch (\Throwable $e) { @@ -232,15 +228,14 @@ class Init extends Command $settings = instanceSettings(); $do_not_track = data_get($settings, 'do_not_track'); if ($do_not_track == true) { - echo "[2]: Skipping sending live signal as do_not_track is enabled\n"; + echo "Do_not_track is enabled\n"; return; } try { Http::get("https://undead.coolify.io/v4/alive?appId=$id&version=$version"); - echo "[2]: Sending live signal!\n"; } catch (\Throwable $e) { - echo "[2]: Error in sending live signal: {$e->getMessage()}\n"; + echo "Error in sending live signal: {$e->getMessage()}\n"; } } @@ -253,7 +248,6 @@ class Init extends Command } $queued_inprogress_deployments = ApplicationDeploymentQueue::whereIn('status', [ApplicationDeploymentStatus::IN_PROGRESS->value, ApplicationDeploymentStatus::QUEUED->value])->get(); foreach ($queued_inprogress_deployments as $deployment) { - echo "Cleaning up deployment: {$deployment->id}\n"; $deployment->status = ApplicationDeploymentStatus::FAILED->value; $deployment->save(); } diff --git a/app/Console/Commands/Scheduler.php b/app/Console/Commands/Scheduler.php index 9ee7b06e6..ee64368c3 100644 --- a/app/Console/Commands/Scheduler.php +++ b/app/Console/Commands/Scheduler.php @@ -13,7 +13,7 @@ class Scheduler extends Command public function handle() { if (config('constants.horizon.is_scheduler_enabled')) { - $this->info('[x]: Scheduler is enabled. Starting.'); + $this->info('Scheduler is enabled on this server.'); $this->call('schedule:work'); exit(0); } else { diff --git a/database/seeders/ProductionSeeder.php b/database/seeders/ProductionSeeder.php index 7acdef548..9a301aa67 100644 --- a/database/seeders/ProductionSeeder.php +++ b/database/seeders/ProductionSeeder.php @@ -22,9 +22,9 @@ class ProductionSeeder extends Seeder public function run(): void { if (isCloud()) { - echo "[x]: Running in cloud mode.\n"; + echo " Running in cloud mode.\n"; } else { - echo "[x]: Running in self-hosted mode.\n"; + echo " Running in self-hosted mode.\n"; } // Fix for 4.0.0-beta.37 diff --git a/docker/development/etc/s6-overlay/s6-rc.d/horizon/run b/docker/development/etc/s6-overlay/s6-rc.d/horizon/run index bcbe20009..ada19b3a3 100644 --- a/docker/development/etc/s6-overlay/s6-rc.d/horizon/run +++ b/docker/development/etc/s6-overlay/s6-rc.d/horizon/run @@ -1,5 +1,12 @@ #!/command/execlineb -P + +# Use with-contenv to ensure environment variables are available +with-contenv +cd /var/www/html + foreground { - s6-sleep 5 - php /var/www/html/artisan start:horizon + php + artisan + start:horizon } + diff --git a/docker/development/etc/s6-overlay/s6-rc.d/init-setup/up b/docker/development/etc/s6-overlay/s6-rc.d/init-setup/up index e02307e49..67e0f5c1a 100644 --- a/docker/development/etc/s6-overlay/s6-rc.d/init-setup/up +++ b/docker/development/etc/s6-overlay/s6-rc.d/init-setup/up @@ -1,5 +1,22 @@ #!/command/execlineb -P -foreground { composer -d /var/www/html/ install } -foreground { php /var/www/html/artisan migrate --step } -foreground { php /var/www/html/artisan dev --init } + +# Use with-contenv to ensure environment variables are available +with-contenv +cd /var/www/html +foreground { + composer + install +} +foreground { + php + artisan + migrate + --step +} +foreground { + php + artisan + dev + --init +} diff --git a/docker/development/etc/s6-overlay/s6-rc.d/scheduler-worker/run b/docker/development/etc/s6-overlay/s6-rc.d/scheduler-worker/run index 09884395a..b81a44833 100644 --- a/docker/development/etc/s6-overlay/s6-rc.d/scheduler-worker/run +++ b/docker/development/etc/s6-overlay/s6-rc.d/scheduler-worker/run @@ -1,5 +1,13 @@ #!/command/execlineb -P + +# Use with-contenv to ensure environment variables are available +with-contenv +cd /var/www/html + foreground { - s6-sleep 5 - php /var/www/html/artisan start:scheduler + php + artisan + start:scheduler } + + diff --git a/docker/production/etc/php/conf.d/zzz-custom-php.ini b/docker/production/etc/php/conf.d/zzz-custom-php.ini index 1e3ea566c..a2297ad0d 100644 --- a/docker/production/etc/php/conf.d/zzz-custom-php.ini +++ b/docker/production/etc/php/conf.d/zzz-custom-php.ini @@ -1,6 +1,6 @@ -error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE +error_reporting = E_ERROR error_log = /var/www/html/storage/logs/php-error.log -log_errors = On +log_errors = Off log_errors_max_len = 8192 ignore_repeated_errors = On ignore_repeated_source = On diff --git a/docker/production/etc/s6-overlay/s6-rc.d/db-migration/up b/docker/production/etc/s6-overlay/s6-rc.d/db-migration/up index 250d5d8b1..f1a5006f1 100644 --- a/docker/production/etc/s6-overlay/s6-rc.d/db-migration/up +++ b/docker/production/etc/s6-overlay/s6-rc.d/db-migration/up @@ -1,2 +1,13 @@ #!/command/execlineb -P -php /var/www/html/artisan migrate --force --isolated + +# Use with-contenv to ensure environment variables are available +with-contenv +cd /var/www/html +foreground { + php + artisan + migrate + --force + --isolated +} + diff --git a/docker/production/etc/s6-overlay/s6-rc.d/horizon/dependencies.d/init-script b/docker/production/etc/s6-overlay/s6-rc.d/horizon/dependencies.d/init-script new file mode 100644 index 000000000..e69de29bb diff --git a/docker/production/etc/s6-overlay/s6-rc.d/horizon/run b/docker/production/etc/s6-overlay/s6-rc.d/horizon/run index bcbe20009..be6647607 100644 --- a/docker/production/etc/s6-overlay/s6-rc.d/horizon/run +++ b/docker/production/etc/s6-overlay/s6-rc.d/horizon/run @@ -1,5 +1,11 @@ #!/command/execlineb -P + +# Use with-contenv to ensure environment variables are available +with-contenv +cd /var/www/html foreground { - s6-sleep 5 - php /var/www/html/artisan start:horizon + php + artisan + start:horizon } + diff --git a/docker/production/etc/s6-overlay/s6-rc.d/init-script/up b/docker/production/etc/s6-overlay/s6-rc.d/init-script/up index 09595f708..3fad5f2c5 100644 --- a/docker/production/etc/s6-overlay/s6-rc.d/init-script/up +++ b/docker/production/etc/s6-overlay/s6-rc.d/init-script/up @@ -1,2 +1,12 @@ #!/command/execlineb -P -php /var/www/html/artisan app:init + +# Use with-contenv to ensure environment variables are available +with-contenv +cd /var/www/html +foreground { + php + artisan + app:init +} + + diff --git a/docker/production/etc/s6-overlay/s6-rc.d/init-seeder/up b/docker/production/etc/s6-overlay/s6-rc.d/init-seeder/up index 44645c11f..20d17c58b 100644 --- a/docker/production/etc/s6-overlay/s6-rc.d/init-seeder/up +++ b/docker/production/etc/s6-overlay/s6-rc.d/init-seeder/up @@ -1,2 +1,15 @@ #!/command/execlineb -P -php /var/www/html/artisan db:seed --class ProductionSeeder --force + +# Use with-contenv to ensure environment variables are available +with-contenv +cd /var/www/html +foreground { + php + artisan + db:seed + --class + ProductionSeeder + --force +} + + diff --git a/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/dependencies.d/init-script b/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/dependencies.d/init-script new file mode 100644 index 000000000..e69de29bb diff --git a/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/run b/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/run index 09884395a..a2ecb0a73 100644 --- a/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/run +++ b/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/run @@ -1,5 +1,10 @@ #!/command/execlineb -P + +# Use with-contenv to ensure environment variables are available +with-contenv +cd /var/www/html foreground { - s6-sleep 5 - php /var/www/html/artisan start:scheduler + php + artisan + start:scheduler }