From e35bbddc40d65b581dccd584e916dffd775273b2 Mon Sep 17 00:00:00 2001 From: IceToast Date: Wed, 24 Apr 2024 10:54:06 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20=E2=99=BB=EF=B8=8F=20Add=20encrypted?= =?UTF-8?q?=20prop=20back=20in?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Settings/DiscordSettings.php | 2 -- app/Settings/MailSettings.php | 7 ++++++- app/Settings/PterodactylSettings.php | 8 +++++++- .../2023_02_01_181334_create_pterodactyl_settings.php | 2 -- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/app/Settings/DiscordSettings.php b/app/Settings/DiscordSettings.php index 4788ae7e..79981c71 100644 --- a/app/Settings/DiscordSettings.php +++ b/app/Settings/DiscordSettings.php @@ -18,8 +18,6 @@ class DiscordSettings extends Settings return 'discord'; } - - /** * Summary of validations array * @return array diff --git a/app/Settings/MailSettings.php b/app/Settings/MailSettings.php index 90b5a328..c3a9a367 100644 --- a/app/Settings/MailSettings.php +++ b/app/Settings/MailSettings.php @@ -20,7 +20,12 @@ class MailSettings extends Settings return 'mail'; } - + public static function encrypted(): array + { + return [ + 'mail_password', + ]; + } public function setConfig() { diff --git a/app/Settings/PterodactylSettings.php b/app/Settings/PterodactylSettings.php index 3e888b93..c9693386 100644 --- a/app/Settings/PterodactylSettings.php +++ b/app/Settings/PterodactylSettings.php @@ -16,7 +16,13 @@ class PterodactylSettings extends Settings return 'pterodactyl'; } - + public static function encrypted(): array + { + return [ + 'admin_token', + 'user_token', + ]; + } /** * Get url with ensured ending backslash diff --git a/database/settings/2023_02_01_181334_create_pterodactyl_settings.php b/database/settings/2023_02_01_181334_create_pterodactyl_settings.php index 1bf0c7c0..dbbb93b6 100644 --- a/database/settings/2023_02_01_181334_create_pterodactyl_settings.php +++ b/database/settings/2023_02_01_181334_create_pterodactyl_settings.php @@ -11,8 +11,6 @@ class CreatePterodactylSettings extends LegacySettingsMigration $this->migrator->addEncrypted('pterodactyl.admin_token', $table_exists ? $this->getOldValue('SETTINGS::SYSTEM:PTERODACTYL:TOKEN', '') : env('PTERODACTYL_TOKEN', '')); $this->migrator->addEncrypted('pterodactyl.user_token', $table_exists ? $this->getOldValue('SETTINGS::SYSTEM:PTERODACTYL:ADMIN_USER_TOKEN', '') : ''); - // $this->migrator->add('pterodactyl.admin_token', $table_exists ? $this->getOldValue('SETTINGS::SYSTEM:PTERODACTYL:TOKEN') : env('PTERODACTYL_TOKEN', '')); - // $this->migrator->add('pterodactyl.user_token', $table_exists ? $this->getOldValue('SETTINGS::SYSTEM:PTERODACTYL:ADMIN_USER_TOKEN') : ''); $this->migrator->add('pterodactyl.panel_url', $table_exists ? $this->getOldValue('SETTINGS::SYSTEM:PTERODACTYL:URL', '') : env('PTERODACTYL_URL', '')); $this->migrator->add('pterodactyl.per_page_limit', $table_exists ? $this->getOldValue('SETTINGS::SYSTEM:PTERODACTYL:PER_PAGE_LIMIT', 200) : 200); }