"""
WSGI entry point for the biosync licensing portal on cPanel "Setup Python App"
(Phusion Passenger). Point the Python App's Application Root at the folder that
contains this file (the repo root, so `biosync/` and `license_server/` are both
importable). Passenger looks for the `application` callable below.

Set the environment variables (BIOSYNC_LICENSE_PRIVKEY, PAYSTACK_SECRET_KEY, etc.)
in the cPanel app's "Environment variables" panel — never in this file.
"""

import os
import sys

HERE = os.path.dirname(os.path.abspath(__file__))
if HERE not in sys.path:
    sys.path.insert(0, HERE)

from license_server.app import create_app

application = create_app(
    os.environ.get("BIOSYNC_PORTAL_DB", os.path.join(HERE, "portal.db")))
