python-api-server/README.md

46 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2023-04-13 14:50:46 +02:00
# python-api-server
2023-04-13 14:21:15 +02:00
2023-11-08 13:24:02 +01:00
[![status-badge](https://ci.mgrote.net/api/badges/5/status.svg)](https://ci.mgrote.net/repos/5)
2023-04-13 15:29:16 +02:00
a small flask-application for storing and downloading stuff like small binaries
2023-04-13 14:50:46 +02:00
## Variables
2023-04-13 14:21:15 +02:00
2023-04-14 07:41:42 +02:00
- ``MAX_CONTENT_LENGTH``: maximal Filesize in MB; defaults to 5MB
- ``UPLOAD_DIRECTORY``: where to store the uploaded files; should be mapped to a volume; defaults to "/uploads"
- ``AUTH_TOKEN``: token used for authenticating
2023-04-13 14:50:46 +02:00
## Example Docker-Compose
```yaml
version: '3'
services:
python-api-server:
container_name: httpd-api
image: quotengrote/python-api-server:v2
ports:
- "5040:5000"
volumes:
- uploads:/uploads
environment:
# FLASK_DEBUG: 1 # for debugging
# FLASK_APP: app # for debugging
MAX_CONTENT_LENGTH: 10
UPLOAD_DIRECTORY: /uploads
AUTH_TOKEN: myuploadtoken
ENABLE_WEBSERVER: true # if enabled a list of files can be viewed in a webbrowser (see screenshot)
2023-04-13 14:50:46 +02:00
volumes:
uploads:
2023-04-14 12:17:08 +02:00
```
### ENABLE_WEBSERVER Screenshot
![](./assets/screenshot_webui.png)
## API-Endpoints
2023-04-14 12:17:08 +02:00
- see [Flasgger](https://github.com/flasgger/flasgger): ``http://<host>:5040/apidocs/``