fix: improve Windows tunnel support

This commit is contained in:
Bohdan Triapitsyn
2026-06-05 15:01:22 +03:00
parent e823497cf1
commit 16fdff530b
24 changed files with 936 additions and 151 deletions
@@ -17,6 +17,7 @@ import {
TUNNEL_PROVIDER_CLOUDFLARE,
TunnelServiceError,
} from '../types.js';
import { getTunnelDependencyInstallInfo } from '../install-help.js';
export const cloudflareTunnelProviderCapabilities = {
provider: TUNNEL_PROVIDER_CLOUDFLARE,
@@ -97,16 +98,21 @@ export function createCloudflareTunnelProvider() {
checkAvailability: async () => {
const result = await checkCloudflaredAvailable();
if (result.available) {
return result;
return {
...result,
...getTunnelDependencyInstallInfo(TUNNEL_PROVIDER_CLOUDFLARE),
};
}
const installInfo = getTunnelDependencyInstallInfo(TUNNEL_PROVIDER_CLOUDFLARE);
return {
...result,
message: 'cloudflared is not installed. Install it with: brew install cloudflared',
...installInfo,
};
},
diagnose: async (request = {}) => {
const dependency = await checkCloudflaredAvailable();
const network = await checkCloudflareApiReachability();
const installInfo = getTunnelDependencyInstallInfo(TUNNEL_PROVIDER_CLOUDFLARE);
const providerChecks = [
{
@@ -115,7 +121,7 @@ export function createCloudflareTunnelProvider() {
status: dependency.available ? 'pass' : 'fail',
detail: dependency.available
? (dependency.version || dependency.path || 'cloudflared available')
: 'cloudflared is not installed. Install it with: brew install cloudflared',
: installInfo.message,
},
{
id: 'network',
@@ -11,6 +11,7 @@ import {
TUNNEL_PROVIDER_NGROK,
TunnelServiceError,
} from '../types.js';
import { getTunnelDependencyInstallInfo } from '../install-help.js';
export const ngrokTunnelProviderCapabilities = {
provider: TUNNEL_PROVIDER_NGROK,
@@ -37,17 +38,22 @@ export function createNgrokTunnelProvider() {
checkAvailability: async () => {
const result = await checkNgrokAvailable();
if (result.available) {
return result;
return {
...result,
...getTunnelDependencyInstallInfo(TUNNEL_PROVIDER_NGROK),
};
}
const installInfo = getTunnelDependencyInstallInfo(TUNNEL_PROVIDER_NGROK);
return {
...result,
message: 'ngrok is not installed. Install it with: brew install ngrok',
...installInfo,
};
},
diagnose: async () => {
const dependency = await checkNgrokAvailable();
const authtoken = await checkNgrokAuthtokenConfigured(dependency.path);
const network = await checkNgrokApiReachability();
const installInfo = getTunnelDependencyInstallInfo(TUNNEL_PROVIDER_NGROK);
const startupReady = dependency.available && authtoken.configured && network.reachable;
const providerChecks = [
{
@@ -56,7 +62,7 @@ export function createNgrokTunnelProvider() {
status: dependency.available ? 'pass' : 'fail',
detail: dependency.available
? (dependency.version || dependency.path || 'ngrok available')
: 'ngrok is not installed. Install it with: brew install ngrok',
: installInfo.message,
},
{
id: 'authtoken',