fix confs etc

This commit is contained in:
Andras Bacsai
2024-12-10 10:46:05 +01:00
parent 854fd3eab2
commit 3893754a10
15 changed files with 99 additions and 28 deletions

View File

@@ -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 {

View File

@@ -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();
}

View File

@@ -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 {

View File

@@ -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

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}