-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
52 lines (46 loc) · 1.71 KB
/
Copy pathconfig.py
File metadata and controls
52 lines (46 loc) · 1.71 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import os
from pathlib import Path
try:
from dotenv import load_dotenv
except ImportError:
load_dotenv = None
if load_dotenv:
load_dotenv(Path(__file__).with_name(".env"))
else:
env_path = Path(__file__).with_name(".env")
if env_path.exists():
for line in env_path.read_text().splitlines():
line = line.strip()
if not line or line.startswith("#") or "=" not in line:
continue
key, value = line.split("=", 1)
os.environ.setdefault(key.strip(), value.strip().strip("\"'"))
APP_CONFIG = {
"name": "TapAuth",
"version": "1.1.3",
"environment": os.getenv("AIRHUB_ENV", "local"),
"active_storage": os.getenv("AIRHUB_STORAGE", "mysql"),
"firebase_ready": True,
"debug": os.getenv("AIRHUB_DEBUG", "false").lower() == "true",
}
WIFI_CONFIG = {
"ssid": os.getenv("AIRHUB_WIFI_SSID", ""),
"password": os.getenv("AIRHUB_WIFI_PASSWORD", ""),
}
MYSQL_CONFIG = {
"host": os.getenv("AIRHUB_DB_HOST", "localhost"),
"user": os.getenv("AIRHUB_DB_USER", ""),
"password": os.getenv("AIRHUB_DB_PASSWORD", ""),
"database": os.getenv("AIRHUB_DB_NAME", "airhub_db"),
}
FIREBASE_CONFIG = {
"enabled": os.getenv("AIRHUB_FIREBASE_ENABLED", "false").lower() == "true",
"mode": os.getenv("AIRHUB_FIREBASE_MODE", "realtime_db"),
"database_url": os.getenv("AIRHUB_FIREBASE_DATABASE_URL", ""),
"database_secret": os.getenv("AIRHUB_FIREBASE_DATABASE_SECRET", ""),
"project_id": os.getenv("AIRHUB_FIREBASE_PROJECT_ID", ""),
"root": os.getenv("AIRHUB_FIREBASE_ROOT", "tapauth").strip("/") or "tapauth",
}
ACCESS_CONFIG = {
"admin_code": os.getenv("TAPAUTH_ADMIN_CODE", os.getenv("AIRHUB_REGISTRATION_CODE", "")),
}