diff --git a/app/Http/Livewire/Notifications/DiscordSettings.php b/app/Http/Livewire/Notifications/DiscordSettings.php index 504b60ac5..e8ef7b94d 100644 --- a/app/Http/Livewire/Notifications/DiscordSettings.php +++ b/app/Http/Livewire/Notifications/DiscordSettings.php @@ -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; diff --git a/app/Http/Livewire/Notifications/EmailSettings.php b/app/Http/Livewire/Notifications/EmailSettings.php index 2d97eccdc..28ecd7aa2 100644 --- a/app/Http/Livewire/Notifications/EmailSettings.php +++ b/app/Http/Livewire/Notifications/EmailSettings.php @@ -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; diff --git a/app/Notifications/Channels/EmailChannel.php b/app/Notifications/Channels/EmailChannel.php index 4aa4b761f..03fb46e2c 100644 --- a/app/Notifications/Channels/EmailChannel.php +++ b/app/Notifications/Channels/EmailChannel.php @@ -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'); diff --git a/app/Notifications/TestNotification.php b/app/Notifications/Notifications/TestNotification.php similarity index 90% rename from app/Notifications/TestNotification.php rename to app/Notifications/Notifications/TestNotification.php index bc207be88..e953c3c61 100644 --- a/app/Notifications/TestNotification.php +++ b/app/Notifications/Notifications/TestNotification.php @@ -1,6 +1,6 @@ 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,19 +97,22 @@ class ProductionSeeder extends Seeder ]); } try { - $ipv4 = Process::run('curl -4s https://ifconfig.io')->output(); - $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_ipv4)) { + $ipv4 = Process::run('curl -4s https://ifconfig.io')->output(); + if ($ipv4) { + $ipv4 = trim($ipv4); + $ipv4 = filter_var($ipv4, FILTER_VALIDATE_IP); + $settings->update(['public_ipv4' => $ipv4]); + } } - $ipv6 = Process::run('curl -6s https://ifconfig.io')->output(); - $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]); + 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->update(['public_ipv6' => $ipv6]); + } } } catch (\Exception $e) { echo "Error: {$e->getMessage()}\n"; diff --git a/database/seeders/ServerSeeder.php b/database/seeders/ServerSeeder.php index e60f7da7d..9754be613 100644 --- a/database/seeders/ServerSeeder.php +++ b/database/seeders/ServerSeeder.php @@ -2,6 +2,7 @@ namespace Database\Seeders; +use App\Actions\Proxy\InstallProxy; use App\Data\ServerMetadata; use App\Enums\ProxyStatus; use App\Enums\ProxyTypes; diff --git a/resources/views/livewire/notifications/email-settings.blade.php b/resources/views/livewire/notifications/email-settings.blade.php index f195be0b9..ed3034199 100644 --- a/resources/views/livewire/notifications/email-settings.blade.php +++ b/resources/views/livewire/notifications/email-settings.blade.php @@ -17,11 +17,11 @@ @endif -