MCPcopy Create free account
hub / github.com/Noumena-Network/code / applyConfigEnvironmentVariables

Function applyConfigEnvironmentVariables

src/utils/managedEnv.ts:228–248  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226 * dangerous environment variables such as LD_PRELOAD, PATH, etc.
227 */
228export function applyConfigEnvironmentVariables(): void {
229 Object.assign(process.env, filterSettingsEnv(getGlobalConfig().env))
230
231 for (const source of SETTINGS_ENV_APPLICATION_ORDER) {
232 if (source !== 'flagSettings' && source !== 'policySettings') {
233 if (!isSettingSourceEnabled(source)) continue
234 }
235 Object.assign(
236 process.env,
237 filterSettingsEnv(getSettingsForSource(source)?.env, source),
238 )
239 }
240
241 // Clear caches so agents are rebuilt with the new env vars
242 clearCACertsCache()
243 clearMTLSCache()
244 clearProxyCache()
245
246 // Reconfigure proxy/mTLS agents to pick up any proxy env vars from settings
247 configureGlobalAgents()
248}

Callers 4

showSetupScreensFunction · 0.85
runFunction · 0.85
onChangeAppStateFunction · 0.85

Calls 8

filterSettingsEnvFunction · 0.85
isSettingSourceEnabledFunction · 0.85
getSettingsForSourceFunction · 0.85
clearCACertsCacheFunction · 0.85
clearMTLSCacheFunction · 0.85
clearProxyCacheFunction · 0.85
configureGlobalAgentsFunction · 0.85
getGlobalConfigFunction · 0.70

Tested by

no test coverage detected