Server tools to backfill, tail, mirror, and verify PLC logs

main page fixup and a favicon even

+27 -10
favicon.ico

This is a binary file and will not be displayed.

+27 -10
src/mirror.rs
··· 24 24 format!( 25 25 r#"{} 26 26 27 - This is a PLC[1] mirror running Allegedly[2] in mirror mode. Allegedly synchronizes and proxies to a downstream PLC reference server instance[3] (why?[4]). 27 + This is a PLC[1] mirror running Allegedly in mirror mode. Mirror mode wraps and 28 + synchronizes a local PLC reference server instance[2] (why?[3]). 28 29 29 30 30 31 Configured upstream: ··· 34 35 35 36 Available APIs: 36 37 37 - - All PLC GET requests [5]. 38 - - Rejects POSTs. This is a mirror. 38 + - GET /_health Health and version info 39 + 40 + - GET /* Proxies to wrapped server; see PLC API docs: 41 + https://web.plc.directory/api/redoc 42 + 43 + - POST /* Always rejected. This is a mirror. 44 + 45 + 46 + tip: try `GET /{{did}}` to resolve an identity 47 + 48 + 49 + Allegedly is a suit of open-source CLI tools for working with PLC logs: 39 50 40 - try `GET /{{did}}` to resolve an identity 51 + https://tangled.org/@microcosm.blue/Allegedly 41 52 42 53 43 54 [1] https://web.plc.directory 44 - [2] https://tangled.org/@microcosm.blue/Allegedly 45 - [3] https://github.com/did-method-plc/did-method-plc 46 - [4] https://updates.microcosm.blue/3lz7nwvh4zc2u 47 - [5] https://web.plc.directory/api/redoc 48 - 55 + [2] https://github.com/did-method-plc/did-method-plc 56 + [3] https://updates.microcosm.blue/3lz7nwvh4zc2u 49 57 "#, 50 58 logo("mirror") 51 59 ) 60 + } 61 + 62 + #[handler] 63 + fn favicon() -> impl IntoResponse { 64 + include_bytes!("../favicon.ico").with_content_type("image/x-icon") 52 65 } 53 66 54 67 fn failed_to_reach_wrapped() -> String { ··· 204 217 205 218 let app = Route::new() 206 219 .at("/", get(hello)) 220 + .at("/favicon.ico", get(favicon)) 207 221 .at("/_health", get(health)) 208 222 .at("/:any", get(proxy).post(nope)) 209 223 .with(AddData::new(state)) ··· 273 287 ) 274 288 } 275 289 276 - let app = Route::new().at("/", get(oop_plz_be_secure)).with(Tracing); 290 + let app = Route::new() 291 + .at("/", get(oop_plz_be_secure)) 292 + .at("/favicon.ico", get(favicon)) 293 + .with(Tracing); 277 294 Server::new(TcpListener::bind("0.0.0.0:80")) 278 295 .name("allegedly (mirror:80 helper)") 279 296 .run(app)