From 0aa816b4f29af66050912df5f379f578f57f237d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 1 Jun 2023 12:15:33 +0200 Subject: [PATCH] a lot hehe --- .env.development.example | 6 ++ .env.secrets.example | 2 +- .../Notifications/DiscordSettings.php | 33 +++++---- .../Livewire/Notifications/EmailSettings.php | 54 +++++++------- app/Http/Livewire/Notifications/Test.php | 19 +++++ app/Http/Livewire/Settings/Email.php | 41 +++++++++++ app/Models/Server.php | 9 ++- app/Models/Team.php | 17 +++-- app/Models/User.php | 3 +- .../Channels/CoolifyEmailChannel.php | 44 ------------ app/Notifications/Channels/DiscordChannel.php | 2 - app/Notifications/Channels/EmailChannel.php | 56 +++++++++++++++ .../Channels/SendsCoolifyEmail.php | 8 --- app/Notifications/Channels/SendsEmail.php | 8 +++ ...oNotification.php => TestNotification.php} | 17 +++-- app/Providers/FortifyServiceProvider.php | 29 +++++++- config/mail.php | 2 +- .../2023_03_20_112811_create_teams_table.php | 2 +- ...2023_03_24_140711_create_servers_table.php | 1 + docker-compose.dev.yml | 6 +- lang/en.json | 13 ++-- resources/css/app.css | 5 +- .../views/auth/confirm-password.blade.php | 28 ++++++++ .../views/auth/forgot-password.blade.php | 58 ++++++--------- resources/views/auth/login.blade.php | 23 +++++- resources/views/auth/register.blade.php | 7 +- resources/views/auth/reset-password.blade.php | 38 ++++++++++ .../views/auth/two-factor-challenge.blade.php | 46 ++++++++++++ .../views/components/layout-simple.blade.php | 3 +- resources/views/components/layout.blade.php | 3 +- resources/views/components/version.blade.php | 2 + .../notifications/discord-settings.blade.php | 24 +++---- .../notifications/email-settings.blade.php | 46 +++++------- .../livewire/notifications/test.blade.php | 4 ++ .../views/livewire/profile/form.blade.php | 10 +-- .../views/livewire/settings/email.blade.php | 18 +++++ .../views/livewire/settings/form.blade.php | 8 +-- .../views/livewire/switch-team.blade.php | 15 ++-- resources/views/profile.blade.php | 72 ++++++++++++++++++- resources/views/settings.blade.php | 8 ++- resources/views/team.blade.php | 19 +++-- routes/web.php | 6 +- 42 files changed, 568 insertions(+), 247 deletions(-) create mode 100644 app/Http/Livewire/Notifications/Test.php create mode 100644 app/Http/Livewire/Settings/Email.php delete mode 100644 app/Notifications/Channels/CoolifyEmailChannel.php create mode 100644 app/Notifications/Channels/EmailChannel.php delete mode 100644 app/Notifications/Channels/SendsCoolifyEmail.php create mode 100644 app/Notifications/Channels/SendsEmail.php rename app/Notifications/{DemoNotification.php => TestNotification.php} (62%) create mode 100644 resources/views/auth/confirm-password.blade.php create mode 100644 resources/views/auth/reset-password.blade.php create mode 100644 resources/views/auth/two-factor-challenge.blade.php create mode 100644 resources/views/components/version.blade.php create mode 100644 resources/views/livewire/notifications/test.blade.php create mode 100644 resources/views/livewire/settings/email.blade.php diff --git a/.env.development.example b/.env.development.example index be06cac76d..a0cbac857b 100644 --- a/.env.development.example +++ b/.env.development.example @@ -8,7 +8,9 @@ GROUPID= PROJECT_PATH_ON_HOST=/Users/your-username-here/code/coollabsio/coolify SERVEO_URL= MUX_ENABLED=false +# If you are using the included Buggregator RAY_HOST=ray@host.docker.internal +RAY_PORT=8001 ############################################################################################################ APP_NAME=Coolify @@ -19,6 +21,10 @@ APP_DEBUG=true APP_URL=http://localhost APP_PORT=8000 +MAIL_MAILER=smtp +MAIL_HOST=coolify-mail +MAIL_PORT=1025 + SESSION_DRIVER=database DUSK_DRIVER_URL=http://selenium:4444 diff --git a/.env.secrets.example b/.env.secrets.example index 7eaca7cbc2..a114f69822 100644 --- a/.env.secrets.example +++ b/.env.secrets.example @@ -1,4 +1,4 @@ -# Secrets related to pushing to GH, Sync files to BunnyCDN etc. +# Secrets related to pushing to GH, Sync files to BunnyCDN etc. Only for maintainers. # Not related to Coolify, but to how we publish new versions. GITHUB_TOKEN= diff --git a/app/Http/Livewire/Notifications/DiscordSettings.php b/app/Http/Livewire/Notifications/DiscordSettings.php index 239d080a66..c503f7829f 100644 --- a/app/Http/Livewire/Notifications/DiscordSettings.php +++ b/app/Http/Livewire/Notifications/DiscordSettings.php @@ -4,7 +4,7 @@ use App\Models\Server; use App\Models\Team; -use App\Notifications\DemoNotification; +use App\Notifications\TestNotification; use Illuminate\Support\Facades\Notification; use Livewire\Component; @@ -13,31 +13,40 @@ class DiscordSettings extends Component public Team|Server $model; protected $rules = [ - 'model.extra_attributes.discord_webhook' => 'nullable|url', - 'model.extra_attributes.discord_active' => 'nullable|boolean', + 'model.smtp_attributes.discord_active' => 'nullable|boolean', + 'model.smtp_attributes.discord_webhook' => 'required|url', ]; protected $validationAttributes = [ - 'model.extra_attributes.discord_webhook' => 'Discord Webhook', + 'model.smtp_attributes.discord_webhook' => 'Discord Webhook', ]; public function mount($model) { // } - public function submit() + public function instantSave() + { + try { + $this->submit(); + } catch (\Exception $e) { + $this->model->smtp_attributes->discord_active = false; + $this->addError('model.smtp_attributes.discord_webhook', $e->getMessage()); + } + } + private function saveModel() { - $this->resetErrorBag(); - $this->validate(); $this->model->save(); - if ( is_a($this->model, Team::class)) { + if (is_a($this->model, Team::class)) { session(['currentTeam' => $this->model]); } } - public function sendTestNotification() + public function submit() { - Notification::send($this->model, new DemoNotification); + $this->resetErrorBag(); + $this->validate(); + $this->saveModel(); } - public function render() + public function sendTestNotification() { - return view('livewire.notifications.discord-settings'); + Notification::send($this->model, new TestNotification); } } diff --git a/app/Http/Livewire/Notifications/EmailSettings.php b/app/Http/Livewire/Notifications/EmailSettings.php index 26f9559255..96e6ac616b 100644 --- a/app/Http/Livewire/Notifications/EmailSettings.php +++ b/app/Http/Livewire/Notifications/EmailSettings.php @@ -4,7 +4,7 @@ use App\Models\Server; use App\Models\Team; -use App\Notifications\DemoNotification; +use App\Notifications\TestNotification; use Illuminate\Support\Facades\Notification; use Livewire\Component; @@ -13,27 +13,27 @@ class EmailSettings extends Component public Team|Server $model; protected $rules = [ - 'model.extra_attributes.smtp_active' => 'nullable|boolean', - 'model.extra_attributes.from_address' => 'nullable', - 'model.extra_attributes.from_name' => 'nullable', - 'model.extra_attributes.recipients' => 'nullable', - 'model.extra_attributes.smtp_host' => 'nullable', - 'model.extra_attributes.smtp_port' => 'nullable', - 'model.extra_attributes.smtp_encryption' => 'nullable', - 'model.extra_attributes.smtp_username' => 'nullable', - 'model.extra_attributes.smtp_password' => 'nullable', - 'model.extra_attributes.smtp_timeout' => 'nullable', + 'model.smtp_attributes.smtp_active' => 'nullable|boolean', + 'model.smtp_attributes.from_address' => 'required', + 'model.smtp_attributes.from_name' => 'required', + 'model.smtp_attributes.recipients' => 'required', + 'model.smtp_attributes.smtp_host' => 'required', + 'model.smtp_attributes.smtp_port' => 'required', + 'model.smtp_attributes.smtp_encryption' => 'nullable', + 'model.smtp_attributes.smtp_username' => 'nullable', + 'model.smtp_attributes.smtp_password' => 'nullable', + 'model.smtp_attributes.smtp_timeout' => 'nullable', + 'model.smtp_attributes.test_address' => 'nullable', ]; protected $validationAttributes = [ - 'model.extra_attributes.from_address' => 'From Address', - 'model.extra_attributes.from_name' => 'From Name', - 'model.extra_attributes.recipients' => 'Recipients', - 'model.extra_attributes.smtp_host' => 'Host', - 'model.extra_attributes.smtp_port' => 'Port', - 'model.extra_attributes.smtp_encryption' => 'Encryption', - 'model.extra_attributes.smtp_username' => 'Username', - 'model.extra_attributes.smtp_password' => 'Password', - 'model.extra_attributes.smtp_timeout' => 'Timeout', + 'model.smtp_attributes.from_address' => 'From Address', + 'model.smtp_attributes.from_name' => 'From Name', + 'model.smtp_attributes.recipients' => 'Recipients', + 'model.smtp_attributes.smtp_host' => 'Host', + 'model.smtp_attributes.smtp_port' => 'Port', + 'model.smtp_attributes.smtp_encryption' => 'Encryption', + 'model.smtp_attributes.smtp_username' => 'Username', + 'model.smtp_attributes.smtp_password' => 'Password', ]; public function mount($model) { @@ -43,17 +43,17 @@ public function submit() { $this->resetErrorBag(); $this->validate(); + $this->saveModel(); + } + private function saveModel() + { $this->model->save(); - if ( is_a($this->model, Team::class)) { + if (is_a($this->model, Team::class)) { session(['currentTeam' => $this->model]); } } - public function sendTestNotification() - { - Notification::send($this->model, new DemoNotification); - } - public function render() + public function instantSave() { - return view('livewire.notifications.email-settings'); + $this->saveModel(); } } diff --git a/app/Http/Livewire/Notifications/Test.php b/app/Http/Livewire/Notifications/Test.php new file mode 100644 index 0000000000..74bb8ca418 --- /dev/null +++ b/app/Http/Livewire/Notifications/Test.php @@ -0,0 +1,19 @@ +model, new TestNotification); + $this->emit('saved', 'Test notification sent.'); + } +} diff --git a/app/Http/Livewire/Settings/Email.php b/app/Http/Livewire/Settings/Email.php new file mode 100644 index 0000000000..3a803d91ef --- /dev/null +++ b/app/Http/Livewire/Settings/Email.php @@ -0,0 +1,41 @@ + 'nullable', + 'model.extra_attributes.from_name' => 'nullable', + 'model.extra_attributes.recipients' => 'nullable', + 'model.extra_attributes.smtp_host' => 'nullable', + 'model.extra_attributes.smtp_port' => 'nullable', + 'model.extra_attributes.smtp_encryption' => 'nullable', + 'model.extra_attributes.smtp_username' => 'nullable', + 'model.extra_attributes.smtp_password' => 'nullable', + 'model.extra_attributes.smtp_timeout' => 'nullable', + ]; + protected $validationAttributes = [ + 'model.extra_attributes.from_address' => 'From Address', + 'model.extra_attributes.from_name' => 'From Name', + 'model.extra_attributes.recipients' => 'Recipients', + 'model.extra_attributes.smtp_host' => 'Host', + 'model.extra_attributes.smtp_port' => 'Port', + 'model.extra_attributes.smtp_encryption' => 'Encryption', + 'model.extra_attributes.smtp_username' => 'Username', + 'model.extra_attributes.smtp_password' => 'Password', + ]; + public function mount($model) + { + // + } + public function render() + { + return view('livewire.settings.email'); + } +} diff --git a/app/Models/Server.php b/app/Models/Server.php index 9351becf76..4858f39a2b 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -22,16 +22,23 @@ protected static function booted() 'port', 'team_id', 'private_key_id', + 'extra_attributes', + 'smtp_attributes', ]; public $casts = [ 'extra_attributes' => SchemalessAttributes::class, + 'smtp_attributes' => SchemalessAttributes::class, ]; public function scopeWithExtraAttributes(): Builder { return $this->extra_attributes->modelScope(); } + public function scopeWithSmtpAttributes(): Builder + { + return $this->smtp_attributes->modelScope(); + } public function standaloneDockers() { @@ -43,8 +50,6 @@ public function swarmDockers() return $this->hasMany(SwarmDocker::class); } - - public function privateKey() { return $this->belongsTo(PrivateKey::class); diff --git a/app/Models/Team.php b/app/Models/Team.php index fd5a0f06ec..f43ae06869 100644 --- a/app/Models/Team.php +++ b/app/Models/Team.php @@ -2,42 +2,41 @@ namespace App\Models; -use App\Notifications\Channels\SendsCoolifyEmail; +use App\Notifications\Channels\SendsEmail; use App\Notifications\Channels\SendsDiscord; use Illuminate\Database\Eloquent\Builder; use Illuminate\Notifications\Notifiable; use Spatie\SchemalessAttributes\Casts\SchemalessAttributes; -class Team extends BaseModel implements SendsDiscord, SendsCoolifyEmail +class Team extends BaseModel implements SendsDiscord, SendsEmail { use Notifiable; protected $casts = [ - 'extra_attributes' => SchemalessAttributes::class, + 'smtp_attributes' => SchemalessAttributes::class, 'personal_team' => 'boolean', ]; protected $fillable = [ 'id', 'name', 'personal_team', - 'extra_attributes', + 'smtp_attributes', ]; public function routeNotificationForDiscord() { - return $this->extra_attributes->get('discord_webhook'); + return $this->smtp_attributes->get('discord_webhook'); } - public function routeNotificationForCoolifyEmail() + public function routeNotificationForEmail(string $attribute = 'recipients') { - $recipients = $this->extra_attributes->get('recipients', ''); - + $recipients = $this->smtp_attributes->get($attribute, ''); return explode(PHP_EOL, $recipients); } public function scopeWithExtraAttributes(): Builder { - return $this->extra_attributes->modelScope(); + return $this->smtp_attributes->modelScope(); } public function projects() diff --git a/app/Models/User.php b/app/Models/User.php index c02ca47a0e..53d6f289ae 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -8,10 +8,11 @@ use Illuminate\Notifications\Notifiable; use Laravel\Sanctum\HasApiTokens; use Visus\Cuid2\Cuid2; +use Laravel\Fortify\TwoFactorAuthenticatable; class User extends Authenticatable { - use HasApiTokens, HasFactory, Notifiable; + use HasApiTokens, HasFactory, Notifiable, TwoFactorAuthenticatable; protected $fillable = [ 'id', 'name', diff --git a/app/Notifications/Channels/CoolifyEmailChannel.php b/app/Notifications/Channels/CoolifyEmailChannel.php deleted file mode 100644 index 3f122070f3..0000000000 --- a/app/Notifications/Channels/CoolifyEmailChannel.php +++ /dev/null @@ -1,44 +0,0 @@ -bootConfigs($notifiable); - $bcc = $notifiable->routeNotificationForCoolifyEmail(); - $mailMessage = $notification->toMail($notifiable); - - Mail::send([], [], fn(Message $message) => $message - ->from( - $notifiable->extra_attributes?->get('from_address'), - $notifiable->extra_attributes?->get('from_name') - ) - ->bcc($bcc) - ->subject($mailMessage->subject) - ->html((string)$mailMessage->render()) - ); - } - - private function bootConfigs($notifiable): void - { - config()->set('mail.mailers.smtp', [ - "transport" => "smtp", - "host" => $notifiable->extra_attributes?->get('smtp_host'), - "port" => $notifiable->extra_attributes?->get('smtp_port'), - "encryption" => $notifiable->extra_attributes?->get('smtp_encryption'), - "username" => $notifiable->extra_attributes?->get('smtp_username'), - "password" => $notifiable->extra_attributes?->get('smtp_password'), - "timeout" => $notifiable->extra_attributes?->get('smtp_timeout'), - "local_domain" => null, - ]); - } -} diff --git a/app/Notifications/Channels/DiscordChannel.php b/app/Notifications/Channels/DiscordChannel.php index 06c8c01306..7032a07968 100644 --- a/app/Notifications/Channels/DiscordChannel.php +++ b/app/Notifications/Channels/DiscordChannel.php @@ -13,9 +13,7 @@ class DiscordChannel public function send(SendsDiscord $notifiable, Notification $notification): void { $message = $notification->toDiscord($notifiable); - $webhookUrl = $notifiable->routeNotificationForDiscord(); - dispatch(new SendMessageToDiscordJob($message, $webhookUrl)); } } diff --git a/app/Notifications/Channels/EmailChannel.php b/app/Notifications/Channels/EmailChannel.php new file mode 100644 index 0000000000..25e0f59b76 --- /dev/null +++ b/app/Notifications/Channels/EmailChannel.php @@ -0,0 +1,56 @@ +bootConfigs($notifiable); + if ($notification instanceof \App\Notifications\TestNotification) { + $bcc = $notifiable->routeNotificationForEmail('test_address'); + if (count($bcc) === 1) { + $bcc = $notifiable->routeNotificationForEmail(); + } + } else { + $bcc = $notifiable->routeNotificationForEmail(); + } + $mailMessage = $notification->toMail($notifiable); + + Mail::send( + [], + [], + fn (Message $message) => $message + ->from( + $notifiable->smtp_attributes?->get('from_address'), + $notifiable->smtp_attributes?->get('from_name') + ) + ->cc($bcc) + ->bcc($bcc) + ->subject($mailMessage->subject) + ->html((string)$mailMessage->render()) + ); + } + + private function bootConfigs($notifiable): void + { + config()->set('mail.default', 'smtp'); + config()->set('mail.mailers.smtp', [ + "transport" => "smtp", + "host" => $notifiable->smtp_attributes?->get('smtp_host'), + "port" => $notifiable->smtp_attributes?->get('smtp_port'), + "encryption" => $notifiable->smtp_attributes?->get('smtp_encryption'), + "username" => $notifiable->smtp_attributes?->get('smtp_username'), + "password" => $notifiable->smtp_attributes?->get('smtp_password'), + "timeout" => $notifiable->smtp_attributes?->get('smtp_timeout'), + "local_domain" => null, + ]); + } +} diff --git a/app/Notifications/Channels/SendsCoolifyEmail.php b/app/Notifications/Channels/SendsCoolifyEmail.php deleted file mode 100644 index e1698a1fe5..0000000000 --- a/app/Notifications/Channels/SendsCoolifyEmail.php +++ /dev/null @@ -1,8 +0,0 @@ -extra_attributes?->get('smtp_active') && $channels[] = CoolifyEmailChannel::class; - $notifiable->extra_attributes?->get('discord_active') && $channels[] = DiscordChannel::class; + $notifiable->smtp_attributes?->get('smtp_active') && $channels[] = EmailChannel::class; + $notifiable->smtp_attributes?->get('discord_active') && $channels[] = DiscordChannel::class; return $channels; } @@ -40,15 +40,14 @@ public function via(object $notifiable): array public function toMail(object $notifiable): MailMessage { return (new MailMessage) - ->subject('Coolify demo notification') - ->line('Welcome to Coolify!') - ->action('Go to dashboard', url('/')) - ->line('We need your attention for disk usage.'); + ->subject('Coolify Test Notification') + ->line('Congratulations!') + ->line('You have successfully received a test Email notification from Coolify. 🥳'); } public function toDiscord(object $notifiable): string { - return 'Welcome to Coolify! We need your attention for disk usage. [Go to dashboard]('.url('/').')'; + return 'You have successfully received a test Discord notification from Coolify. 🥳 [Go to your dashboard](' . url('/') . ')'; } /** diff --git a/app/Providers/FortifyServiceProvider.php b/app/Providers/FortifyServiceProvider.php index 570219cf52..a1b116560b 100644 --- a/app/Providers/FortifyServiceProvider.php +++ b/app/Providers/FortifyServiceProvider.php @@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\ServiceProvider; +use Laravel\Fortify\Contracts\RegisterResponse; use Laravel\Fortify\Fortify; class FortifyServiceProvider extends ServiceProvider @@ -22,7 +23,17 @@ class FortifyServiceProvider extends ServiceProvider */ public function register(): void { - // + $this->app->instance(RegisterResponse::class, new class implements RegisterResponse + { + public function toResponse($request) + { + // First user (root) will be redirected to /settings instead of / on registration. + if ($request->user()->currentTeam->id === 0) { + return redirect('/settings'); + } + return redirect('/'); + } + }); } /** @@ -30,6 +41,7 @@ public function register(): void */ public function boot(): void { + Fortify::createUsersUsing(CreateNewUser::class); Fortify::registerView(function () { $settings = InstanceSettings::get(); if (!$settings->is_registration_enabled) { @@ -58,10 +70,21 @@ public function boot(): void Fortify::requestPasswordResetLinkView(function () { return view('auth.forgot-password'); }); - Fortify::createUsersUsing(CreateNewUser::class); + Fortify::resetPasswordView(function ($request) { + return view('auth.reset-password', ['request' => $request]); + }); + Fortify::resetUserPasswordsUsing(ResetUserPassword::class); + Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class); Fortify::updateUserPasswordsUsing(UpdateUserPassword::class); - Fortify::resetUserPasswordsUsing(ResetUserPassword::class); + + Fortify::confirmPasswordView(function () { + return view('auth.confirm-password'); + }); + + Fortify::twoFactorChallengeView(function () { + return view('auth.two-factor-challenge'); + }); RateLimiter::for('login', function (Request $request) { $email = (string) $request->email; diff --git a/config/mail.php b/config/mail.php index 542d98c37c..4c63daf4fc 100644 --- a/config/mail.php +++ b/config/mail.php @@ -13,7 +13,7 @@ | */ - 'default' => env('MAIL_MAILER', 'smtp'), + 'default' => env('MAIL_MAILER', null), /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2023_03_20_112811_create_teams_table.php b/database/migrations/2023_03_20_112811_create_teams_table.php index 4396c8db72..8fff7314f3 100644 --- a/database/migrations/2023_03_20_112811_create_teams_table.php +++ b/database/migrations/2023_03_20_112811_create_teams_table.php @@ -16,7 +16,7 @@ public function up(): void $table->string('uuid')->unique(); $table->string('name'); $table->boolean('personal_team')->default(false); - $table->schemalessAttributes('extra_attributes'); + $table->schemalessAttributes('smtp_attributes'); $table->timestamps(); }); } diff --git a/database/migrations/2023_03_24_140711_create_servers_table.php b/database/migrations/2023_03_24_140711_create_servers_table.php index 84e2ab6ba8..ae0da4f360 100644 --- a/database/migrations/2023_03_24_140711_create_servers_table.php +++ b/database/migrations/2023_03_24_140711_create_servers_table.php @@ -22,6 +22,7 @@ public function up(): void $table->foreignId('team_id'); $table->foreignId('private_key_id'); $table->schemalessAttributes('extra_attributes'); + $table->schemalessAttributes('smtp_attributes'); $table->timestamps(); }); } diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 07177d96ff..8e1f5e6f7c 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -64,13 +64,17 @@ services: - "./_data/coolify/proxy/testing-host-2:/data/coolify/proxy" mailpit: image: 'axllent/mailpit:latest' + container_name: coolify-mail ports: - '${FORWARD_MAILPIT_PORT:-1025}:1025' - '${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025' + networks: + - coolify + buggregator: image: ghcr.io/buggregator/server:latest container_name: coolify-debug ports: - - 23517:8000 + - 8001:8000 networks: - coolify diff --git a/lang/en.json b/lang/en.json index 3816ace194..8ad5876457 100644 --- a/lang/en.json +++ b/lang/en.json @@ -1,11 +1,14 @@ { "auth.login": "Login", - "auth.already-registered": "Already registered?", - "auth.register-now": "Register now!", + "auth.already_registered": "Already registered?", + "auth.confirm_password": "Confirm password", + "auth.forgot_password": "Forgot password", + "auth.forgot_password_send_email": "Send password reset link via email", + "auth.register_now": "Register now!", "auth.logout": "Logout", "auth.register": "Register", "auth.registration_disabled": "Registration is disabled. Please contact the administrator.", - "auth.reset_password": "Reset Password", + "auth.reset_password": "Reset password", "auth.failed": "These credentials do not match our records.", "auth.failed.password": "The provided password is incorrect.", "auth.failed.email": "We can't find a user with that e-mail address.", @@ -13,6 +16,8 @@ "input.name": "Name", "input.email": "Email", "input.password": "Password", - "input.password.again": "Password Again", + "input.password.again": "Password again", + "input.code": "One-time code", + "input.recovery_code": "Recovery code", "button.save": "Save" } \ No newline at end of file diff --git a/resources/css/app.css b/resources/css/app.css index 893ac66d10..bbef10eac6 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -55,11 +55,14 @@ h1 { @apply text-3xl font-bold pb-4 text-white; } h2 { - @apply text-2xl font-bold pb-4 text-white; + @apply text-2xl font-bold py-4 text-white; } h3 { @apply text-xl font-bold py-4 text-white; } +h4 { + @apply text-base font-bold pb-4 text-white; +} a { @apply text-neutral-400 hover:text-white text-sm link link-hover hover:bg-transparent; } diff --git a/resources/views/auth/confirm-password.blade.php b/resources/views/auth/confirm-password.blade.php new file mode 100644 index 0000000000..5cd6e6fd8d --- /dev/null +++ b/resources/views/auth/confirm-password.blade.php @@ -0,0 +1,28 @@ + +
+
+
+
Coolify
+ +
+
+
+ @csrf + + {{ __('auth.confirm_password') }} + + @if ($errors->any()) +
+ {{ __('auth.failed') }} +
+ @endif + @if (session('status')) +
+ {{ session('status') }} +
+ @endif +
+
+
+
diff --git a/resources/views/auth/forgot-password.blade.php b/resources/views/auth/forgot-password.blade.php index b4a63f5067..8c2366f591 100644 --- a/resources/views/auth/forgot-password.blade.php +++ b/resources/views/auth/forgot-password.blade.php @@ -1,50 +1,32 @@ - Forgot Password -
- @csrf - - - @if (session('status')) -
- {{ session('status') }} -
- @endif - {{--
+
-
Coolify
+
+
Coolify
+ +
+
-

{{ __('auth.login') }}

- @if ($is_registration_enabled) - - - - @endif +

{{ __('auth.forgot_password') }}

-
+ @csrf - @env('local') - - @else - - - @endenv - @if ($errors->any()) -
- {{ __('auth.failed') }} -
- @endif - {{ __('auth.login') }} - @if (!$is_registration_enabled) -
{{ __('auth.registration_disabled') }}
- @endif + {{ __('auth.forgot_password_send_email') }} + @if ($errors->any()) +
+ {{ __('auth.failed') }} +
+ @endif + @if (session('status')) +
+ {{ session('status') }} +
+ @endif
-
--}} +
diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index d5027419e8..38d8fa07c7 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,13 +1,16 @@
-
Coolify
+
+
Coolify
+ +
@@ -17,6 +20,17 @@ class="normal-case rounded-none btn btn-sm btn-primary bg-coollabs-gradient">{{ @env('local') + {{-- @if (config('mail.default')) + {{ dd('mailer configured') }} + @else + {{ dd('mailer not configured') }} + @endif --}} + + @if (!config('mail.default')) + + {{ __('auth.forgot_password') }}? + + @endif @else @@ -28,6 +42,11 @@ class="normal-case rounded-none btn btn-sm btn-primary bg-coollabs-gradient">{{ {{ __('auth.failed') }}
@endif + @if (session('status')) +
+ {{ session('status') }} +
+ @endif {{ __('auth.login') }} @if (!$is_registration_enabled)
{{ __('auth.registration_disabled') }}
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index c9601c9d74..7866569c63 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -1,12 +1,15 @@
-
Coolify
+
+
Coolify
+ +
diff --git a/resources/views/auth/reset-password.blade.php b/resources/views/auth/reset-password.blade.php new file mode 100644 index 0000000000..7032893559 --- /dev/null +++ b/resources/views/auth/reset-password.blade.php @@ -0,0 +1,38 @@ + +
+
+
+
Coolify
+ +
+
+

{{ __('auth.reset_password') }}

+
+
+ + @csrf + + +
+ + +
+ {{ __('auth.reset_password') }} + + @if ($errors->any()) +
+ {{ __('auth.failed') }} +
+ @endif + @if (session('status')) +
+ {{ session('status') }} +
+ @endif +
+
+
+
diff --git a/resources/views/auth/two-factor-challenge.blade.php b/resources/views/auth/two-factor-challenge.blade.php new file mode 100644 index 0000000000..76b6c3fed4 --- /dev/null +++ b/resources/views/auth/two-factor-challenge.blade.php @@ -0,0 +1,46 @@ + +
+
+
+
Coolify
+ +
+
+
+ @csrf + + + {{ __('auth.login') }} +
+ @if ($errors->any()) +
+ {{ __('auth.failed') }} +
+ @endif + @if (session('status')) +
+ {{ session('status') }} +
+ @endif +
+
+
+
diff --git a/resources/views/components/layout-simple.blade.php b/resources/views/components/layout-simple.blade.php index 8c6472474a..4218ffdd04 100644 --- a/resources/views/components/layout-simple.blade.php +++ b/resources/views/components/layout-simple.blade.php @@ -25,8 +25,7 @@
{{ $slot }}
- v{{ config('version') }} + diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index 94616f77a1..9c2ed7464c 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -35,8 +35,7 @@
{{ $slot }}
- v{{ config('version') }} + @auth