Skip to content

Commit e483227

Browse files
authored
Merge pull request #17 from ashirrwad/security
Security Constraints
2 parents 3c2553f + ba5822e commit e483227

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Backend/app.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# Starting container
1515
client = docker.from_env()
16-
container = client.containers.run("playground-small", tty=True, detach=True)
16+
container = client.containers.run("playground-small", tty=True, detach=True, network_disabled=True, mem_limit="16g")
1717

1818
# Editing the file with code inside editor
1919
def edit_file(code, input=""):
@@ -49,7 +49,7 @@ def execute_code_in_container():
4949
)
5050
if executable.exit_code == 0:
5151
a = container.exec_run(
52-
'sh -c "cat program_input.txt | ./executed_file.o"', demux=True
52+
'sh -c "cat program_input.txt | timeout 15s ./executed_file.o"', demux=True
5353
)
5454
else:
5555
a = executable

0 commit comments

Comments
 (0)