Skip to content

Commit eb36cc8

Browse files
committed
core: remove unused supported_protocols config field
1 parent 93c34ba commit eb36cc8

4 files changed

Lines changed: 2 additions & 26 deletions

File tree

crates/bonded-core/src/config.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ pub struct ServerSection {
7575
pub health_bind: String,
7676
pub upstream_tcp_target: String,
7777
pub log_level: String,
78-
pub supported_protocols: Vec<String>,
7978
pub authorized_keys_file: String,
8079
pub invite_tokens_file: String,
8180
}
@@ -92,7 +91,6 @@ impl Default for ServerSection {
9291
health_bind: "0.0.0.0:8081".to_owned(),
9392
upstream_tcp_target: String::new(),
9493
log_level: "info".to_owned(),
95-
supported_protocols: vec!["naive_tcp".to_owned()],
9694
authorized_keys_file: DEFAULT_AUTHORIZED_KEYS_PATH.to_owned(),
9795
invite_tokens_file: DEFAULT_INVITE_TOKENS_PATH.to_owned(),
9896
}
@@ -165,7 +163,6 @@ mod tests {
165163
#[test]
166164
fn default_server_config_has_naive_tcp_protocol() {
167165
let cfg = ServerConfig::default();
168-
assert_eq!(cfg.server.supported_protocols, vec!["naive_tcp"]);
169166
assert!(cfg.server.upstream_tcp_target.is_empty());
170167
assert_eq!(cfg.server.websocket_bind, "0.0.0.0:8443");
171168
assert_eq!(cfg.server.status_bind, "0.0.0.0:8082");
@@ -188,7 +185,6 @@ bind = "127.0.0.1:9000"
188185
assert_eq!(cfg.server.status_bind, "0.0.0.0:8082");
189186
assert_eq!(cfg.server.health_bind, "0.0.0.0:8081");
190187
assert_eq!(cfg.server.log_level, "info");
191-
assert_eq!(cfg.server.supported_protocols, vec!["naive_tcp"]);
192188
}
193189

194190
#[test]

crates/bonded-server/src/main.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -673,17 +673,6 @@ where
673673
if let Some(invite_tokens_file) = read_env("BONDED_INVITE_TOKENS_FILE") {
674674
cfg.server.invite_tokens_file = invite_tokens_file;
675675
}
676-
if let Some(protocols) = read_env("BONDED_SUPPORTED_PROTOCOLS") {
677-
let parsed: Vec<String> = protocols
678-
.split(',')
679-
.map(str::trim)
680-
.filter(|item| !item.is_empty())
681-
.map(ToOwned::to_owned)
682-
.collect();
683-
if !parsed.is_empty() {
684-
cfg.server.supported_protocols = parsed;
685-
}
686-
}
687676
}
688677

