Merge remote-tracking branch 'origin/main'

main
_ 2021-11-13 20:29:22 -06:00
commit 80f1c21fd0
11 changed files with 79 additions and 17 deletions

23
.github/workflows/rust.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

8
Cargo.lock generated
View File

@ -345,9 +345,9 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
[[package]] [[package]]
name = "fltk" name = "fltk"
version = "1.2.7" version = "1.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0953c34fd5b0c6ac1b615fdcda8845c81ed364165b115ddac46ae8953d456640" checksum = "889d9b2176b88c6f8f90ba64b0b030e52807ed1d6e416df0c15611225b40cc1d"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"fltk-sys", "fltk-sys",
@ -356,9 +356,9 @@ dependencies = [
[[package]] [[package]]
name = "fltk-sys" name = "fltk-sys"
version = "1.2.7" version = "1.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2df700440c014123cc1644fbef7d33dcdda18cdd80373a7552a9d5cec47ca63" checksum = "e38b2f3fb23b4bd46fc492d5d8d099b0bf766a7ab5d18b8424d93089ae934a48"
dependencies = [ dependencies = [
"cmake", "cmake",
] ]

View File

@ -226,4 +226,4 @@ For now, either email me (if you know me personally) or make a pull request to a
PTTH is licensed under the PTTH is licensed under the
[GNU AGPLv3](https://www.gnu.org/licenses/agpl-3.0.html) [GNU AGPLv3](https://www.gnu.org/licenses/agpl-3.0.html)
Copyright 2020 "Trish" Copyright 2020-2021 "Trish"

View File

@ -52,8 +52,6 @@ Lorem ipsum dolor set amet
<p> <p>
<a href="endless_sink">Data sink (POST only)</a> <a href="endless_sink">Data sink (POST only)</a>
<p>Persistent toggle is <pre>{{persistent_toggle}}</pre></p>
<form action="toggle" method="post"> <form action="toggle" method="post">
<input type="submit" value="Toggle"> <input type="submit" value="Toggle">
</form> </form>

View File

@ -14,6 +14,10 @@
.entry_list div:nth-child(odd) { .entry_list div:nth-child(odd) {
background-color: #ddd; background-color: #ddd;
} }
.fine {
color: #444;
font-size: 12px;
}
</style> </style>
<title>PTTH relay</title> <title>PTTH relay</title>
</head> </head>
@ -33,5 +37,12 @@
</div> </div>
<p class="fine">
Rendered by PTTH relay server.
Copyright 2020-2021 "Trish" ReactorScram. Licensed under the
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
</p>
</body> </body>
</html> </html>

View File

@ -95,6 +95,13 @@ Git version: {{git_version}}
{{else}} {{else}}
Not built from Git Not built from Git
{{/if}} {{/if}}
<p>
Rendered by PTTH relay server.
Copyright 2020-2021 "Trish" ReactorScram. Licensed under the
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
</p>
</div> </div>
</body> </body>

View File

@ -27,6 +27,10 @@ AIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAA" rel="icon" type="image/x-icon" />
transition: var(--dark-mode-transition); transition: var(--dark-mode-transition);
} }
.fine {
color: #444;
font-size: 12px;
}
.light_switch { .light_switch {
display: none; display: none;
} }
@ -40,7 +44,7 @@ AIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAA" rel="icon" type="image/x-icon" />
.light_switch_label::before { .light_switch_label::before {
content: "[ ] "; content: "[ ] ";
} }
a { .app a {
color: var(--main-link-color); color: var(--main-link-color);
transition: var(--dark-mode-transition); transition: var(--dark-mode-transition);
} }
@ -122,6 +126,15 @@ AIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAA" rel="icon" type="image/x-icon" />
<!-- Doesn't work perfectly yet --> <!-- Doesn't work perfectly yet -->
<!--<label for="light_switch" class="light_switch_label">Dark mode</label>--> <!--<label for="light_switch" class="light_switch_label">Dark mode</label>-->
</page>
</div>
<p class="fine">
Rendered by PTTH end server.
Copyright 2020-2021 "Trish" ReactorScram. Licensed under the
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
</p>
</body> </body>
</html> </html>

