mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-25 12:01:04 +02:00
* feat(scripts): free trusted HTTPS via sslip.io for public-IP remote installs Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: refactor setup scripts * chore: generate sdk * chore: fix messaging for setup_remote script * fix: fix ffmpeg download url * feat: centralise and simplify the url configuration * fix: force script run as sudo * fix: fix documentation --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
16 lines
676 B
TypeScript
16 lines
676 B
TypeScript
/**
|
|
* Public base URL that external callers (telephony providers, webhook senders)
|
|
* should use to reach this deployment's API.
|
|
*
|
|
* Prefers the Cloudflare tunnel URL the backend reports via /health (set when the
|
|
* host has no public IP, so `window.location.origin` would be a private/LAN
|
|
* address an external caller can't reach), then a build-time configured backend
|
|
* URL, then the current origin (correct for a same-origin public deployment).
|
|
*/
|
|
export function resolveWebhookBaseUrl(tunnelUrl?: string | null): string {
|
|
return (
|
|
tunnelUrl ||
|
|
process.env.NEXT_PUBLIC_BACKEND_URL ||
|
|
(typeof window !== "undefined" ? window.location.origin : "")
|
|
);
|
|
}
|