-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
36 lines (28 loc) · 1.49 KB
/
Copy pathconfig.py
File metadata and controls
36 lines (28 loc) · 1.49 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
"""Application configuration.
Secrets (Flask session key) come from the environment / a local .env file.
Connector credentials (SureMDM / SOTI URLs, API keys, passwords) are NOT stored
here -- they are managed at runtime through the UI and persisted in the database
(see app.models.Connector), exactly as requested.
"""
import os
from dotenv import load_dotenv
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(BASE_DIR, ".env"))
class Config:
SECRET_KEY = os.environ.get("SECRET_KEY", "dev-change-me-in-production")
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DATABASE_URL", "sqlite:///" + os.path.join(BASE_DIR, "migration_tracker.db")
)
SQLALCHEMY_TRACK_MODIFICATIONS = False
# Default admin seeded on first run (change via env or after first login).
ADMIN_USERNAME = os.environ.get("ADMIN_USERNAME", "admin")
ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "changeme")
# Optional pre-fill for the SureMDM endpoint. Left blank by default so the
# app stays tenant-agnostic; each deployment sets its own URL in the UI.
DEFAULT_SUREMDM_URL = os.environ.get("DEFAULT_SUREMDM_URL", "")
# Default regex used to derive a store/location code from a device name,
# e.g. "1654_Kiosk_05" -> "1654". Editable in the UI (Settings).
DEFAULT_STORE_CODE_REGEX = r"^(\d{3,4})"
# A migrated device is considered STALE if it has not checked into SureMDM
# within this many days. Editable in the UI (Settings).
DEFAULT_STALE_DAYS = 14