Stu Mason
Stu Mason

Activity

Issue Resolved

Issue #14 closed: Add Pusher/Broadcasting environment variables to stack provisioning

Problem

When deploying a Laravel application with broadcasting enabled (e.g., using Laravel Reverb or Pusher), the application fails with:

app-BG8-Nn95.js:90 Uncaught You must pass your app key when you instantiate Pusher.

This happens because the Coolify stack provisioning doesn't include the necessary Pusher/broadcasting environment variables.

Required Environment Variables

The following environment variables need to be provisioned when setting up a stack:

Core Broadcasting Config

BROADCAST_CONNECTION=reverb

Reverb Server Config

REVERB_APP_ID=<generated>
REVERB_APP_KEY=<generated>
REVERB_APP_SECRET=<generated>
REVERB_HOST="localhost"
REVERB_PORT=8080
REVERB_SCHEME=http

Vite/Frontend Config (exposed to browser)

VITE_REVERB_APP_KEY="${REVERB_APP_KEY}"
VITE_REVERB_HOST="${REVERB_HOST}"
VITE_REVERB_PORT="${REVERB_PORT}"
VITE_REVERB_SCHEME="${REVERB_SCHEME}"

Proposed Solution

  1. Add option to enable broadcasting when provisioning a stack
  2. Auto-generate REVERB_APP_ID, REVERB_APP_KEY, and REVERB_APP_SECRET (similar to how APP_KEY is generated)
  3. Set sensible defaults for host/port/scheme based on deployment environment
  4. Ensure the VITE_* variables reference the Reverb variables so they stay in sync

Notes

  • For production deployments, REVERB_HOST should be the public domain
  • REVERB_SCHEME should be https for production
  • The Reverb server needs to be started as a separate process (typically via Supervisor or as a Coolify service)