mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 19:54:44 -07:00
fix setting the custom cloudflared bin directory
This commit is contained in:
parent
9ecf1c6757
commit
39ac48d44f
1 changed files with 5 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { Tunnel, install } from 'cloudflared';
|
import { Tunnel, install, use as setCloudflaredBin } from 'cloudflared';
|
||||||
import { platform } from 'process';
|
import { platform } from 'process';
|
||||||
|
|
||||||
import { logError } from '@/utils/node/logging';
|
import { logError } from '@/utils/node/logging';
|
||||||
|
|
@ -42,15 +42,14 @@ export const startTunnel = async (
|
||||||
const bin = getCloudflaredBin();
|
const bin = getCloudflaredBin();
|
||||||
|
|
||||||
if (!fs.existsSync(bin)) {
|
if (!fs.existsSync(bin)) {
|
||||||
sendKoboldOutput('Installing cloudflared binary...');
|
sendKoboldOutput(`Installing cloudflared binary to ${bin}...`);
|
||||||
await install(bin);
|
await install(bin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCloudflaredBin(bin);
|
||||||
|
|
||||||
const tunnelTarget = getTunnelTarget(frontendPreference);
|
const tunnelTarget = getTunnelTarget(frontendPreference);
|
||||||
const tunnel = Tunnel.quick(tunnelTarget, {
|
const tunnel = Tunnel.quick(tunnelTarget, { '--no-autoupdate': true });
|
||||||
'--no-autoupdate': true,
|
|
||||||
bin,
|
|
||||||
});
|
|
||||||
activeTunnel = tunnel;
|
activeTunnel = tunnel;
|
||||||
|
|
||||||
let rateLimited = false;
|
let rateLimited = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue