Skip to content

API .env ​

Every key and secret the API uses comes from .env, read through files in config/. Admin pages show whether keys are set, but you change them here. After editing .env in production, run php artisan config:cache and php artisan queue:restart.

.env.example in the repository has every key below with its default.

App ​

KeyDefaultWhat it does
APP_NAMELaravelName in emails and notifications.
APP_ENVlocalproduction on live servers.
APP_KEYEncryption key. Create it with php artisan key:generate.
APP_DEBUGtrueMust be false in production.
APP_URLhttp://localhostThe API's public address. File and placeholder image links are built from it.
ASSET_URLAPP_URLWhere placeholder images in public/defaults are served from, if not APP_URL.
FRONTEND_URLhttps://collab.toneflix.ngThe app's public address. Used for links in emails and push, push icons, and the Freesound callback.
APP_TIMEZONEUTC
LOG_LEVELdebugUse error or warning in production.

Database ​

PostgreSQL is the one we test on. MySQL/MariaDB and SQLite also work.

KeyDefault
DB_CONNECTIONpgsql
DB_HOST127.0.0.1
DB_PORT5432
DB_DATABASEtoneflix_collab
DB_USERNAMEpostgres
DB_PASSWORD

Queue, cache and sessions ​

KeyDefaultWhat it does
QUEUE_CONNECTIONdatabasedatabase or redis. Never sync in production; AI jobs and the sound sync would run inside web requests.
DB_QUEUE_RETRY_AFTER3700Seconds before a job that is still running is handed to another worker. Keep it above the longest job. See Production deploy.
REDIS_QUEUE_RETRY_AFTER3700The same, for the Redis queue.
CACHE_STOREdatabase
SESSION_DRIVERdatabase
REDIS_HOST, REDIS_PORT, REDIS_PASSWORDOnly when Redis is used.

Storage ​

KeyDefaultWhat it does
FILESYSTEM_DISKlocallocal, or s3 for Amazon S3 and S3-compatible stores (R2, MinIO, Spaces).
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEYBucket credentials.
AWS_DEFAULT_REGIONus-east-1
AWS_BUCKET
AWS_ENDPOINTFor S3-compatible stores, for example https://<account>.r2.cloudflarestorage.com.
AWS_URLPublic address of the bucket, when it differs from the default.
AWS_USE_PATH_STYLE_ENDPOINTfalsetrue for MinIO.
FILEABLE_TEMPORARY_URLStrueSign file links, for private buckets. false gives plain bucket URLs.
FILEABLE_TEMPORARY_URL_TTL60Minutes a signed link lasts.

Audio ​

KeyDefaultWhat it does
FFMPEG_BINARIESffmpegPath to FFmpeg. It needs Chromaprint for copied-audio detection.
FFPROBE_BINARIESffprobePath to ffprobe.
FFMPEG_TEMPORARY_FILES_ROOTsystem tempScratch folder for encoding.
AUDIO_ENCODING_CODECempty (libfdk_aac)Set aac when FFmpeg has no libfdk_aac, like Ubuntu's package.

See FFmpeg and Chromaprint.

Mail ​

Standard Laravel mail settings: MAIL_MAILER (log locally, smtp or another mailer in production), MAIL_HOST, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD, MAIL_ENCRYPTION, MAIL_FROM_ADDRESS, MAIL_FROM_NAME.

Realtime ​

The driver is chosen on the admin Realtime page, which starts from REALTIME_DRIVER. Only the chosen driver's keys are needed. See Realtime.

KeyDefaultWhat it does
REALTIME_DRIVERnonenone, reverb, pusher, ably or firebase.
BROADCAST_CONNECTIONlogLaravel's default connection. The realtime driver replaces it at runtime, so leave it.

Reverb

KeyDefaultWhat it does
REVERB_APP_ID, REVERB_APP_KEY, REVERB_APP_SECRETAny values you choose. The key is sent to browsers; the secret stays on the server.
REVERB_HOSTlocalhostPublic host of the Reverb server. Used by the API to send events and by browsers to connect.
REVERB_PORT8080Public port, 443 behind TLS.
REVERB_SCHEMEhttphttps behind TLS.
REVERB_SERVER_HOST0.0.0.0Address reverb:start listens on.
REVERB_SERVER_PORT8080Port reverb:start listens on.

Pusher

PUSHER_APP_ID, PUSHER_APP_KEY, PUSHER_APP_SECRET, PUSHER_APP_CLUSTER (default mt1). PUSHER_HOST, PUSHER_PORT and PUSHER_SCHEME are optional overrides.

Ably

ABLY_KEY, the full API key (appId.keyId:secret). Ably is used through its Pusher protocol.

Firebase Realtime Database

KeyWhat it does
FIREBASE_CREDENTIALSThe service account, as a path to its JSON file or the JSON itself. The API uses it to write events.
FIREBASE_DATABASE_URLhttps://<project>-default-rtdb.firebaseio.com
FIREBASE_API_KEYWeb API key, sent to browsers.
FIREBASE_PROJECT_IDProject id, sent to browsers.
FIREBASE_APP_IDOptional web app id.

Payments and payouts ​

See Payment providers for webhooks and dashboard settings.

KeyWhat it does
PAYSTACK_PUBLIC_KEYpk_.... Sent to the app for checkout.
PAYSTACK_SECRET_KEYsk_.... Charges, transfers and webhook signatures.
FLUTTERWAVE_SECRET_KEYFlutterwave payouts.
FLUTTERWAVE_WEBHOOK_HASHThe secret hash set on Flutterwave's webhook page.
STRIPE_SECRET_KEYStripe Connect payouts.
STRIPE_CONNECT_SECRET_KEYOptional separate key for Connect. STRIPE_SECRET_KEY is used when empty.
STRIPE_WEBHOOK_SECRETwhsec_..., the endpoint's signing secret.

Sounds ​

KeyDefaultWhat it does
FREESOUND_CLIENT_IDFrom your API app at freesound.org/apiv2/apply.
FREESOUND_CLIENT_SECRETThe app's secret, which is also its API key.
FREESOUND_DOWNLOAD_DELAY2Seconds between library downloads, to stay under Freesound's limits.
FREESOUND_BASE_URLhttps://freesound.org/apiv2Only for testing against a stand-in API.

AI ​

KeyDefaultWhat it does
REPLICATE_API_TOKENFrom replicate.com/account/api-tokens. AI tools stay off without it.
REPLICATE_MUSIC_MODELelevenlabs/musicModel for music generation.
REPLICATE_STEMS_MODELryan5453/demucsModel for stem separation.
REPLICATE_TIMEOUT600Seconds to wait for one prediction.

Notifications ​

KeyDefaultWhat it does
VAPID_SUBJECTmailto:hello@toneflix.ngContact for push services.
VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEYBrowser push keys. Create them once with php artisan webpush:vapid. Changing them later drops every existing push subscription.
NOTIFY_MESSAGE_DELAY5Minutes to wait before emailing or pushing unread messages.