aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xapp.py (renamed from cgi-bin/get.py)0
-rwxr-xr-xcgi-bin/get.sh17
-rwxr-xr-xserver.py4
3 files changed, 2 insertions, 19 deletions
diff --git a/cgi-bin/get.py b/app.py
index e852561..e852561 100755
--- a/cgi-bin/get.py
+++ b/app.py
diff --git a/cgi-bin/get.sh b/cgi-bin/get.sh
deleted file mode 100755
index ea4f4ce..0000000
--- a/cgi-bin/get.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-
-set -o errexit -o nounset -o pipefail
-
-script_dir="$( dirname -- "${BASH_SOURCE[0]}" )"
-script_dir="$( cd -- "$script_dir" && pwd )"
-readonly script_dir
-
-# Python's http.server runs CGI scripts under user nobody.
-# This is not what we want unfortunately.
-# The best solution I could find so far is to create an entry in
-# /etc/sudoers.d, allowing the nobody user to run the real scripts w/ sudo.
-if [ "$( id --user --name )" == nobody ]; then
- sudo --non-interactive --preserve-env "$script_dir/get.py"
-else
- "$script_dir/get.py"
-fi
diff --git a/server.py b/server.py
index 9533be7..24ee72a 100755
--- a/server.py
+++ b/server.py
@@ -7,10 +7,10 @@
import http.server
-from get import Request
+from app import Request
-class RequestHandler(http.server.CGIHTTPRequestHandler):
+class RequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
try:
request = Request.from_http_path(self.path)