replica-bridge 0.3.19 → 0.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/bridge/board.js +12 -5
- package/src/bridge/main.js +126 -5
- package/src/bridge/pair.js +2 -0
- package/src/bridge/ring.js +427 -0
- package/src/bridge/service.js +402 -25
- package/src/bridge/state.js +53 -1
- package/src/http.js +5 -2
- package/src/protocol.js +704 -3
- package/src/relay/config.js +8 -0
package/src/relay/config.js
CHANGED
|
@@ -37,6 +37,8 @@ export function readEnvFile(file ) {
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
|
|
41
|
+
|
|
40
42
|
|
|
41
43
|
|
|
42
44
|
|
|
@@ -89,6 +91,11 @@ function desktopPairingMode(value ) {
|
|
|
89
91
|
throw new Error(`RELAY_DESKTOP_PAIRING takes open, owned or off, not "${value}"`);
|
|
90
92
|
}
|
|
91
93
|
|
|
94
|
+
function onOff(name , value ) {
|
|
95
|
+
if (value === "on" || value === "off") return value === "on";
|
|
96
|
+
throw new Error(`${name} takes on or off, not "${value}"`);
|
|
97
|
+
}
|
|
98
|
+
|
|
92
99
|
function positiveNumber(name , value ) {
|
|
93
100
|
if (value === null) return null;
|
|
94
101
|
const number = Number(value);
|
|
@@ -114,6 +121,7 @@ export function loadRelayConfig(envPath = defaultEnvPath()) {
|
|
|
114
121
|
trustProxy: get("RELAY_TRUST_PROXY") === "1",
|
|
115
122
|
clientIPHeader: get("RELAY_CLIENT_IP_HEADER"),
|
|
116
123
|
desktopPairing: desktopPairingMode(get("RELAY_DESKTOP_PAIRING") ?? "open"),
|
|
124
|
+
ring: onOff("RELAY_RING", get("RELAY_RING") ?? "on"),
|
|
117
125
|
anonymousIdleDays: positiveNumber("RELAY_ANONYMOUS_IDLE_DAYS", get("RELAY_ANONYMOUS_IDLE_DAYS")),
|
|
118
126
|
desktopBytesPerHostPerDay: dailyMiB === null ? null : dailyMiB * 1024 * 1024,
|
|
119
127
|
dataDir: expandHome(get("RELAY_DATA_DIR") ?? "~/.local/share/replica-relay"),
|