fix setting the custom cloudflared bin directory

This commit is contained in:
Egor 2025-12-03 18:27:36 -08:00
parent 9ecf1c6757
commit 39ac48d44f

View file

@ -1,6 +1,6 @@
import fs from 'fs';
import path from 'path';
import { Tunnel, install } from 'cloudflared';
import { Tunnel, install, use as setCloudflaredBin } from 'cloudflared';
import { platform } from 'process';
import { logError } from '@/utils/node/logging';
@ -42,15 +42,14 @@ export const startTunnel = async (
const bin = getCloudflaredBin();
if (!fs.existsSync(bin)) {
sendKoboldOutput('Installing cloudflared binary...');
sendKoboldOutput(`Installing cloudflared binary to ${bin}...`);
await install(bin);
}
setCloudflaredBin(bin);
const tunnelTarget = getTunnelTarget(frontendPreference);
const tunnel = Tunnel.quick(tunnelTarget, {
'--no-autoupdate': true,
bin,
});
const tunnel = Tunnel.quick(tunnelTarget, { '--no-autoupdate': true });
activeTunnel = tunnel;
let rateLimited = false;