By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 config.py

View raw Download
text/x-script.python • 4.39 kiB
Python script, ASCII text executable
        
            
1
import os
2
from dotenv import load_dotenv
3
load_dotenv("secrets.env")
4
5
DB_PASSWORD = os.environ.get("DB_PASSWORD")
6
DB_URI = f"postgresql://root:{DB_PASSWORD}@localhost/gitme"
7
8
REPOS_PATH = "./repos"
9
USERDATA_PATH = "./userdata"
10
DEFAULT_AVATARS_PATH = "./defaultAvatars"
11
BASE_DOMAIN = "localhost"
12
SERVER_IPS = {"127.0.0.1", "localhost", "0.0.0.0"}
13
AUTH_REALM = "roundabout"
14
15
AVATAR_SIZE = (192, 192)
16
17
HASHING_ROUNDS = 16
18
RESERVED_NAMES = ("git", "settings", "logout", "accounts", "info", "alerts", "notifications", "about",)
19
20
locking = False
21
22
folderIcon = "mdi:folder"
23
unknownIcon = "mdi:file"
24
fileIcons = {
25
"text/plain": "ic:baseline-text-snippet",
26
"text/css": "simple-icons:css3",
27
"text/csv": "mdi:table",
28
"text/html": "simple-icons:html5",
29
"text/calendar": "mdi:calendar",
30
"text/javascript": "simple-icons:javascript",
31
"text/xml": "mdi:xml",
32
"text/markdown": "simple-icons:markdown",
33
34
"application/octet-stream": "mdi:numeric-10-box",
35
"application/x-abiword": "mdi:file-document",
36
"application/x-msword": "mdi:file-document",
37
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "mdi:file-document",
38
"application/vnd.oasis.opendocument.text": "mdi:file-document",
39
"application/rtf": "mdi:file-document",
40
"application/x-dvi": "mdi:file-document",
41
"application/epub+zip": "mdi:book-open-variant",
42
"application/pdf": "mdi:book-open-variant",
43
"application/x-freearc": "mdi:archive",
44
"application/x-bzip": "mdi:archive",
45
"application/x-bzip2": "mdi:archive",
46
"application/gzip": "mdi:archive",
47
"application/x-tar": "mdi:archive",
48
"application/zip": "mdi:archive",
49
"application/x-7z-compressed": "mdi:archive",
50
"application/vnd.rar": "mdi:archive",
51
"application/x-rar-compressed": "mdi:archive",
52
"application/java-archive": "simple-icons:openjdk",
53
"application/vnd.amazon.ebook": "mdi:cellphone-text",
54
"application/x-cdf": "mdi:disc-player",
55
"application/x-csh": "ic:baseline-terminal",
56
"application/x-sh": "ic:baseline-terminal",
57
"application/xml": "mdi:xml",
58
"application/json": "mdi:code-json",
59
"application/ld+json": "mdi:code-json",
60
"application/vnd.apple.installer+xml": "simple-icons:apple",
61
"application/vnd.oasis.opendocument.presentation": "mdi:presentation",
62
"application/vnd.ms-powerpoint": "mdi:presentation",
63
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "mdi:presentation",
64
"application/vnd.oasis.opendocument.spreadsheet": "mdi:table-large",
65
"application/vnd.ms-excel": "mdi:table-large",
66
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "mdi:table-large",
67
"application/x-httpd-php": "mdi:server",
68
"application/xhtml+xml": "simple-icons:html5",
69
"application/vnd.android.package-archive": "bi:android2",
70
"application/x-x509-ca-cert": "mdi:certificate",
71
"application/x-shockwave-flash": "simple-icons:adobe",
72
"application/font-woff": "mdi:format-text",
73
"application/x-font-truetype": "mdi:format-text",
74
"application/x-font-opentype": "mdi:format-text",
75
"application/vnd.ms-fontobject": "mdi:format-text",
76
77
"audio/aac": "mdi:music",
78
"audio/mp3": "mdi:music",
79
"audio/ogg": "mdi:music",
80
"audio/opus": "mdi:music",
81
"audio/wav": "mdi:music",
82
"audio/webm": "mdi:music",
83
"audio/3gpp": "mdi:music",
84
"audio/3gpp2": "mdi:music",
85
"audio/midi": "mdi:piano",
86
"audio/x-midi": "mdi:piano",
87
"audio/flac": "mdi:music",
88
"audio/x-ms-wma": "mdi:music",
89
90
"image/avif": "mdi:image",
91
"image/jpeg": "mdi:image",
92
"image/png": "mdi:image",
93
"image/tiff": "mdi:image",
94
"image/webp": "mdi:image",
95
"image/gif": "mdi:image-multiple",
96
"image/vnd.microsoft.icon": "mdi:bookmark-multiple",
97
"image/x-icon": "simple-icons:windowsxp",
98
"image/bmp": "mdi:brush",
99
"image/svg+xml": "mdi:vector-curve",
100
101
"video/mp4": "mdi:video",
102
"video/mpeg": "mdi:video",
103
"video/ogg": "mdi:video",
104
"video/webm": "mdi:video",
105
"video/3gpp": "mdi:video",
106
"video/3gpp2": "mdi:video",
107
"video/x-flv": "mdi:video",
108
"video/mp2t": "ic:baseline-live-tv",
109
"video/x-msvideo": "mdi:video-vintage",
110
}
111
112
113
def matchIcon(name):
114
if name.startswith(("LICENCE", "LICENSE", "COPYING")):
115
return "ic:gavel"
116
if name.startswith("README"):
117
return "mdi:book-information-variant"
118
if name.startswith(".gitignore"):
119
return "simple-icons:git"
120