build: 屏蔽敏感环境变量

This commit is contained in:
shaohuzhang1 2024-09-26 16:20:40 +08:00 committed by 刘瑞斌
parent 52e883c65c
commit 677ce46b49

View File

@ -47,6 +47,11 @@ class FunctionExecutor:
path = r'' + self.sandbox_path + ''
_exec_code = f"""
try:
import os
env = dict(os.environ)
for key in list(env.keys()):
if key in os.environ and (key.startswith('MAXKB') or key.startswith('POSTGRES') or key.startswith('PG')):
del os.environ[key]
locals_v={'{}'}
keywords={keywords}
globals_v=globals()