diff --git a/src/utils/netbird.ts b/src/utils/netbird.ts index cd02c347..897d89d7 100644 --- a/src/utils/netbird.ts +++ b/src/utils/netbird.ts @@ -5,8 +5,16 @@ export const GRPC_API_ORIGIN = config.grpcApiOrigin; export const getNetBirdUpCommand = () => { let cmd = "netbird up"; - if (!GRPC_API_ORIGIN) return cmd; - cmd += " --management-url " + GRPC_API_ORIGIN; + if (GRPC_API_ORIGIN) { + cmd += " --management-url " + GRPC_API_ORIGIN + } + if (!isNetBirdHosted()) { + let admin_url = window.location.protocol + "://" + window.location.hostname + if (window.location.port != "") { + admin_url += ":" + window.location.port + } + cmd += " --admin-url " + admin_url + }; return cmd; };