# ============================================================ # Liara Environment Variables — ClinicPro (Docker, single app) # ------------------------------------------------------------ # Liara does NOT support docker-compose. The whole app (web + both message # consumers) runs as ONE Docker app via Supervisor (docker/supervisord.conf). # MariaDB and Redis are SEPARATE Liara managed services on the PRIVATE NETWORK. # # Set these in the Liara console (Environment tab) or via the CLI: # liara env set KEY=VALUE --app clinicpro-api # Build/deploy config (platform, port, disks, healthcheck) lives in liara.json. # ============================================================ APP_ENV=prod APP_DEBUG=0 # ── Secrets (REQUIRED — set before the first deploy) ── APP_SECRET= # php -r "echo bin2hex(random_bytes(32));" JWT_PASSPHRASE= # openssl rand -hex 32 (JWT keypair is generated with it on first boot) # ── Database / Redis (point at the Liara MANAGED services via PRIVATE hostnames) ── # Create a MariaDB 11.8 service + a Redis service in Liara, enable private network, # put both + this app on the SAME private network, then copy their private hosts here. # serverVersion MUST match the MariaDB service (11.8). DATABASE_URL="mysql://:@:3306/?serverVersion=mariadb-11.8.0&charset=utf8mb4" REDIS_URL="redis://:6379" MESSENGER_TRANSPORT_DSN="redis://:6379/messages" # If the Redis service has a password: redis://:@:6379 # ── JWT key paths (keys live on the persistent 'jwt' disk, see liara.json) ── JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem # ── Backend's own domain (API host — used for payment callbacks & absolute URLs) ── APP_BASE_URL=https:// DEFAULT_URI=https:// # ── Reverse proxy (Liara router) — trust X-Forwarded-* from the private ranges ── TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,127.0.0.1 # ── Frontend domains (MANY) — GENERATED from docker/frontend-domains.json ── # To add/remove a city domain: edit that file, then run: # ddev exec php docker/gen-cors-env.php (or: php docker/gen-cors-env.php on the server) # and paste the new output into both vars below. CORS_ALLOW_ORIGIN='^https://(ahvaz\-nobat\.ir|arak\-nobat\.ir|ardabil\-nobat\.ir|bandar\-nobat\.ir|behbahan\-nobat\.ir|birjand\-nobat\.ir|bojnord\-nobat\.ir|bushehr\-nobat\.ir|dehdasht\-nobat\.ir|esf\-nobat\.ir|golestan\-nobat\.ir|hamadan\-nobat\.ir|ilam\-nobat\.ir|karaj\-nobat\.ir|kerman\-nobat\.ir|kermanshah\-nobat\.ir|lorestan\-nobat\.ir|mashhad\-nobat\.ir|nobat724\.com|qazvin\-nobat\.ir|qom\-nobat\.ir|rasht\-nobat\.ir|sanandaj\-nobat\.ir|sari\-nobat\.ir|semnan\-nobat\.ir|shiraz\-nobat\.ir|shkord\-nobat\.ir|tabriz\-nobat\.ir|tehran\-nobat\.ir|urmia\-nobat\.ir|yasuj\-nobat\.ir|yazd\-nobat\.ir|zahedan\-nobat\.ir|zanjan\-nobat\.ir)$' ALLOWED_FRONTEND_HOSTS=ahvaz-nobat.ir,arak-nobat.ir,ardabil-nobat.ir,bandar-nobat.ir,behbahan-nobat.ir,birjand-nobat.ir,bojnord-nobat.ir,bushehr-nobat.ir,dehdasht-nobat.ir,esf-nobat.ir,golestan-nobat.ir,hamadan-nobat.ir,ilam-nobat.ir,karaj-nobat.ir,kerman-nobat.ir,kermanshah-nobat.ir,lorestan-nobat.ir,mashhad-nobat.ir,nobat724.com,qazvin-nobat.ir,qom-nobat.ir,rasht-nobat.ir,sanandaj-nobat.ir,sari-nobat.ir,semnan-nobat.ir,shiraz-nobat.ir,shkord-nobat.ir,tabriz-nobat.ir,tehran-nobat.ir,urmia-nobat.ir,yasuj-nobat.ir,yazd-nobat.ir,zahedan-nobat.ir,zanjan-nobat.ir # ── api.ir identity inquiry (Shahkar + IbanMatch) ── # Empty token => fail-closed (representative verification is rejected). API_IR_BASE_URL=https://s.api.ir API_IR_TOKEN= # ── Fixed app params (same values as the compose stack) ── REFRESH_TOKEN_TTL=2592000 OTP_TTL=1200 MAX_FILE_SIZE_BYTES=5242880 UPLOAD_DIR=var/uploads # ── Notes ── # • Do NOT set RUN_INIT — entrypoint.sh defaults it to 1, and this is a single app, # so JWT keygen + doctrine migrations run once on boot (correct). # • Kavenegar API key is read ONLY from env — set KAVENEGAR_API_KEY below. # • Payment gateway keys (mellat/sep) are read from the DB ("Site Settings"), NOT from env. # • Liara exposes only ONE external HTTP port (8080, from liara.json). MariaDB/Redis # are reachable on the private network only.