config.py
Python script, ASCII text executable
1import os 2from dotenv import load_dotenv 3load_dotenv("secrets.env") 4 5DB_PASSWORD = os.environ.get("DB_PASSWORD") 6DB_URI = f"postgresql://root:{DB_PASSWORD}@localhost/roundabout" 7 8REPOS_PATH = "./repos" 9USERDATA_PATH = "./userdata" 10DEFAULT_AVATARS_PATH = "./defaultAvatars" 11BASE_DOMAIN = "localhost" 12SERVER_IPS = {"127.0.0.1", "localhost", "0.0.0.0"} 13AUTH_REALM = "roundabout" 14 15AVATAR_SIZE = (192, 192) 16 17HASHING_ROUNDS = 11 18RESERVED_NAMES = ("git", "settings", "logout", "accounts", "info", "alerts", "notifications", "about", "newrepo") 19 20locking = False 21 22folderIcon = "mdi:folder" 23unknownIcon = "mdi:file" 24fileIcons = { 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 113def matchIcon(name): 114if name.startswith(("LICENCE", "LICENSE", "COPYING")): 115return "ic:gavel" 116if name.startswith("README"): 117return "mdi:book-information-variant" 118if name.startswith(".gitignore"): 119return "simple-icons:git" 120