Compare commits
No commits in common. "2732e0376305fcc1543330004c3885b68a8374ad" and "ed660f3432c98ec4b173c69906c73cb95951f4ff" have entirely different histories.
2732e03763
...
ed660f3432
|
@ -1243,7 +1243,6 @@ dependencies = [
|
||||||
"ptth_file_server",
|
"ptth_file_server",
|
||||||
"ptth_server",
|
"ptth_server",
|
||||||
"quic_demo",
|
"quic_demo",
|
||||||
"rand",
|
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"rusty_ulid",
|
"rusty_ulid",
|
||||||
"sha2",
|
"sha2",
|
||||||
|
|
|
@ -19,7 +19,6 @@ hex = "0.4.3"
|
||||||
ptth_file_server = { path = "../ptth_file_server_bin" }
|
ptth_file_server = { path = "../ptth_file_server_bin" }
|
||||||
ptth_server = { path = "../ptth_server" }
|
ptth_server = { path = "../ptth_server" }
|
||||||
quic_demo = { path = "../../prototypes/quic_demo" }
|
quic_demo = { path = "../../prototypes/quic_demo" }
|
||||||
rand = "0.8.4"
|
|
||||||
rusty_ulid = "0.10.1"
|
rusty_ulid = "0.10.1"
|
||||||
sha2 = "0.9.8"
|
sha2 = "0.9.8"
|
||||||
tokio = { version = "1.8.1", features = ["full"] }
|
tokio = { version = "1.8.1", features = ["full"] }
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
use rand::Rng;
|
|
||||||
|
|
||||||
pub fn main () {
|
|
||||||
let wordlist = include_str! ("eff_short_wordlist_1.txt");
|
|
||||||
let words: Vec <_> = wordlist.split ('\n').take (1253).collect ();
|
|
||||||
|
|
||||||
assert_eq! (words.len (), 1253);
|
|
||||||
assert_eq! (words [0], "acid");
|
|
||||||
assert_eq! (words [600], "large");
|
|
||||||
assert_eq! (words [1252], "zoom");
|
|
||||||
|
|
||||||
let mut rng = rand::thread_rng ();
|
|
||||||
|
|
||||||
let random_words: Vec <&str> = (0..8)
|
|
||||||
.map (|_| {
|
|
||||||
words [rng.gen_range (0..words.len ())]
|
|
||||||
})
|
|
||||||
.collect ();
|
|
||||||
|
|
||||||
let passphrase = random_words.join (" ");
|
|
||||||
|
|
||||||
println! ("{}", passphrase);
|
|
||||||
}
|
|
|
@ -5,13 +5,11 @@ use std::{
|
||||||
|
|
||||||
use tokio::sync::watch;
|
use tokio::sync::watch;
|
||||||
|
|
||||||
mod diceware;
|
|
||||||
mod download;
|
mod download;
|
||||||
mod ulid;
|
mod ulid;
|
||||||
|
|
||||||
#[derive (Clone, Copy, Debug, PartialEq)]
|
#[derive (Clone, Copy, Debug, PartialEq)]
|
||||||
enum Subcommand {
|
enum Subcommand {
|
||||||
Diceware,
|
|
||||||
Download,
|
Download,
|
||||||
PtthServer,
|
PtthServer,
|
||||||
PtthFileServer,
|
PtthFileServer,
|
||||||
|
@ -29,7 +27,6 @@ async fn main () -> anyhow::Result <()> {
|
||||||
|
|
||||||
let (subcommand, args) = parse_args (&args)?;
|
let (subcommand, args) = parse_args (&args)?;
|
||||||
match subcommand {
|
match subcommand {
|
||||||
Diceware => Ok (diceware::main ()),
|
|
||||||
Download => download::main (&args).await,
|
Download => download::main (&args).await,
|
||||||
PtthServer => ptth_server::executable::main (&args).await,
|
PtthServer => ptth_server::executable::main (&args).await,
|
||||||
PtthFileServer => ptth_file_server::main (&args).await,
|
PtthFileServer => ptth_file_server::main (&args).await,
|
||||||
|
@ -53,7 +50,6 @@ fn parse_subcommand (arg: &str) -> Option <Subcommand>
|
||||||
use Subcommand::*;
|
use Subcommand::*;
|
||||||
|
|
||||||
let map = vec! [
|
let map = vec! [
|
||||||
("diceware", Diceware),
|
|
||||||
("download", Download),
|
("download", Download),
|
||||||
("ptth_server", PtthServer),
|
("ptth_server", PtthServer),
|
||||||
("ptth_file_server", PtthFileServer),
|
("ptth_file_server", PtthFileServer),
|
||||||
|
|
|
@ -70,7 +70,7 @@ fn file_server () {
|
||||||
let files_root = PathBuf::from ("./");
|
let files_root = PathBuf::from ("./");
|
||||||
let dirs_roots = Default::default ();
|
let dirs_roots = Default::default ();
|
||||||
|
|
||||||
let roots = internal::FileRoots {
|
let file_server_root = internal::FileRoots {
|
||||||
files: &files_root,
|
files: &files_root,
|
||||||
dirs: &dirs_roots,
|
dirs: &dirs_roots,
|
||||||
};
|
};
|
||||||
|
@ -96,7 +96,7 @@ fn file_server () {
|
||||||
})),
|
})),
|
||||||
] {
|
] {
|
||||||
let resp = internal::serve_all (
|
let resp = internal::serve_all (
|
||||||
roots,
|
file_server_root,
|
||||||
Method::Get,
|
Method::Get,
|
||||||
uri_path,
|
uri_path,
|
||||||
&headers,
|
&headers,
|
||||||
|
@ -113,7 +113,7 @@ fn file_server () {
|
||||||
}),
|
}),
|
||||||
] {
|
] {
|
||||||
let resp = internal::serve_all (
|
let resp = internal::serve_all (
|
||||||
roots,
|
file_server_root,
|
||||||
Method::Get,
|
Method::Get,
|
||||||
uri_path,
|
uri_path,
|
||||||
&headers,
|
&headers,
|
||||||
|
|
|
@ -17,13 +17,9 @@ hyper = { version = "0.14.4", features = ["http1", "server", "stream", "tcp"] }
|
||||||
quinn = "0.7.2"
|
quinn = "0.7.2"
|
||||||
rand = "0.8.4"
|
rand = "0.8.4"
|
||||||
rcgen = "0.8.11"
|
rcgen = "0.8.11"
|
||||||
|
reqwest = "0.11.4"
|
||||||
rmp-serde = "0.15.5"
|
rmp-serde = "0.15.5"
|
||||||
structopt = "0.3.20"
|
structopt = "0.3.20"
|
||||||
tokio = { version = "1.8.1", features = ["full"] }
|
tokio = { version = "1.8.1", features = ["full"] }
|
||||||
tracing-subscriber = "0.2.16"
|
tracing-subscriber = "0.2.16"
|
||||||
tracing = "0.1.25"
|
tracing = "0.1.25"
|
||||||
|
|
||||||
[dependencies.reqwest]
|
|
||||||
version = "0.11.10"
|
|
||||||
default-features = false
|
|
||||||
features = ["stream", "rustls-tls", "hyper-rustls"]
|
|
||||||
|
|
Loading…
Reference in New Issue