# Zeiterfassung # Quasi-Konstanten import os from pathlib import Path import hashlib app_title = "Zeiterfassung" app_version = "0.0.0" # Standardpfade def is_docker(): cgroup = Path('/proc/self/cgroup') return Path('/.dockerenv').is_file() or (cgroup.is_file() and 'docker' in cgroup.read_text()) if is_docker(): scriptpath = "/settings" backupfolder = "/backup" userfolder = "/users" else: scriptpath = str(Path(os.path.dirname(os.path.abspath(__file__))).parent.absolute()) backupfolder = str(os.path.join(scriptpath, "backup")) userfolder = os.path.join(scriptpath, "users") # Dateinamen usersettingsfilename = "settings.json" photofilename = "photo.jpg" va_file = "vacation_application.json" # Status status_in = "eingestempelt" status_out = "ausgestempelt" # Standardadmin Settings: standard_adminsettings = { "admin_user": "admin", "admin_password": "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918", "port": "8090", "secret": "ftgzuhjikg,mt5jn46uzer8sfi9okrmtzjhndfierko5zltjhdgise", "times_on_touchscreen": True, "photos_on_touchscreen": True, "touchscreen": True, "picture_height": 200, "button_height": 300, "user_notes": True, "vacation_application": True, "backup_folder": backupfolder, "backup_api_key": hashlib.shake_256(bytes(backupfolder, 'utf-8')).hexdigest(20), "holidays": { } } # Standard User Settings: standard_usersettings = { "username": "default", "fullname": "Standardbenutzer", "password": "37a8eec1ce19687d132fe29051dca629d164e2c4958ba141d5f4133a33f0688f", "api_key": "1234567890", "workhours": { } } # Abesenheiten absence_entries = {"U": { "name": "Urlaub", "color": "green", "text-color": "black"}, "K": { "name": "Krankheit", "color": "red", "text-color": "white"}, "KK": { "name": "Krankheit Kind", "color": "orange", "text-color": "black"}, "UU": { "name": "Urlaub aus Überstunden", "color": "green", "text-color": "black"}, "F": { "name": "Fortbildung", "color": "black", "text-color": "white"}, "EZ": { "name": "Elternzeit", "color": "purple", "text-color": "white"}, "SO": { "name": "Sonstiges", "color": "pink", "text-color": "white"} } # Styling h1 = "text-5xl font-bold" h2 = "text-4xl font-medium" h3 = "text-3xl font-light" h4 = "text-2xl" # SVGs: no_photo_svg = f''' '''