"""BG Remover Web - settings.  Edit this file on the server, then restart the Python app in cPanel."""
import os

BASE = os.path.dirname(os.path.abspath(__file__))

# ---- secrets (keep private!). They are DIFFERENT on purpose:
#      APP_KEY   -> goes inside the desktop app (app.py), so customers could read it. It can only activate/check.
#      ADMIN_KEY -> only in keygen.py on YOUR computer. It can create / delete licenses.
ADMIN_KEY = "-Ugm2F05n_B412M00Q5qxHnC1hi_9ASu"
APP_KEY = "jQ9rC8PWdN5LCQG2mh9LHpAH4Tga7Yv0"

# ---- licensing ----
EXPIRY_TZ_HOURS = 6          # Bangladesh (UTC+6). A license is valid through the whole expiry day.
TRIAL_HOURS = 24             # free trial length
TRIALS_PER_IP = 5            # max NEW web trials from one IP address per 30 days (0 = no limit)
BUY_URL = ""                 # default "Buy License" link (can also be changed from the admin API / manage.py)

# ---- image processing ----
MAX_SIDE = 2500              # bigger images are shrunk to this many pixels on the long side (saves RAM)
MAX_UPLOAD_MB = 25
MAX_PIXELS = 50_000_000
JOB_TTL = 3600               # temporary result files are deleted after this many seconds
ONNX_THREADS = 2             # CPU threads used by the AI model
ENGINE = "auto"              # "auto" (rembg if installed, else built-in onnxruntime) | "rembg" | "onnx"

# ---- folders ----
DATA_DIR = os.path.join(BASE, "data")
DB_PATH = os.path.join(DATA_DIR, "licenses.db")
JOBS_DIR = os.path.join(DATA_DIR, "jobs")
MODELS_DIR = os.path.join(BASE, "models")     # put u2net.onnx, u2net_human_seg.onnx, isnet-general-use.onnx here
