Add a stage branch deploy beside production on z00.
Pushing stage runs CI and deploys to stage.transcribe.z00.nu with its own data, Reverb credentials, and Caddy network.
This commit is contained in:
+28
-5
@@ -3,13 +3,36 @@ import Echo from 'laravel-echo';
|
||||
import Pusher from 'pusher-js';
|
||||
window.Pusher = Pusher;
|
||||
|
||||
function metaContent(name) {
|
||||
return document.querySelector(`meta[name="${name}"]`)?.getAttribute('content')?.trim() || '';
|
||||
}
|
||||
|
||||
const isLocalHost = ['localhost', '127.0.0.1'].includes(window.location.hostname);
|
||||
const internalHosts = new Set(['', 'reverb', 'localhost', '127.0.0.1']);
|
||||
|
||||
const key = metaContent('reverb-key') || import.meta.env.VITE_REVERB_APP_KEY;
|
||||
|
||||
let host = metaContent('reverb-host') || import.meta.env.VITE_REVERB_HOST || '';
|
||||
let port = metaContent('reverb-port') || import.meta.env.VITE_REVERB_PORT || '';
|
||||
let scheme = metaContent('reverb-scheme') || import.meta.env.VITE_REVERB_SCHEME || 'https';
|
||||
|
||||
if (!isLocalHost && internalHosts.has(host)) {
|
||||
host = `reverb.${window.location.hostname}`;
|
||||
port = '443';
|
||||
scheme = 'https';
|
||||
} else if (isLocalHost && host === 'reverb') {
|
||||
host = import.meta.env.VITE_REVERB_HOST || 'localhost';
|
||||
port = import.meta.env.VITE_REVERB_PORT || '8081';
|
||||
scheme = import.meta.env.VITE_REVERB_SCHEME || 'http';
|
||||
}
|
||||
|
||||
window.Echo = new Echo({
|
||||
broadcaster: 'reverb',
|
||||
key: import.meta.env.VITE_REVERB_APP_KEY,
|
||||
wsHost: import.meta.env.VITE_REVERB_HOST,
|
||||
wsPort: import.meta.env.VITE_REVERB_PORT ?? 80,
|
||||
wssPort: import.meta.env.VITE_REVERB_PORT ?? 443,
|
||||
forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https',
|
||||
key,
|
||||
wsHost: host,
|
||||
wsPort: port || 80,
|
||||
wssPort: port || 443,
|
||||
forceTLS: scheme === 'https',
|
||||
enabledTransports: ['ws', 'wss'],
|
||||
authEndpoint: '/broadcasting/auth',
|
||||
auth: {
|
||||
|
||||
Reference in New Issue
Block a user