689678
fn init_tracing_from_level(level: &str) {
@@ -729,7 +718,6 @@ mod tests {
729718
("BONDED_LOG_LEVEL", "debug"),
730719
("BONDED_AUTHORIZED_KEYS_FILE", "/tmp/auth.toml"),
731720
("BONDED_INVITE_TOKENS_FILE", "/tmp/tokens.toml"),
732-
("BONDED_SUPPORTED_PROTOCOLS", "naive_tcp,wss,quic"),
733721
];
734722

735723
apply_env_overrides(&mut cfg, |key| {
@@ -749,10 +737,6 @@ mod tests {
749737
assert_eq!(cfg.server.log_level, "debug");
750738
assert_eq!(cfg.server.authorized_keys_file, "/tmp/auth.toml");
751739
assert_eq!(cfg.server.invite_tokens_file, "/tmp/tokens.toml");
752-
assert_eq!(
753-
cfg.server.supported_protocols,
754-
vec!["naive_tcp", "wss", "quic"]
755-
);
756740
}
757741

758742
#[test]

docs/design/implementation-plan.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Implementation Plan — Server, Linux Client, Android Client
22

33
**Status:** In Progress
4-
**Last Updated:** 2026-04-06 (session 22)
4+
**Last Updated:** 2026-04-06 (session 23)
55

66
This is a living document. Update the status column and notes as work progresses.
77

@@ -62,7 +62,6 @@ status_bind = "0.0.0.0:8082"
6262
public_address = "bonded.example.com:8080"
6363
health_bind = "0.0.0.0:8081"
6464
log_level = "info"
65-
supported_protocols = ["naive_tcp"]
6665
authorized_keys_file = "/var/lib/bonded/authorized_keys.toml"
6766
invite_tokens_file = "/var/lib/bonded/invite_tokens.toml"
6867
```
@@ -252,7 +251,7 @@ Build the server binary on top of `bonded-core`.
252251

253252
| # | Task | Status | Notes |
254253
|---|------|--------|-------|
255-
| 2.1 | Server config loading (env vars + config file) | completed | Server loads TOML via `BONDED_CONFIG`/`--config`, falls back to defaults on read failure, applies env overrides for bind/public/health/log/protocol/key paths, and now deserializes partial `server.toml` files by filling missing options from defaults |
254+
| 2.1 | Server config loading (env vars + config file) | completed | Server loads TOML via `BONDED_CONFIG`/`--config`, falls back to defaults on read failure, applies env overrides for bind/public/health/log/key paths, and now deserializes partial `server.toml` files by filling missing options from defaults |
256255
| 2.2 | Authorized keys file — load, watch for changes, reload | completed | Added server authorized key store loading from TOML plus `notify` watcher callbacks; hardened watcher to ignore non-mutating access events and debounce rapid bursts to avoid self-triggered tight reload loops; server startup pre-creates missing state files/directories so operators only need to provide `server.toml` |
257256
| 2.3 | Accept NaiveTCP connections, perform auth handshake | completed | Added NaiveTCP listener accept loop and line-delimited JSON challenge-signature handshake with authorized-key enforcement |
258257
| 2.4 | Server-side session management (multiple concurrent clients) | completed | Added concurrent session registry keyed by authenticated client key with unique server session IDs and per-connection frame receive loop lifecycle |

server/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ bind = "0.0.0.0:8080"
6464
public_address = "bonded.example.com:8080"
6565
health_bind = "0.0.0.0:8081"
6666
log_level = "info"
67-
supported_protocols = ["naive_tcp"]
6867
authorized_keys_file = "/var/lib/bonded/authorized_keys.toml"
6968
invite_tokens_file = "/var/lib/bonded/invite_tokens.toml"
7069
@@ -85,7 +84,6 @@ upstream_tcp_target = ""
8584
| `public_address` | *(empty)* | Public address shown in the QR code for clients — **must be set** |
8685
| `health_bind` | `0.0.0.0:8081` | Health-check HTTP listener |
8786
| `log_level` | `info` | Tracing level (`trace`, `debug`, `info`, `warn`, `error`) |
88-
| `supported_protocols` | `["naive_tcp"]` | Protocols advertised to clients |
8987
| `authorized_keys_file` | `/var/lib/bonded/authorized_keys.toml` | Authorized device keys file |
9088
| `invite_tokens_file` | `/var/lib/bonded/invite_tokens.toml` | Invite tokens file |
9189
| `websocket_bind` | `0.0.0.0:8443` | WebSocket listener address |
@@ -103,7 +101,6 @@ Every field can be overridden via `BONDED_` prefixed environment variables:
103101
| `BONDED_PUBLIC_ADDRESS` | `public_address` |
104102
| `BONDED_HEALTH_BIND` | `health_bind` |
105103
| `BONDED_LOG_LEVEL` | `log_level` |
106-
| `BONDED_SUPPORTED_PROTOCOLS` | `supported_protocols` (comma-separated) |
107104
| `BONDED_AUTHORIZED_KEYS_FILE` | `authorized_keys_file` |
108105
| `BONDED_INVITE_TOKENS_FILE` | `invite_tokens_file` |
109106
| `BONDED_WEBSOCKET_BIND` | `websocket_bind` |

0 commit comments

Comments
 (0)