From 2f8df05f323fbb449c3a21d0e22edd67e2a7eec3 Mon Sep 17 00:00:00 2001 From: Pablo Zmdl Date: Thu, 25 Jun 2026 17:17:40 +0200 Subject: [PATCH] Remove useless seeding of desec mock The AIO password can be read from the setup page, if the tests are executed on a properly cleaned plate (as they are now). Resetting the desec tokens is also not necessary anymore with a properly cleaned plate. The desec URLs can now be provided through environment variables. This makes the whole setup simpler and less brittle. Signed-off-by: Pablo Zmdl --- php/tests/seed-desec-mock-config.php | 54 ---------------------------- 1 file changed, 54 deletions(-) delete mode 100644 php/tests/seed-desec-mock-config.php diff --git a/php/tests/seed-desec-mock-config.php b/php/tests/seed-desec-mock-config.php deleted file mode 100644 index 78d27de0..00000000 --- a/php/tests/seed-desec-mock-config.php +++ /dev/null @@ -1,54 +0,0 @@ - - -declare(strict_types=1); - -$apiBase = $argv[1] ?? ''; -$updateUrl = $argv[2] ?? ''; -if ($apiBase === '' || $updateUrl === '') { - fwrite(STDERR, "usage: php seed-desec-mock-config.php \n"); - exit(1); -} - -$password = getenv('AIO_TEST_PASSWORD'); -if ($password === false || $password === '') { - fwrite(STDERR, "AIO_TEST_PASSWORD env var must be set to the master password to seed\n"); - exit(1); -} - -$file = '/mnt/docker-aio-config/data/configuration.json'; -$config = is_file($file) ? json_decode((string)file_get_contents($file), true) : []; -if (!is_array($config)) { - $config = []; -} -$config['desec_api_base'] = $apiBase; -$config['desec_update_url'] = $updateUrl; -$config['password'] = $password; - -// Reset any deSEC state from a previous test run so the registration UI renders again. -unset($config['domain'], $config['desec_email']); -if (isset($config['secrets']) && is_array($config['secrets'])) { - unset($config['secrets']['DESEC_TOKEN'], $config['secrets']['DESEC_PASSWORD']); -} - -file_put_contents($file, json_encode($config, JSON_PRETTY_PRINT)); -echo "Seeded deSEC mock config into $file\n";