A rudimentary, lightweight, file send service for your internet server.
%%{init: {"theme": "dark"}}%%
graph LR
subgraph Internet
Client[Client]
DNS["drop.mydomain.com"]
end
subgraph Server
nginx["nginx<br>Reverse Proxy"]
DropService["<code>dropservice:8080</code><br>Python Flask API"]
DropFolder["<code>/srv/drops</code><br/>filesystem"]
end
Client -->|HTTP Upload/Download| DNS
DNS -->|DNS| Server
nginx --> DropService
DropService -->|Read/Write| DropFolder
Copy .env.example to .env and adjust as needed:
cp .env.example .env| Variable | Default | Description |
|---|---|---|
UPLOAD_PATH |
/srv/drops |
Directory where uploads are stored |
PORT |
8080 |
Port the Flask server listens on |
UPLOAD_PASSWORD |
(required) | Password required to upload files |
setup.sh handles everything on a Debian/Ubuntu server: installs dependencies, deploys the app to /opt/dropservice, configures systemd, obtains a TLS certificate via Cloudflare DNS challenge, and sets up nginx.
Prerequisites:
- A Cloudflare API token with Zone → DNS → Edit permission (scoped to the target zone)
DOMAIN=drop.mydomain.com sudo -E ./setup.shThis project uses uv for dependency management:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync
uv run python main.pymkdir -p /srv/drops
chown www-data:www-data /srv/dropsPlace the project at /opt/dropservice, then:
# /etc/systemd/system/drop.service
[Unit]
Description=File drop service
After=network.target
[Service]
WorkingDirectory=/opt/dropservice
EnvironmentFile=/opt/dropservice/.env
ExecStart=/opt/dropservice/.venv/bin/python main.py
Restart=always
User=www-data
[Install]
WantedBy=multi-user.targetsystemctl enable --now dropserver {
listen 80;
server_name drop.mydomain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name drop.mydomain.com;
ssl_certificate /etc/letsencrypt/live/drop.mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/drop.mydomain.com/privkey.pem;
client_max_body_size 0;
proxy_read_timeout 600;
proxy_request_buffering off;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}If you change
PORTin.env, update theproxy_passport accordingly.