Allow self-hosted relays to opt into wss:// (#767)

* Add relay TLS schema fields

* Wire relay TLS into websocket URLs

* Propagate relay TLS from pairing offers

* Expose relay TLS opt-in

* Mark relay TLS fallback for removal

* Preserve explicit relay TLS false

* Align relay TLS defaults outside config loader
This commit is contained in:
Mohamed Boudra
2026-05-06 17:25:16 +08:00
committed by GitHub
parent 6c319d05dd
commit 2e45650f22
33 changed files with 397 additions and 17 deletions
@@ -11,6 +11,7 @@ export interface DaemonStartOptions {
home?: string;
foreground?: boolean;
relay?: boolean;
relayUseTls?: boolean;
mcp?: boolean;
injectMcp?: boolean;
hostnames?: string;
@@ -28,6 +29,9 @@ export interface LocalDaemonPidInfo {
export interface LocalDaemonState {
home: string;
listen: string;
relayEnabled: boolean;
relayEndpoint: string;
relayUseTls: boolean;
logPath: string;
pidPath: string;
pidInfo: LocalDaemonPidInfo | null;
@@ -93,6 +97,9 @@ function buildRunnerArgs(options: DaemonStartOptions): string[] {
if (options.relay === false) {
args.push("--no-relay");
}
if (options.relayUseTls === true) {
args.push("--relay-use-tls");
}
if (options.mcp === false) {
args.push("--no-mcp");
@@ -117,6 +124,9 @@ function buildChildEnv(options: DaemonStartOptions): NodeJS.ProcessEnv {
if (options.hostnames) {
childEnv.PASEO_HOSTNAMES = options.hostnames;
}
if (options.relayUseTls === true) {
childEnv.PASEO_RELAY_USE_TLS = "true";
}
return childEnv;
}
@@ -353,6 +363,9 @@ export function resolveLocalDaemonState(options: { home?: string } = {}): LocalD
return {
home,
listen,
relayEnabled: config.relayEnabled ?? true,
relayEndpoint: config.relayPublicEndpoint ?? config.relayEndpoint ?? "relay.paseo.sh:443",
relayUseTls: config.relayUseTls ?? false,
logPath,
pidPath,
pidInfo,