Skip to content

Commit

Permalink
Merge pull request #4487 from coollabsio/next
Browse files Browse the repository at this point in the history
v4.0.0-beta.377
  • Loading branch information
andrasbacsai authored Dec 13, 2024
2 parents 8d779c8 + 830a4ee commit b650279
Show file tree
Hide file tree
Showing 255 changed files with 7,677 additions and 3,484 deletions.
13 changes: 12 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/public/build
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
Expand All @@ -25,3 +24,15 @@ yarn-error.log
.ignition.json
.env.dusk.local
docker/coolify-realtime/node_modules

/storage/*.key
/storage/app/backups
/storage/app/ssh/keys
/storage/app/ssh/mux
/storage/app/tmp
/storage/app/debugbar
/storage/logs
/storage/pail



4 changes: 2 additions & 2 deletions .github/workflows/coolify-production-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: docker/prod/Dockerfile
file: docker/production/Dockerfile
platforms: linux/amd64
push: true
tags: |
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: docker/prod/Dockerfile
file: docker/production/Dockerfile
platforms: linux/aarch64
push: true
tags: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/coolify-staging-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: docker/prod/Dockerfile
file: docker/production/Dockerfile
platforms: linux/amd64
push: true
tags: |
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
file: docker/prod/Dockerfile
file: docker/production/Dockerfile
platforms: linux/aarch64
push: true
tags: |
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Special thanks to our biggest sponsors!

### Special Sponsors

![image](https://github.com/user-attachments/assets/726fb63e-c3b8-4260-b3ac-06780605ec5d)
![image](https://github.com/user-attachments/assets/6022bc9c-8435-4d14-9497-8be230ed8cb1)


* [CCCareers](https://cccareers.org/) - A career development platform connecting coding bootcamp graduates with job opportunities in the tech industry.
* [Hetzner](http://htznr.li/CoolifyXHetzner) - A German web hosting company offering affordable dedicated servers, cloud services, and web hosting solutions.
Expand All @@ -52,7 +53,9 @@ Special thanks to our biggest sponsors!
* [SupaGuide](https://supa.guide/?ref=coolify.io) - A comprehensive resource hub offering guides and tutorials for web development using Supabase.
* [GoldenVM](https://billing.goldenvm.com/?ref=coolify.io) - A cloud hosting provider offering scalable infrastructure solutions for businesses of all sizes.
* [Tigris](https://tigrisdata.com/?ref=coolify.io) - A fully managed serverless object storage service compatible with Amazon S3 API. Offers high performance, scalability, and built-in search capabilities for efficient data management.
* [Advin](https://coolify.ad.vin/?ref=coolify.io) - A digital advertising agency specializing in programmatic advertising and data-driven marketing strategies.
* [Cloudify.ro](https://cloudify.ro/?ref=coolify.io) - A cloud hosting provider offering scalable infrastructure solutions for businesses of all sizes.
* [Syntaxfm](https://syntax.fm/?ref=coolify.io) - Podcast for web developers.
* [PFGlabs](https://pfglabs.com/?ref=coolify.io) - Build real project with Golang.
* [Treive](https://trieve.ai/?ref=coolify.io) - An AI-powered search and discovery platform for enhancing information retrieval in large datasets.
* [Blacksmith](https://blacksmith.sh/?ref=coolify.io) - A cloud-native platform for automating infrastructure provisioning and management across multiple cloud providers.
* [Brand Dev](https://brand.dev/?ref=coolify.io) - A web development agency specializing in creating custom digital experiences and brand identities.
Expand Down Expand Up @@ -92,6 +95,9 @@ Special thanks to our biggest sponsors!
<a href="https://github.com/monocursive"><img src="https://github.com/monocursive.png" width="60px" alt="Michael Mazurczak" /></a>
<a href="https://formbricks.com/?utm_source=coolify.io"><img src="https://github.com/formbricks.png" width="60px" alt="Formbricks" /></a>
<a href="https://startupfa.me?utm_source=coolify.io"><img src="https://github.com/startupfame.png" width="60px" alt="StartupFame" /></a>
<a href="https://bsky.app/profile/jyc.dev"><img src="https://github.com/jycouet.png" width="60px" alt="jyc.dev" /></a>
<a href="https://bitlaunch.io/?utm_source=coolify.io"><img src="https://github.com/bitlaunchio.png" width="60px" alt="BitLaunch" /></a>
<a href="https://internetgarden.co/?utm_source=coolify.io"><img src="./other/logos/internetgarden.ico" width="60px" alt="Internet Garden" /></a>
<a href="https://jonasjaeger.com?utm_source=coolify.io"><img src="https://github.com/toxin20.png" width="60px" alt="Jonas Jaeger" /></a>
<a href="https://github.com/therealjp?utm_source=coolify.io"><img src="https://github.com/therealjp.png" width="60px" alt="JP" /></a>
<a href="https://evercam.io/?utm_source=coolify.io"><img src="https://github.com/evercam.png" width="60px" alt="Evercam" /></a>
Expand Down
10 changes: 8 additions & 2 deletions app/Actions/Proxy/StartProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Actions\Proxy;

use App\Enums\ProxyTypes;
use App\Events\ProxyStarted;
use App\Models\Server;
use Lorisleiva\Actions\Concerns\AsAction;
Expand Down Expand Up @@ -37,11 +38,16 @@ public function handle(Server $server, bool $async = true, bool $force = false):
"echo 'Successfully started coolify-proxy.'",
]);
} else {
$caddfile = 'import /dynamic/*.caddy';
if (isDev()) {
if ($proxyType === ProxyTypes::CADDY->value) {
$proxy_path = '/data/coolify/proxy/caddy';
}
}
$caddyfile = 'import /dynamic/*.caddy';
$commands = $commands->merge([
"mkdir -p $proxy_path/dynamic",
"cd $proxy_path",
"echo '$caddfile' > $proxy_path/dynamic/Caddyfile",
"echo '$caddyfile' > $proxy_path/dynamic/Caddyfile",
"echo 'Creating required Docker Compose file.'",
"echo 'Pulling docker image.'",
'docker compose pull',
Expand Down
1 change: 0 additions & 1 deletion app/Console/Commands/CleanupUnreachableServers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public function handle()
if ($servers->count() > 0) {
foreach ($servers as $server) {
echo "Cleanup unreachable server ($server->id) with name $server->name";
// send_internal_notification("Server $server->name is unreachable for 7 days. Cleaning up...");
$server->update([
'ip' => '1.2.3.4',
]);
Expand Down
2 changes: 0 additions & 2 deletions app/Console/Commands/Dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,5 @@ public function init()
} else {
echo "Instance already initialized.\n";
}
// Set permissions
Process::run(['chmod', '-R', 'o+rwx', '.']);
}
}
23 changes: 1 addition & 22 deletions app/Console/Commands/Emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

namespace App\Console\Commands;

use App\Jobs\SendConfirmationForWaitlistJob;
use App\Models\Application;
use App\Models\ApplicationPreview;
use App\Models\ScheduledDatabaseBackup;
use App\Models\Server;
use App\Models\StandalonePostgresql;
use App\Models\Team;
use App\Models\Waitlist;
use App\Notifications\Application\DeploymentFailed;
use App\Notifications\Application\DeploymentSuccess;
use App\Notifications\Application\StatusChanged;
Expand Down Expand Up @@ -64,8 +62,6 @@ public function handle()
'backup-success' => 'Database - Backup Success',
'backup-failed' => 'Database - Backup Failed',
// 'invitation-link' => 'Invitation Link',
'waitlist-invitation-link' => 'Waitlist Invitation Link',
'waitlist-confirmation' => 'Waitlist Confirmation',
'realusers-before-trial' => 'REAL - Registered Users Before Trial without Subscription',
'realusers-server-lost-connection' => 'REAL - Server Lost Connection',
],
Expand Down Expand Up @@ -187,7 +183,7 @@ public function handle()
'team_id' => 0,
]);
}
// $this->mail = (new BackupSuccess($backup->frequency, $db->name))->toMail();
//$this->mail = (new BackupSuccess($backup->frequency, $db->name))->toMail();
$this->sendEmail();
break;
// case 'invitation-link':
Expand All @@ -204,23 +200,6 @@ public function handle()
// $this->mail = (new InvitationLink($user))->toMail();
// $this->sendEmail();
// break;
case 'waitlist-invitation-link':
$this->mail = new MailMessage;
$this->mail->view('emails.waitlist-invitation', [
'loginLink' => 'https://coolify.io',
]);
$this->mail->subject('Congratulations! You are invited to join Coolify Cloud.');
$this->sendEmail();
break;
case 'waitlist-confirmation':
$found = Waitlist::where('email', $this->email)->first();
if ($found) {
SendConfirmationForWaitlistJob::dispatch($this->email, $found->uuid);
} else {
throw new Exception('Waitlist not found');
}

break;
case 'realusers-before-trial':
$this->mail = new MailMessage;
$this->mail->view('emails.before-trial-conversion');
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Horizon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 2 additions & 8 deletions app/Console/Commands/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ public function handle()
} 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 {
Expand Down Expand Up @@ -114,7 +112,6 @@ private function pullTemplatesFromCDN()

private function optimize()
{
echo "[1]: Optimizing Laravel (caching config, routes, views).\n";
Artisan::call('optimize:clear');
Artisan::call('optimize');
}
Expand Down Expand Up @@ -189,7 +186,6 @@ private function cleanup_unused_network_from_coolify_proxy()
}
}
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) {
Expand Down Expand Up @@ -232,15 +228,14 @@ private function send_alive_signal()
$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";
}
}

Expand All @@ -253,7 +248,6 @@ private function cleanup_in_progress_application_deployments()
}
$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();
}
Expand Down
24 changes: 24 additions & 0 deletions app/Console/Commands/Migration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class Migration extends Command
{
protected $signature = 'start:migration';

protected $description = 'Start Migration';

public function handle()
{
if (config('constants.migration.is_migration_enabled')) {
$this->info('Migration is enabled on this server.');
$this->call('migrate', ['--force' => true, '--isolated' => true]);
exit(0);
} else {
$this->info('Migration is disabled on this server.');
exit(0);
}
}
}
5 changes: 3 additions & 2 deletions app/Console/Commands/NotifyDemo.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ private function showHelp()
<div class="text-yellow-500"> Channels: </div>
<ul class="text-coolify">
<li>email</li>
<li>slack</li>
<li>discord</li>
<li>telegram</li>
<li>slack</li>
<li>pushover</li>
</ul>
</div>
</div>
Expand All @@ -72,6 +73,6 @@ private function showHelp()
<div class="mr-1">
In which manner you wish a <strong class="text-coolify">coolified</strong> notification?
</div>
HTML, ['email', 'slack', 'discord', 'telegram']);
HTML, ['email', 'discord', 'telegram', 'slack', 'pushover']);
}
}
2 changes: 1 addition & 1 deletion app/Console/Commands/Scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
24 changes: 24 additions & 0 deletions app/Console/Commands/Seeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class Seeder extends Command
{
protected $signature = 'start:seeder';

protected $description = 'Start Seeder';

public function handle()
{
if (config('constants.seeder.is_seeder_enabled')) {
$this->info('Seeder is enabled on this server.');
$this->call('db:seed', ['--class' => 'ProductionSeeder', '--force' => true]);
exit(0);
} else {
$this->info('Seeder is disabled on this server.');
exit(0);
}
}
}
Loading

0 comments on commit b650279

Please sign in to comment.