fix
This commit is contained in:
		@@ -4,7 +4,7 @@ namespace App\Http\Livewire\Notifications;
 | 
			
		||||
 | 
			
		||||
use App\Models\Server;
 | 
			
		||||
use App\Models\Team;
 | 
			
		||||
use App\Notifications\TestNotification;
 | 
			
		||||
use App\Notifications\Notifications\TestNotification;
 | 
			
		||||
use Illuminate\Support\Facades\Notification;
 | 
			
		||||
use Livewire\Component;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,7 @@ namespace App\Http\Livewire\Notifications;
 | 
			
		||||
 | 
			
		||||
use App\Models\InstanceSettings;
 | 
			
		||||
use App\Models\Team;
 | 
			
		||||
use App\Notifications\TestNotification;
 | 
			
		||||
use App\Notifications\Notifications\TestNotification;
 | 
			
		||||
use Illuminate\Support\Facades\Notification;
 | 
			
		||||
use Livewire\Component;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -11,7 +11,7 @@ class EmailChannel
 | 
			
		||||
    public function send(SendsEmail $notifiable, Notification $notification): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->bootConfigs($notifiable);
 | 
			
		||||
        $is_test_notification = $notification instanceof \App\Notifications\TestNotification;
 | 
			
		||||
        $is_test_notification = $notification instanceof  \App\Notifications\Notifications\TestNotification;
 | 
			
		||||
 | 
			
		||||
        if ($is_test_notification) {
 | 
			
		||||
            $bcc = $notifiable->routeNotificationForEmail('smtp_test_recipients');
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Notifications;
 | 
			
		||||
namespace App\Notifications\Notifications;
 | 
			
		||||
 | 
			
		||||
use App\Notifications\Channels\EmailChannel;
 | 
			
		||||
use App\Notifications\Channels\DiscordChannel;
 | 
			
		||||
@@ -29,6 +29,6 @@ class TestNotification extends Notification implements ShouldQueue
 | 
			
		||||
 | 
			
		||||
    public function toDiscord(): string
 | 
			
		||||
    {
 | 
			
		||||
        return 'You have successfully received a test Discord notification from Coolify. 🥳 [Go to your dashboard](' . url('/') . ')';
 | 
			
		||||
        return 'You have successfully received a test Discord notification from Coolify. 🥳 [Go to your dashboard](' . base_url() . ')';
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -11,7 +11,6 @@ use App\Models\InstanceSettings;
 | 
			
		||||
use App\Models\PrivateKey;
 | 
			
		||||
use App\Models\Server;
 | 
			
		||||
use App\Models\StandaloneDocker;
 | 
			
		||||
use App\Models\Team;
 | 
			
		||||
use Illuminate\Database\Seeder;
 | 
			
		||||
use Illuminate\Support\Facades\Process;
 | 
			
		||||
use Illuminate\Support\Facades\Storage;
 | 
			
		||||
@@ -46,15 +45,6 @@ class ProductionSeeder extends Seeder
 | 
			
		||||
            ]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Add first Team if it doesn't exist
 | 
			
		||||
        // if (Team::find(0) == null) {
 | 
			
		||||
        //     Team::create([
 | 
			
		||||
        //         'id' => 0,
 | 
			
		||||
        //         'name' => "Root's Team",
 | 
			
		||||
        //         'personal_team' => true,
 | 
			
		||||
        //     ]);
 | 
			
		||||
        // }
 | 
			
		||||
 | 
			
		||||
        // Save SSH Keys for the Coolify Host
 | 
			
		||||
        $coolify_key_name = "id.root@host.docker.internal";
 | 
			
		||||
        $coolify_key = Storage::disk('ssh-keys')->get("{$coolify_key_name}");
 | 
			
		||||
@@ -107,20 +97,23 @@ class ProductionSeeder extends Seeder
 | 
			
		||||
            ]);
 | 
			
		||||
        }
 | 
			
		||||
        try {
 | 
			
		||||
            $settings = InstanceSettings::get();
 | 
			
		||||
            if (is_null($settings->public_ipv4)) {
 | 
			
		||||
                $ipv4 = Process::run('curl -4s https://ifconfig.io')->output();
 | 
			
		||||
                if ($ipv4) {
 | 
			
		||||
                    $ipv4 = trim($ipv4);
 | 
			
		||||
                    $ipv4 = filter_var($ipv4, FILTER_VALIDATE_IP);
 | 
			
		||||
            $settings = InstanceSettings::get();
 | 
			
		||||
            if (is_null($settings->public_ipv4) && $ipv4) {
 | 
			
		||||
                    $settings->update(['public_ipv4' => $ipv4]);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if (is_null($settings->public_ipv6)) {
 | 
			
		||||
                $ipv6 = Process::run('curl -6s https://ifconfig.io')->output();
 | 
			
		||||
                if ($ipv6) {
 | 
			
		||||
                    $ipv6 = trim($ipv6);
 | 
			
		||||
                    $ipv6 = filter_var($ipv6, FILTER_VALIDATE_IP);
 | 
			
		||||
            $settings = InstanceSettings::get();
 | 
			
		||||
            if (is_null($settings->public_ipv6) && $ipv6) {
 | 
			
		||||
                    $settings->update(['public_ipv6' => $ipv6]);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        } catch (\Exception $e) {
 | 
			
		||||
            echo "Error: {$e->getMessage()}\n";
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -2,6 +2,7 @@
 | 
			
		||||
 | 
			
		||||
namespace Database\Seeders;
 | 
			
		||||
 | 
			
		||||
use App\Actions\Proxy\InstallProxy;
 | 
			
		||||
use App\Data\ServerMetadata;
 | 
			
		||||
use App\Enums\ProxyStatus;
 | 
			
		||||
use App\Enums\ProxyTypes;
 | 
			
		||||
 
 | 
			
		||||
@@ -17,11 +17,11 @@
 | 
			
		||||
                </x-forms.button>
 | 
			
		||||
            @endif
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="flex flex-col w-96">
 | 
			
		||||
        <div class="flex flex-col">
 | 
			
		||||
            <x-forms.checkbox instantSave id="model.extra_attributes.smtp_active" label="Notification Enabled" />
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="flex gap-2">
 | 
			
		||||
        <div class="flex flex-col gap-2 xl:flex-row">
 | 
			
		||||
            <x-forms.input id="model.extra_attributes.smtp_recipients"
 | 
			
		||||
                placeholder="If empty, all users will be notified in the team."
 | 
			
		||||
                helper="Email list to send the all notifications to, separated by comma." label="Recipient(s)" />
 | 
			
		||||
@@ -30,7 +30,6 @@
 | 
			
		||||
                helper="Email list to send the test notification to, separated by comma." />
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="flex flex-col gap-2 xl:flex-row">
 | 
			
		||||
            <div class="flex flex-col w-96">
 | 
			
		||||
            <x-forms.input required id="model.extra_attributes.smtp_host" helper="SMTP Hostname"
 | 
			
		||||
                placeholder="smtp.mailgun.org" label="Host" />
 | 
			
		||||
            <x-forms.input required id="model.extra_attributes.smtp_port" helper="SMTP Port" placeholder="587"
 | 
			
		||||
@@ -38,14 +37,15 @@
 | 
			
		||||
            <x-forms.input helper="If SMTP through SSL, set it to 'tls'." placeholder="tls"
 | 
			
		||||
                id="model.extra_attributes.smtp_encryption" label="Encryption" />
 | 
			
		||||
        </div>
 | 
			
		||||
            <div class="flex flex-col w-96">
 | 
			
		||||
        <div class="flex flex-col">
 | 
			
		||||
            <div class="flex flex-col gap-2 xl:flex-row">
 | 
			
		||||
                <x-forms.input id="model.extra_attributes.smtp_username" helper="SMTP Username" label="Username" />
 | 
			
		||||
                <x-forms.input type="password" helper="SMTP Password" id="model.extra_attributes.smtp_password"
 | 
			
		||||
                    label="Password" />
 | 
			
		||||
            </div>
 | 
			
		||||
            <x-forms.input id="model.extra_attributes.smtp_timeout" helper="Timeout value for sending emails."
 | 
			
		||||
                label="Timeout" />
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="flex flex-col w-96">
 | 
			
		||||
            <div class="flex flex-col gap-2 xl:flex-row">
 | 
			
		||||
                <x-forms.input required id="model.extra_attributes.smtp_from_name" helper="Name used in emails."
 | 
			
		||||
                    label="From Name" />
 | 
			
		||||
                <x-forms.input required id="model.extra_attributes.smtp_from_address"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user