chore: ♻️ Add encrypted prop back in

This commit is contained in:
IceToast 2024-04-24 10:54:06 +02:00
parent 931f08a1d7
commit e35bbddc40
4 changed files with 13 additions and 6 deletions

View file

@ -18,8 +18,6 @@ class DiscordSettings extends Settings
return 'discord'; return 'discord';
} }
/** /**
* Summary of validations array * Summary of validations array
* @return array<string, string> * @return array<string, string>

View file

@ -20,7 +20,12 @@ class MailSettings extends Settings
return 'mail'; return 'mail';
} }
public static function encrypted(): array
{
return [
'mail_password',
];
}
public function setConfig() public function setConfig()
{ {

View file

@ -16,7 +16,13 @@ class PterodactylSettings extends Settings
return 'pterodactyl'; return 'pterodactyl';
} }
public static function encrypted(): array
{
return [
'admin_token',
'user_token',
];
}
/** /**
* Get url with ensured ending backslash * Get url with ensured ending backslash

View file

@ -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.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->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.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); $this->migrator->add('pterodactyl.per_page_limit', $table_exists ? $this->getOldValue('SETTINGS::SYSTEM:PTERODACTYL:PER_PAGE_LIMIT', 200) : 200);
} }