hide socks password in desktop joiner logs, restore window size

This commit is contained in:
kulikov0 committed 2026-11-04 10:43:27 +01:00
1 parent d2f189549e
commit 755e053a55
6 files changed
+16 -18

No files matched your search

+2
View File
@@ -10,6 +10,8 @@ export const IPC = {
export const JOINER_PLATFORMS = ['wbstream', 'telemost', 'vk', 'dion', 'bitrix', 'blink'] as const;
export type JoinerPlatform = typeof JOINER_PLATFORMS[number];
export const DUAL_TRACK_PLATFORMS: readonly JoinerPlatform[] = ['vk', 'wbstream', 'bitrix', 'blink'];
export const RELIABLE_PLATFORMS: readonly JoinerPlatform[] = ['vk', 'telemost', 'wbstream', 'bitrix', 'blink'];
export interface LoginLink {
link: string;
+5 -7
View File
@@ -131,10 +131,8 @@ function send(channel: string, payload: unknown) {
function createWindow() {
mainWindow = new BrowserWindow({
width: 1060,
height: 780,
minWidth: 850,
minHeight: 650,
width: 900,
height: 600,
title: 'WhitelistBypass Joiner',
icon: join(__dirname, '..', '..', 'resources', 'icon.png'),
webPreferences: {
@@ -189,7 +187,9 @@ async function spawnJoiner(settings: JoinerSettings): Promise<{ ok: boolean; err
process.getuid && process.getuid() !== 0;
const spawnCmd = elevateOnLinux ? 'pkexec' : exe;
const spawnArgs = elevateOnLinux ? [exe, ...args] : args;
const commandLine = [spawnCmd, ...spawnArgs].map((s) => (/\s/.test(s) ? `"${s}"` : s)).join(' ');
const commandLine = [spawnCmd, ...spawnArgs]
.map((s, index, all) => (all[index - 1] === '--socks-pass' ? '[redacted]' : s))
.map((s) => (/\s/.test(s) ? `"${s}"` : s)).join(' ');
send(IPC.LOG, `[main] spawning: ${commandLine}\n`);
try {
joinerProcess = spawn(spawnCmd, spawnArgs, { windowsHide: true });
@@ -279,8 +279,6 @@ ipcMain.handle(IPC.START, async (_e, settings: JoinerSettings) => {
});
ipcMain.handle(IPC.STATE, async () => {
// Reopening a window must retain the current in-memory password. Only
// disk persistence omits it; a fresh application still starts without it.
const settings = lastSettings ?? readSettings();
const occupied = !running && !startInProgress && !(await portIsAvailable(settings.socksPort));
return { settings, running, status: occupied ? 'port in use' : currentStatus, log: logBuffer };
+4 -6
View File
@@ -1,4 +1,4 @@
import { JOINER_PLATFORMS, JoinerSettings } from '../constants';
import { DUAL_TRACK_PLATFORMS, JOINER_PLATFORMS, JoinerSettings, RELIABLE_PLATFORMS } from '../constants';
export const DEFAULT_SETTINGS: JoinerSettings = {
platform: 'telemost', link: '', displayName: 'Joiner', socksPort: 1080,
@@ -36,14 +36,12 @@ export function buildJoinerArgs(settings: JoinerSettings): string[] {
if (settings.socksUser) args.push('--socks-user', settings.socksUser);
if (settings.socksPass) args.push('--socks-pass', settings.socksPass);
if (settings.noTun) args.push('--no-tun');
if (settings.dualTrack && ['vk', 'wbstream', 'bitrix', 'blink'].includes(settings.platform)) args.push('--dual-track');
if (settings.reliable && ['vk', 'telemost', 'wbstream', 'bitrix', 'blink'].includes(settings.platform)) args.push('--reliable');
if (settings.dualTrack && DUAL_TRACK_PLATFORMS.includes(settings.platform)) args.push('--dual-track');
if (settings.reliable && RELIABLE_PLATFORMS.includes(settings.platform)) args.push('--reliable');
return args;
}
export function redactLog(text: string, settings: JoinerSettings | null): string {
for (const secret of [settings?.link, settings?.socksPass]) {
if (secret) text = text.split(secret).join('[redacted]');
}
if (settings?.link) text = text.split(settings.link).join('[redacted]');
return text;
}
+1 -1
View File
@@ -103,7 +103,7 @@ func (t *Tunnel) Start() error {
Device: "tun://" + dev,
MTU: t.cfg.MTU,
}
t.log("[desktoptun] starting tun2socks engine adapter=%s mtu=%d proxy=%s", dev, t.cfg.MTU, proxy)
t.log("[desktoptun] starting tun2socks engine adapter=%s mtu=%d proxy=socks5://%s:%d", dev, t.cfg.MTU, t.cfg.SocksHost, t.cfg.SocksPort)
engine.Insert(key)
engine.Start()
+2 -2
View File
@@ -98,8 +98,8 @@ func (t *Tunnel) Start() error {
Device: "tun://" + t.cfg.AdapterName,
MTU: t.cfg.MTU,
}
t.log("[desktoptun] starting tun2socks engine adapter=%s mtu=%d proxy=%s",
t.cfg.AdapterName, t.cfg.MTU, proxy)
t.log("[desktoptun] starting tun2socks engine adapter=%s mtu=%d proxy=socks5://%s:%d",
t.cfg.AdapterName, t.cfg.MTU, t.cfg.SocksHost, t.cfg.SocksPort)
engine.Insert(key)
engine.Start()
+2 -2
View File
@@ -117,8 +117,8 @@ func (t *Tunnel) Start() error {
Device: "tun://" + t.cfg.AdapterName,
MTU: t.cfg.MTU,
}
t.log("[desktoptun] starting tun2socks engine adapter=%s mtu=%d proxy=%s",
t.cfg.AdapterName, t.cfg.MTU, proxy)
t.log("[desktoptun] starting tun2socks engine adapter=%s mtu=%d proxy=socks5://%s:%d",
t.cfg.AdapterName, t.cfg.MTU, t.cfg.SocksHost, t.cfg.SocksPort)
engine.Insert(key)
engine.Start()