كل التوثيق

Environment Variables

Complete reference for all required and optional environment variables for backend and frontend.

محتوى هذه الصفحة متاح حالياً بالإنجليزية فقط.

Backend configuration lives in backend/.env.production. Start from backend/.env.production.example, which lists every supported key with a safe default. The variables below are the ones you must set or are most likely to change.

Application

VariablePurpose
APP_KEYEncryption key. Generate with php artisan key:generate.
APP_URLPublic URL of the API, e.g. https://api.example.com.
PORTAL_URLPublic URL of the admin portal. Also determines the WebAuthn relying party for passkeys.
MARKETING_URLPublic URL of the marketing site, if separate.
APP_DEBUGMust be false in production.
TRUSTED_PROXIESSet to * behind a reverse proxy so client IPs and HTTPS detection are correct.

Database, cache and queue

VariablePurpose
DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORDPostgreSQL connection.
REDIS_HOST, REDIS_PORT, REDIS_PASSWORDRedis for cache, sessions and queues.
QUEUE_CONNECTIONUse redis in production.
QUEUE_TIER_CRITICAL / DEFAULT / LOWQueue names per tier. Workers are sized separately with QUEUE_WORKER_*_PROCS.
SESSION_DRIVER, SESSION_DOMAIN, SESSION_SECURE_COOKIESession storage and cookie scope. Set the domain so the portal and API share a session.

Cross-origin and stateful auth

VariablePurpose
SANCTUM_STATEFUL_DOMAINSComma-separated portal hostnames allowed to hold a session.
CORS_ALLOWED_ORIGINSOrigins permitted to call the API.
تنبيهIf the portal and API are on different subdomains, both must appear in SANCTUM_STATEFUL_DOMAINS and CORS_ALLOWED_ORIGINS, and SESSION_DOMAIN must be the shared parent domain — otherwise sign-in appears to succeed and then immediately drops.

Mail

  • MAIL_MAILER, MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_ENCRYPTION
  • MAIL_FROM_ADDRESS and MAIL_FROM_NAME — the sender your clients see.

Provisioning panels

VariablePurpose
HOSTINVO_PANEL_DRIVERSEnabled drivers, e.g. cpanel,plesk.
HOSTINVO_CPANEL_DEFAULT_PORT, HOSTINVO_CPANEL_TIMEOUT, HOSTINVO_CPANEL_RETRY_TIMEScPanel/WHM API behaviour.
HOSTINVO_PLESK_DEFAULT_PORT, HOSTINVO_PLESK_TIMEOUT, HOSTINVO_PLESK_RETRY_TIMESPlesk API behaviour.
HOSTINVO_PROVISIONING_QUEUEQueue that provisioning jobs are dispatched to.

Payments

VariablePurpose
PAYMENTS_STRIPE_ENABLED, STRIPE_SECRET_KEY, STRIPE_PUBLISHABLE_KEY, STRIPE_WEBHOOK_SECRETStripe gateway.
PAYMENTS_PAYPAL_ENABLED, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PAYPAL_WEBHOOK_ID, PAYPAL_MODEPayPal gateway. PAYPAL_MODE is sandbox or live.
PAYMENT_WEBHOOK_TOLERANCE_SECONDSHow much clock skew a signed webhook may have.

Licensing

VariablePurpose
LICENSING_VERIFICATION_URLLicence authority endpoint.
LICENSING_ALLOW_LOCAL_VALIDATIONPermit offline validation. Leave disabled unless you operate the authority.
LICENSING_AUTHORITY_PUBLIC_KEYEd25519 public key used to verify signed authority responses.

Security and monitoring

VariablePurpose
PASSKEY_RP_IDWebAuthn relying party. Defaults to the portal host; set the shared parent domain if you serve the portal on more than one hostname.
TURNSTILE_VERIFY_URL, TURNSTILE_TIMEOUT_SECONDSCloudflare Turnstile verification. Keys are stored in the database, not here.
MONITORING_METRICS_TOKENBearer token guarding the metrics endpoint.
MONITORING_ALERT_WEBHOOK_URLWhere alerts are POSTed.
BACKUP_ROOT, BACKUP_RETENTION_DAYSBackup destination and retention.

Frontend

VariablePurpose
NEXT_PUBLIC_API_BASE_URLAPI base URL used by the browser, e.g. https://api.example.com/api/v1.
INTERNAL_API_BASE_URLAPI base URL used for server-side rendering. Can be an internal address.
نصيحةAfter changing any backend variable, run php artisan config:cache and restart the app, queue worker and scheduler containers. Cached config is not re-read on its own.