From 2877145032166da3ffe490e972df24efa2f102e3 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:04:21 +0200 Subject: [PATCH] fix: encrypt all existing redis passwords --- ...20026_encrypt_existing_redis_passwords.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 database/migrations/2024_10_16_120026_encrypt_existing_redis_passwords.php diff --git a/database/migrations/2024_10_16_120026_encrypt_existing_redis_passwords.php b/database/migrations/2024_10_16_120026_encrypt_existing_redis_passwords.php new file mode 100644 index 000000000..3b4f11986 --- /dev/null +++ b/database/migrations/2024_10_16_120026_encrypt_existing_redis_passwords.php @@ -0,0 +1,27 @@ +chunkById(100, function ($redisInstances) { + foreach ($redisInstances as $redis) { + DB::table('standalone_redis') + ->where('id', $redis->id) + ->update(['redis_password' => Crypt::encryptString($redis->redis_password)]); + } + }); + } catch (\Exception $e) { + echo 'Encrypting Redis passwords failed.'; + echo $e->getMessage(); + } + } +}