diff --git a/app/Settings/DiscordSettings.php b/app/Settings/DiscordSettings.php new file mode 100644 index 00000000..3065c05c --- /dev/null +++ b/app/Settings/DiscordSettings.php @@ -0,0 +1,25 @@ +migrator->add('mail.mail_host', ($this->getOldValue('SETTINGS::MAIL:HOST') != null) ?: ''); - $this->migrator->add('mail.mail_port', ($this->getOldValue('SETTINGS::MAIL:PORT') != null) ?: 'mailhog'); - $this->migrator->add('mail.mail_username', ($this->getOldValue('SETTINGS::MAIL:USERNAME') != null) ?: null); - $this->migrator->add('mail.mail_password', ($this->getOldValue('SETTINGS::MAIL:PASSWORD') != null) ?: null); - $this->migrator->add('mail.mail_encryption', ($this->getOldValue('SETTINGS::MAIL:ENCRYPTION') != null) ?: null); - $this->migrator->add('mail.mail_from_address', ($this->getOldValue('SETTINGS::MAIL:FROM_ADDRESS') != null) ?: null); - $this->migrator->add('mail.mail_from_name', ($this->getOldValue('SETTINGS::MAIL:FROM_NAME') != null) ?: 'ControlPanel.gg'); - $this->migrator->add('mail.mail_mailer', ($this->getOldValue('SETTINGS::MAIL:MAILER') != null) ?: 'smtp'); + $this->migrator->add('mail.mail_host', ($this->getOldValue('SETTINGS::MAIL:HOST') != null) ?: env('MAIL_HOST', 'localhost')); + $this->migrator->add('mail.mail_port', ($this->getOldValue('SETTINGS::MAIL:PORT') != null) ?: env('MAIL_PORT', '25')); + $this->migrator->add('mail.mail_username', ($this->getOldValue('SETTINGS::MAIL:USERNAME') != null) ?: env('MAIL_USERNAME', '')); + $this->migrator->addEncrypted('mail.mail_password', ($this->getOldValue('SETTINGS::MAIL:PASSWORD') != null) ?: env('MAIL_PASSWORD', '')); + $this->migrator->add('mail.mail_encryption', ($this->getOldValue('SETTINGS::MAIL:ENCRYPTION') != null) ?: env('MAIL_ENCRYPTION', 'tls')); + $this->migrator->add('mail.mail_from_address', ($this->getOldValue('SETTINGS::MAIL:FROM_ADDRESS') != null) ?: env('MAIL_FROM_ADDRESS', '')); + $this->migrator->add('mail.mail_from_name', ($this->getOldValue('SETTINGS::MAIL:FROM_NAME') != null) ?: env('APP_NAME', 'ControlPanel.gg')); + $this->migrator->add('mail.mail_mailer', ($this->getOldValue('SETTINGS::MAIL:MAILER') != null) ?: env('MAIL_MAILER', 'smtp')); $this->migrator->add('mail.mail_enabled', true); } diff --git a/database/settings/2023_02_01_182043_create_discord_settings.php b/database/settings/2023_02_01_182043_create_discord_settings.php index 34f06141..bbc03009 100644 --- a/database/settings/2023_02_01_182043_create_discord_settings.php +++ b/database/settings/2023_02_01_182043_create_discord_settings.php @@ -8,9 +8,9 @@ class CreateDiscordSettings extends SettingsMigration public function up(): void { // Get the user-set configuration values from the old table. - $this->migrator->add('discord.bot_token', ($this->getOldValue('SETTINGS::DISCORD:BOT_TOKEN') != null) ?: null); - $this->migrator->add('discord.client_id', ($this->getOldValue('SETTINGS::DISCORD:CLIENT_ID') != null) ?: null); - $this->migrator->add('discord.client_secret', ($this->getOldValue('SETTINGS::DISCORD:CLIENT_SECRET') != null) ?: null); + $this->migrator->addEncrypted('discord.bot_token', ($this->getOldValue('SETTINGS::DISCORD:BOT_TOKEN') != null) ?: null); + $this->migrator->addEncrypted('discord.client_id', ($this->getOldValue('SETTINGS::DISCORD:CLIENT_ID') != null) ?: null); + $this->migrator->addEncrypted('discord.client_secret', ($this->getOldValue('SETTINGS::DISCORD:CLIENT_SECRET') != null) ?: null); $this->migrator->add('discord.guild_id', ($this->getOldValue('SETTINGS::DISCORD:GUILD_ID') != null) ?: null); $this->migrator->add('discord.invite_url', ($this->getOldValue('SETTINGS::DISCORD:INVITE_URL') != null) ?: null); $this->migrator->add('discord.role_id', ($this->getOldValue('SETTINGS::DISCORD:ROLE_ID') != null) ?: null); diff --git a/database/settings/2023_02_01_182158_create_website_settings.php b/database/settings/2023_02_01_182158_create_website_settings.php index 310024b9..b5a1fba0 100644 --- a/database/settings/2023_02_01_182158_create_website_settings.php +++ b/database/settings/2023_02_01_182158_create_website_settings.php @@ -8,7 +8,6 @@ class CreateWebsiteSettings extends SettingsMigration public function up(): void { // Get the user-set configuration values from the old table. - $this->migrator->add('website.', ($this->getOldValue('SETTINGS::') != null) ?: ''); $this->migrator->add('website.motd_enabled', ($this->getOldValue("SETTINGS::SYSTEM:MOTD_ENABLED") != null) ?: true); $this->migrator->add('website.motd_message', ($this->getOldValue("SETTINGS::SYSTEM:MOTD_MESSAGE") != null) ?: '

Controlpanel.gg