about summary refs log tree commit diff
path: root/src/config.py
blob: 2aa903250c5204afa7080f277a057ca5b104a27f (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
# generic
LOGGER_PATH = "logs"
BUFFER_LENGTH = 2**16           # 64 KiB
BUFFER_MAX_SIZE = 2**30 * 0.5   # 512 MiB

# threading
CLIENT_MAX_AMOUNT = 2**15       # max requests at once, after which the connections are dropped
CLIENT_MAX_PROCESS = 64         # max processing threads at once

# sockets
SOCKET_TIMEOUT = 10.0
SOCKET_ACK_INTERVAL = 0.005
SOCKET_TIMER = SOCKET_TIMEOUT / SOCKET_ACK_INTERVAL

# API
API_FILE_RANDOM_MIN_SIZE_LIMIT = 1              # 1 byte
API_FILE_RANDOM_MAX_SIZE_LIMIT = 2**30 * 5      # 5 GiB
API_VERSIONS = {
    "APIv1": {"supported": True}
}

# file manager
FILE_MAN_COMPRESSED_PATH = "compress"
FILE_MAN_PATH_MAP = {
    # external
    "/":                {"path": "www/index.html", "compress": True},
    "/about":           {"path": "www/about.html", "compress": True},
    "/testing":         {"path": "www/testing.html", "compress": True},
    "/projects":        {"path": "www/projects.html", "compress": True},
    "/images/*":        {"path": "www/images/*", "compress": False},
    "/scripts/*":       {"path": "www/scripts/*", "compress": True},
    "/robots.txt":      {"path": "www/robots.txt", "compress": False},
    "/favicon.ico":     {"path": "www/favicon.ico", "compress": True},
    "/css/styles.css":  {"path": "www/css/styles.css", "compress": True},

    "/testing/pyscript": {"path": "www/pyscript.html", "compress": True},
}