aboutsummaryrefslogtreecommitdiff
path: root/hex-zero.py
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-12-09 20:30:40 -0500
committerB Stack <bgstack15@gmail.com>2020-12-09 20:30:40 -0500
commit260c70e3173f3595fa183612c8641c6da36de572 (patch)
tree150f97296c0ee28bc846c3a81ce124186901c38b /hex-zero.py
parentadd some example files, and experimental logging (diff)
downloadhex-zero-260c70e3173f3595fa183612c8641c6da36de572.tar.gz
hex-zero-260c70e3173f3595fa183612c8641c6da36de572.tar.bz2
hex-zero-260c70e3173f3595fa183612c8641c6da36de572.zip
use uwsgi!
apparently uwsgi_python3 is the useful binary in Devuan
Diffstat (limited to 'hex-zero.py')
-rwxr-xr-xhex-zero.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/hex-zero.py b/hex-zero.py
index a93ebe0..81c8169 100755
--- a/hex-zero.py
+++ b/hex-zero.py
@@ -312,7 +312,6 @@ def store_url(url, addr):
@app.route("/<path:path>")
def get(path):
- app.logger.info("next source: {0}".format(str(request.environ["HTTP_X_FORWARDED_FOR"])))
p = os.path.splitext(path)
id = su.debase(p[0])
@@ -349,7 +348,6 @@ def get(path):
@app.route("/dump_files/")
@app.route("/dump_files/<int:start>")
def dump_files(start=0):
- app.logger.info("next source: {0}".format(str(request.environ["HTTP_X_FORWARDED_FOR"])))
meta = "#FORMAT: BEACON\n#PREFIX: {}/\n\n".format(fhost_url("https"))
def gen():
@@ -363,7 +361,6 @@ def dump_files(start=0):
@app.route("/dump_urls/")
@app.route("/dump_urls/<int:start>")
def dump_urls(start=0):
- app.logger.info("next source: {0}".format(str(request.environ["HTTP_X_FORWARDED_FOR"])))
meta = "#FORMAT: BEACON\n#PREFIX: {}/\n\n".format(fhost_url("https"))
def gen():
@@ -381,7 +378,6 @@ def dump_urls(start=0):
@app.route("/", methods=["GET", "POST"])
def fhost():
- app.logger.info("next source: {0}".format(str(request.environ["HTTP_X_FORWARDED_FOR"])))
if request.method == "POST":
out = None
@@ -397,6 +393,7 @@ def fhost():
out = shorten(request.form["shorten"])
if not out == None:
+ app.logger.info("Stored file: "+str(out.strip()))
return Response(out, mimetype="text/plain")
abort(400)
@@ -422,7 +419,6 @@ def fhost():
@app.route("/robots.txt")
def robots():
- app.logger.info("next source: {0}".format(str(request.environ["HTTP_X_FORWARDED_FOR"])))
return """User-agent: *
Disallow: /
"""
bgstack15