forked from phoenix/litellm-mirror
fix - setting env vars on proxy
This commit is contained in:
parent
3a8cd306e3
commit
e90645bd5d
1 changed files with 8 additions and 3 deletions
|
@ -2496,9 +2496,14 @@ class ProxyConfig:
|
||||||
# we need to set env variables too
|
# we need to set env variables too
|
||||||
environment_variables = config_data.get("environment_variables", {})
|
environment_variables = config_data.get("environment_variables", {})
|
||||||
for k, v in environment_variables.items():
|
for k, v in environment_variables.items():
|
||||||
decoded_b64 = base64.b64decode(v)
|
try:
|
||||||
value = decrypt_value(value=decoded_b64, master_key=master_key)
|
decoded_b64 = base64.b64decode(v)
|
||||||
os.environ[k] = value
|
value = decrypt_value(value=decoded_b64, master_key=master_key)
|
||||||
|
os.environ[k] = value
|
||||||
|
except Exception as e:
|
||||||
|
verbose_proxy_logger.error(
|
||||||
|
"Error setting env variable: %s - %s", k, str(e)
|
||||||
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
verbose_proxy_logger.error(
|
verbose_proxy_logger.error(
|
||||||
"{}\nTraceback:{}".format(str(e), traceback.format_exc())
|
"{}\nTraceback:{}".format(str(e), traceback.format_exc())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue