added gitea activity for fun
This commit is contained in:
@@ -129,6 +129,30 @@ VITE_DEV_SERVER = os.environ.get('VITE_DEV_SERVER', 'http://localhost:5173')
|
||||
VITE_USE_DEV_SERVER = os.environ.get('VITE_USE_DEV_SERVER', str(DEBUG)).lower() in {'1', 'true', 'yes'}
|
||||
VITE_MANIFEST_PATH = BASE_DIR / 'planner' / 'static' / 'planner' / 'dist' / '.vite' / 'manifest.json'
|
||||
|
||||
# Optional Gitea contribution grid on the task dashboard. Read only these
|
||||
# values from the repository's ignored .env file; the process environment wins.
|
||||
def _gitea_env(name, default=''):
|
||||
if name in os.environ:
|
||||
return os.environ[name]
|
||||
env_file = BASE_DIR.parent / '.env'
|
||||
try:
|
||||
lines = env_file.read_text(encoding='utf-8').splitlines()
|
||||
except FileNotFoundError:
|
||||
return default
|
||||
for line in lines:
|
||||
key, separator, value = line.strip().partition('=')
|
||||
if separator and key.strip() == name:
|
||||
value = value.strip()
|
||||
if len(value) >= 2 and value[0] == value[-1] and value[0] in {'"', "'"}:
|
||||
value = value[1:-1]
|
||||
return value
|
||||
return default
|
||||
|
||||
|
||||
GITEA_BASE_URL = _gitea_env('GITEA_BASE_URL', 'https://git.jorendegraaf.eu').rstrip('/')
|
||||
GITEA_USERNAME = _gitea_env('GITEA_USERNAME').strip()
|
||||
GITEA_TOKEN = _gitea_env('GITEA_TOKEN').strip()
|
||||
|
||||
LOGIN_URL = 'planner:login'
|
||||
LOGIN_REDIRECT_URL = 'planner:task-list'
|
||||
LOGOUT_REDIRECT_URL = 'planner:login'
|
||||
|
||||
Reference in New Issue
Block a user