Skip to content

Commit 5e366d8

Browse files
fix: smtp is mistakenly banned.
1 parent c1d66ef commit 5e366d8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/common/utils/tool_code.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@ def init_sandbox_dir():
7373
allow_subprocess = CONFIG.get("SANDBOX_PYTHON_ALLOW_SUBPROCESS", '0')
7474
allow_syscall = CONFIG.get("SANDBOX_PYTHON_ALLOW_SYSCALL", '0')
7575
if banned_hosts:
76-
hostname = socket.gethostname()
77-
local_ip = socket.gethostbyname(hostname)
78-
banned_hosts = f"{banned_hosts},{hostname},{local_ip}"
76+
local_ip = socket.gethostbyname(socket.gethostname())
77+
banned_hosts = f"{banned_hosts},{local_ip}"
7978
with open(sandbox_conf_file_path, "w") as f:
8079
f.write(f"SANDBOX_PYTHON_BANNED_HOSTS={banned_hosts}\n")
8180
f.write(f"SANDBOX_PYTHON_ALLOW_DL_PATHS={','.join(sorted(set(filter(None, sys.path + _sandbox_python_sys_path + allow_dl_paths.split(',')))))}\n")

0 commit comments

Comments
 (0)