diff --git a/README.md b/README.md index b4d57a9..9ff4b1b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ -Dieses Projekt demonstriert die Umsetzung eines einfaches Dienstes mit Python 3, Flask und Caddy welches ermöglicht das Hochladen/Herunterladen von Dateien über Weboberfläche oder API. +Dieses Projekt demonstriert die Umsetzung eines einfaches Dienstes mit Python 3, Flask, sqlite3 und Caddy welches ermöglicht das Hochladen/Herunterladen von Dateien über Weboberfläche oder API. ## Pre-Installation -1. Installiere Caddy und - Debian: sudo apt install caddy - Fedora: sudo dnf install caddy - Arch: sudo pacman -S caddy +1. Installiere Abhängigkeiten. + Debian-basierte Distributionen: sudo apt install caddy python - pip install flask + pip install flask sqlite3 2. Editiere die Konfigurationsdatei von Caddy nano /etc/caddy/Caddyfile diff --git a/index.html b/index.html new file mode 100644 index 0000000..b7ae71f --- /dev/null +++ b/index.html @@ -0,0 +1,11 @@ + + + + + + Filehosting Panel + + + + + \ No newline at end of file diff --git a/main.py b/main.py index e69de29..b0b5b9f 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,18 @@ +from flask import send_file, Flask +#from werkzeug.middleware.proxy_fix import ProxyFix +from markupsafe import escape + +app = Flask(__name__) +#app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1) + +@app.route("/") +def mainpage(): + return "no i chuj" + +@app.route("/upload") +def uploader(): + return "ebebe" + +@app.route("/download/") +def downloader(identifier): + return "identifier: " + escape(identifier) \ No newline at end of file