aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 7e15515dd9091d5909015874b1e46a8a6b7366be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# python-api-server

[![status-badge](https://ci.mgrote.net/api/badges/5/status.svg)](https://ci.mgrote.net/repos/5)

a small flask-application for storing and downloading stuff like small binaries

## Variables

- ``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

## 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)

volumes:
  uploads:

```

### ENABLE_WEBSERVER Screenshot


![](./assets/screenshot_webui.png)

## API-Endpoints

- see [Flasgger](https://github.com/flasgger/flasgger): ``http://<host>:5040/apidocs/``