🚧 wip: add prefix for relay debugging tools

main
_ 2021-02-20 16:23:12 +00:00
parent b5b6410ff9
commit 0ffa129937
4 changed files with 52 additions and 0 deletions

View File

@ -354,6 +354,9 @@ async fn handle_all (
Ok (error_reply (StatusCode::BAD_REQUEST, "Bad URI format")?)
}
}
else if let Some (rest) = prefix_match ("/frontend/debug/", &path) {
Ok (error_reply (StatusCode::NOT_IMPLEMENTED, "Not implemented (yet)")?)
}
else if path == "/" {
let s = handlebars.render ("relay_root", &())?;
Ok (ok_reply (s)?)

View File

@ -0,0 +1,44 @@
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="data:image/x-icon;base64,AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAlJSUAAGIAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAIiIiIgAAAAAAAAAgAAAAAAAAAAAAADIiIiIi
IiIjMhERERERESMyERERERERIzIREREREREjMhERIRERESMyERIiIiERIzIRESEREREjMhERERER
ESMyERERERERIzIREREREREjMiIiIiIiIiMAAAAAAAAAAAAAAAAAAAAAAAAAAIABAACAAQAAgAEA
AIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAA" rel="icon" type="image/x-icon" />
<style>
body {
font-family: sans-serif;
}
td {
padding: 0px;
}
td > * {
padding: 20px;
display: block;
}
.entry {
}
.grey {
color: #888;
text-align: right;
}
.entry_list {
width: 100%;
border-collapse: collapse;
}
tbody tr:nth-child(odd) {
background-color: #ddd;
}
</style>
<title>ptth_relay debugging tools</title>
</head>
<body>
<h1>ptth_relay debugging tools</h1>
</body>
</html>

View File

@ -27,6 +27,10 @@
<a class="entry" href="frontend/servers/">Server list</a>
</div>
<div>
<a class="entry" href="frontend/debug/">Debugging tools</a>
</div>
</div>
</body>

View File

@ -1,6 +1,7 @@
Interesting issues will get a unique ID with
`dd if=/dev/urandom bs=5 count=1 | base32`
- Add endless virtual files for debugging
- Fix long-running downloads restarting in the middle
- [DMX6CO4G](issues/2021-01Jan/status-DMX6CO4G.md) fire-and-forget logs / key-value status data
- ptth_tail