ebebebasdasd

This commit is contained in:
2025-01-28 17:53:58 +01:00
parent f20e46dc50
commit 8f6eaa8b63
3 changed files with 33 additions and 6 deletions

View File

@@ -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 ## Pre-Installation
1. Installiere Caddy und 1. Installiere Abhängigkeiten.
Debian: sudo apt install caddy Debian-basierte Distributionen: sudo apt install caddy python
Fedora: sudo dnf install caddy
Arch: sudo pacman -S caddy
pip install flask pip install flask sqlite3
2. Editiere die Konfigurationsdatei von Caddy 2. Editiere die Konfigurationsdatei von Caddy
nano /etc/caddy/Caddyfile nano /etc/caddy/Caddyfile

11
index.html Normal file
View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Filehosting Panel</title>
</head>
<body>
</body>
</html>

18
main.py
View File

@@ -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/<string:identifier>")
def downloader(identifier):
return "identifier: " + escape(identifier)