From b611418e33c76e388a236b38317c111390d2e26b Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 15 Jan 2026 13:46:00 -0600 Subject: [PATCH] fix for settings on boot --- bin/neuron | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bin/neuron b/bin/neuron index acd18e8..74aea0a 100755 --- a/bin/neuron +++ b/bin/neuron @@ -48,19 +48,28 @@ if( version_compare( PHP_VERSION, '8.4.0', '<' ) ) } // Load configuration if available +// Use SettingManagerFactory to load environment-specific configs and encrypted secrets $settings = null; $configPaths = [ - getcwd() . '/config/neuron.yaml', - getcwd() . '/neuron.yaml', + getcwd() . '/config', + getcwd(), ]; foreach( $configPaths as $configPath ) { - if( file_exists( $configPath ) ) + $neuronYaml = $configPath . '/neuron.yaml'; + + if( file_exists( $neuronYaml ) ) { try { - $settings = new \Neuron\Data\Settings\Source\Yaml( $configPath ); + // Use SettingManagerFactory to load all configuration layers: + // - Base config (neuron.yaml) + // - Environment-specific config (environments/{env}.yaml) + // - Base secrets (secrets.yml.enc) + // - Environment-specific secrets (environments/{env}.secrets.yml.enc) + // - .env variables (fallback) + $settings = \Neuron\Data\Settings\SettingManagerFactory::create( null, $configPath ); break; } catch( \Exception $e )