diff --git a/src/bin/file_server.rs b/src/bin/ptth_file_server.rs similarity index 100% rename from src/bin/file_server.rs rename to src/bin/ptth_file_server.rs diff --git a/src/bin/relay.rs b/src/bin/ptth_relay.rs similarity index 100% rename from src/bin/relay.rs rename to src/bin/ptth_relay.rs diff --git a/src/bin/server.rs b/src/bin/ptth_server.rs similarity index 100% rename from src/bin/server.rs rename to src/bin/ptth_server.rs diff --git a/src/relay/mod.rs b/src/relay/mod.rs index 654aa66..fd5bebf 100644 --- a/src/relay/mod.rs +++ b/src/relay/mod.rs @@ -397,6 +397,16 @@ pub async fn run_relay ( 4000, )); + { + let mut tripcode_set = HashSet::new (); + + for (_, v) in state.config.server_tripcodes.iter () { + if ! tripcode_set.insert (v) { + panic! ("Two servers have the same tripcode. That is not allowed."); + } + } + } + eprintln! ("Loaded {} server tripcodes", state.config.server_tripcodes.len ()); let make_svc = make_service_fn (|_conn| { diff --git a/todo.md b/todo.md index 9987cc8..96ba1b8 100644 --- a/todo.md +++ b/todo.md @@ -1,3 +1,5 @@ +- Error out if 2 servers have the same tripcode +- Error out if a server has a weak password - ETag cache - Server-side hash? - Log / audit log?