From e22a0e519a6a58f94a0db035aa4416f207e8ffff Mon Sep 17 00:00:00 2001 From: Jakub Szymsza Date: Tue, 22 Oct 2024 19:10:38 +0200 Subject: [PATCH 01/12] Fix code highlighting modes and add new .py filetype --- bci/web/vue/src/components/poc-editor.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bci/web/vue/src/components/poc-editor.vue b/bci/web/vue/src/components/poc-editor.vue index 7bac6b8e..df83d875 100644 --- a/bci/web/vue/src/components/poc-editor.vue +++ b/bci/web/vue/src/components/poc-editor.vue @@ -1,5 +1,8 @@ + + \ No newline at end of file diff --git a/experiments/pages/Support/PythonServer/a.test/server/index.py b/experiments/pages/Support/PythonServer/a.test/server/index.py index 0519ecba..d66d9d75 100644 --- a/experiments/pages/Support/PythonServer/a.test/server/index.py +++ b/experiments/pages/Support/PythonServer/a.test/server/index.py @@ -1 +1 @@ - \ No newline at end of file +xyz \ No newline at end of file From 6c23ec9326ccb0a7fd2b3f13e87bc92e21196512 Mon Sep 17 00:00:00 2001 From: Jakub Szymsza Date: Wed, 23 Oct 2024 18:20:22 +0200 Subject: [PATCH 06/12] Basic python directory proxying --- bci/web/blueprints/experiments.py | 11 +++++++++++ .../pages/Support/PythonServer/a.test/main/index.html | 2 +- .../a.test/{server => py-server}/headers.json | 0 .../a.test/{server => py-server}/index.py | 0 nginx/config/experiments.conf | 8 ++++++++ 5 files changed, 20 insertions(+), 1 deletion(-) rename experiments/pages/Support/PythonServer/a.test/{server => py-server}/headers.json (100%) rename experiments/pages/Support/PythonServer/a.test/{server => py-server}/index.py (100%) diff --git a/bci/web/blueprints/experiments.py b/bci/web/blueprints/experiments.py index 96297cc1..e643acf3 100644 --- a/bci/web/blueprints/experiments.py +++ b/bci/web/blueprints/experiments.py @@ -137,5 +137,16 @@ def report_leak_if_contains(expected_header_name: str, expected_header_value: st ) +@exp.route("////") +def python_evaluation(project: str, experiment: str, directory: str): + """ + Evaluates the python script and returns its result. + """ + host = request.host.lower() + + logger.warning(f"Received evaluation request '{host}' - '{project}' - '{experiment}' - '{directory}'") + return f"Received evaluation request '{host}' - '{project}' - '{experiment}' - '{directory}'" + + def get_all_bughog_GET_parameters(request): return {k: v for k, v in request.args.items() if k.startswith("bughog_")} diff --git a/experiments/pages/Support/PythonServer/a.test/main/index.html b/experiments/pages/Support/PythonServer/a.test/main/index.html index 1c03b6c5..e2d4e786 100644 --- a/experiments/pages/Support/PythonServer/a.test/main/index.html +++ b/experiments/pages/Support/PythonServer/a.test/main/index.html @@ -2,7 +2,7 @@