View File

@ -15,6 +15,10 @@
.entry_list div:nth-child(even) { .entry_list div:nth-child(even) {
background-color: #ddd; background-color: #ddd;
} }
.fine {
color: #444;
font-size: 12px;
}
</style> </style>
<title>{{metrics_startup.server_name}}</title> <title>{{metrics_startup.server_name}}</title>
</head> </head>
@ -22,10 +26,6 @@
<h1>{{metrics_startup.server_name}}</h1> <h1>{{metrics_startup.server_name}}</h1>
<h2>Gauges</h2>
<p>RSS MiB: {{metrics_interval.rss_mib}}</p>
<div class="entry_list"> <div class="entry_list">
<div> <div>
@ -40,5 +40,12 @@
</div> </div>
<p class="fine">
Rendered by PTTH end server.
Copyright 2020-2021 "Trish" ReactorScram. Licensed under the
<a href="https://www.gnu.org/licenses/agpl-3.0.html">GNU AGPLv3.</a>
<a href="https://six-five-six-four.com/git/reactor/ptth">Download source code</a>
</p>
</body> </body>
</html> </html>

View File

@ -10,7 +10,7 @@ license = "AGPL-3.0"
[dependencies] [dependencies]
anyhow = "1.0.38" anyhow = "1.0.38"
blake3 = "1.0.0" blake3 = "1.0.0"
fltk = "1.2.7" fltk = "1.2.8"
quic_demo = { path = "../quic_demo" } quic_demo = { path = "../quic_demo" }
quinn = "0.7.2" quinn = "0.7.2"
rand = "0.8.4" rand = "0.8.4"

View File

@ -136,7 +136,9 @@ impl GuiClient <'_> {
ports_col: &mut Flex, ports_col: &mut Flex,
fltk_tx: fltk::app::Sender <Message> fltk_tx: fltk::app::Sender <Message>
) { ) {
if self.ports.len () >= 5 { const MAX_PORTS: usize = 15;
if self.ports.len () >= MAX_PORTS {
return; return;
} }
@ -151,7 +153,7 @@ impl GuiClient <'_> {
self.ports.push (port); self.ports.push (port);
if self.ports.len () >= 5 { if self.ports.len () >= MAX_PORTS {
self.but_add_port.deactivate (); self.but_add_port.deactivate ();
} }
} }
@ -224,7 +226,7 @@ fn main () -> anyhow::Result <()> {
let connection_p2_p3 = rt.block_on (async move { let connection_p2_p3 = rt.block_on (async move {
let server_cert = match opt.cert_url.as_ref () { let server_cert = match opt.cert_url.as_ref () {
Some (url) => reqwest::get (url).await?.bytes ().await?, Some (url) => reqwest::get (url).await?.bytes ().await?,
None => tokio::fs::read ("ptth_quic_output/quic_server.crt").await?.into (), None => tokio::fs::read ("ptth_quic_output/quic_server.crt").await.context ("can't read quic_server.crt from disk")?.into (),
}; };
let endpoint = make_client_endpoint ("0.0.0.0:0".parse ()?, &[&server_cert])?; let endpoint = make_client_endpoint ("0.0.0.0:0".parse ()?, &[&server_cert])?;

View File

@ -1,6 +1,7 @@
Interesting issues will get a unique ID with Interesting issues will get a unique ID with
`dd if=/dev/urandom bs=5 count=1 | base32` `dd if=/dev/urandom bs=5 count=1 | base32`
- PTTH_QUIC: Report errors on client GUI (At least whether it's P2 or P4)
- Fix long-running downloads restarting in the middle - Fix long-running downloads restarting in the middle
- [DMX6CO4G](issues/2021-01Jan/status-DMX6CO4G.md) fire-and-forget logs / key-value status data - [DMX6CO4G](issues/2021-01Jan/status-DMX6CO4G.md) fire-and-forget logs / key-value status data
- ptth_tail - ptth_tail