diff --git a/.gitignore b/.gitignore index 9eac0693e..5b4c283fc 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ integration-tests/staging* integration-tests/althea_rs_* integration-tests/target* integration-tests/mail/* +integration-tests/bounty.db-journal diff --git a/.travis.yml b/.travis.yml index 5bc0d2257..e225ebef4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,9 @@ before_install: - which diesel || cargo install diesel_cli --no-default-features --features sqlite - sudo cp $(which diesel) /usr/bin env: - - TEST_COMMAND="rustup component add rustfmt-preview --toolchain nightly && cargo fmt --all -- --check" + - TEST_COMMAND="rustup component add rustfmt-preview --toolchain nightly && cargo +nightly fmt --all -- --check" - TEST_COMMAND="cargo build --verbose --all" - - TEST_COMMAND="./integration-tests/cross-build.sh" - TEST_COMMAND="cargo test --verbose --all" RUST_TEST_THREADS=1 - - TEST_COMMAND="./integration-tests/rita.sh" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 - - TEST_COMMAND="./integration-tests/rita.sh" REVISION_B=release COMPAT_LAYOUT="inner_ring_old" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 - - TEST_COMMAND="./integration-tests/rita.sh" REVISION_B=master COMPAT_LAYOUT="inner_ring_old" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 rust: - stable - beta @@ -22,20 +18,23 @@ rust: script: - (eval "$TEST_COMMAND") matrix: + allow_failures: + - rust: beta + - rust: nightly + env: TEST_COMMAND="cargo build --verbose --all" + - rust: nightly + env: TEST_COMMAND="cargo test --verbose --all" RUST_TEST_THREADS=1 exclude: - - rust: stable - env: TEST_COMMAND="rustup component add rustfmt-preview --toolchain nightly && cargo fmt --all -- --check" - - rust: beta - env: TEST_COMMAND="rustup component add rustfmt-preview --toolchain nightly && cargo fmt --all -- --check" - - rust: stable - env: TEST_COMMAND="./integration-tests/cross-build.sh" - - rust: beta - env: TEST_COMMAND="./integration-tests/cross-build.sh" - - rust: stable - env: TEST_COMMAND="./integration-tests/rita.sh" REVISION_B=release COMPAT_LAYOUT="inner_ring_old" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 - - rust: beta - env: TEST_COMMAND="./integration-tests/rita.sh" REVISION_B=release COMPAT_LAYOUT="inner_ring_old" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 - - rust: stable - env: TEST_COMMAND="./integration-tests/rita.sh" REVISION_B=master COMPAT_LAYOUT="inner_ring_old" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 - - rust: beta - env: TEST_COMMAND="./integration-tests/rita.sh" REVISION_B=master COMPAT_LAYOUT="inner_ring_old" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 + - rust: beta + env: TEST_COMMAND="rustup component add rustfmt-preview --toolchain nightly && cargo +nightly fmt --all -- --check" + - rust: stable + env: TEST_COMMAND="rustup component add rustfmt-preview --toolchain nightly && cargo +nightly fmt --all -- --check" + include: + - name: "Cross compile on MIPS" + script: ./integration-tests/cross-build.sh + - script: ./integration-tests/rita.sh + env: INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 + - script: ./integration-tests/rita.sh + env: REVISION_B=release REMOTE_A=.. REMOTE_B="https://github.com/althea-mesh/althea_rs.git" COMPAT_LAYOUT="inner_ring_old" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 + - script: ./integration-tests/rita.sh + env: REVISION_B=master REMOTE_A=.. REMOTE_B="https://github.com/althea-mesh/althea_rs.git" COMPAT_LAYOUT="inner_ring_old" INITIAL_POLL_INTERVAL=5 BACKOFF_FACTOR="1.5" VERBOSE=1 diff --git a/Cargo.lock b/Cargo.lock index d8d78a57a..565ab25b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,47 +1,19 @@ [[package]] name = "actix" version = "0.7.0" -source = "git+https://github.com/kingoflolz/actix.git?branch=althea-mesh#d5d29e69dccf39fb54db642458ed7a511ac2371e" +source = "git+https://github.com/kingoflolz/actix.git?branch=althea-mesh#24128214460d911943a06b87028810cae5011774" dependencies = [ "actix_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-signal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "trust-dns-resolver 0.9.0 (git+https://github.com/kingoflolz/trust-dns.git?branch=lower-max-ttl)", - "uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "actix" -version = "0.7.1" -source = "git+https://github.com/actix/actix#9148a9c298d2b081de3df7d4e2053a1e2a409683" -dependencies = [ - "actix_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-channel 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -62,36 +34,36 @@ dependencies = [ "actix 0.7.0 (git+https://github.com/kingoflolz/actix.git?branch=althea-mesh)", "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "h2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 2.0.0-alpha.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -113,6 +85,16 @@ dependencies = [ "version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "actix_derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "adler32" version = "1.0.3" @@ -128,7 +110,7 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -139,18 +121,18 @@ name = "althea_kernel_interface" version = "0.1.0" dependencies = [ "eui48 0.4.0 (git+https://github.com/althea-mesh/eui48)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "althea_rs" -version = "0.1.4" +version = "0.1.5" dependencies = [ - "rita 0.1.4", + "rita 0.1.5", ] [[package]] @@ -165,7 +147,7 @@ dependencies = [ "num256 0.1.0", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -196,12 +178,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "ascii" -version = "0.8.7" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "atty" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -213,10 +195,10 @@ dependencies = [ name = "babel_monitor" version = "0.1.0" dependencies = [ - "ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", + "ascii 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "mockstream 0.0.3 (git+https://github.com/lazy-bitfield/rust-mockstream.git)", @@ -232,7 +214,7 @@ dependencies = [ "dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -244,7 +226,7 @@ dependencies = [ "backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -257,12 +239,21 @@ dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "base64" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "base64" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -271,7 +262,7 @@ name = "base64" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -299,15 +290,15 @@ name = "bounty_hunter" version = "0.1.0" dependencies = [ "althea_types 0.1.0", - "diesel 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dotenv 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "diesel 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "num256 0.1.0", "rouille 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -336,15 +327,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" -version = "1.2.3" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bytes" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -357,7 +348,7 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -381,7 +372,7 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", @@ -403,7 +394,7 @@ dependencies = [ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "clippy_lints 0.0.212 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -415,13 +406,13 @@ version = "0.0.212" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", - "if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", @@ -445,29 +436,38 @@ dependencies = [ "althea_kernel_interface 0.1.0", "althea_types 0.1.0", "docopt 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ipgen 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "settings 0.1.0", ] +[[package]] +name = "colored" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "config" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-ini 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde-hjson 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -495,6 +495,15 @@ dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "core-foundation" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "core-foundation-sys" version = "0.2.3" @@ -503,6 +512,14 @@ dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "core-foundation-sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crc" version = "1.8.1" @@ -513,14 +530,14 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-epoch 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-epoch 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -540,20 +557,20 @@ dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "crossbeam-epoch" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -596,27 +613,32 @@ dependencies = [ [[package]] name = "diesel" -version = "1.2.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "diesel_derives 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "diesel_derives 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libsqlite3-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "diesel_derives" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.12.15 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "digest" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -627,7 +649,7 @@ name = "docopt" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", @@ -636,10 +658,12 @@ dependencies = [ [[package]] name = "dotenv" -version = "0.9.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -654,13 +678,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "email" -version = "0.0.19" +version = "0.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -733,14 +757,14 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -816,31 +840,32 @@ name = "exit_db" version = "0.1.0" dependencies = [ "althea_types 0.1.0", - "diesel 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dotenv 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "diesel 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "failure_derive" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -898,7 +923,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -906,7 +931,7 @@ name = "futures-cpupool" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -933,18 +958,18 @@ dependencies = [ [[package]] name = "h2" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "string 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -953,14 +978,14 @@ name = "handlebars" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "pest_derive 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -983,7 +1008,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crypto-mac 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "digest 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1002,10 +1027,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "http" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1034,42 +1059,39 @@ dependencies = [ [[package]] name = "hyper" -version = "0.11.27" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "hyper-tls" -version = "0.1.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1077,14 +1099,14 @@ name = "idna" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "if_chain" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1170,7 +1192,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lazy_static" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1199,7 +1221,7 @@ dependencies = [ "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1208,7 +1230,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", - "email 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "email 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)", "lettre 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1226,7 +1248,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1236,7 +1258,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1294,7 +1316,7 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1304,7 +1326,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "digest 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1354,7 +1376,7 @@ dependencies = [ [[package]] name = "mime_guess" -version = "1.8.5" +version = "1.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1365,7 +1387,7 @@ dependencies = [ [[package]] name = "mime_guess" -version = "2.0.0-alpha.5" +version = "2.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "mime 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1420,14 +1442,16 @@ dependencies = [ [[package]] name = "mockito" -version = "0.9.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "http-muncher 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1444,7 +1468,7 @@ dependencies = [ "httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 1.8.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 1.8.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1465,6 +1489,22 @@ dependencies = [ "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "native-tls" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "net2" version = "0.2.33" @@ -1488,37 +1528,52 @@ dependencies = [ "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "nom" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "num" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", - "num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-bigint 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-complex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", + "num-rational 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-bigint" -version = "0.1.44" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-complex" -version = "0.1.43" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1540,13 +1595,12 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.1.42" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1567,11 +1621,11 @@ name = "num256" version = "0.1.0" dependencies = [ "ethereum-types 0.3.3 (git+https://github.com/paritytech/primitives.git)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1589,11 +1643,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "openssl" +version = "0.10.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "openssl-sys" version = "0.9.33" @@ -1601,7 +1673,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1632,7 +1704,7 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1646,7 +1718,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1701,18 +1773,18 @@ name = "phf_shared" version = "0.7.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "pkg-config" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro2" -version = "0.2.3" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1720,7 +1792,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "0.4.6" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1752,18 +1824,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "quote" -version = "0.4.2" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "quote" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1833,7 +1905,7 @@ name = "regex" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1842,12 +1914,12 @@ dependencies = [ [[package]] name = "regex" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "aho-corasick 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1867,20 +1939,12 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "relay" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "remove_dir_all" version = "0.5.1" @@ -1891,24 +1955,26 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.9.0-pre" +source = "git+https://github.com/seanmonstar/reqwest#d8e47babf6ed19168c7f0992d322e690d83f869b" dependencies = [ - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "encoding_rs 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libflate 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 2.0.0-alpha.5 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde_urlencoded 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1924,46 +1990,49 @@ dependencies = [ [[package]] name = "rita" -version = "0.1.4" +version = "0.1.5" dependencies = [ "actix 0.7.0 (git+https://github.com/kingoflolz/actix.git?branch=althea-mesh)", "actix-web 0.7.0 (git+https://github.com/actix/actix-web.git?branch=fix-missing-content-length)", - "actix_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "actix_derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "althea_kernel_interface 0.1.0", "althea_types 0.1.0", "babel_monitor 0.1.0", - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "clippy 0.0.212 (registry+https://github.com/rust-lang/crates.io-index)", "clu 0.0.1", - "config 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "diesel 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "config 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "diesel 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "docopt 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", - "dotenv 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", "eui48 0.4.0 (git+https://github.com/althea-mesh/eui48)", "exit_db 0.1.0", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "handlebars 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipnetwork 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "lettre 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "lettre_email 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "libsqlite3-sys 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "minihttpse 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mockito 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "mockito 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "mockstream 0.0.3 (git+https://github.com/lazy-bitfield/rust-mockstream.git)", "num256 0.1.0", + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.9.0-pre (git+https://github.com/seanmonstar/reqwest)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "settings 0.1.0", "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "trust-dns-resolver 0.9.0 (git+https://github.com/kingoflolz/trust-dns.git?branch=lower-max-ttl)", ] @@ -1973,14 +2042,14 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", "multipart 0.13.6 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2001,9 +2070,14 @@ dependencies = [ "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rust-ini" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rustc-demangle" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2042,15 +2116,10 @@ name = "schannel" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "scoped-tls" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "scopeguard" version = "0.3.3" @@ -2067,6 +2136,17 @@ dependencies = [ "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "security-framework" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "security-framework-sys" version = "0.1.16" @@ -2076,6 +2156,15 @@ dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "security-framework-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "semver" version = "0.9.0" @@ -2117,14 +2206,14 @@ name = "serde_derive" version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2157,16 +2246,16 @@ version = "0.1.0" dependencies = [ "althea_kernel_interface 0.1.0", "althea_types 0.1.0", - "config 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "config 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "eui48 0.4.0 (git+https://github.com/althea-mesh/eui48)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "num256 0.1.0", "owning_ref 0.3.3 (git+https://github.com/kingoflolz/owning-ref-rs/?branch=fix-bug)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2182,12 +2271,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "siphasher" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "slab" -version = "0.3.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2197,13 +2281,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "smallvec" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "smallvec" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "socket2" @@ -2225,22 +2307,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "stats_server" version = "0.1.0" dependencies = [ - "actix 0.7.1 (git+https://github.com/actix/actix)", + "actix 0.7.0 (git+https://github.com/kingoflolz/actix.git?branch=althea-mesh)", "actix-web 0.7.0 (git+https://github.com/actix/actix-web.git?branch=fix-missing-content-length)", "althea_types 0.1.0", "docopt 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "string" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2260,21 +2342,21 @@ dependencies = [ [[package]] name = "syn" -version = "0.12.15" +version = "0.13.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "syn" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2288,18 +2370,15 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.6.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "take" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "tempdir" version = "0.3.7" @@ -2309,6 +2388,18 @@ dependencies = [ "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tempfile" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "term" version = "0.2.14" @@ -2320,10 +2411,10 @@ dependencies = [ [[package]] name = "termcolor" -version = "0.3.6" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "wincolor 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2358,7 +2449,7 @@ name = "thread_local" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2406,7 +2497,7 @@ name = "tokio" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-fs 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2423,27 +2514,9 @@ name = "tokio-codec" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-core" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", - "scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2451,7 +2524,7 @@ name = "tokio-executor" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2459,7 +2532,7 @@ name = "tokio-fs" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-threadpool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2469,34 +2542,17 @@ name = "tokio-io" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio-proto" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio-reactor" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2504,20 +2560,12 @@ dependencies = [ "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio-service" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio-signal" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", "mio-uds 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2532,8 +2580,8 @@ name = "tokio-tcp" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2546,7 +2594,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2558,28 +2606,17 @@ name = "tokio-timer" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "tokio-tls" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "tokio-udp" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2600,14 +2637,14 @@ name = "trust-dns-proto" version = "0.4.0" source = "git+https://github.com/kingoflolz/trust-dns.git?branch=lower-max-ttl#e0cfafe8517ed5471d52438b16f213d2c0a375c5" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "socket2 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2625,20 +2662,20 @@ source = "git+https://github.com/kingoflolz/trust-dns.git?branch=lower-max-ttl#e dependencies = [ "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "ipconfig 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "resolv-conf 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "trust-dns-proto 0.4.0 (git+https://github.com/kingoflolz/trust-dns.git?branch=lower-max-ttl)", ] [[package]] name = "try-lock" -version = "0.1.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -2664,7 +2701,7 @@ name = "uint" version = "0.2.1" source = "git+https://github.com/paritytech/primitives.git#19c1d38627676cc9c51a24d3388c6fdb3b2264b2" dependencies = [ - "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2691,7 +2728,7 @@ name = "unicode-bidi" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2727,7 +2764,7 @@ name = "url" version = "0.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2739,7 +2776,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2797,12 +2834,12 @@ dependencies = [ [[package]] name = "want" -version = "0.0.4" +version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2841,7 +2878,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wincolor" -version = "0.1.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2882,21 +2919,22 @@ dependencies = [ [metadata] "checksum actix 0.7.0 (git+https://github.com/kingoflolz/actix.git?branch=althea-mesh)" = "" -"checksum actix 0.7.1 (git+https://github.com/actix/actix)" = "" "checksum actix-web 0.7.0 (git+https://github.com/actix/actix-web.git?branch=fix-missing-content-length)" = "" "checksum actix_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c4b1dc922654b9aca7a8a31eab875fde804fa9fbd67f220f2e457787b23590f2" +"checksum actix_derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b9d1525ef45e5e021f0b93dace157dcab5d792acb4cc78f3213787d65e2bb92" "checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" -"checksum aho-corasick 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0ba20154ea1f47ce2793322f049c5646cc6d0fa9759d5f333f286e507bf8080" +"checksum aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c1c6d463cbe7ed28720b5b489e7c083eeb8f90d08be2a0d6bb9e1ffea9ce1afa" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum arrayref 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0fd1479b7c29641adbd35ff3b5c293922d696a92f25c8c975da3e0acbc87258f" "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum ascii 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae7d751998c189c1d4468cf0a39bb2eae052a9c58d50ebb3b9591ee3813ad50" -"checksum ascii 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "97be891acc47ca214468e09425d02cef3af2c94d0d82081cd02061f996802f14" -"checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1" +"checksum ascii 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2b3c943947ef9a60212bd70d62f5775333c7739cf44b1b4abcbf4a57976f1867" +"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "346d7644f0b5f9bc73082d3b2236b69a05fd35cce0cfa3724e184e6a5c9e2a2f" "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" "checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e" +"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" "checksum base64 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5032d51da2741729bfdaeb2664d9b8c6d9fd1e2b90715c660b6def36628499c2" "checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" @@ -2906,40 +2944,44 @@ dependencies = [ "checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32" "checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" -"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9" -"checksum bytes 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7dd32989a66957d3f0cba6588f15d4281a733f4e9ffc43fcd2385f57d3bf99ff" +"checksum byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8389c509ec62b9fe8eca58c502a0acaf017737355615243496cde4994f8fa4f9" +"checksum bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e178b8e0e239e844b083d5a0d4a156b2654e67f9f80144d48398fcd736a24fb8" "checksum cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1efca0b863ca03ed4c109fb1c55e0bc4bbeb221d3e103d86251046b06a526bd0" "checksum cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275" "checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e" "checksum chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00" -"checksum chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6962c635d530328acc53ac6a955e83093fedc91c5809dfac1fa60fa470830a37" +"checksum chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e48d85528df61dc964aa43c5f6ca681a19cfa74939b2348d204bd08a981f2fb0" "checksum chunked_transfer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "498d20a7aaf62625b9bf26e637cf7736417cde1d0c99f1d04d1170229a85cf87" "checksum clippy 0.0.212 (registry+https://github.com/rust-lang/crates.io-index)" = "7e253af13a0cc39c7f22cf16f1be49d593dedc5895fe2fbb15f14d66ead00533" "checksum clippy_lints 0.0.212 (registry+https://github.com/rust-lang/crates.io-index)" = "bd2326065405649672adbd5cb30dad2fad3a470935653d51c70591d47d3a8512" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum config 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e595d1735d8ab6b04906bbdcfc671cce2a5e609b6f8e92865e67331cc2f41ba4" +"checksum colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc0a60679001b62fb628c4da80e574b9645ab4646056d7c9018885efffe45533" +"checksum config 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b5379dd8b3e7f488a31107d2c9586ce2ddbee2bc839201b3b38dbdf550351c1e" "checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e" "checksum cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "746858cae4eae40fff37e1998320068df317bc247dc91a67c6cfa053afdc2abb" "checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67" +"checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980" "checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d" +"checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa" "checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" -"checksum crossbeam-channel 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "258f3c07af0255827670241eacc8b0af7dbfc363df537ad062c6c515ca4a32ee" +"checksum crossbeam-channel 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "efff2d411e0ac3731b9f6de882b2790fdd2de651577500a806ce78b95b2b9f31" "checksum crossbeam-deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fe8153ef04a7594ded05b427ffad46ddeaf22e63fd48d42b3e1e3bb4db07cae7" "checksum crossbeam-epoch 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2af0e75710d6181e234c8ecc79f14a97907850a541b13b0be1dd10992f2e4620" -"checksum crossbeam-epoch 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "48deb8586d997ab13e98fb7e057b232149f9440321c73845b2f4cee483da29bc" +"checksum crossbeam-epoch 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "285987a59c4d91388e749850e3cb7b3a92299668528caaacd08005b8f238c0ea" "checksum crossbeam-utils 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d636a8b3bcc1b409d7ffd3facef8f21dcb4009626adbd0c5e6c4305c07253c7b" "checksum crossbeam-utils 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ea52fab26a99d96cdff39d0ca75c9716125937f5dba2ab83923aaaf5928f684a" "checksum crunchy 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda" "checksum crypto-mac 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7afa06d05a046c7a47c3a849907ec303504608c927f4e85f7bfff22b7180d971" "checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" -"checksum diesel 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06b6446da8e5ae24540deeb54b724ca401efd321fb0c77e583df05a086e05a2a" -"checksum diesel_derives 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6471a2b637b414d3ee1504cf230409a550381c79204282f8fe06c527e4ae56be" -"checksum digest 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3cae2388d706b52f2f2f9afe280f9d768be36544bd71d1b8120cb34ea6450b55" +"checksum diesel 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e71e7a348ae6064e86c4cf0709f0e4c3ef6f30e8e7d3dc05737164af4ebd3511" +"checksum diesel_derives 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03bcaf77491f53e400d5ee3bdd57142ea4e1c47fe9217b3361ff9a76ca0e3d37" +"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" +"checksum digest 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "5b29c278aa8fd30796bd977169e8004b4aa88cdcd2f32a6eb22bc2d5d38df94a" "checksum docopt 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d8acd393692c503b168471874953a2531df0e9ab77d0b6bbc582395743300a4a" -"checksum dotenv 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "400b347fe65ccfbd8f545c9d9a75d04b0caf23fec49aaa838a9a05398f94c019" +"checksum dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d0a1279c96732bc6800ce6337b6a614697b0e74ae058dc03c62ebeb78b4d86" "checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" -"checksum email 0.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "faacb54ba5ccc18b63f197548756b92e25a3a311696e84044238baf39b90c74a" +"checksum email 0.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "91549a51bb0241165f13d57fc4c72cef063b4088fb078b019ecbf464a45f22e4" "checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" "checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" "checksum encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" @@ -2948,7 +2990,7 @@ dependencies = [ "checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" "checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" "checksum encoding_rs 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98fd0f24d1fb71a4a6b9330c8ca04cbd4e7cc5d846b54ca74ff376bc7c9f798d" -"checksum env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0e6e40ebb0e66918a37b38c7acab4e10d299e0463fe2af5d29b9cc86710cfd2a" +"checksum env_logger 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "7873e292d20e8778f951278972596b3df36ac72a65c5b406f6d4961070a870c1" "checksum error-chain 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faa976b4fd2e4c2b2f3f486874b19e61944d3de3de8b61c9fcf835d583871bcc" "checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" "checksum error-chain 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6930e04918388a9a2e41d518c25cf679ccafe26733fb4127dbf21993f2575d46" @@ -2956,8 +2998,8 @@ dependencies = [ "checksum ethereum-types 0.3.3 (git+https://github.com/paritytech/primitives.git)" = "" "checksum ethereum-types-serialize 0.2.1 (git+https://github.com/paritytech/primitives.git)" = "" "checksum eui48 0.4.0 (git+https://github.com/althea-mesh/eui48)" = "" -"checksum failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934799b6c1de475a012a02dab0ace1ace43789ee4b99bcfbf1a2e3e8ced5de82" -"checksum failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cdda555bb90c9bb67a3b670a0f42de8e73f5981524123ad8578aafec8ddb8b" +"checksum failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7efb22686e4a466b1ec1a15c2898f91fa9cb340452496dca654032de20ff95b9" +"checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426" "checksum filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "714653f3e34871534de23771ac7b26e999651a0a228f47beb324dfdf1dd4b10f" "checksum fixed-hash 0.2.1 (git+https://github.com/paritytech/primitives.git)" = "" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" @@ -2965,26 +3007,26 @@ dependencies = [ "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "80599c995ed197a276e27c27f94a6346446538adde3b87c1ab384f6f8cabfed4" +"checksum futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "884dbe32a6ae4cd7da5c6db9b78114449df9953b8d490c9d7e1b51720b922c62" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" "checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" "checksum getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0a7292d30132fb5424b354f5dc02512a86e4c516fe544bb7a25e7f266951b797" -"checksum h2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "6229ac66d3392dd83288fe04defd4b353354b15bbe07820d53dda063a736afcc" +"checksum h2 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "35754349586639c6ff629abd19a605e5a42599b0da4aff7be67d63e48ef1ba4e" "checksum handlebars 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df2594295f9b79788875e0102718eb2eeea55f26ee18bee134c22db5c80e9d3e" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hmac 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "efb895368093a17d136b1d9eecdb607c7aa038a452e646c74e37ded2da106285" "checksum hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "21ceb46a83a85e824ef93669c8b390009623863b5c195d1ba747292c0c72f94e" "checksum htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163" -"checksum http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "4fbced8864b04c030eebcb7d0dc3a81ba5231ac559f5116a29a8ba83ecee22cd" +"checksum http 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0d7f7b919d476c052ff46833ac89aaf205726da8133dae61facad50ec4c9eaec" "checksum http-muncher 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ad5ef098f884f8d927426a231d14a923be1798ff0d5ad238989f4912565fb283" "checksum httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b6288d7db100340ca12873fd4d08ad1b8f206a9457798dfb17c018a33fee540" "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" -"checksum hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)" = "34a590ca09d341e94cddf8e5af0bbccde205d5fbc2fa3c09dd67c7f85cea59d7" -"checksum hyper-tls 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a5aa51f6ae9842239b0fac14af5f22123b8432b4cc774a44ff059fcba0f675ca" +"checksum hyper 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c087746de95e20e4dabe86606c3a019964a8fde2d5f386152939063c116c5971" +"checksum hyper-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "caaee4dea92794a9e697038bd401e264307d1f22c883dbcb6f6618ba0d3b3bd3" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -"checksum if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "61bb90bdd39e3af69b0172dfc6130f6cd6332bf040fbb9bdd4401d37adbd48b8" +"checksum if_chain 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4bac95d9aa0624e7b78187d6fb8ab012b41d9f6f54b1bcb61e61c4845f8357ec" "checksum indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08173ba1e906efb6538785a8844dd496f5d34f0a2d88038e95195172fc667220" "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" "checksum ipconfig 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9ec4e18c0a0d4340870c14284293632d8421f419008371422dd327892b88877c" @@ -2996,7 +3038,7 @@ dependencies = [ "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" -"checksum lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739" +"checksum lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fb497c35d362b6a331cfd94956a07fc2c78a4604cdbee844a81170386b996dd3" "checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef" "checksum lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d33a48d0365c96081958cc663eef834975cb1e8d8bea3378513fc72bdbf11e50" "checksum lettre 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d440625fef1b29dd39cbe1c582476ca4295117adc940bad78a7b37514a18eef2" @@ -3011,7 +3053,7 @@ dependencies = [ "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "61bd98ae7f7b754bc53dca7d44b604f733c6bba044ea6f41bc8d89272d8161d2" "checksum lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d06ff7ff06f729ce5f4e227876cb88d10bc59cd4ae1e09fbb2bde15c850dc21" -"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" +"checksum matches 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "835511bab37c34c47da5cb44844bea2cfde0236db0b506f90ea4224482c9774a" "checksum md-5 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9402eaae33a9e144ce18ef488a0e4ca19869673c7bcdbbfe2030fdc3f84211cd" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" @@ -3019,34 +3061,39 @@ dependencies = [ "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" "checksum mime 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "fe51c8699d2dc522bf8c1ebe26ea2193d151fb54bcdfd7d0318750c189994cd9" -"checksum mime_guess 1.8.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7287ba93031813826d8974566e54eb5e49d4473752f7df21c610dab289aee8cb" -"checksum mime_guess 2.0.0-alpha.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d1a78b5e2283080d5a8ba68216171b4fe34f6ccdd909bb29be16ce8a9a831341" +"checksum mime_guess 1.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2d4c0961143b8efdcfa29c3ae63281601b446a4a668165454b6c90f8024954c5" +"checksum mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)" = "30de2e4613efcba1ec63d8133f344076952090c122992a903359be5a4f99c3ed" "checksum minihttpse 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8e50e8cee436b4318ec759930d6ea5f839d14dab94e81b6fba37d492d07ebf55" "checksum mio 0.6.15 (registry+https://github.com/rust-lang/crates.io-index)" = "4fcfcb32d63961fb6f367bfd5d21e4600b92cd310f71f9dca25acae196eb1560" "checksum mio-uds 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "84c7b5caa3a118a6e34dbac36504503b1e8dc5835e833306b9d6af0e05929f79" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum mockito 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a3c526330d1f3b57ed2f3231922f8e196342fe0d24c9a89e4bbc6970e3c0a5f2" +"checksum mockito 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b92f0012f86f99e9733772b8cb72cc64e78dbe9fc9989648244e7e3d78f92424" "checksum mockstream 0.0.3 (git+https://github.com/lazy-bitfield/rust-mockstream.git)" = "" "checksum multipart 0.13.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92f54eb45230c3aa20864ccf0c277eeaeadcf5e437e91731db498dbf7fbe0ec6" "checksum native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0" +"checksum native-tls 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7530becae57a21b3325685bd5c98559c58cb57b7cc8c53e825cd85459b023ba9" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" "checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" +"checksum nom 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "898696750eb5c3ce5eb5afbfbe46e7f7c4e1936e19d3e97be4b7937da7b6d114" "checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" -"checksum num-bigint 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1" -"checksum num-complex 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656" +"checksum num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf4825417e1e1406b3782a8ce92f4d53f26ec055e3622e1881ca8e9f5f9e08db" +"checksum num-bigint 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3eceac7784c5dc97c2d6edf30259b4e153e6e2b42b3c85e9a6e9f45d06caef6e" +"checksum num-complex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "68de83578789e0fbda3fa923035be83cf8bfd3b30ccfdecd5aa89bf8601f408e" "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" "checksum num-iter 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "af3fdbbc3291a5464dc57b03860ec37ca6bf915ed6ee385e7c6c052c422b2124" -"checksum num-rational 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" +"checksum num-rational 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e96f040177bb3da242b5b1ecf3f54b5d5af3efbbfb18608977a5d2767b22f10" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" "checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" +"checksum openssl 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ed18a0f40ec4e9a8a81f8865033d823b7195d16a0a5721e10963ee1b0c2980ca" "checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985" +"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" "checksum openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)" = "d8abc04833dcedef24221a91852931df2f63e3369ae003134e70aff3645775cc" "checksum owning_ref 0.3.3 (git+https://github.com/kingoflolz/owning-ref-rs/?branch=fix-bug)" = "" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac" -"checksum parking_lot 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "901d6514273469bb17380c1ac3f51fb3ce54be1f960e51a6f04901eba313ab8d" +"checksum parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "69376b761943787ebd5cc85a5bc95958651a22609c5c1c2b65de21786baec72b" "checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum pest 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0fce5d8b5cc33983fc74f78ad552b5522ab41442c4ca91606e4236eb4b5ceefc" @@ -3055,15 +3102,15 @@ dependencies = [ "checksum phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "4e4048fe7dd7a06b8127ecd6d3803149126e9b33c7558879846da3a63f734f2b" "checksum phf_generator 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "05a079dd052e7b674d21cb31cbb6c05efd56a2cd2827db7692e2f1a507ebd998" "checksum phf_shared 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)" = "c2261d544c2bb6aa3b10022b0be371b9c7c64f762ef28c6f5d4f1ef6d97b5930" -"checksum pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "110d5ee3593dbb73f56294327fe5668bcc997897097cbc76b51e7aed3f52452f" -"checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" -"checksum proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "effdb53b25cdad54f8f48843d67398f7ef2e14f12c1b4cb4effc549a6462a4d6" +"checksum pkg-config 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "6a52e4dbc8354505ee07e484ab07127e06d87ca6fa7f0a516a2b294e5ad5ad16" +"checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" +"checksum proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "cccdc7557a98fe98453030f077df7f3a042052fae465bb61d2c2c41435cfd9b6" "checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408" -"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035" +"checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" +"checksum quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b71f9f575d55555aa9c06188be9d4e2bfc83ed02537948ac0d520c24d0419f1a" "checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" "checksum rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "12397506224b2f93e6664ffc4f664b29be8208e5157d3d90b44f09b5fae470ea" @@ -3072,56 +3119,55 @@ dependencies = [ "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" "checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -"checksum regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13c93d55961981ba9226a213b385216f83ab43bd6ac53ab16b2eeb47e337cf4e" +"checksum regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5bbbea44c5490a1e84357ff28b7d518b4619a159fed5d25f6c1de2d19cc42814" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" -"checksum regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05b06a75f5217880fc5e905952a42750bf44787e56a6c6d6852ed0992f5e1d54" -"checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" +"checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" -"checksum reqwest 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2abe46f8e00792693a2488e296c593d1f4ea39bb1178cfce081d6793657575e4" +"checksum reqwest 0.9.0-pre (git+https://github.com/seanmonstar/reqwest)" = "" "checksum resolv-conf 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c62bd95a41841efdf7fca2ae9951e64a8d8eae7e5da196d8ce489a2241491a92" "checksum rouille 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc1f8407af80b0630983b2c1f1860dda1960fdec8d3ee75ba8db14937756d3a0" "checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" -"checksum rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "76d7ba1feafada44f2d38eed812bd2489a03c0f5abb975799251518b68848649" +"checksum rust-ini 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ac66e816614e124a692b6ac1b8437237a518c9155a3aacab83a373982630c715" +"checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" "checksum rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0ceb8ce7a5e520de349e1fa172baeba4a9e8d5ef06c47471863530bc4972ee1e" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a" "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" "checksum same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cfb6eded0b06a0b512c8ddbcf04089138c9b4362c2f696f3c3d76039d68f3637" "checksum schannel 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "dc1fabf2a7b6483a141426e1afd09ad543520a77ac49bd03c286e7696ccfd77f" -"checksum scoped-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "332ffa32bf586782a3efaeb58f127980944bbc8c4d6913a86107ac2a5ab24b28" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "dfa44ee9c54ce5eecc9de7d5acbad112ee58755239381f687e564004ba4a2332" +"checksum security-framework 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "697d3f3c23a618272ead9e1fb259c1411102b31c6af8b93f1d64cca9c3b0e8e0" "checksum security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "5421621e836278a0b139268f36eee0dc7e389b784dc3f79d8f11aabadf41bead" +"checksum security-framework-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab01dfbe5756785b5b4d46e0289e5a18071dfa9a7c2b24213ea00b9ef9b665bf" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" "checksum serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3adf19c07af6d186d91dae8927b83b0553d07ca56cbf7f2f32560455c91920" "checksum serde-hjson 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a2376ebb8976138927f48b49588ef73cde2f6591b8b3df22f4063e0f27b9bec" "checksum serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)" = "3525a779832b08693031b8ecfb0de81cd71cfd3812088fafe9a7496789572124" -"checksum serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)" = "84b8035cabe9b35878adec8ac5fe03d5f6bc97ff6edd7ccb96b44c1276ba390e" +"checksum serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c6908c7b925cd6c590358a4034de93dbddb20c45e1d021931459fd419bf0e2" "checksum serde_test 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "110b3dbdf8607ec493c22d5d947753282f3bae73c0f56d322af1e8c78e4c23d5" "checksum serde_urlencoded 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e703cef904312097cfceab9ce131ff6bbe09e8c964a0703345a5f49238757bc1" "checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" -"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" +"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" "checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d" -"checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013" -"checksum smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "312a7df010092e73d6bbaf141957e868d4f30efd2bfd9bb1028ad91abec58514" +"checksum smallvec 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "26df3bb03ca5eac2e64192b723d51f56c1b1e0860e7c766281f4598f181acdc8" "checksum socket2 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "962a516af4d3a7c272cb3a1d50a8cc4e5b41802e4ad54cfb7bee8ba61d37d703" "checksum stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffbc596e092fe5f598b12ef46cc03754085ac2f4d8c739ad61c4ae266cc3b3fa" -"checksum string 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "31f98b200e7caca9efca50fc0aa69cd58a5ec81d5f6e75b2f3ecaad2e998972a" +"checksum string 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00caf261d6f90f588f8450b8e1230fa0d5be49ee6140fdfbcb55335aff350970" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum syn 0.12.15 (registry+https://github.com/rust-lang/crates.io-index)" = "c97c05b8ebc34ddd6b967994d5c6e9852fa92f8b82b3858c39451f97346dcce5" -"checksum syn 0.14.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2beff8ebc3658f07512a413866875adddd20f4fd47b2a4e6c9da65cd281baaea" +"checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" +"checksum syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4bad7abdf6633f07c7046b90484f1d9dc055eca39f8c991177b1046ce61dba9a" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" -"checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd" -"checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" +"checksum synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb9b7550d063ea184027c9b8c20ac167cd36d3e06b3a40bceb9d746dc1a7b7" "checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +"checksum tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c4b103c6d08d323b92ff42c8ce62abcd83ca8efa7fd5bf7927efefec75f58c76" "checksum term 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "f2077e54d38055cf1ca0fd7933a2e00cd3ec8f6fed352b2a377f06dcdaaf3281" -"checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83" +"checksum termcolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "722426c4a0539da2c4ffd9b419d90ad540b4cff4a053be9069c908d4d07e2836" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" @@ -3132,23 +3178,19 @@ dependencies = [ "checksum tiny_http 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f4d55c9a213880d1f0c89ded183f209c6e45b912ca6c7df6f93c163773572e1" "checksum tokio 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8ee337e5f4e501fc32966fec6fe0ca0cc1c237b0b1b14a335f8bfe3c5f06e286" "checksum tokio-codec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "881e9645b81c2ce95fcb799ded2c29ffb9f25ef5bef909089a420e5961dd8ccb" -"checksum tokio-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "aeeffbbb94209023feaef3c196a41cbcdafa06b4a6f893f68779bb5e53796f71" "checksum tokio-executor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8cac2a7883ff3567e9d66bb09100d09b33d90311feca0206c7ca034bc0c55113" "checksum tokio-fs 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "40697ecbea5660df15b15d50a077386477d2f6a35002adf01ce76ff9dd9dce48" "checksum tokio-io 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a5c9635ee806f26d302b8baa1e145689a280d8f5aa8d0552e7344808da54cc21" -"checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389" "checksum tokio-reactor 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e00ec63bbec2c97ce1178cb0587b2c438b2f6b09d3ee54a33c45a9cf0d530810" -"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" "checksum tokio-signal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "342d088c63623f63eada591e065778038c63b516939530db2aa09a8df9118507" "checksum tokio-tcp 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec9b094851aadd2caf83ba3ad8e8c4ce65a42104f7b94d9e6550023f0407853f" "checksum tokio-threadpool 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "24ab84f574027b0e875378f31575cf175360891919e93a3490f07e76e00e4efb" "checksum tokio-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "028b94314065b90f026a21826cffd62a4e40a92cda3e5c069cc7b02e5945f5e9" -"checksum tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "772f4b04e560117fe3b0a53e490c16ddc8ba6ec437015d91fa385564996ed913" "checksum tokio-udp 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43eb534af6e8f37d43ab1b612660df14755c42bd003c5f8d2475ee78cc4600c0" "checksum toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a0263c6c02c4db6c8f7681f9fd35e90de799ebd4cfdeab77a38f4ff6b3d8c0d9" "checksum trust-dns-proto 0.4.0 (git+https://github.com/kingoflolz/trust-dns.git?branch=lower-max-ttl)" = "" "checksum trust-dns-resolver 0.9.0 (git+https://github.com/kingoflolz/trust-dns.git?branch=lower-max-ttl)" = "" -"checksum try-lock 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2aa4715743892880f70885373966c83d73ef1b0838a664ef0c76fffd35e7c2" +"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum twoway 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" @@ -3171,14 +3213,14 @@ dependencies = [ "checksum version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "63636bd0eb3d00ccb8b9036381b526efac53caf112b7783b730ab3f8e44da369" -"checksum want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" +"checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3" "checksum widestring 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7157704c2e12e3d2189c507b7482c52820a16dfa4465ba91add92f266667cadb" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767" +"checksum wincolor 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b9dc3aa9dcda98b5a16150c54619c1ead22e3d3a5d458778ae914be760aa981a" "checksum winreg 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a27a759395c1195c4cc5cda607ef6f8f6498f64e78f7900f5de0a127a424704a" "checksum winutil 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7daf138b6b14196e3830a588acf1e86966c694d3e8fb026fb105b8b5dca07e6e" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/Cargo.toml b/Cargo.toml index 5be21bec9..a2b80a859 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,11 @@ [package] name = "althea_rs" -version = "0.1.4" +version = "0.1.5" authors = ["Stan Drozd "] +[features] +development = ["rita/development"] + [dependencies] rita = { path = "./rita" } @@ -11,7 +14,6 @@ members = ["althea_kernel_interface", "bounty_hunter", "settings", "clu", "exit_ [profile.release] opt-level = "z" -debug=true lto = true codegen-units = 1 incremental = false diff --git a/README.md b/README.md index cf52eeb4e..80ad9f420 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,19 @@ You are now ready to build code from this Rust repository by running cargo build --all +If you want to build a development build that contains unsafe options that are not suitable for production usage: + + cargo build --all --features development + +## Development + +Please install required git hooks before contributing. Those hooks are responsible for making the codebase consistent. + +```sh +rustup component add rustfmt-preview --toolchain nightly +cd .git/hooks && ln -s ../../scripts/.git-hooks/pre-commit +``` + ## Components ### Rita diff --git a/althea_kernel_interface/Cargo.toml b/althea_kernel_interface/Cargo.toml index fbab961d3..17037899a 100644 --- a/althea_kernel_interface/Cargo.toml +++ b/althea_kernel_interface/Cargo.toml @@ -6,9 +6,9 @@ description = "Gets information from and changes settings of kernel network stac license = "Apache-2.0" [dependencies] -regex = "0.2" -failure = "0.1.1" -itertools = "0.7.4" -log = "^0.4" -lazy_static = "1.0" +regex = "1.0.2" +failure = "0.1.2" +itertools = "0.7.8" +log = "0.4.3" +lazy_static = "1.0.2" eui48 = { git = "https://github.com/althea-mesh/eui48", features = ["serde"] } diff --git a/althea_kernel_interface/src/dns.rs b/althea_kernel_interface/src/dns.rs new file mode 100644 index 000000000..263cb0c44 --- /dev/null +++ b/althea_kernel_interface/src/dns.rs @@ -0,0 +1,34 @@ +use super::KernelInterface; + +use std::fs::File; +use std::io::Error; +use std::io::Read; +use std::net::IpAddr; + +impl KernelInterface { + /// Gets a list of IP addresses of nameservers from /etc/resolv.conf, may be v6, v4 or both + /// generally ignores malformed lines but produces IO errors + pub fn get_resolv_servers(&self) -> Result, Error> { + let mut f = File::open("/etc/resolv.conf")?; + let mut contents = String::new(); + f.read_to_string(&mut contents)?; + + let mut res = Vec::new(); + for line in contents.lines() { + if line.starts_with("nameserver") { + let mut nameserver = line.split(" "); + nameserver.next(); + match nameserver.next() { + Some(ip) => match ip.parse() { + Ok(addr) => res.push(addr), + Err(e) => { + warn!("Could not parse /etc/resolv.conf ip {:?} with {:?}", ip, e) + } + }, + None => warn!("Invalid /etc/resolv.conf!"), + } + } + } + Ok(res) + } +} diff --git a/althea_kernel_interface/src/exit_server_tunnel.rs b/althea_kernel_interface/src/exit_server_tunnel.rs index c8bd2452b..88411ce12 100644 --- a/althea_kernel_interface/src/exit_server_tunnel.rs +++ b/althea_kernel_interface/src/exit_server_tunnel.rs @@ -17,7 +17,7 @@ pub struct ExitClient { impl KernelInterface { pub fn set_exit_wg_config( &self, - clients: Vec<(ExitClient)>, + clients: Vec, listen_port: u16, private_key_path: &str, local_ip: &IpAddr, diff --git a/althea_kernel_interface/src/interface_tools.rs b/althea_kernel_interface/src/interface_tools.rs index 6a4252d6a..3c10ab65c 100644 --- a/althea_kernel_interface/src/interface_tools.rs +++ b/althea_kernel_interface/src/interface_tools.rs @@ -123,8 +123,7 @@ fn test_get_wg_remote_ip() { assert_eq!(args, &["show", "wg0", "endpoints"]); Ok(Output { stdout: b"fvLYbeMV+RYbzJEc4lNEPuK8ulva/5wcSJBz0W5t3hM= 71.8.186.226:60000\ -" - .to_vec(), +".to_vec(), stderr: b"".to_vec(), status: ExitStatus::from_raw(0), }) diff --git a/althea_kernel_interface/src/lib.rs b/althea_kernel_interface/src/lib.rs index 4d452ec0c..b1db09f94 100644 --- a/althea_kernel_interface/src/lib.rs +++ b/althea_kernel_interface/src/lib.rs @@ -20,6 +20,7 @@ use std::str; mod counter; mod create_wg_key; mod delete_tunnel; +mod dns; mod exit_client_tunnel; mod exit_server_counter; mod exit_server_tunnel; diff --git a/althea_kernel_interface/src/link_local_tools.rs b/althea_kernel_interface/src/link_local_tools.rs index 47c5647e4..3ef933713 100644 --- a/althea_kernel_interface/src/link_local_tools.rs +++ b/althea_kernel_interface/src/link_local_tools.rs @@ -1,6 +1,6 @@ use super::{KernelInterface, KernelInterfaceError}; -use std::net::IpAddr; +use std::net::{IpAddr, Ipv6Addr}; use regex::Regex; @@ -8,7 +8,7 @@ use failure::Error; impl KernelInterface { /// This gets our link local ip for a given device - pub fn get_link_local_device_ip(&self, dev: &str) -> Result { + pub fn get_link_local_device_ip(&self, dev: &str) -> Result { let output = self.run_command("ip", &["addr", "show", "dev", dev, "scope", "link"])?; trace!("Got {:?} from `ip addr`", output); @@ -17,7 +17,7 @@ impl KernelInterface { let cap = re.captures(&str); if let Some(cap) = cap { trace!("got link local IP of {} from device {}", &cap[1], &dev); - Ok(cap[1].parse()?) + Ok(cap[1].parse::()?) } else { Err(KernelInterfaceError::RuntimeError( "No link local addresses found or no interface found".to_string(), @@ -26,7 +26,7 @@ impl KernelInterface { } /// This gets our global ip for a given device - pub fn get_global_device_ip(&self, dev: &str) -> Result { + pub fn get_global_device_ip(&self, dev: &str) -> Result { let output = self.run_command("ip", &["addr", "show", "dev", dev, "scope", "global"])?; trace!("Got {:?} from `ip addr`", output); @@ -35,7 +35,7 @@ impl KernelInterface { let cap = re.captures(&str); if let Some(cap) = cap { trace!("got global IP of {} from device {}", &cap[1], &dev); - Ok(cap[1].parse()?) + Ok(cap[1].parse::()?) } else { Err(KernelInterfaceError::RuntimeError( "No global found or no interface found".to_string(), @@ -59,9 +59,9 @@ impl KernelInterface { /// This gets our link local ip that can be reached by another node with link local ip pub fn get_reply_ip( &self, - their_ip: IpAddr, + their_ip: Ipv6Addr, external_interface: Option, - ) -> Result { + ) -> Result { let neigh = self.get_neighbors()?; trace!("Looking for {:?} in {:?} for reply ip", their_ip, neigh); diff --git a/althea_types/Cargo.toml b/althea_types/Cargo.toml index a004d7816..31f7f4201 100644 --- a/althea_types/Cargo.toml +++ b/althea_types/Cargo.toml @@ -5,11 +5,11 @@ authors = ["Jehan "] [dependencies] num256 = { path = "../num256" } -base64 = "0.9.0" -serde_derive = "1.0.24" -serde = "1.0.24" -serde_json = "1.0.8" -hex = "0.3.1" +base64 = "0.9.2" +serde_derive = "1.0.70" +serde = "1.0.70" +serde_json = "1.0.24" +hex = "0.3.2" eui48 = { git = "https://github.com/althea-mesh/eui48", features = ["serde"] } actix = { git = "https://github.com/kingoflolz/actix", branch = "althea-mesh", optional=true} -ethereum-types = {git="https://github.com/paritytech/primitives.git"} \ No newline at end of file +ethereum-types = {git="https://github.com/paritytech/primitives.git"} diff --git a/althea_types/src/interop.rs b/althea_types/src/interop.rs index 89817f5a0..8f0651c1c 100644 --- a/althea_types/src/interop.rs +++ b/althea_types/src/interop.rs @@ -146,6 +146,7 @@ impl Message for Identity { #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Hash, Clone)] pub struct LocalIdentity { pub wg_port: u16, + pub have_tunnel: Option, // If we have an existing tunnel, None if we don't know pub global: Identity, } diff --git a/babel_monitor/Cargo.toml b/babel_monitor/Cargo.toml index 299ca0df2..14f92d6c7 100644 --- a/babel_monitor/Cargo.toml +++ b/babel_monitor/Cargo.toml @@ -5,9 +5,9 @@ authors = ["jkilpatr "] [dependencies] mockstream = { git = "https://github.com/lazy-bitfield/rust-mockstream.git" } -ascii = "0.8.6" -bufstream = "0.1" +ascii = "0.9.0" +bufstream = "0.1.3" ipnetwork = "0.13.0" -failure = "0.1.1" -log = "^0.4" -env_logger = "0.5" +failure = "0.1.2" +log = "0.4.3" +env_logger = "0.5.11" diff --git a/bounty_hunter/Cargo.toml b/bounty_hunter/Cargo.toml index 0b501cfb6..9cbcd5b74 100644 --- a/bounty_hunter/Cargo.toml +++ b/bounty_hunter/Cargo.toml @@ -4,16 +4,16 @@ version = "0.1.0" authors = ["kingoflolz "] [dependencies] -log = "^0.4" -env_logger = "^0.5.5" +log = "0.4.3" +env_logger = "0.5.11" num256 = { path = "../num256" } althea_types = { path = "../althea_types" } -diesel = { version = "=1.2.0", features = ["sqlite"] } -dotenv = "0.9.0" -serde = "1.0.24" -serde_derive = "1.0.24" -serde_json = "1.0.8" +diesel = { version = "1.3.2", features = ["sqlite"] } +dotenv = "0.13.0" +serde = "1.0.70" +serde_derive = "1.0.70" +serde_json = "1.0.24" [dependencies.rouille] -version = "2.0" -default-features = false \ No newline at end of file +version = "2.1.0" +default-features = false diff --git a/clu/Cargo.toml b/clu/Cargo.toml index 8f9df5912..52d933d23 100644 --- a/clu/Cargo.toml +++ b/clu/Cargo.toml @@ -7,14 +7,14 @@ authors = ["Justin "] settings = { path = "../settings" } althea_kernel_interface = { path = "../althea_kernel_interface" } althea_types = { path = "../althea_types" } -lazy_static = "1.0" -docopt = "0.8.1" -log = "^0.4" -env_logger = "^0.5.5" -failure = "0.1.1" +lazy_static = "1.0.2" +docopt = "0.8.3" +log = "0.4.3" +env_logger = "0.5.11" +failure = "0.1.2" ipgen = "0.0.4" -regex = "0.2" -rand = "0.4" -serde = "1.0" -serde_derive = "1.0" -serde_json = "1.0" +regex = "1.0.2" +rand = "0.5.4" +serde = "1.0.70" +serde_derive = "1.0.70" +serde_json = "1.0.24" diff --git a/clu/src/lib.rs b/clu/src/lib.rs index 7fab372c3..1fdfdef13 100644 --- a/clu/src/lib.rs +++ b/clu/src/lib.rs @@ -20,6 +20,7 @@ use failure::Error; use althea_kernel_interface::KI; extern crate althea_kernel_interface; +use rand::distributions::Alphanumeric; use regex::Regex; use std::path::Path; use std::sync::{Arc, RwLock}; @@ -33,7 +34,7 @@ pub enum CluError { RuntimeError(String), } -fn linux_generate_wg_keys(config: &mut NetworkSettings) -> Result<(), Error> { +pub fn linux_generate_wg_keys(config: &mut NetworkSettings) -> Result<(), Error> { let keys = KI.create_wg_keypair()?; let wg_public_key = &keys[0]; let wg_private_key = &keys[1]; @@ -45,8 +46,8 @@ fn linux_generate_wg_keys(config: &mut NetworkSettings) -> Result<(), Error> { Ok(()) } -fn linux_generate_mesh_ip(config: &mut NetworkSettings) -> Result<(), Error> { - let seed: String = thread_rng().gen_ascii_chars().take(50).collect(); +pub fn linux_generate_mesh_ip(config: &mut NetworkSettings) -> Result<(), Error> { + let seed: String = thread_rng().sample_iter(&Alphanumeric).take(50).collect(); let mesh_ip = ipgen::ip(&seed, "fd00::/8").unwrap(); info!("generated new ip address {}", mesh_ip); diff --git a/docs/api/router-dashboard.md b/docs/api/router-dashboard.md index f0a79e83a..0741b6225 100644 --- a/docs/api/router-dashboard.md +++ b/docs/api/router-dashboard.md @@ -25,7 +25,7 @@ This file documents the dashboard API found in Rita client. `curl 127.0.0.1:4877/info` ---- + ## /neighbors @@ -64,11 +64,12 @@ This file documents the dashboard API found in Rita client. `curl 127.0.0.1:4877/neighbors` ---- + ## /exits - URL: `:/exits' +- Comment: Gets all the configured exits - Method: `GET` - URL Params: `None` - Data Params: `None` @@ -104,8 +105,94 @@ This file documents the dashboard API found in Rita client. `curl 127.0.0.1:4877/exits` ---- +## /exits/{nickname}/reset + +- URL: `:/exits/{nickname}/reset' +- Comment: Resets the exit named `nickname` +- Method: `POST` +- URL Params: `nickname`, string +- Data Params: `None` +- Success Response: + - Code: 200 OK + - Contents: `{}` +- Error Response: `400 Bad Request` +- Error Contents: +```json +{ + "error": "", +} +``` +- Sample Call: + +`curl -XPOST 127.0.0.1:4877/exits/borked/reset` + +## /exits/{nickname}/select + +- URL: `:/exits/{nickname}/select' +- Comment: Sets the exit named `nickname` as the current exit +- Method: `POST` +- URL Params: `nickname`, string +- Data Params: `None` +- Success Response: + - Code: 200 OK + - Contents: `{}` +- Error Response: `400 Bad Request` +- Error Contents: +```json +{ + "error": "", +} +``` +- Sample Call: + +`curl -XPOST 127.0.0.1:4877/exits/borked/reset` + +## /exits/{nickname}/register + +- URL: `:/exits/{nickname}/register' +- Comment: Asks exit `{nickname}` to be registered +- Method: `POST` +- URL Params: `nickname`, string +- Data Params: `None` +- Success Response: + - Code: 200 OK + - Contents: `{}` +- Error Response: `400 Bad Request` +- Error Contents: +```json +{ + "error": "", + "rust_error": "" +} +``` +- Sample Call: + +`curl -XPOST 127.0.0.1:4877/exits/borked/register` +## /exits/{nickname}/verify/{code} + +- URL: `:/exits/{nickname}/verify/{code}' +- Comment: After registering and receiving a verification code, asks exit + `{nickname}` for verification using `{code}` +- Method: `POST` +- URL Params: + - `nickname`, string + - `code`, string +- Data Params: `None` +- Success Response: + - Code: 200 OK + - Contents: `{}` +- Error Response: `400 Bad Request` +- Error Contents: +```json +{ + "error": "", + "rust_error": "" +} +``` +- Sample Call: + +`curl -XPOST 127.0.0.1:4877/exits/borked/register` ## /settings @@ -228,7 +315,7 @@ This file documents the dashboard API found in Rita client. `curl 127.0.0.1:4877/settings` ---- + ## /settings @@ -254,7 +341,7 @@ This file documents the dashboard API found in Rita client. `curl -XPOST 127.0.0.1:/settings -H 'Content-Type: application/json' -i -d '{"exit_client": {"current_exit": "SELECTEDEXIT"}}'` } ---- + ## /wifi_settings @@ -313,7 +400,7 @@ This file documents the dashboard API found in Rita client. `curl 127.0.0.1:4877/wifi_settings` ---- + ## /wifi_settings @@ -336,3 +423,111 @@ This file documents the dashboard API found in Rita client. `curl -XPOST 127.0.0.1:/settings -H 'Content-Type: application/json' -i -d '{"default_radio0": {"ssid": "NetworkName"}}'` --- + +## /wifi_settings/ssid + +- URL: `:/wifi_settings/ssid` +- Method: `POST` +- URL Params: `Content-Type: application/json` +- Data Params: `Radio to change the ssid of and ssid` +- Success Response: + - Code: 200 OK + - Contents: + +``` +{} +``` + +- Error Response: `500 Server Error` + +- Sample Call: + +`curl -XPOST 127.0.0.1:/wifi_settings/ssid -H 'Content-Type: application/json' -i -d '{"radio":"radio0", "ssid": "this is a freeform ssid"}'` + + +--- + +## /wifi_settings/pass + +- URL: `:/wifi_settings/pass` +- Method: `POST` +- URL Params: `Content-Type: application/json` +- Data Params: `Radio to change the password of and password` +- Success Response: + - Code: 200 OK + - Contents: + +``` +{} +``` + +- Error Response: `500 Server Error` + +- Sample Call: + +`curl -XPOST 127.0.0.1:/wifi_settings/pass -H 'Content-Type: application/json' -i -d '{"radio":"radio0", "pass": "this is a freeform password"}'` + + +--- + +## /wifi_settings/mesh + +- URL: `:/wifi_settings/mesh` +- Method: `POST` +- URL Params: `Content-Type: application/json` +- Data Params: `Radio to toggle mesh and mesh bool, resets radio to default ssid and pass on disable` +- Success Response: + - Code: 200 OK + - Contents: + +``` +{} +``` + +- Error Response: `500 Server Error` + +- Sample Call: + +`curl -XPOST 127.0.0.1:/wifi_settings/mesh -H 'Content-Type: application/json' -i -d '{"radio":"radio0", "mesh": true}'` + + +--- + + +## /wipe + +**This endpoint works only on development builds and is meant only for development purposes** + +- URL: `:/wipe` +- Method: `POST` +- URL Params: `None` +- Data Params: `None` +- Success Response: + - Code: 204 NO CONTENT + - Contents: `None` +- Error Response: `500 Server Error` +- Sample Call: + +`curl -XPOST 127.0.0.1:/wipe` + +--- + +## /database + +**This endpoint worsk only on development builds and is meant only for development purposes** + +Calling HTTP `DELETE` request on this endpoint causes all tables to be wiped out of data. + +- URL: `:/wipe` +- Method: `DELETE` +- URL Params: `None` +- Data Params: `None` +- Success Response: + - Code: 204 NO CONTENT + - Contents: `None` +- Error Response: `500 Server Error` +- Sample Call: + +`curl -XDELETE 127.0.0.1:/database` + +--- diff --git a/exit_db/Cargo.toml b/exit_db/Cargo.toml index 3baa4fab5..e6f805561 100644 --- a/exit_db/Cargo.toml +++ b/exit_db/Cargo.toml @@ -4,10 +4,10 @@ version = "0.1.0" authors = ["Ben "] [dependencies] -diesel = { version = "=1.2.0", features = ["sqlite"] } -dotenv = "0.9.0" +diesel = { version = "1.3.2", features = ["sqlite"] } +dotenv = "0.13.0" althea_types = { path = "../althea_types", features = ["actix"]} -serde = "1.0" -serde_derive = "1.0" -serde_json = "1.0" -failure = "0.1.1" \ No newline at end of file +serde = "1.0.70" +serde_derive = "1.0.70" +serde_json = "1.0.24" +failure = "0.1.2" diff --git a/exit_db/migrations/2018-07-30-160806_remove_unused/down.sql b/exit_db/migrations/2018-07-30-160806_remove_unused/down.sql new file mode 100644 index 000000000..15a67cdd4 --- /dev/null +++ b/exit_db/migrations/2018-07-30-160806_remove_unused/down.sql @@ -0,0 +1,2 @@ +ALTER TABLE clients ADD COLUMN luci_pass VARCHAR NOT NULL; +ALTER TABLE clients ADD COLUMN zip VARCHAR NOT NULL; diff --git a/exit_db/migrations/2018-07-30-160806_remove_unused/up.sql b/exit_db/migrations/2018-07-30-160806_remove_unused/up.sql new file mode 100644 index 000000000..ef2edfc7f --- /dev/null +++ b/exit_db/migrations/2018-07-30-160806_remove_unused/up.sql @@ -0,0 +1,19 @@ +ALTER TABLE clients RENAME TO clients_old; + +CREATE TABLE clients +( mesh_ip VARCHAR NOT NULL PRIMARY KEY, + wg_pubkey VARCHAR NOT NULL, + wg_port VARCHAR NOT NULL, + internal_ip VARCHAR NOT NULL, + email VARCHAR NOT NULL, + country VARCHAR NOT NULL, + email_code VARCHAR DEFAULT "0" NOT NULL, + verified bool DEFAULT TRUE NOT NULL, + email_sent_time INTEGER DEFAULT 0 NOT NULL +); + +INSERT INTO clients (mesh_ip, wg_pubkey, wg_port, internal_ip, email, country, email_code, verified, email_sent_time) + SELECT mesh_ip, wg_pubkey, wg_port, internal_ip, email, country, email_code, verified, email_sent_time + FROM clients_old; + +DROP TABLE clients_old; diff --git a/exit_db/src/models.rs b/exit_db/src/models.rs index 620ee8e6c..61dd2228e 100644 --- a/exit_db/src/models.rs +++ b/exit_db/src/models.rs @@ -6,12 +6,11 @@ pub struct Client { pub mesh_ip: String, pub wg_pubkey: String, pub wg_port: String, - pub luci_pass: String, pub internal_ip: String, pub email: String, pub country: String, pub email_code: String, pub verified: bool, - // TODO change before 2038 + // TODO change before 2038; it's left that way because diesel cannot do `Insertable` for i64 pub email_sent_time: i32, } diff --git a/exit_db/src/schema.rs b/exit_db/src/schema.rs index e098daccf..3887b6c89 100644 --- a/exit_db/src/schema.rs +++ b/exit_db/src/schema.rs @@ -3,7 +3,6 @@ table! { mesh_ip -> Text, wg_pubkey -> Text, wg_port -> Text, - luci_pass -> Text, internal_ip -> Text, email -> Text, country -> Text, diff --git a/integration-tests/readme.md b/integration-tests/readme.md index ddc07cff1..71014f691 100644 --- a/integration-tests/readme.md +++ b/integration-tests/readme.md @@ -7,14 +7,14 @@ althea-mesh/ |- babeld/ # Althea fork of babeld ``` -The tests need to be run on ubuntu 16.04 as root (`sudo su`). - Network lab needs to be installed using `bpkg`. Example: ``` -sudo su -bpkg install sudomesh/network-lab +# use this or whatever package manager is available on your platform +sudo apt-get install -y libsqlite3-dev iperf3 python3-pip bridge-utils wireguard linux-source linux-headers-$(uname -r) curl git libssl-dev pkg-config build-essential ipset jq +cargo install diesel_cli --no-default-features --features sqlite +bpkg install sudomesh/network-lab bash rita.sh -``` \ No newline at end of file +``` diff --git a/integration-tests/rita.py b/integration-tests/rita.py index 0f6e73fae..7fb68028c 100644 --- a/integration-tests/rita.py +++ b/integration-tests/rita.py @@ -162,7 +162,7 @@ def get_veth_interfaces(self): interfaces.append("veth-{}-{}".format(self.id, i)) return interfaces - def has_route(self, dest, price, next_hop, backlog=5000, verbose=False): + def has_route(self, dest, price, next_hop, backlog=10000, verbose=False): """ This function takes :data:`self` and returns ``True`` if a specified route is installed in the last :data:`backlog` characters of the node's @@ -312,26 +312,20 @@ def switch_binaries(node_id): "BOUNTY_HUNTER:\t{}").format(RITA, RITA_EXIT, BOUNTY_HUNTER)) def register_to_exit(node): - id = node.id - os.system("ip netns exec netlab-{id} curl -XPOST 127.0.0.1:4877/settings -H 'Content-Type: application/json' -i -d '{data}'" - .format(id=id, data=json.dumps({"exit_client": EXIT_SELECT}))) + os.system(("ip netns exec netlab-{} curl -XPOST " + + "127.0.0.1:4877/exits/exit_a/register").format(node.id)) def email_verif(node): - id = node.id - email_text = read_email(node) code = re.search(r"\[([0-9]+)\]", email_text).group(1) - print(code) - - os.system("ip netns exec netlab-{id} curl -XPOST 127.0.0.1:4877/settings -H 'Content-Type: application/json' -i -d '{data}'" - .format(id=id, data=json.dumps({"exit_client": {"exits": {"exit_a": {"email_code": code}}}}))) - - os.system("ip netns exec netlab-{id} curl 127.0.0.1:4877/settings" - .format(id=id)) - + print("Email code for node {} is {}".format(node.id, code)) + exec_or_exit(("ip netns exec netlab-{} curl -XPOST " + + "127.0.0.1:4877/exits/exit_a/verify/{}").format(node.id, code)) + exec_or_exit(("ip netns exec netlab-{} curl " + + "127.0.0.1:4877/settings").format(node.id)) def read_email(node): id = node.id @@ -341,7 +335,7 @@ def read_email(node): mail = json.load(mail_file_handle) if mail["envelope"]["forward_path"][0] == "{}@example.com".format(id): return ''.join(chr(i) for i in mail["message"]) - print("cannot find email for node {}".format(id)) + raise Exception("cannot find email for node {}".format(id)) def start_rita(node): id = node.id @@ -511,7 +505,7 @@ def create(self): print("network topology: {}".format(network)) print(NETWORK_LAB) - proc = subprocess.Popen([NETWORK_LAB], stdin=subprocess.PIPE, universal_newlines=True) + proc = subprocess.Popen(['/bin/bash', NETWORK_LAB], stdin=subprocess.PIPE, universal_newlines=True) proc.stdin.write(network_string) proc.stdin.close() @@ -688,14 +682,16 @@ def test_endpoints_all(self): + "netlab-{} curl -sfg6 [::1]:4877/neighbors".format(node.id)), stdout=subprocess.PIPE) assert_test(not result.wait(), "curl-ing /neighbors") + stdout = result.stdout.read().decode('utf-8') try: print("Received neighbors:") if VERBOSE: - neighbors = json.loads(result.stdout.read().decode('utf-8')) + neighbors = json.loads(stdout) pprint(neighbors) else: - print(result.stdout.read().decode('utf-8')) - except json.JSONDecodeError as e: + print(stdout) + except ValueError as e: + print('Unable to decode JSON {!r}: {}'.format(stdout, e)) assert_test(False, "Decoding the neighbors JSON") # /exits @@ -706,14 +702,16 @@ def test_endpoints_all(self): + "netlab-{} curl -sfg6 [::1]:4877/exits".format(node.id)), stdout=subprocess.PIPE, stderr=subprocess.PIPE) assert_test(not result.wait(), "curl-ing /exits") + stdout = result.stdout.read().decode('utf-8') try: print("Received exits:") if VERBOSE: - exits = json.loads(result.stdout.read().decode('utf-8')) + exits = json.loads(stdout) pprint(exits) else: - print(result.stdout.read().decode('utf-8')) - except json.JSONDecodeError as e: + print(stdout) + except ValueError as e: + print('Unable to decode JSON {!r}: {}'.format(stdout, e)) assert_test(False, "Decoding the exits JSON") # /info @@ -724,14 +722,16 @@ def test_endpoints_all(self): + "netlab-{} curl -sfg6 [::1]:4877/info".format(node.id)), stdout=subprocess.PIPE, stderr=subprocess.PIPE) assert_test(not result.wait(), "curl-ing /info") + stdout = result.stdout.read().decode('utf-8') try: print("Received info:") if VERBOSE: - info = json.loads(result.stdout.read().decode('utf-8')) + info = json.loads(stdout) pprint(info) else: - print(result.stdout.read().decode('utf-8')) - except json.JSONDecodeError as e: + print(stdout) + except ValueError as e: + print('Unable to decode JSON {!r}: {}'.format(stdout, e)) assert_test(False, "Decoding the info JSON") # /settings @@ -742,14 +742,16 @@ def test_endpoints_all(self): + "netlab-{} curl -sfg6 [::1]:4877/settings".format(node.id)), stdout=subprocess.PIPE, stderr=subprocess.PIPE) assert_test(not result.wait(), "curl-ing /settings") + stdout = result.stdout.read().decode('utf-8') try: print("Received settings:") if VERBOSE: - settings = json.loads(result.stdout.read().decode('utf-8')) + settings = json.loads(stdout) pprint(settings) else: - print(result.stdout.read().decode('utf-8')) - except json.JSONDecodeError as e: + print(stdout) + except ValueError as e: + print('Unable to decode JSON {!r}: {}'.format(stdout, e)) assert_test(False, "Decoding the settings JSON") diff --git a/integration-tests/rita.sh b/integration-tests/rita.sh index 41252a5ad..f28959399 100755 --- a/integration-tests/rita.sh +++ b/integration-tests/rita.sh @@ -1,14 +1,15 @@ #!/usr/bin/env bash +# export PATH="$PATH:$HOME/.cargo/bin" BABELD_DIR="deps/babeld" NETLAB_PATH="deps/network-lab/network-lab.sh" REMOTE_A=${REMOTE_A:=https://github.com/althea-mesh/althea_rs.git} -REVISION_A=${REVISION_A:=master} +REVISION_A=${REVISION_A:=""} DIR_A=${DIR_A:=althea_rs_a} # Don't override without good reason, this one and $DIR_B are git ignored TARGET_DIR_A=${TARGET_DIR_A:=target_a} # Don't override without good reason, this one and $TARGET_DIR_B are git ignored REMOTE_B=${REMOTE_B:=$REMOTE_A} -REVISION_B=${REVISION_B:=release} +REVISION_B=${REVISION_B:=$RELEASE_A} DIR_B=${DIR_B:=althea_rs_b} TARGET_DIR_B=${TARGET_DIR_B:=target_b} @@ -16,12 +17,20 @@ set -euxo pipefail cd $(dirname $0) # Make the script runnable from anywhere +# Loads module if not loaded and available, does nothing if already loaded and fails if not available +sudo modprobe wireguard + + build_rev() { remote=$1 revision=$2 dir=$3 target_dir=$4 + if [ -z "${VERBOSE-}" ] ; then + git --no-pager show + fi + mkdir -p $target_dir if [ -z "${NO_PULL-}" ] ; then @@ -54,7 +63,7 @@ fi # Only care about revisions if a compat layout was picked if [ ! -z "${COMPAT_LAYOUT-}" ] ; then - build_rev $REMOTE_A $REVISION_A $DIR_A $TARGET_DIR_A + build_rev $REMOTE_A "$REVISION_A" $DIR_A $TARGET_DIR_A export RITA_A="$target_dir/debug/rita" export RITA_EXIT_A="$target_dir/debug/rita_exit" export BOUNTY_HUNTER_A="$target_dir/debug/bounty_hunter" @@ -63,7 +72,7 @@ if [ ! -z "${COMPAT_LAYOUT-}" ] ; then # Save on common dep artifacts between A and B cp -r $TARGET_DIR_A $TARGET_DIR_B - build_rev $REMOTE_B $REVISION_B $DIR_B $TARGET_DIR_B + build_rev $REMOTE_B "$REVISION_B" $DIR_B $TARGET_DIR_B export RITA_B="$target_dir/debug/rita" export RITA_EXIT_B="$target_dir/debug/rita_exit" export BOUNTY_HUNTER_B="$target_dir/debug/bounty_hunter" @@ -74,4 +83,4 @@ else popd fi -sudo -E python3 rita.py $@ +sudo -E PATH="$PATH:$HOME/.cargo/bin" python3 rita.py $@ diff --git a/kv_store/.gitignore b/kv_store/.gitignore deleted file mode 100644 index 77fbec39b..000000000 --- a/kv_store/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ - -/target/ -**/*.rs.bk -Cargo.lock -*.db -*.db2 \ No newline at end of file diff --git a/kv_store/Cargo.toml b/kv_store/Cargo.toml deleted file mode 100644 index 6f8238209..000000000 --- a/kv_store/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "althea_kv_store" -version = "0.1.0" -authors = ["Jehan "] -license = "Apache 2.0" - -[dependencies] -rocksdb = "0.8.1" -serde = "1.0.24" -serde_derive = "1.0.24" -serde_json = "1.0.8" -derive-error = "0.0.4" \ No newline at end of file diff --git a/kv_store/readme.md b/kv_store/readme.md deleted file mode 100644 index 4bc261c6a..000000000 --- a/kv_store/readme.md +++ /dev/null @@ -1 +0,0 @@ -A very light wrapper providing a key value store with serde serialize, currently using RocksDB. diff --git a/kv_store/src/lib.rs b/kv_store/src/lib.rs deleted file mode 100644 index ff3b9037f..000000000 --- a/kv_store/src/lib.rs +++ /dev/null @@ -1,234 +0,0 @@ -#[macro_use] -extern crate serde_derive; - -use rocksdb::{DBIterator, IteratorMode, DB, Direction}; - -#[macro_use] -extern crate derive_error; - -extern crate rocksdb; -extern crate serde; -extern crate serde_json; -use std::marker::PhantomData; - -use serde::de::DeserializeOwned; -use serde::Serialize; - -use std::str; - -// use self::rocksdb::DB; - -#[derive(Debug, Error)] -pub enum Error { - Json(serde_json::Error), - Rocksdb(rocksdb::Error), - #[error(msg_embedded, no_from, non_std)] Storage(String), -} - -/// Storage is a trait that can be implemented by structs wrapping key value stores. -/// -/// ``` -/// #[derive(Serialize, Deserialize, Debug, PartialEq)] -/// struct Dog { -/// name: String, -/// color: String, -/// age: u64, -/// } -/// -/// let store = RocksStorage::new(0, ".db"); -/// let dog = Dog { -/// name: "franklin".to_string(), -/// color: "brown".to_string(), -/// age: 3, -/// }; -/// -/// store.insert(&dog.name, &dog).unwrap(); -/// assert_eq!(dog, store.get(&dog.name).unwrap().unwrap()); - -/// ``` -pub trait Storage> { - /// Get a value from the current key or None if it does not exist. - fn get(&self, id: &T) -> Result, Error>; - /// Insert a value under the given key. Will overwrite the existing value. - fn insert(&self, id: &T, item: &U) -> Result<(), Error>; - fn iter(&self) -> I; -} - -/// RocksJsonStorage implements the Storage trait, storing data in RocksDB, -/// serialized as JSON. Multiple instances of RocksJsonStorage can use 1 RocksDB by -/// initializing with different "bucket" u8's. This is not currently safe to use from -/// different threads. -/// -/// ``` -/// enum Breeds { -/// Shiba = 1, -/// Rottweiler = 2, -/// } -/// -/// #[derive(Serialize, Deserialize, Debug, PartialEq)] -/// struct Dog { -/// name: String, -/// color: String, -/// age: u64, -/// } -/// -/// #[test] -/// fn it_works() { -/// let store = RocksJsonStorage::new(Breeds::Shiba as u8, ".db"); -/// let dog = Dog { -/// name: "franklin".to_string(), -/// color: "brown".to_string(), -/// age: 3, -/// }; -/// -/// store.insert(&dog.name, &dog).unwrap(); -/// assert_eq!(dog, store.get(&dog.name).unwrap().unwrap()); -/// } -/// ``` -pub struct RocksJsonStorage { - db: DB, - bucket: u8, - phantom1: PhantomData, - phantom2: PhantomData, -} - -impl RocksJsonStorage - where - T: Serialize + DeserializeOwned, - U: Serialize + DeserializeOwned { - pub fn new(bucket: u8, path: &str) -> RocksJsonStorage { - RocksJsonStorage { - db: DB::open_default(path).unwrap(), - bucket, - phantom1: PhantomData, - phantom2: PhantomData, - } - } - fn my_bucket(&self) -> u8 { - self.bucket - } - fn iter(&self) -> RocksJsonIterator { - RocksJsonIterator { - bucket: self.bucket, - db_iter: self.db.iterator(IteratorMode::Start), - phantom1: PhantomData, - phantom2: PhantomData, - } - } -} - -fn prefix_with_bucket(typ: u8, input: &[u8]) -> Vec { - let mut v = Vec::with_capacity(input.len() + 1); - v.push(typ); - v.extend_from_slice(input); - v -} - -impl< - T: Serialize + DeserializeOwned, - U: Serialize + DeserializeOwned, -> Storage> for RocksJsonStorage { - fn get(&self, id: &T) -> Result, Error> { - Ok(match self.db.get(&prefix_with_bucket( - self.my_bucket(), - &serde_json::to_vec(&id)?, - )) { - Ok(Some(v)) => Some(serde_json::from_slice(&v)?), - _ => None, - }) - } - fn insert(&self, id: &T, item: &U) -> Result<(), Error> { - Ok(self.db.put( - &prefix_with_bucket(self.my_bucket(), &serde_json::to_vec(&id)?), - &serde_json::to_vec(&item)?, - )?) - } - fn iter(&self) -> RocksJsonIterator { - RocksJsonIterator { - db_iter: self.db.iterator(IteratorMode::From(&[self.bucket], Direction::Forward)), - bucket: self.bucket, - phantom1: PhantomData, - phantom2: PhantomData, - } - } -} - -struct RocksJsonIterator { - db_iter: DBIterator, - bucket: u8, - phantom1: PhantomData, - phantom2: PhantomData, -} - -impl Iterator - for RocksJsonIterator { - type Item = (T, U); - - fn next(&mut self) -> Option<(T, U)> { - match self.db_iter.next() { - Some(v) => { - let (bucket, key): (&[u8], &[u8]) = v.0.split_at(1); - if bucket[0] != self.bucket { - None - } else { - Some(( - serde_json::from_slice(key).unwrap(), - serde_json::from_slice(&v.1).unwrap(), - )) - } - }, - None => None, - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - use std::collections::HashMap; - - enum Breeds { - Shiba = 10, - Rottweiler = 2, - } - - #[derive(Serialize, Deserialize, Debug, PartialEq)] - struct Dog { - name: String, - color: String, - age: u64, - } - #[test] - fn insert_and_get() { - let store = RocksJsonStorage::new(Breeds::Shiba as u8, ".db"); - let dog = Dog { - name: "franklin".to_string(), - color: "brown".to_string(), - age: 3, - }; - - store.insert(&dog.name, &dog).unwrap(); - assert_eq!(dog, store.get(&dog.name).unwrap().unwrap()); - } - - #[test] - fn iterate() { - let store = RocksJsonStorage::new(Breeds::Shiba as u8, ".db2"); - let dog1 = Dog { - name: "franklin".to_string(), - color: "brown".to_string(), - age: 3, - }; - let dog2 = Dog { - name: "ro".to_string(), - color: "red".to_string(), - age: 5, - }; - store.insert(&dog1.name, &dog1).unwrap(); - store.insert(&dog2.name, &dog2).unwrap(); - - let map: HashMap = store.iter().collect(); - - assert_eq!("{\"ro\": Dog { name: \"ro\", color: \"red\", age: 5 }, \"franklin\": Dog { name: \"franklin\", color: \"brown\", age: 3 }}", format!("{:?}", map)); - } -} diff --git a/num256/Cargo.toml b/num256/Cargo.toml index df306b1bb..ae4d9e058 100644 --- a/num256/Cargo.toml +++ b/num256/Cargo.toml @@ -5,9 +5,9 @@ authors = ["Jehan "] license = "Apache 2.0" [dependencies] -num = "0.1.41" -serde = "1.0.24" -serde_derive = "1.0.24" -serde_json = "1.0.8" -lazy_static = "1.0.0" -ethereum-types = {git="https://github.com/paritytech/primitives.git"} \ No newline at end of file +num = "0.2.0" +serde = "1.0.70" +serde_derive = "1.0.70" +serde_json = "1.0.24" +lazy_static = "1.0.2" +ethereum-types = {git="https://github.com/paritytech/primitives.git"} diff --git a/rita/Cargo.toml b/rita/Cargo.toml index f6b65917f..1be129072 100644 --- a/rita/Cargo.toml +++ b/rita/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rita" -version = "0.1.4" +version = "0.1.5" authors = ["Jehan ", "Ben "] build = "build.rs" @@ -15,6 +15,8 @@ path = "src/client.rs" [features] default = [] system_alloc = [] +development = [] + [dependencies] althea_kernel_interface = { path = "../althea_kernel_interface" } @@ -26,34 +28,37 @@ num256 = { path = "../num256" } settings = { path = "../settings" } actix = { git = "https://github.com/kingoflolz/actix", branch = "althea-mesh"} -actix-web = { git = "https://github.com/actix/actix-web.git", branch = "fix-missing-content-length", default-features = false} -actix_derive = "0.2.0" -bytes = "0.4" -clippy = { version = "*", optional = true } -config = "0.8.0" -diesel = { version = "=1.2.0", features = ["sqlite"] } -libsqlite3-sys = { version = "*", features = ["bundled"] } +actix-web = { git = "https://github.com/actix/actix-web", default-features = false, branch = "fix-missing-content-length"} +actix_derive = "0.3.0" +bytes = "0.4.9" +clippy = { version = "0.0.212", optional = true } +config = "0.9.0" +diesel = { version = "1.3.2", features = ["sqlite"] } +libsqlite3-sys = { version = "0.9.1", features = ["bundled"] } docopt = "0.8.3" -dotenv = "0.9.0" -env_logger = "^0.5.5" +dotenv = "0.13.0" +env_logger = "0.5.11" eui48 = {git="https://github.com/althea-mesh/eui48.git"} -failure = "0.1.1" -futures = "0.1" +failure = "0.1.2" +futures = "0.1.23" ipnetwork = "0.13.0" -lazy_static = "1.0" -lettre = "0.8" -lettre_email = "0.8" -log = "^0.4" +lazy_static = "1.0.2" +lettre = "0.8.2" +lettre_email = "0.8.2" +log = "0.4.3" minihttpse = "0.1.6" -mockito = "0.9" +mockito = "0.12.0" mockstream = { git = "https://github.com/lazy-bitfield/rust-mockstream.git" } -rand = "*" -reqwest = "0.8" -serde = "1.0" -serde_derive = "1.0" -serde_json = "1.0" -tokio = "0.1" -tokio-core = "0.1" -regex = "1.0" -trust-dns-resolver = "0.9" +rand = "0.5.4" +reqwest = {git = "https://github.com/seanmonstar/reqwest", rev = "3424e91746f64a50bd02408750a5f01eef2abd5f"} +serde = "1.0.70" +serde_derive = "1.0.70" +serde_json = "1.0.24" +tokio = "0.1.7" +tokio-io = "0.1.7" +tokio-codec = "0.1.0" +regex = "1.0.2" +trust-dns-resolver = "0.9.0" handlebars = "1.0.0" +byteorder = { version = "1.2.4", features = ["i128"] } +openssl-probe = "0.1.2" diff --git a/rita/src/client.rs b/rita/src/client.rs index d26b45169..8c7815940 100644 --- a/rita/src/client.rs +++ b/rita/src/client.rs @@ -23,11 +23,10 @@ extern crate lazy_static; extern crate log; #[macro_use] extern crate serde_derive; -#[macro_use] -extern crate serde_json; extern crate actix; extern crate actix_web; +extern crate byteorder; extern crate bytes; extern crate clu; extern crate docopt; @@ -39,13 +38,16 @@ extern crate ipnetwork; extern crate lettre; extern crate lettre_email; extern crate minihttpse; +extern crate openssl_probe; extern crate rand; extern crate regex; extern crate reqwest; extern crate serde; +extern crate serde_json; extern crate settings; extern crate tokio; -extern crate tokio_core; +extern crate tokio_codec; +extern crate tokio_io; extern crate trust_dns_resolver; use docopt::Docopt; @@ -149,8 +151,17 @@ lazy_static! { } fn main() { + // On Linux static builds we need to probe ssl certs path to be able to + // do TLS stuff. + openssl_probe::init_ssl_cert_env_vars(); env_logger::init(); + if cfg!(feature = "development") { + println!("Warning!"); + println!("This build is meant only for development purposes."); + println!("Running this on production is unsupported and not safe!"); + } + let args: Args = Docopt::new((*USAGE).as_str()) .and_then(|d| d.deserialize()) .unwrap_or_else(|e| e.exit()); @@ -175,6 +186,7 @@ fn main() { assert!(rita_common::tunnel_manager::TunnelManager::from_registry().connected()); assert!(rita_common::http_client::HTTPClient::from_registry().connected()); assert!(rita_common::traffic_watcher::TrafficWatcher::from_registry().connected()); + assert!(rita_common::peer_listener::PeerListener::from_registry().connected()); assert!(rita_client::exit_manager::ExitManager::from_registry().connected()); // rita @@ -189,10 +201,10 @@ fn main() { r.method(Method::POST).with(make_payments) }) }).workers(1) - .bind(format!("[::0]:{}", SETTING.get_network().rita_contact_port)) - .unwrap() - .shutdown_timeout(0) - .start(); + .bind(format!("[::0]:{}", SETTING.get_network().rita_contact_port)) + .unwrap() + .shutdown_timeout(0) + .start(); // dashboard server::new(|| { @@ -206,16 +218,24 @@ fn main() { .route("/exits", Method::GET, get_exit_info) .route("/exits/{name}/reset", Method::POST, reset_exit) .route("/exits/{name}/select", Method::POST, select_exit) - .route("/info", Method::GET, get_own_info) + .route("/wifi_settings/ssid", Method::POST, set_wifi_ssid) + .route("/wifi_settings/pass", Method::POST, set_wifi_pass) + .route("/wifi_settings/mesh", Method::POST, set_wifi_mesh) + .route("/exits/{name}/register", Method::POST, register_to_exit) + .route( + "/exits/{name}/verify/{code}", + Method::POST, + verify_on_exit_with_code, + ).route("/info", Method::GET, get_own_info) .route("/version", Method::GET, version) + .route("/wipe", Method::POST, wipe) }).workers(1) - .bind(format!( - "[::0]:{}", - SETTING.get_network().rita_dashboard_port - )) - .unwrap() - .shutdown_timeout(0) - .start(); + .bind(format!( + "[::0]:{}", + SETTING.get_network().rita_dashboard_port + )).unwrap() + .shutdown_timeout(0) + .start(); let common = rita_common::rita_loop::RitaLoop::new(); let _: Addr<_> = common.start(); diff --git a/rita/src/exit.rs b/rita/src/exit.rs index 778b9f97f..6c3213e67 100644 --- a/rita/src/exit.rs +++ b/rita/src/exit.rs @@ -29,6 +29,7 @@ extern crate serde_json; extern crate actix; extern crate actix_web; +extern crate byteorder; extern crate bytes; extern crate clu; extern crate docopt; @@ -41,13 +42,13 @@ extern crate ipnetwork; extern crate lettre; extern crate lettre_email; extern crate minihttpse; +extern crate openssl_probe; extern crate rand; extern crate regex; extern crate reqwest; extern crate serde; extern crate settings; extern crate tokio; -extern crate tokio_core; extern crate trust_dns_resolver; use settings::{RitaCommonSettings, RitaExitSettings, RitaExitSettingsStruct}; @@ -150,8 +151,17 @@ lazy_static! { } fn main() { + // On Linux static builds we need to probe ssl certs path to be able to + // do TLS stuff. + openssl_probe::init_ssl_cert_env_vars(); env_logger::init(); + if cfg!(feature = "development") { + println!("Warning!"); + println!("This build is meant only for development purposes."); + println!("Running this on production as an exit node is unsupported and not safe!"); + } + let args: Args = Docopt::new((*USAGE).as_str()) .and_then(|d| d.deserialize()) .unwrap_or_else(|e| e.exit()); @@ -176,6 +186,7 @@ fn main() { assert!(rita_common::tunnel_manager::TunnelManager::from_registry().connected()); assert!(rita_common::http_client::HTTPClient::from_registry().connected()); assert!(rita_common::traffic_watcher::TrafficWatcher::from_registry().connected()); + assert!(rita_common::peer_listener::PeerListener::from_registry().connected()); assert!(rita_exit::traffic_watcher::TrafficWatcher::from_registry().connected()); assert!(rita_exit::db_client::DbClient::from_registry().connected()); @@ -190,10 +201,10 @@ fn main() { r.method(Method::POST).with(make_payments) }) }).workers(1) - .bind(format!("[::0]:{}", SETTING.get_network().rita_contact_port)) - .unwrap() - .shutdown_timeout(0) - .start(); + .bind(format!("[::0]:{}", SETTING.get_network().rita_contact_port)) + .unwrap() + .shutdown_timeout(0) + .start(); // Exit stuff server::new(|| { @@ -201,19 +212,16 @@ fn main() { .resource("/setup", |r| r.method(Method::POST).with(setup_request)) .resource("/status", |r| { r.method(Method::POST).with_async(status_request) - }) - .resource("/list", |r| r.method(Method::POST).with(list_clients)) + }).resource("/list", |r| r.method(Method::POST).with(list_clients)) .resource("/exit_info", |r| { r.method(Method::GET).with(get_exit_info_http) - }) - .resource("/rtt", |r| r.method(Method::GET).with(rtt)) + }).resource("/rtt", |r| r.method(Method::GET).with(rtt)) }).bind(format!( "[::0]:{}", SETTING.get_exit_network().exit_hello_port - )) - .unwrap() - .shutdown_timeout(0) - .start(); + )).unwrap() + .shutdown_timeout(0) + .start(); // Dashboard server::new(|| { @@ -226,13 +234,14 @@ fn main() { .route("/settings", Method::GET, get_settings) .route("/settings", Method::POST, set_settings) .route("/version", Method::GET, version) + .route("/wipe", Method::POST, wipe) + .route("/database", Method::DELETE, nuke_db) }).bind(format!( "[::0]:{}", SETTING.get_network().rita_dashboard_port - )) - .unwrap() - .shutdown_timeout(0) - .start(); + )).unwrap() + .shutdown_timeout(0) + .start(); let common = rita_common::rita_loop::RitaLoop::new(); let _: Addr<_> = common.start(); diff --git a/rita/src/rita_client/dashboard/mod.rs b/rita/src/rita_client/dashboard/mod.rs index 1b8754ad9..781f67657 100644 --- a/rita/src/rita_client/dashboard/mod.rs +++ b/rita/src/rita_client/dashboard/mod.rs @@ -1,4 +1,5 @@ use actix::prelude::*; +use actix_web::Path; use failure::Error; use futures::Future; @@ -6,13 +7,15 @@ use serde_json; use serde_json::Value; use std::collections::HashMap; use std::net::{SocketAddr, TcpStream}; +use std::{thread, time}; use althea_types::ExitState; use babel_monitor::Babel; use num256::Int256; use rita_common::dashboard::Dashboard; use rita_common::debt_keeper::{DebtKeeper, Dump}; -use rita_common::tunnel_manager::{Listen, TunnelManager, UnListen}; +use rita_common::peer_listener::PeerListener; +use rita_common::peer_listener::{Listen, UnListen}; use settings::ExitServer; use settings::RitaClientSettings; use settings::RitaCommonSettings; @@ -51,6 +54,24 @@ pub struct WifiDevice { pub radio_type: String, } +#[derive(Serialize, Deserialize, Default, Clone, Debug)] +pub struct WifiSSID { + pub radio: String, + pub ssid: String, +} + +#[derive(Serialize, Deserialize, Default, Clone, Debug)] +pub struct WifiPass { + pub radio: String, + pub pass: String, +} + +#[derive(Serialize, Deserialize, Default, Clone, Debug)] +pub struct WifiMesh { + pub radio: String, + pub mesh: bool, +} + struct GetWifiConfig; impl Message for GetWifiConfig { @@ -124,28 +145,29 @@ impl Handler for Dashboard { let iface_number = i.section_name.clone().chars().last(); if i.mesh && iface_number.is_some() { - let iface_name = format!("rita_wlan{}", iface_number.unwrap()); + let iface_name = format!("wlan{}", iface_number.unwrap()); - TunnelManager::from_registry().do_send(Listen(iface_name.clone())); KI.set_uci_var(&format!("wireless.{}.ssid", i.section_name), "AltheaMesh")?; KI.set_uci_var(&format!("wireless.{}.encryption", i.section_name), "none")?; KI.set_uci_var(&format!("wireless.{}.mode", i.section_name), "adhoc")?; KI.set_uci_var(&format!("wireless.{}.network", i.section_name), &iface_name)?; - KI.set_uci_var(&format!("network.{}", iface_name.clone()), "interface")?; + KI.set_uci_var(&format!("network.rita_{}", iface_name.clone()), "interface")?; KI.set_uci_var( &format!("network.{}.ifname", iface_name.clone()), &iface_name, )?; KI.set_uci_var(&format!("network.{}.proto", iface_name.clone()), "static")?; - } else if iface_number.is_some() { - let iface_name = format!("rita_wlan{:?}", iface_number); - TunnelManager::from_registry().do_send(UnListen(iface_name)); + // These must run before listen/unlisten to avoid race conditions + KI.uci_commit()?; + KI.openwrt_reset_wireless()?; + // when we run wifi reset it takes seconds for a new fe80 address to show up + thread::sleep(time::Duration::from_millis(30000)); + + PeerListener::from_registry().do_send(Listen(iface_name.clone())); + } else if iface_number.is_some() { + let iface_name = format!("wlan{}", iface_number.unwrap()); KI.set_uci_var(&format!("wireless.{}.ssid", i.section_name), &i.ssid)?; - KI.set_uci_var( - &format!("wireless.{}.encryption", i.section_name), - &i.encryption, - )?; KI.set_uci_var(&format!("wireless.{}.key", i.section_name), &i.key)?; KI.set_uci_var(&format!("wireless.{}.mode", i.section_name), "ap")?; KI.set_uci_var( @@ -153,6 +175,12 @@ impl Handler for Dashboard { "psk2+tkip+aes", )?; KI.set_uci_var(&format!("wireless.{}.network", i.section_name), "lan")?; + + // Order is reversed here + PeerListener::from_registry().do_send(UnListen(iface_name)); + + KI.uci_commit()?; + KI.openwrt_reset_wireless()?; } } @@ -333,50 +361,107 @@ impl Handler for Dashboard { } #[derive(Debug)] -pub struct ResetExit(String); +pub struct SetWiFiSSID(WifiSSID); -impl Message for ResetExit { +impl Message for SetWiFiSSID { type Result = Result<(), Error>; } -impl Handler for Dashboard { +impl Handler for Dashboard { type Result = Result<(), Error>; - fn handle(&mut self, msg: ResetExit, _ctx: &mut Self::Context) -> Self::Result { - let mut exits = SETTING.get_exits_mut(); + fn handle(&mut self, msg: SetWiFiSSID, _ctx: &mut Self::Context) -> Self::Result { + // think radio0, radio1 + let iface_name = msg.0.radio; + let ssid = msg.0.ssid; + let section_name = format!("default_{}", iface_name); + KI.set_uci_var(&format!("wireless.{}.ssid", section_name), &ssid)?; - if let Some(mut exit) = exits.get_mut(&msg.0) { - info!("Changing exit {:?} state to New", msg.0); - exit.info = ExitState::New; - } else { - error!("Requested a reset on an unknown exit {:?}", msg.0); - bail!("Requested a reset on an unknown exit {:?}", msg.0); - } + KI.uci_commit()?; + KI.openwrt_reset_wireless()?; + // We edited disk contents, force global sync + KI.fs_sync()?; Ok(()) } } #[derive(Debug)] -pub struct SelectExit(String); +pub struct SetWiFiPass(WifiPass); -impl Message for SelectExit { +impl Message for SetWiFiPass { type Result = Result<(), Error>; } -impl Handler for Dashboard { +impl Handler for Dashboard { type Result = Result<(), Error>; - fn handle(&mut self, msg: SelectExit, _ctx: &mut Self::Context) -> Self::Result { - debug!("Attempting to select exit {:?}", msg.0); + fn handle(&mut self, msg: SetWiFiPass, _ctx: &mut Self::Context) -> Self::Result { + // think radio0, radio1 + let iface_name = msg.0.radio; + let pass = msg.0.pass; + let section_name = format!("default_{}", iface_name); + KI.set_uci_var(&format!("wireless.{}.key", section_name), &pass)?; - let mut exit_client = SETTING.get_exit_client_mut(); + KI.uci_commit()?; + KI.openwrt_reset_wireless()?; - if exit_client.exits.contains_key(&msg.0) { - info!("Selecting exit {:?}", msg.0); - exit_client.current_exit = Some(msg.0); + // We edited disk contents, force global sync + KI.fs_sync()?; + Ok(()) + } +} + +#[derive(Debug)] +pub struct SetWiFiMesh(WifiMesh); + +impl Message for SetWiFiMesh { + type Result = Result<(), Error>; +} + +impl Handler for Dashboard { + type Result = Result<(), Error>; + fn handle(&mut self, msg: SetWiFiMesh, _ctx: &mut Self::Context) -> Self::Result { + // think radio0, radio1 + let iface_name = msg.0.radio; + let mesh = msg.0.mesh; + let iface_number = iface_name.clone().chars().last(); + let wlan_name = format!("wlan{}", iface_number.unwrap()); + let section_name = format!("default_{}", iface_name); + + if mesh { + KI.set_uci_var(&format!("wireless.{}.ssid", section_name), "AltheaMesh")?; + KI.set_uci_var(&format!("wireless.{}.encryption", section_name), "none")?; + KI.set_uci_var(&format!("wireless.{}.mode", section_name), "adhoc")?; + KI.set_uci_var(&format!("wireless.{}.network", section_name), &wlan_name)?; + KI.set_uci_var(&format!("network.{}", wlan_name), "interface")?; + KI.set_uci_var(&format!("network.{}.ifname", wlan_name), &wlan_name)?; + KI.set_uci_var(&format!("network.{}.proto", wlan_name), "static")?; + + // These must run before listen/unlisten to avoid race conditions + KI.uci_commit()?; + KI.openwrt_reset_wireless()?; + // when we run wifi reset it takes seconds for a new fe80 address to show up + thread::sleep(time::Duration::from_millis(30000)); + + PeerListener::from_registry().do_send(Listen(wlan_name.clone())); } else { - error!("Requested selection of an unknown exit {:?}", msg.0); - bail!("Requested selection of an unknown exit {:?}", msg.0); + KI.set_uci_var(&format!("wireless.{}.ssid", section_name), "AltheaHome")?; + KI.set_uci_var(&format!("wireless.{}.key", section_name), "ChangeMe")?; + KI.set_uci_var(&format!("wireless.{}.mode", section_name), "ap")?; + KI.set_uci_var( + &format!("wireless.{}.encryption", section_name), + "psk2+tkip+aes", + )?; + KI.set_uci_var(&format!("wireless.{}.network", section_name), "lan")?; + + // Order is reversed here + PeerListener::from_registry().do_send(UnListen(wlan_name)); + + KI.uci_commit()?; + KI.openwrt_reset_wireless()?; } + + // We edited disk contents, force global sync + KI.fs_sync()?; Ok(()) } } diff --git a/rita/src/rita_client/dashboard/network_endpoints.rs b/rita/src/rita_client/dashboard/network_endpoints.rs index 2f7ccf91f..efdae66a8 100644 --- a/rita/src/rita_client/dashboard/network_endpoints.rs +++ b/rita/src/rita_client/dashboard/network_endpoints.rs @@ -1,13 +1,17 @@ use actix::registry::SystemService; -use actix_web::*; +use actix_web::http::StatusCode; +use actix_web::{AsyncResponder, HttpRequest, HttpResponse, Json}; use failure::Error; +use futures::future; use futures::Future; use rita_client::dashboard::WifiInterface; +use rita_client::exit_manager::exit_setup_request; use super::*; use std::boxed::Box; +use std::collections::HashMap; pub fn get_wifi_config( _req: HttpRequest, @@ -54,21 +58,129 @@ pub fn get_exit_info(_req: HttpRequest) -> Box> .responder() } -pub fn reset_exit(name: Path) -> Box, Error = Error>> { - debug!("/exits/{}/reset hit", name); +pub fn reset_exit(path: Path) -> Box> { + let exit_name = path.into_inner(); + debug!("/exits/{}/reset hit", exit_name); + + let mut exits = SETTING.get_exits_mut(); + let mut ret = HashMap::new(); + + if let Some(exit) = exits.get_mut(&exit_name) { + info!("Changing exit {:?} state to New", exit_name); + exit.info = ExitState::New; + return Box::new(future::ok(HttpResponse::Ok().json(ret))); + } else { + error!("Requested a reset on unknown exit {:?}", exit_name); + ret.insert( + "error".to_owned(), + format!("Requested reset on unknown exit {:?}", exit_name), + ); + return Box::new(future::ok( + HttpResponse::new(StatusCode::BAD_REQUEST) + .into_builder() + .json(ret), + )); + } +} + +pub fn select_exit(path: Path) -> Box> { + let exit_name = path.into_inner(); + debug!("/exits/{}/select hit", exit_name); + + let mut exit_client = SETTING.get_exit_client_mut(); + let mut ret = HashMap::new(); + + if exit_client.exits.contains_key(&exit_name) { + info!("Selecting exit {:?}", exit_name); + exit_client.current_exit = Some(exit_name); + return Box::new(future::ok(HttpResponse::Ok().json(ret))); + } else { + error!("Requested selection of an unknown exit {:?}", exit_name); + ret.insert( + "error".to_owned(), + format!("Requested selection of an unknown exit {:?}", exit_name), + ); + return Box::new(future::ok( + HttpResponse::new(StatusCode::BAD_REQUEST) + .into_builder() + .json(ret), + )); + } +} + +pub fn register_to_exit(path: Path) -> Box> { + let exit_name = path.into_inner(); + debug!("/exits/{}/register hit", exit_name); + + debug!("Attempting to register on exit {:?}", exit_name); + + Box::new(exit_setup_request(exit_name, None).then(|res| { + let mut ret = HashMap::new(); + match res { + Ok(_) => future::ok(HttpResponse::Ok().json(ret)), + Err(e) => { + error!("exit_setup_request() failed with: {:?}", e); + ret.insert("error".to_owned(), "Exit setup request failed".to_owned()); + ret.insert("rust_error".to_owned(), format!("{:?}", e)); + future::ok( + HttpResponse::new(StatusCode::BAD_REQUEST) + .into_builder() + .json(ret), + ) + } + } + })) +} + +pub fn verify_on_exit_with_code( + path: Path<(String, String)>, +) -> Box> { + let (exit_name, code) = path.into_inner(); + debug!("/exits/{}/verify/{} hit", exit_name, code); + + Box::new(exit_setup_request(exit_name, Some(code)).then(|res| { + let mut ret = HashMap::new(); + match res { + Ok(_) => future::ok(HttpResponse::Ok().json(ret)), + Err(e) => { + error!("exit_setup_request() failed with: {:?}", e); + ret.insert("error".to_owned(), "Exit setup request failed".to_owned()); + ret.insert("rust_error".to_owned(), format!("{:?}", e)); + future::ok( + HttpResponse::new(StatusCode::BAD_REQUEST) + .into_builder() + .json(ret), + ) + } + } + })) +} + +pub fn set_wifi_ssid(wifi_ssid: Json) -> Box, Error = Error>> { + debug!("/wifi_settings/ssid hit with {:?}", wifi_ssid); + + Dashboard::from_registry() + .send(SetWiFiSSID(wifi_ssid.into_inner())) + .from_err() + .and_then(move |reply| Ok(Json(reply?))) + .responder() +} + +pub fn set_wifi_pass(wifi_pass: Json) -> Box, Error = Error>> { + debug!("/wifi_settings/pass hit with {:?}", wifi_pass); Dashboard::from_registry() - .send(ResetExit(name.into_inner())) + .send(SetWiFiPass(wifi_pass.into_inner())) .from_err() .and_then(move |reply| Ok(Json(reply?))) .responder() } -pub fn select_exit(name: Path) -> Box, Error = Error>> { - debug!("/exits/{}/select hit", name); +pub fn set_wifi_mesh(wifi_mesh: Json) -> Box, Error = Error>> { + debug!("/wifi_settings/mesh hit with {:?}", wifi_mesh); Dashboard::from_registry() - .send(SelectExit(name.into_inner())) + .send(SetWiFiMesh(wifi_mesh.into_inner())) .from_err() .and_then(move |reply| Ok(Json(reply?))) .responder() diff --git a/rita/src/rita_client/exit_manager/mod.rs b/rita/src/rita_client/exit_manager/mod.rs index 8e79c6033..7d55f141e 100644 --- a/rita/src/rita_client/exit_manager/mod.rs +++ b/rita/src/rita_client/exit_manager/mod.rs @@ -11,6 +11,7 @@ use SETTING; use rita_client::rita_loop::Tick; use rita_client::traffic_watcher::{TrafficWatcher, Watch}; +use futures::future; use futures::future::join_all; use futures::Future; @@ -146,9 +147,15 @@ fn exit_general_details_request(exit: String) -> impl Future) -> impl Future { +pub fn exit_setup_request( + exit: String, + code: Option, +) -> Box> { let exits = SETTING.get_exits(); - let current_exit = &exits[&exit]; + let current_exit = match exits.get(&exit) { + Some(exit_struct) => exit_struct, + None => return Box::new(future::err(format_err!("Could not find exit {:?}", exit))), + }; let exit_server = current_exit.id.mesh_ip; let mut reg_details = SETTING.get_exit_client().reg_details.clone().unwrap(); reg_details.email_code = code; @@ -163,19 +170,24 @@ fn exit_setup_request(exit: String, code: Option) -> impl Future exit_struct, + None => bail!("Could not find exit {:?}", exit), + }; - current_exit.info = exit_response.clone(); + current_exit.info = exit_response.clone(); - trace!("Got exit setup response {:?}", exit_response.clone()); + trace!("Got exit setup response {:?}", exit_response.clone()); - Ok(()) - }) + Ok(()) + }), + ) } fn exit_status_request(exit: String) -> impl Future { @@ -234,9 +246,13 @@ impl Handler for ExitManager { }; // code that connects to the current exit server + trace!("About to setup exit tunnel!"); if let Some(exit) = exit_server { + trace!("We have selected an exit!"); if let Some(ref general_details) = exit.info.general_details() { + trace!("We have details for the selected exit!"); if let Some(_) = exit.info.our_details() { + trace!("We are signed up for the selected exit!"); linux_setup_exit_tunnel().expect("failure setting up exit tunnel"); TrafficWatcher::from_registry() .do_send(Watch(exit.id.clone(), general_details.exit_price)); @@ -272,43 +288,6 @@ impl Handler for ExitManager { }, ))); } - ExitState::Registering { .. } - | ExitState::GotInfo { - auto_register: true, - .. - } => { - futs.push(Box::new(exit_setup_request(k.clone(), None).then( - move |res| { - match res { - Ok(_) => { - info!("exit setup request (no code) to {} was successful", k); - } - Err(e) => { - info!("exit setup request to {} failed with {:?}", k, e); - } - }; - Ok(()) - }, - ))); - } - ExitState::Pending { - email_code: Some(email_code), - .. - } => { - futs.push(Box::new( - exit_setup_request(k.clone(), Some(email_code.clone())).then(move |res| { - match res { - Ok(_) => { - info!("exit setup request (with code) to {} was successful", k); - } - Err(e) => { - info!("exit setup request to {} failed with {:?}", k, e); - } - }; - Ok(()) - }), - )); - } ExitState::Registered { .. } => { futs.push(Box::new(exit_status_request(k.clone()).then(move |res| { match res { @@ -322,8 +301,8 @@ impl Handler for ExitManager { Ok(()) }))); } - _ => { - info!("waiting on one time code for {}", k); + state => { + info!("Waiting on exit state {:?} for {}", state, k); } } } diff --git a/rita/src/rita_client/rita_loop/mod.rs b/rita/src/rita_client/rita_loop/mod.rs index 31834392f..87dbb5dbc 100644 --- a/rita/src/rita_client/rita_loop/mod.rs +++ b/rita/src/rita_client/rita_loop/mod.rs @@ -1,4 +1,4 @@ -use std::time::Duration; +use std::time::{Duration, Instant}; use actix::prelude::*; use actix::registry::SystemService; @@ -13,7 +13,10 @@ impl Actor for RitaLoop { type Context = Context; fn started(&mut self, ctx: &mut Context) { - ctx.notify_later(Tick {}, Duration::from_secs(5)); + ctx.run_interval(Duration::from_secs(5), |_act, ctx| { + let addr: Addr = ctx.address(); + addr.do_send(Tick); + }); } } @@ -26,19 +29,24 @@ impl Message for Tick { impl Handler for RitaLoop { type Result = Result<(), Error>; fn handle(&mut self, _: Tick, ctx: &mut Context) -> Self::Result { + let start = Instant::now(); trace!("Client Tick!"); ctx.spawn( ExitManager::from_registry() .send(Tick {}) .into_actor(self) - .then(|res, _act, ctx| { + .then(|res, _act, _ctx| { trace!("exit manager said {:?}", res); - ctx.notify_later(Tick {}, Duration::from_secs(10)); actix::fut::ok(()) }), ); + info!( + "Rita Client loop completed in {}s {}ms", + start.elapsed().as_secs(), + start.elapsed().subsec_nanos() / 1000000 + ); Ok(()) } } diff --git a/rita/src/rita_client/traffic_watcher/mod.rs b/rita/src/rita_client/traffic_watcher/mod.rs index d252bddcc..4dc30d6a5 100644 --- a/rita/src/rita_client/traffic_watcher/mod.rs +++ b/rita/src/rita_client/traffic_watcher/mod.rs @@ -110,8 +110,7 @@ pub fn watch( )); } } - )) - .send()? + )).send()? .json()?; let client_rx = SystemTime::now(); diff --git a/rita/src/rita_common/dashboard/mod.rs b/rita/src/rita_common/dashboard/mod.rs index c2cf15d91..587106e51 100644 --- a/rita/src/rita_common/dashboard/mod.rs +++ b/rita/src/rita_common/dashboard/mod.rs @@ -46,11 +46,12 @@ impl Handler for Dashboard { PaymentController::from_registry() .send(GetOwnBalance {}) .from_err() - .and_then(|res| { - Ok(OwnInfo { - balance: res?, + .and_then(|own_balance| match own_balance { + Ok(balance) => Ok(OwnInfo { + balance: balance, version: env!("CARGO_PKG_VERSION").to_string(), - }) + }), + Err(e) => Err(e), }), ) } diff --git a/rita/src/rita_common/dashboard/network_endpoints.rs b/rita/src/rita_common/dashboard/network_endpoints.rs index c5eb0acbd..35d44273e 100644 --- a/rita/src/rita_common/dashboard/network_endpoints.rs +++ b/rita/src/rita_common/dashboard/network_endpoints.rs @@ -1,5 +1,4 @@ use actix::registry::SystemService; -use actix_web::*; use futures::Future; @@ -13,6 +12,7 @@ use settings::RitaCommonSettings; use SETTING; use super::{Dashboard, GetOwnInfo, OwnInfo}; +use actix_web::*; use rita_common::network_endpoints::JsonStatusResponse; @@ -38,3 +38,64 @@ pub fn set_settings( JsonStatusResponse::new(Ok("New settings applied".to_string())) } + +#[cfg(not(feature = "development"))] +pub fn wipe(_req: HttpRequest) -> Result { + // This is returned on production builds. + Ok(HttpResponse::NotFound().finish()) +} + +#[cfg(feature = "development")] +pub fn wipe(_req: HttpRequest) -> Result { + // Clean up existing WG interfaces + match cleanup() { + Ok(_) => trace!("wipe: WireGuard interfaces cleanup success!"), + Err(e) => { + warn!( + "wipe: Unable to complete WireGuard interfaces cleanup: {:?}", + e + ); + return Err(e); + } + } + + // Restore default route + match KI.restore_default_route(&mut SETTING.get_network_mut().default_route) { + Ok(_) => trace!("wipe: Restore default route success!"), + Err(e) => { + warn!("wipe: Unable to restore default route: {:?}", e); + return Err(e); + } + } + + // Create new WireGuard keys + match linux_generate_wg_keys(&mut SETTING.get_network_mut()) { + Ok(_) => trace!("wipe: Generated new WireGuard keys"), + Err(e) => { + warn!("wipe: Unable to generate new WireGuard keys: {:?}", e); + return Err(e); + } + } + // Generate new mesh IP + match linux_generate_mesh_ip(&mut SETTING.get_network_mut()) { + Ok(_) => trace!("wipe: Generated new mesh IP"), + Err(e) => { + warn!("wipe: Unable to generate new mesh IP: {:?}", e); + return Err(e); + } + } + + // Creates file on disk containing key + match KI.create_wg_key( + &Path::new(&SETTING.get_network().wg_private_key_path), + &SETTING.get_network().wg_private_key, + ) { + Ok(_) => trace!("wipe: Saved new WireGuard keys to disk"), + Err(e) => { + warn!("wipe: Unable to save new WireGuard keys: {:?}", e); + return Err(e); + } + } + + Ok(HttpResponse::NoContent().finish()) +} diff --git a/rita/src/rita_common/http_client/mod.rs b/rita/src/rita_common/http_client/mod.rs index e18a189f3..0b8c52f92 100644 --- a/rita/src/rita_common/http_client/mod.rs +++ b/rita/src/rita_common/http_client/mod.rs @@ -1,14 +1,16 @@ -use std::net::SocketAddr; - use tokio::net::TcpStream as TokioTcpStream; use actix::prelude::*; use actix::registry::SystemService; use actix_web::*; +use futures::future::ok as future_ok; use futures::Future; -use althea_types::{Identity, LocalIdentity}; +use althea_types::LocalIdentity; + +use rita_common::peer_listener::Peer; +use rita_common::tunnel_manager::{IdentityCallback, PortCallback, TunnelManager}; use actix_web::client::Connection; use failure::Error; @@ -27,42 +29,90 @@ impl SystemService for HTTPClient { } } -#[derive(Debug, Eq, PartialEq)] +#[derive(Debug)] pub struct Hello { - pub my_id: Identity, - pub to: SocketAddr, + pub my_id: LocalIdentity, + pub to: Peer, } impl Message for Hello { - type Result = Result; + type Result = Result<(), Error>; } +/// Handler for sending hello messages, it's important that any path by which this handler +/// may crash is handled such that ports are returned to tunnel manager, otherwise we end +/// up with a port leak which will eventually crash the program impl Handler for HTTPClient { - type Result = ResponseFuture; + type Result = ResponseFuture<(), Error>; fn handle(&mut self, msg: Hello, _: &mut Self::Context) -> Self::Result { - info!("sending {:?}", msg); + info!("Sending Hello {:?}", msg); - let stream = TokioTcpStream::connect(&msg.to); + let stream = TokioTcpStream::connect(&msg.to.contact_socket); - let endpoint = format!("http://[{}]:{}/hello", msg.to.ip(), msg.to.port()); + let endpoint = format!( + "http://[{}]:{}/hello", + msg.to.contact_socket.ip(), + msg.to.contact_socket.port() + ); - Box::new(stream.from_err().and_then(move |stream| { + Box::new(stream.then(move |stream| { trace!("stream status {:?}, to: {:?}", stream, &msg.to); - let mut req = client::post(&endpoint); - - let req = req.with_connection(Connection::from_stream(stream)); - - let req = req.json(&msg.my_id); - - trace!("sending hello request {:?}", req); - - req.unwrap().send().from_err().and_then(|response| { + let mut network_request = client::post(&endpoint); + let peer = msg.to; + let wg_port = msg.my_id.wg_port; + + let stream = match stream { + Ok(s) => s, + Err(e) => { + trace!("Error getting stream from hello {:?}", e); + TunnelManager::from_registry().do_send(PortCallback(wg_port)); + return Box::new(future_ok(())) as Box>; + } + }; + + let network_request = network_request.with_connection(Connection::from_stream(stream)); + + let network_json = network_request.json(&msg.my_id); + + let network_json = match network_json { + Ok(n) => n, + Err(e) => { + trace!("Error serializing our request {:?}", e); + TunnelManager::from_registry().do_send(PortCallback(wg_port)); + return Box::new(future_ok(())) as Box>; + } + }; + + trace!("sending hello request {:?}", network_json); + + let http_result = network_json.send().then(move |response| { trace!("got response from Hello {:?}", response); - response - .json() - .from_err() - .and_then(|val: LocalIdentity| Ok(val)) - }) + match response { + Ok(response) => Box::new(response.json().then(move |val| match val { + Ok(val) => { + TunnelManager::from_registry().do_send(IdentityCallback( + val, + peer, + Some(wg_port), + )); + Ok(()) + } + Err(e) => { + trace!("Got error deserializing Hello {:?}", e); + TunnelManager::from_registry().do_send(PortCallback(wg_port)); + Ok(()) + } + })) + as Box>, + Err(e) => { + trace!("Got error getting Hello response {:?}", e); + TunnelManager::from_registry().do_send(PortCallback(wg_port)); + Box::new(future_ok(())) as Box> + } + } + }); + + Box::new(http_result) as Box> })) } } diff --git a/rita/src/rita_common/mod.rs b/rita/src/rita_common/mod.rs index fec805446..496fbb531 100644 --- a/rita/src/rita_common/mod.rs +++ b/rita/src/rita_common/mod.rs @@ -3,6 +3,7 @@ pub mod debt_keeper; pub mod http_client; pub mod network_endpoints; pub mod payment_controller; +pub mod peer_listener; pub mod rita_loop; pub mod stats_collector; pub mod traffic_watcher; diff --git a/rita/src/rita_common/network_endpoints/mod.rs b/rita/src/rita_common/network_endpoints/mod.rs index 5de7dec11..39986d389 100644 --- a/rita/src/rita_common/network_endpoints/mod.rs +++ b/rita/src/rita_common/network_endpoints/mod.rs @@ -1,4 +1,4 @@ -use althea_types::{Identity, LocalIdentity, PaymentTx}; +use althea_types::{LocalIdentity, PaymentTx}; use actix::registry::SystemService; use actix_web::*; @@ -10,11 +10,12 @@ use failure::Error; use settings::RitaCommonSettings; use SETTING; -use serde_json; +use std::net::SocketAddr; use rita_common; use rita_common::payment_controller::PaymentController; -use rita_common::tunnel_manager::{GetWgInterface, OpenTunnelListener, TunnelManager}; +use rita_common::peer_listener::Peer; +use rita_common::tunnel_manager::{IdentityCallback, TunnelManager}; use std::boxed::Box; @@ -44,52 +45,48 @@ pub fn make_payments( PaymentController::from_registry() .send(rita_common::payment_controller::PaymentReceived( pmt.0.clone(), - )) - .from_err() + )).from_err() .and_then(|_| Ok(HttpResponse::Ok().into())) .responder() } pub fn hello_response( - req: (Json, HttpRequest), + req: (Json, HttpRequest), ) -> Box, Error = Error>> { - let new_id: Result = serde_json::from_value(req.0.clone()); - let old_id: Result = serde_json::from_value(req.0.clone()); - - // remove in Alpha 6 - let their_id = match new_id { - Ok(new_id) => { - info!("got new id sending new response"); - new_id - } - Err(_) => match old_id { - Ok(old_id) => { - info!("got old_id sending new response"); - old_id.global - } - _ => panic!("did not match either"), - }, - }; + let their_id = req.0.clone(); + + let socket = req + .1 + .connection_info() + .remote() + .unwrap() + .parse::() + .unwrap(); info!("Got Hello from {:?}", req.1.connection_info().remote()); trace!("Received neighbour identity: {:?}", their_id); + info!("opening tunnel in hello_response for {:?}", their_id); + + let peer = Peer { + contact_socket: socket, + ifidx: 0, // only works because we lookup ifname in kernel interface + }; + + // We send the callback, which can safely allocate a port because it already successfully + // contacted a neighbor. The exception to this is when the TCP session fails at exactly + // the wrong time. TunnelManager::from_registry() - .send(OpenTunnelListener(their_id.clone())) - .from_err() - .and_then(move |_| { - info!("opening tunnel in hello_response for {:?}", their_id); - TunnelManager::from_registry() - .send(GetWgInterface(their_id.mesh_ip)) - .from_err() - .and_then(|wg_iface| { - Ok(Json(LocalIdentity { - global: SETTING.get_identity(), - wg_port: wg_iface?.listen_port, - })) - }) - }) + .send(IdentityCallback(their_id, peer, None)) + .and_then(|tunnel| { + let tunnel = tunnel.unwrap(); + Ok(Json(LocalIdentity { + global: SETTING.get_identity(), + wg_port: tunnel.0.listen_port, + have_tunnel: Some(tunnel.1), + })) + }).from_err() .responder() } diff --git a/rita/src/rita_common/payment_controller/mod.rs b/rita/src/rita_common/payment_controller/mod.rs index 3d0b71ad8..b25e73837 100644 --- a/rita/src/rita_common/payment_controller/mod.rs +++ b/rita/src/rita_common/payment_controller/mod.rs @@ -150,7 +150,7 @@ impl PaymentController { .body(serde_json::to_string(&update)?) .send()?; - if r.status() == StatusCode::Ok { + if r.status() == StatusCode::OK { Ok(()) } else { trace!("Unsuccessfully in sending update to bounty hunter"); @@ -246,7 +246,7 @@ impl PaymentController { let mut r = self.client.post(&neighbor_url).json(&pmt).send()?; - if r.status() == StatusCode::Ok { + if r.status() == StatusCode::OK { self.balance = self.balance.clone() - Int256::from(pmt.amount.clone()); self.update_bounty(BountyUpdate { from: self.identity.clone(), diff --git a/rita/src/rita_common/peer_listener/message.rs b/rita/src/rita_common/peer_listener/message.rs new file mode 100644 index 000000000..56fbd6793 --- /dev/null +++ b/rita/src/rita_common/peer_listener/message.rs @@ -0,0 +1,203 @@ +use byteorder::{BigEndian, ReadBytesExt}; +use bytes::BufMut; +use std::convert::From; +use std::error::Error; +use std::io::Cursor; +use std::net::Ipv6Addr; +use std::{fmt, io}; + +#[derive(Debug)] +pub enum MessageError { + /// Doesn't have enough bytes to decode a correct message + InvalidPayloadError, + /// Insufficient bytes in to decode a full message + BufferUnderflow, + /// Unknown message code indicates a possible unsupported message + InvalidMagic, + /// General I/O error + IoError(io::Error), + /// MSG_IM_HERE: Received IP address is invalid + InvalidIpAddress, +} + +impl Error for MessageError { + fn description(&self) -> &str { + match *self { + MessageError::InvalidPayloadError => "Invalid payload detected", + MessageError::InvalidMagic => "Invalid magic value received", + MessageError::BufferUnderflow => "Buffer underflow while reading message", + MessageError::IoError(ref e) => e.description(), + MessageError::InvalidIpAddress => "Received ImHere with invalid IP address", + } + } +} + +impl fmt::Display for MessageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + self.description().fmt(f) + } +} + +impl From for MessageError { + fn from(error: io::Error) -> Self { + MessageError::IoError(error) + } +} + +#[test] +fn test_message_error() { + assert_eq!( + MessageError::InvalidPayloadError.description(), + "Invalid payload detected" + ); +} + +const MSG_IM_HERE: u8 = 0x5b; +const MSG_IM_HERE_LEN: u16 = 19; + +/** + * An enum that contains all supported p2p packets + */ +#[derive(Debug, PartialEq)] +pub enum PeerMessage { + ImHere(Ipv6Addr), +} + +impl PeerMessage { + /** + * Encode an ImHere message + * Message format is very simple + * Magic , Size , Ipaddr &[u16; 8] + */ + pub fn encode(&self) -> Vec { + let mut buf = Vec::new(); + + match *self { + PeerMessage::ImHere(addr) => { + buf.put_u8(MSG_IM_HERE); + buf.put_u16_be(MSG_IM_HERE_LEN); + let ipaddr_bytes: [u8; 16] = addr.octets(); + for i in 0..16 { + buf.put_u8(ipaddr_bytes[i]); + } + trace!("Encoded ImHere packet {:x?}", buf); + return buf; + } + } + } + /** + * Decode buffer of data into a ImHere message + * Message format is very simple + * Magic , Size , Ipaddr &[u16; 8] + */ + pub fn decode(buf: &Vec) -> Result { + trace!("Starting ImHere packet decode!"); + // Check if buffer is empty + if buf.is_empty() { + trace!("Recieved an empty ImHere packet!"); + return Err(MessageError::InvalidPayloadError); + } + let mut pointer = Cursor::new(&buf); + let packet_magic = pointer.read_u8()?; + + match packet_magic { + MSG_IM_HERE => { + let packet_size = pointer.read_u16::()?; + if packet_size < MSG_IM_HERE_LEN { + trace!( + "Recieved an ImHere packet with an invalid size: {:?}", + packet_size + ); + return Err(MessageError::BufferUnderflow); + } + + let mut peer_address_arr: [u16; 8] = [0xFFFF; 8]; + for i in (0..8).rev() { + peer_address_arr[i] = pointer.read_u16::()?; + } + let peer_address = Ipv6Addr::new( + peer_address_arr[7], + peer_address_arr[6], + peer_address_arr[5], + peer_address_arr[4], + peer_address_arr[3], + peer_address_arr[2], + peer_address_arr[1], + peer_address_arr[0], + ); + + if peer_address.is_unspecified() + || peer_address.is_loopback() + || peer_address.is_multicast() + { + trace!( + "Recieved a valid ImHere with an invalid ip address: {:?}", + peer_address, + ); + return Err(MessageError::InvalidIpAddress); + } + + trace!("ImHere decoding completed successfully {:?}", peer_address); + Ok(PeerMessage::ImHere(peer_address)) + } + _ => { + trace!("Recieved packet with an unknown magic: {:X?}", packet_magic); + return Err(MessageError::InvalidMagic); + } + } + } +} + +#[test] +fn test_encode_im_here() { + let data = PeerMessage::ImHere(Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff)).encode(); + assert_eq!( + data, + vec![91, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 192, 10, 2, 255,] + ); +} + +#[test] +fn test_decode_imhere() { + let result = PeerMessage::decode(&vec![ + 91, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 192, 10, 2, 255, + ]); + match result { + Ok(PeerMessage::ImHere(addr)) => { + assert_eq!(addr, Ipv6Addr::new(0, 0, 0, 0, 0, 0xffff, 0xc00a, 0x2ff)) + } + Err(e) => panic!("Unexpected error: {:?}", e), + } +} + +#[test] +fn test_decode_imhere_with_empty_buf() { + let result = PeerMessage::decode(&vec![] as &Vec); + match result { + Ok(msg) => panic!("Expected error, got message {:?}", msg), + Err(MessageError::InvalidPayloadError) => assert!(true), + Err(e) => panic!("Unexpected error received: {:?}", e), + } +} + +#[test] +fn test_decode_imhere_with_wrong_magic() { + match PeerMessage::decode(&vec![1, 2, 3, 4]) { + Ok(msg) => assert!(false, "Unexpected success {:?}", msg), + Err(MessageError::InvalidMagic) => assert!(true), + Err(_) => panic!("Invalid error"), + } +} + +#[test] +fn test_decode_imhere_with_multicast_interface() { + let multicast_addr = Ipv6Addr::new(0xff00, 0xde, 0xad, 0xbe, 0xef, 0xb4, 0xdc, 0x0d); + assert!(multicast_addr.is_multicast()); + let data = PeerMessage::ImHere(multicast_addr).encode(); + let msg = PeerMessage::decode(&data); + match msg { + Ok(msg) => panic!("Unexpected Ok: {:?}", msg), + Err(MessageError::InvalidIpAddress) => assert!(true), + Err(e) => panic!("Unexpected error: {:?}", e), + } +} diff --git a/rita/src/rita_common/peer_listener/mod.rs b/rita/src/rita_common/peer_listener/mod.rs new file mode 100644 index 000000000..100fc020f --- /dev/null +++ b/rita/src/rita_common/peer_listener/mod.rs @@ -0,0 +1,313 @@ +/* +PeerListener is used to detect nearby mesh peers, it listens on a ff02::/8 ipv6 address, which is +a link local multicast address, on each listen port. + +On initilization a set of ListenInterface objects are created, these are important becuase they +actually hold the sockets required to listen and broadcast on the listen interfaces, every +rita_loop iteration we send out our own IP as a UDP boradcast packet and then get our peers +off the queue. These are turned into Peer structs which are passed to TunnelManager to do +whatever remaining work there may be. +*/ +use actix::prelude::*; +use actix::{Actor, Context}; +use failure::Error; +use settings::RitaCommonSettings; +use std::collections::HashMap; +use std::net::{IpAddr, Ipv6Addr, SocketAddr, SocketAddrV6, UdpSocket}; + +use rita_common::rita_loop::Tick; + +use KI; +use SETTING; + +mod message; +use self::message::PeerMessage; + +#[derive(Debug)] +pub struct PeerListener { + interfaces: HashMap, + peers: HashMap, +} + +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub struct Peer { + pub ifidx: u32, + pub contact_socket: SocketAddr, +} + +impl Peer { + pub fn new(ip: Ipv6Addr, idx: u32) -> Peer { + let port = SETTING.get_network().rita_hello_port; + let socket = SocketAddrV6::new(ip, port.into(), 0, idx); + Peer { + ifidx: idx, + contact_socket: socket.into(), + } + } +} + +impl Actor for PeerListener { + type Context = Context; +} + +impl Default for PeerListener { + fn default() -> PeerListener { + PeerListener::new().unwrap() + } +} + +impl PeerListener { + pub fn new() -> Result { + Ok(PeerListener { + interfaces: HashMap::new(), + peers: HashMap::new(), + }) + } +} + +impl Supervised for PeerListener {} + +impl SystemService for PeerListener { + // Binds to all ready interfaces + fn service_started(&mut self, _ctx: &mut Context) { + info!("PeerListener starting"); + let interfaces = SETTING.get_network().peer_interfaces.clone(); + let iface_list = interfaces; + for iface in iface_list.iter() { + let res = ListenInterface::new(iface); + if res.is_ok() { + let new_listen_interface = res.unwrap(); + self.interfaces + .insert(new_listen_interface.ifname.clone(), new_listen_interface); + } + } + } +} + +impl Handler for PeerListener { + type Result = Result<(), Error>; + fn handle(&mut self, _: Tick, _ctx: &mut Context) -> Self::Result { + trace!("Starting PeerListener tick!"); + let res = send_im_here(&mut self.interfaces); + if res.is_err() { + error!("Sending ImHere failed with {:?}", res); + } + + match receive_im_here(&mut self.interfaces) { + Ok(new_peers) => { + self.peers = new_peers; + } + Err(e) => { + error!("Receiving ImHere failed with {:?}", e); + } + } + + Ok(()) + } +} + +// message containing interface name as a string +pub struct Listen(pub String); +impl Message for Listen { + type Result = (); +} + +/// Adds a given interface to the list of interfaces on which peers can be found +/// and contacted +impl Handler for PeerListener { + type Result = (); + + fn handle(&mut self, listen: Listen, _: &mut Context) -> Self::Result { + trace!("Peerlistener listen on {:?}", listen.0); + let new_iface_name = listen.0; + + if self.interfaces.contains_key(&new_iface_name) { + error!("Someone attempted a double listen!"); + return (); + } + + let new_iface = ListenInterface::new(&new_iface_name); + match new_iface { + Ok(n) => { + self.interfaces.insert(new_iface_name.clone(), n); + SETTING + .get_network_mut() + .peer_interfaces + .insert(new_iface_name); + } + Err(e) => { + error!("Peer listener failed to listen on {:?}", e); + } + } + } +} + +// message containing interface name as a string +pub struct UnListen(pub String); +impl Message for UnListen { + type Result = (); +} + +/// Removes a given interface to the list of interfaces on which peers can be found +/// and contacted +impl Handler for PeerListener { + type Result = (); + + fn handle(&mut self, un_listen: UnListen, _: &mut Context) -> Self::Result { + trace!("Peerlistener unlisten on {:?}", un_listen.0); + let ifname_to_delete = un_listen.0; + if self.interfaces.contains_key(&ifname_to_delete) { + self.interfaces.remove(&ifname_to_delete); + SETTING + .get_network_mut() + .peer_interfaces + .remove(&ifname_to_delete); + } else { + error!("Tried to unlisten interface that's not present!") + } + } +} + +#[derive(Debug)] +pub struct GetPeers(); +impl Message for GetPeers { + type Result = Result, Error>; +} + +impl Handler for PeerListener { + type Result = Result, Error>; + + fn handle(&mut self, _: GetPeers, _: &mut Context) -> Self::Result { + Ok(self.peers.clone()) + } +} + +#[derive(Debug)] +pub struct ListenInterface { + ifname: String, + ifidx: u32, + multicast_socketaddr: SocketAddrV6, + multicast_socket: UdpSocket, + linklocal_socket: UdpSocket, + linklocal_ip: Ipv6Addr, +} + +impl ListenInterface { + pub fn new(ifname: &str) -> Result { + let port = SETTING.get_network().rita_hello_port; + let disc_ip = SETTING.get_network().discovery_ip; + debug!("Binding to {:?} for ListenInterface", ifname); + // Lookup interface link local ip + let link_ip = KI.get_link_local_device_ip(&ifname)?; + + // Lookup interface index + let iface_index = match KI.get_iface_index(&ifname) { + Ok(idx) => idx, + Err(_) => 0, + }; + // Bond to multicast discovery address on each listen port + let multicast_socketaddr = SocketAddrV6::new(disc_ip, port.into(), 0, iface_index); + let multicast_socket = UdpSocket::bind(multicast_socketaddr) + .expect("Failed to bind to peer discovery address!"); + let res = multicast_socket.join_multicast_v6(&disc_ip, iface_index); + trace!("ListenInterface init set multicast v6 with {:?}", res); + let res = multicast_socket.set_nonblocking(true); + trace!( + "ListenInterface multicast init set nonblocking with {:?}", + res + ); + + let linklocal_socketaddr = SocketAddrV6::new(link_ip, port.into(), 0, iface_index); + let linklocal_socket = UdpSocket::bind(linklocal_socketaddr).expect(&format!( + "ListenInterface Failed to bind to link local address {:?} on {:?} with iface_index {:?} ", + link_ip, ifname, iface_index + )); + let res = linklocal_socket.set_nonblocking(true); + trace!("ListenInterface init set nonblocking with {:?}", res); + + let res = linklocal_socket.join_multicast_v6(&disc_ip, iface_index); + trace!("ListenInterface Set link local multicast v6 with {:?}", res); + + Ok(ListenInterface { + ifname: ifname.to_string(), + ifidx: iface_index, + multicast_socket: multicast_socket, + linklocal_socket: linklocal_socket, + multicast_socketaddr: multicast_socketaddr, + linklocal_ip: link_ip, + }) + } +} + +fn send_im_here(interfaces: &mut HashMap) -> Result<(), Error> { + trace!("About to send ImHere"); + for obj in interfaces.iter_mut() { + let listen_interface = obj.1; + trace!( + "Sending ImHere to {:?}, with ip {:?}", + listen_interface.ifname, + listen_interface.linklocal_ip + ); + let message = PeerMessage::ImHere(listen_interface.linklocal_ip.clone()); + let result = listen_interface + .linklocal_socket + .send_to(&message.encode(), listen_interface.multicast_socketaddr); + trace!("Sending ImHere to broadcast gets {:?}", result); + } + Ok(()) +} + +fn receive_im_here( + interfaces: &mut HashMap, +) -> Result, Error> { + trace!("About to dequeue ImHere"); + let mut output = HashMap::::new(); + for obj in interfaces.iter_mut() { + let listen_interface = obj.1; + // Since the only datagrams we are interested in are very small (22 bytes plus overhead) + // this buffer is kept intentionally small to discard larger packets earlier rather than later + loop { + let mut datagram: [u8; 100] = [0; 100]; + let (bytes_read, sock_addr) = + match listen_interface.multicast_socket.recv_from(&mut datagram) { + Ok(b) => b, + Err(e) => { + trace!("Could not recv ImHere: {:?}", e); + // TODO Consider we might want to remove interfaces that produce specific types + // of errors from the active list + break; + } + }; + trace!( + "Received {} bytes on multicast socket from {:?}", + bytes_read, + sock_addr + ); + + let ipaddr = match PeerMessage::decode(&datagram.to_vec()) { + Ok(PeerMessage::ImHere(ipaddr)) => ipaddr, + Err(e) => { + warn!("ImHere decode failed: {:?}", e); + continue; + } + }; + + if ipaddr == listen_interface.linklocal_ip { + trace!("Got ImHere from myself"); + continue; + } + + if output.contains_key(&ipaddr.into()) { + trace!( + "Discarding ImHere We already have a peer with {:?} for this cycle", + ipaddr + ); + continue; + } + trace!("ImHere with {:?}", ipaddr); + let peer = Peer::new(ipaddr, listen_interface.ifidx); + output.insert(peer.contact_socket.ip(), peer); + } + } + Ok(output) +} diff --git a/rita/src/rita_common/rita_loop/mod.rs b/rita/src/rita_common/rita_loop/mod.rs index 44afddd97..2d35329bc 100644 --- a/rita/src/rita_common/rita_loop/mod.rs +++ b/rita/src/rita_common/rita_loop/mod.rs @@ -4,26 +4,29 @@ use actix::prelude::*; use actix::registry::SystemService; use actix_utils::KillActor; -#[cfg(not(test))] -use trust_dns_resolver::config::ResolverConfig; - use actix_utils::ResolverWrapper; -#[cfg(not(test))] use KI; use rita_common::tunnel_manager::{GetNeighbors, TunnelManager}; use rita_common::traffic_watcher::{TrafficWatcher, Watch}; +use rita_common::peer_listener::PeerListener; + use rita_common::debt_keeper::{DebtKeeper, SendUpdate}; use rita_common::payment_controller::{PaymentController, PaymentControllerUpdate}; use rita_common::stats_collector::StatsCollector; +use rita_common::peer_listener::GetPeers; + +use rita_common::tunnel_manager::PeersToContact; + use failure::Error; -use rita_common::tunnel_manager::OpenTunnel; + +use futures::Future; use settings::RitaCommonSettings; use SETTING; @@ -79,14 +82,16 @@ impl Handler for RitaLoop { self.was_gateway = true } - trace!("Adding default routes for TrustDNS"); - #[cfg(not(test))] - for i in ResolverConfig::default().name_servers() { - trace!("TrustDNS default {:?}", i); - KI.manual_peers_route( - &i.socket_addr.ip(), - &mut SETTING.get_network_mut().default_route, - ).unwrap(); + + match KI.get_resolv_servers() { + Ok(s) => { + for ip in s.iter() { + trace!("Resolv route {:?}", ip); + KI.manual_peers_route(&ip, &mut SETTING.get_network_mut().default_route) + .unwrap(); + } + } + Err(e) => warn!("Failed to add DNS routes with {:?}", e), } } else { self.was_gateway = false @@ -98,34 +103,71 @@ impl Handler for RitaLoop { .send(GetNeighbors) .into_actor(self) .then(move |res, act, _ctx| { + // TODO refactor to use an struct instead of a tuple + // Vec<(LocalIdentity, Iface Name, IpAddr)> let res = res.unwrap().unwrap(); - info!("got neighbors: {:?}", res); + info!("Currently open tunnels: {:?}", res); let neigh = Instant::now(); - - for &(ref their_id, _, ref ip) in &res { - TunnelManager::from_registry() - .do_send(OpenTunnel(their_id.clone(), ip.clone())); - } + info!( + "GetNeighbors completed in {}s {}ms", + start.elapsed().as_secs(), + start.elapsed().subsec_nanos() / 1000000 + ); let res = res .iter() - .map(|input| (input.0.clone(), input.1.clone())) + .map(|res| (res.0.clone(), res.1.clone())) .collect(); TrafficWatcher::from_registry() .send(Watch(res)) .into_actor(act) .then(move |_res, _act, _ctx| { - info!("loop completed in {:?}", start.elapsed()); - info!("traffic watcher completed in {:?}", neigh.elapsed()); + info!( + "TrafficWatcher completed in {}s {}ms", + neigh.elapsed().as_secs(), + neigh.elapsed().subsec_nanos() / 1000000 + ); DebtKeeper::from_registry().do_send(SendUpdate {}); PaymentController::from_registry().do_send(PaymentControllerUpdate {}); actix::fut::ok(()) }) }), ); + + let start = Instant::now(); + trace!("Starting PeerListener tick"); + Arbiter::spawn( + PeerListener::from_registry() + .send(Tick {}) + .then(move |res| { + info!( + "PeerListener tick completed in {}s {}ms, with result {:?}", + start.elapsed().as_secs(), + start.elapsed().subsec_nanos() / 1000000, + res + ); + res + }).then(|_| Ok(())), + ); + + let start = Instant::now(); + trace!("Getting Peers from PeerListener to pass to TunnelManager"); + Arbiter::spawn( + PeerListener::from_registry() + .send(GetPeers {}) + .and_then(move |peers| { + info!( + "PeerListener get peers completed in {}s {}ms", + start.elapsed().as_secs(), + start.elapsed().subsec_nanos() / 1000000 + ); + TunnelManager::from_registry().send(PeersToContact(peers.unwrap())) // GetPeers never fails so unwrap is safe + }).then(|_| Ok(())), + ); + Ok(()) } } diff --git a/rita/src/rita_common/tunnel_manager/mod.rs b/rita/src/rita_common/tunnel_manager/mod.rs index b0772a35d..1135b2f85 100644 --- a/rita/src/rita_common/tunnel_manager/mod.rs +++ b/rita/src/rita_common/tunnel_manager/mod.rs @@ -1,14 +1,21 @@ -use std::collections::{HashMap, HashSet}; -use std::net::{IpAddr, SocketAddr, SocketAddrV4, SocketAddrV6, TcpStream}; +/* +Tunnel manager manages WireGuard tunnels between mesh peers. In rita_loop PeerListener is called +and asked about what peers it has heard from since the last cycle, these peers are passed to +TunnelManager, which then orchestrates calling these peers over their http endpoints and setting +up tunnels if they respond, likewise if someone calls us their hello goes through network_endpoints +then into TunnelManager to open a tunnel for them. +*/ +use std::collections::HashMap; +use std::net::{IpAddr, SocketAddr, TcpStream}; use std::path::Path; use actix::actors::resolver; use actix::prelude::*; -use futures; use futures::Future; -use althea_types::{Identity, LocalIdentity}; +use althea_types::Identity; +use althea_types::LocalIdentity; use KI; @@ -16,6 +23,7 @@ use babel_monitor::{Babel, Route}; use rita_common; use rita_common::http_client::Hello; +use rita_common::peer_listener::Peer; use settings::RitaCommonSettings; use SETTING; @@ -40,31 +48,78 @@ type Resolver = resolver::Resolver; #[derive(Debug, Fail)] pub enum TunnelManagerError { - #[fail(display = "DNS lookup error")] - DNSLookupError, + #[fail(display = "Port Error: {:?}", _0)] + PortError(String), } +/* Uncomment when tunnel state handling is added #[derive(Debug, Clone)] -pub struct TunnelData { - pub iface_name: String, - pub listen_port: u16, +pub enum TunnelState { + Init, + Open, + Throttled, + Closed, } +*/ -impl TunnelData { - fn new(listen_port: u16) -> TunnelData { +#[derive(Debug, Clone)] +pub struct Tunnel { + pub ip: IpAddr, // Tunnel endpoint + pub iface_name: String, // name of wg# + pub listen_ifidx: u32, // the physical interface this tunnel is listening on + pub listen_port: u16, // the local port this tunnel is listening on + // pub tunnel_state: TunnelState, // how this exit feels about it's lifecycle + pub localid: LocalIdentity, // the identity of the counterparty tunnel +} + +impl Tunnel { + fn new( + ip: IpAddr, + our_listen_port: u16, + ifidx: u32, + their_id: LocalIdentity, + ) -> Result { let iface_name = KI.setup_wg_if().unwrap(); - TunnelData { - iface_name, - listen_port, - } + + //let init = TunnelState::Init; + let tunnel = Tunnel { + ip: ip, + iface_name: iface_name, + listen_ifidx: ifidx, + listen_port: our_listen_port, + //tunnel_state: init, + localid: their_id.clone(), + }; + + let network = SETTING.get_network().clone(); + + KI.open_tunnel( + &tunnel.iface_name, + tunnel.listen_port, + &SocketAddr::new(ip, their_id.wg_port), + &their_id.global.wg_public_key, + Path::new(&network.wg_private_key_path), + &network.own_ip, + network.external_nic.clone(), + &mut SETTING.get_network_mut().default_route, + )?; + + let stream = TcpStream::connect::( + format!("[::1]:{}", SETTING.get_network().babel_port).parse()?, + )?; + + let mut babel = Babel::new(stream); + + babel.start_connection()?; + babel.monitor(&tunnel.iface_name)?; + + Ok(tunnel) } } pub struct TunnelManager { - pub port: u16, - - tunnel_map: HashMap, - listen_interfaces: HashSet, + free_ports: Vec, + tunnels: HashMap<(Identity, u32), Tunnel>, } impl Actor for TunnelManager { @@ -74,11 +129,6 @@ impl Supervised for TunnelManager {} impl SystemService for TunnelManager { fn service_started(&mut self, _ctx: &mut Context) { info!("Tunnel manager started"); - - for i in SETTING.get_network().peer_interfaces.clone() { - self.listen_interfaces.insert(i); - } - trace!("Loaded listen interfaces {:?}", self.listen_interfaces); } } @@ -88,30 +138,58 @@ impl Default for TunnelManager { } } -pub struct GetWgInterface(pub IpAddr); -impl Message for GetWgInterface { - type Result = Result; +pub struct IdentityCallback(pub LocalIdentity, pub Peer, pub Option); +impl Message for IdentityCallback { + type Result = Option<(Tunnel, bool)>; } -impl Handler for TunnelManager { - type Result = Result; +// An attempt to contact a neighbor has succeeded or a neighbor has contacted us, either way +// we need to allocate a tunnel for them and place it onto our local storage. In the case +// that a neighbor contacts us we don't have a port already allocated and we need to choose one +// in the case that we have atempted to contact a neighbor we have already sent them a port that +// we now must attach to their tunnel entry. If we also return a bool for if the tunnel already +// exists +impl Handler for TunnelManager { + type Result = Option<(Tunnel, bool)>; + + fn handle(&mut self, msg: IdentityCallback, _: &mut Context) -> Self::Result { + let peer_local_id = msg.0; + let peer = msg.1; + let our_port = match msg.2 { + Some(port) => port, + _ => match self.free_ports.pop() { + Some(p) => p, + None => { + warn!("Failed to allocate tunnel port! All tunnel opening will fail"); + return None; + } + }, + }; - fn handle(&mut self, msg: GetWgInterface, _: &mut Context) -> Self::Result { - Ok(self.get_if(msg.0)) + let res = self.open_tunnel(peer_local_id, peer, our_port); + match res { + Ok(res) => Some(res), + Err(e) => { + warn!("Open Tunnel failed with {:?}", e); + return None; + } + } } } -pub struct Listen(pub String); -impl Message for Listen { +// An attempt to contact a neighbor has failed and we need to return the port to +// the available ports list +pub struct PortCallback(pub u16); +impl Message for PortCallback { type Result = (); } -impl Handler for TunnelManager { +impl Handler for TunnelManager { type Result = (); - fn handle(&mut self, listen: Listen, _: &mut Context) -> Self::Result { - self.listen_interfaces.insert(listen.0); - SETTING.get_network_mut().peer_interfaces = self.listen_interfaces.clone(); + fn handle(&mut self, msg: PortCallback, _: &mut Context) -> Self::Result { + let port = msg.0; + self.free_ports.push(port); } } @@ -154,950 +232,264 @@ impl Handler for TunnelManager { } } -pub struct UnListen(pub String); -impl Message for UnListen { - type Result = (); -} - -impl Handler for TunnelManager { - type Result = (); - - fn handle(&mut self, un_listen: UnListen, _: &mut Context) -> Self::Result { - self.listen_interfaces.remove(&un_listen.0); - SETTING.get_network_mut().peer_interfaces = self.listen_interfaces.clone(); - } -} - -pub struct GetListen; -impl Message for GetListen { - type Result = Result, Error>; -} - -impl Handler for TunnelManager { - type Result = Result, Error>; - fn handle(&mut self, _: GetListen, _: &mut Context) -> Self::Result { - Ok(self.listen_interfaces.clone()) - } -} - pub struct GetNeighbors; impl Message for GetNeighbors { type Result = Result, Error>; } impl Handler for TunnelManager { - type Result = ResponseFuture, Error>; + type Result = Result, Error>; fn handle(&mut self, _: GetNeighbors, _: &mut Context) -> Self::Result { - self.get_neighbors() - } -} - -pub struct GetLocalIdentity { - pub from: IpAddr, -} -impl Message for GetLocalIdentity { - type Result = LocalIdentity; -} - -impl Handler for TunnelManager { - type Result = MessageResult; - - fn handle(&mut self, their_id: GetLocalIdentity, _: &mut Context) -> Self::Result { - MessageResult(self.get_local_identity(their_id.from)) + let mut res = Vec::new(); + for obj in self.tunnels.iter() { + let tunnel = obj.1; + res.push((tunnel.localid.clone(), tunnel.iface_name.clone(), tunnel.ip)); + } + Ok(res) } } -pub struct OpenTunnel(pub LocalIdentity, pub IpAddr); +pub struct PeersToContact(pub HashMap); -impl Message for OpenTunnel { +impl Message for PeersToContact { type Result = (); } -impl Handler for TunnelManager { +/// Takes a list of peers to contact and dispatches requests if you have a WAN connection +/// it will also dispatch neighbor requests to manual peers +impl Handler for TunnelManager { type Result = (); - - fn handle(&mut self, their_id: OpenTunnel, _: &mut Context) -> Self::Result { - self.open_tunnel(their_id.0, their_id.1).unwrap(); - () + fn handle(&mut self, msg: PeersToContact, _ctx: &mut Context) -> Self::Result { + trace!("TunnelManager contacting peers"); + for obj in msg.0.iter() { + let peer = obj.1; + let res = self.neighbor_inquiry(peer.clone()); + if res.is_err() { + warn!("Neighbor inqury for {:?} failed! with {:?}", peer, res); + } + } + // Do not contact manual peers if we are not a gateway + if SETTING.get_network().is_gateway { + for manual_peer in SETTING.get_network().manual_peers.iter() { + let ip = manual_peer.parse::(); + let port = SETTING.get_network().rita_hello_port; + + match ip { + Ok(ip) => { + let socket = SocketAddr::new(ip, port); + let man_peer = Peer { + ifidx: 0, + contact_socket: socket, + }; + let res = self.neighbor_inquiry(man_peer); + if res.is_err() { + warn!( + "Neighbor inqury for {:?} failed with: {:?}", + manual_peer, res + ); + } + } + Err(_) => { + let res = self.neighbor_inquiry_hostname(manual_peer.to_string()); + if res.is_err() { + warn!( + "Neighbor inqury for {:?} failed with: {:?}", + manual_peer, res + ); + } + } + } + } + } } } -pub struct OpenTunnelListener(pub Identity); - -impl Message for OpenTunnelListener { - type Result = (); -} +/// Sets out to contact a neighbor, takes a speculative port (only assigned if the neighbor +/// responds successfully) +fn contact_neighbor(peer: Peer, our_port: u16) -> Result<(), Error> { + KI.manual_peers_route( + &peer.contact_socket.ip(), + &mut SETTING.get_network_mut().default_route, + )?; -impl Handler for TunnelManager { - type Result = (); + let _res = HTTPClient::from_registry().do_send(Hello { + my_id: LocalIdentity { + global: SETTING.get_identity(), + wg_port: our_port, + have_tunnel: None, + }, + to: peer, + }); - fn handle(&mut self, their_id: OpenTunnelListener, _: &mut Context) -> Self::Result { - self.open_tunnel_listener(their_id.0).unwrap(); - () - } + Ok(()) } impl TunnelManager { pub fn new() -> Self { + let start = SETTING.get_network().wg_start_port; + let ports = (start..65535).collect(); TunnelManager { - tunnel_map: HashMap::new(), - port: SETTING.get_network().wg_start_port, - listen_interfaces: SETTING.get_network().peer_interfaces.clone(), + free_ports: ports, + tunnels: HashMap::<(Identity, u32), Tunnel>::new(), } } - fn new_if(&mut self) -> TunnelData { - trace!("creating new interface"); - let r = TunnelData::new(self.port); - info!("creating new wg interface {:?}", r); - - self.port += 1; - r - } + /// This function generates a future and hands it off to the Actix arbiter to actually resolve + /// in the case that the DNS request is successful the hello handler and eventually the Identity + /// callback continue execution flow. But this function itself returns syncronously + pub fn neighbor_inquiry_hostname(&mut self, their_hostname: String) -> Result<(), Error> { + trace!("Getting tunnel, inq"); - fn get_if(&mut self, ip: IpAddr) -> TunnelData { - if self.tunnel_map.contains_key(&ip) { - trace!("found existing wg interface for {}", ip); - self.tunnel_map[&ip].clone() - } else { - trace!("creating new wg interface for {}", ip); - let new = self.new_if(); - self.tunnel_map.insert(ip.clone(), new.clone()); - new - } - } + let our_port = match self.free_ports.pop() { + Some(p) => p, + None => { + warn!("Failed to allocate tunnel port! All tunnel opening will fail"); + return Err(TunnelManagerError::PortError("No remaining ports!".to_string()).into()); + } + }; - /// This gets the list of link-local neighbors, and then contacts them to get their - /// Identity using `neighbor_inquiry` as well as their wireguard tunnel name - pub fn get_neighbors(&mut self) -> ResponseFuture, Error> { - KI.trigger_neighbor_disc(&SETTING.get_network().peer_interfaces) - .unwrap(); - let neighs: Vec< - Box, Error = ()>>, - > = KI - .get_neighbors() - .unwrap() - .iter() - .map(|&(ip_address, ref dev)| (ip_address.to_string(), Some(dev.clone()))) - .chain({ - let mut out = Vec::new(); - if SETTING.get_network().is_gateway && SETTING.get_network().external_nic.is_some() - { - for i in SETTING.get_network().manual_peers.clone() { - out.push((i, SETTING.get_network().external_nic.clone())) - } - } - out - }) - .filter_map(|(ip_address, dev)| { - info!("neighbor at interface {:?}, ip {}", dev, ip_address,); - if let Some(dev) = dev.clone() { - // Demorgans equal to "if a neighbor is on the listen interfaces and has a valid - // ip or if it's a manual peer and from the right nic don't filter it" - if !(self.listen_interfaces.contains(&dev) - && ip_address.parse::().is_ok()) - && !(SETTING.get_network().external_nic.is_some() - && SETTING - .get_network() - .external_nic - .clone() - .unwrap() - .contains(&dev) - && SETTING.get_network().manual_peers.contains(&ip_address)) - { - info!( - "Filtering neighbor at interface {:?}, ip {}", - dev, ip_address, + let res = Resolver::from_registry() + .send(resolver::Resolve::host(their_hostname.clone())) + .then(move |res| match res { + Ok(Ok(dnsresult)) => { + let port = SETTING.get_network().rita_hello_port; + let url = format!("http://[{}]:{}/hello", their_hostname, port); + info!("Saying hello to: {:?} at ip {:?}", url, dnsresult); + if dnsresult.len() > 0 && SETTING.get_network().is_gateway { + let their_ip = dnsresult[0].ip(); + let socket = SocketAddr::new(their_ip, port); + let man_peer = Peer { + ifidx: 0, + contact_socket: socket, + }; + let res = contact_neighbor(man_peer, our_port); + if res.is_err() { + warn!("Contact neighbor failed with {:?}", res); + } + } else { + trace!( + "We're not a gateway or we got a zero length dns response: {:?}", + dnsresult ); - return None; } + Ok(()) } - Some( - Box::new( - self.neighbor_inquiry(ip_address, dev.clone()) - .then(|res| match res { - Ok(res) => futures::future::ok(Some(res)), - Err(err) => { - warn!("got error {:} from neighbor inquiry", err); - futures::future::ok(None) - } - }), - ) - as Box, Error = ()>>, - ) - }) - .collect(); - Box::new(futures::future::join_all(neighs).then(|res| { - let mut output = Vec::new(); - for i in res.unwrap() { - if let Some(i) = i { - output.push(i); + Err(e) => { + warn!("Actor mailbox failure from DNS resolver! {:?}", e); + // We might need a port callback here + Ok(()) } - } - futures::future::ok(output) - })) + + Ok(Err(e)) => { + warn!("DNS resolution failed with {:?}", e); + Ok(()) + } + }); + Arbiter::spawn(res); + Ok(()) } /// Contacts one neighbor with our LocalIdentity to get their LocalIdentity and wireguard tunnel /// interface name. - pub fn neighbor_inquiry( - &mut self, - their_hostname: String, - dev: Option, - ) -> Box> { - trace!("Getting tunnel, inq"); - let iface_index = if let Some(dev) = dev.clone() { - KI.get_iface_index(&dev).unwrap() - } else { - 0 - }; - - trace!("Checking if {} is a url", their_hostname); - match their_hostname.parse::() { - Ok(ip) => Box::new({ - let url = format!("http://[{}%{:?}]:4876/hello", their_hostname, dev); - info!("Saying hello to: {:?}", url); - - TunnelManager::contact_neighbor(iface_index, ip) - }), - _ => Box::new( - Resolver::from_registry() - .send(resolver::Resolve::host(their_hostname.clone())) - .from_err() - .and_then(move |res| { - let url = format!("http://[{}%{:?}]:4876/hello", their_hostname, dev); - info!("Saying hello to: {:?} at ip {:?}", url, res); - - if let Ok(res) = res { - if res.len() > 0 && SETTING.get_network().is_gateway { - let their_ip = res[0].ip(); - - TunnelManager::contact_neighbor(iface_index, their_ip) - } else { - trace!( - "We're not a gateway or we got a zero length dns response: {:?}", - res - ); - Box::new(futures::future::err( - TunnelManagerError::DNSLookupError.into(), - )) - } - } else { - trace!("Error during dns request!"); - Box::new(futures::future::err( - TunnelManagerError::DNSLookupError.into(), - )) - } - }), - ), - } - } - - fn contact_neighbor( - iface_index: u32, - their_ip: IpAddr, - ) -> Box> { - KI.manual_peers_route(&their_ip, &mut SETTING.get_network_mut().default_route) - .unwrap(); - - let socket = match their_ip { - IpAddr::V6(ip_v6) => SocketAddr::V6(SocketAddrV6::new( - ip_v6, - SETTING.get_network().rita_hello_port, - 0, - iface_index, - )), - IpAddr::V4(ip_v4) => SocketAddr::V4(SocketAddrV4::new( - ip_v4, - SETTING.get_network().rita_hello_port, - )), + pub fn neighbor_inquiry(&mut self, peer: Peer) -> Result<(), Error> { + trace!("TunnelManager neigh inquiry for {:?}", peer); + let our_port = match self.free_ports.pop() { + Some(p) => p, + None => { + warn!("Failed to allocate tunnel port! All tunnel opening will fail"); + return Err(TunnelManagerError::PortError("No remaining ports!".to_string()).into()); + } }; - Box::new( - HTTPClient::from_registry() - .send(Hello { - my_id: SETTING.get_identity(), - to: socket, - }) - .from_err() - .and_then(move |res| match res { - Ok(res) => Box::new( - TunnelManager::from_registry() - .send(GetWgInterface(res.global.mesh_ip)) - .from_err() - .and_then(move |interface| Ok((res, interface?.iface_name, their_ip))), - ) - as Box>, - Err(e) => Box::new(futures::future::err(e)) - as Box>, - }), - ) - } - pub fn get_local_identity(&mut self, mesh_ip: IpAddr) -> LocalIdentity { - trace!("Getting tunnel, local id"); - let tunnel = self.get_if(mesh_ip); - - LocalIdentity { - global: SETTING.get_identity(), - wg_port: tunnel.listen_port, - } + contact_neighbor(peer, our_port) } /// Given a LocalIdentity, connect to the neighbor over wireguard - pub fn open_tunnel(&mut self, their_id: LocalIdentity, ip: IpAddr) -> Result<(), Error> { - trace!("Getting tunnel, open tunnel"); - let tunnel = self.get_if(their_id.global.mesh_ip); - let network = SETTING.get_network().clone(); - - KI.open_tunnel( - &tunnel.iface_name, - tunnel.listen_port, - &SocketAddr::new(ip, their_id.wg_port), - &their_id.global.wg_public_key, - Path::new(&network.wg_private_key_path), - &network.own_ip, - network.external_nic.clone(), - &mut SETTING.get_network_mut().default_route, - )?; - - let stream = TcpStream::connect::( - format!("[::1]:{}", SETTING.get_network().babel_port).parse()?, - )?; - - let mut babel = Babel::new(stream); - - babel.start_connection()?; - babel.monitor(&tunnel.iface_name)?; - Ok(()) - } - - /// Given a LocalIdentity, listens for a neighbor over wireguard - pub fn open_tunnel_listener(&mut self, their_id: Identity) -> Result<(), Error> { - trace!("Getting tunnel, open tunnel"); - let tunnel = self.get_if(their_id.mesh_ip); - let network = SETTING.get_network().clone(); - - KI.open_tunnel_listener( - &tunnel.iface_name, - tunnel.listen_port, - &their_id.wg_public_key, - Path::new(&network.wg_private_key_path), - &network.own_ip, - )?; - - let stream = TcpStream::connect::( - format!("[::1]:{}", SETTING.get_network().babel_port).parse()?, - )?; - - let mut babel = Babel::new(stream); - - babel.start_connection()?; - babel.monitor(&tunnel.iface_name)?; - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use actix::*; - use futures::{future, Future}; - - use env_logger; - - use std::os::unix::process::ExitStatusExt; - use std::process::ExitStatus; - use std::process::Output; - - use super::*; - - use actix::actors::resolver::ResolverError; - use std::collections::VecDeque; - use std::net::Ipv4Addr; - - fn vec_string_to_str<'a>(vstr: &'a Vec) -> Vec<&'a str> { - let mut arr = Vec::new(); - for i in 0..vstr.len() { - arr.push(vstr[i].as_str()); - } - arr - } - - #[test] - fn test_contact_neighbor_ipv4() { - env_logger::init(); - - let link_args = &["link"]; - let link_add = &["link", "add", "wg1", "type", "wireguard"]; + /// return the tunnel object and if already had a tunnel + pub fn open_tunnel( + &mut self, + their_localid: LocalIdentity, + peer: Peer, + our_port: u16, + ) -> Result<(Tunnel, bool), Error> { + trace!("getting existing tunnel or opening a new one"); + // ifidx must be a part of the key so that we can open multiple tunnels + // if we have more than one physical connection to the same peer + let key = &(their_localid.global.clone(), peer.ifidx); + + let we_have_tunnel = self.tunnels.contains_key(key); + let they_have_tunnel = match their_localid.have_tunnel { + Some(v) => v, + None => true, // when we don't take the more conservative option + }; - let mut counter = 0; - KI.set_mock(Box::new(move |program, args| { - counter += 1; + let mut return_bool = false; + if we_have_tunnel && they_have_tunnel { trace!( - "program {:?}, args {:?}, counter {}", - program, - args, - counter + "We already have a tunnel for {:?}%{:?}", + peer.contact_socket.ip(), + peer.ifidx, ); + // return allocated port as it's not required + self.free_ports.push(our_port); + // Unwrap is safe because we confirm membership + let tunnel = self.tunnels.get(key).unwrap(); + return Ok((tunnel.clone(), true)); + } - match counter { - 1 => { - assert_eq!(program, "ip"); - assert_eq!(args, ["route", "list", "default"]); - Ok(Output { - stdout: b"default via 192.168.1.1 dev eth0 proto static metric 600\n" - .to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 2 => { - assert_eq!(program, "ip"); - assert_eq!( - args, - [ - "route", - "add", - "1.1.1.1", - "via", - "192.168.1.1", - "dev", - "eth0", - "proto", - "static", - "metric", - "600" - ] - ); - Ok(Output { - stdout: b"ok".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 3 => { - assert_eq!(program, "ip"); - assert_eq!(args, link_args); - Ok(Output { - stdout: b"82: wg0: mtu 1420 qdisc noop state DOWN mode DEFAULT group default qlen 1000".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 4 => { - assert_eq!(program, "ip"); - assert_eq!(args, link_add); - Ok(Output { - stdout: b"".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - _ => panic!("command called too many times"), - } - })); - - let sys = System::new("test"); - - System::current().registry().set( - HTTPClient::mock(Box::new(|msg, _ctx| { - assert_eq!( - msg.downcast_ref::(), - Some(&Hello { - my_id: SETTING.get_identity(), - to: SocketAddr::V4(SocketAddrV4::new("1.1.1.1".parse().unwrap(), 4876)) - }) - ); - - let ret: Result = Ok(LocalIdentity { - wg_port: 60000, - global: SETTING.get_identity(), - }); - Box::new(Some(ret)) - })).start(), - ); - - let res = TunnelManager::contact_neighbor(0, "1.1.1.1".parse().unwrap()); - - Arbiter::spawn(res.then(|res| { - assert_eq!( - res.unwrap(), - ( - LocalIdentity { - wg_port: 60000, - global: SETTING.get_identity(), - }, - "wg1".to_string(), - "1.1.1.1".parse().unwrap() - ) - ); - - System::current().stop(); - future::result(Ok(())) - })); - - sys.run(); - } - - #[test] - fn test_neighbor_inquiry_domain() { - let link_args = &["link"]; - let link_add = &["link", "add", "wg1", "type", "wireguard"]; - - let mut counter = 0; - KI.set_mock(Box::new(move |program, args| { - counter += 1; + if we_have_tunnel && !they_have_tunnel { trace!( - "program {:?}, args {:?}, counter {}", - program, - args, - counter + "We have a tunnel but our peer {:?} does not! Handling", + peer.contact_socket.ip() ); - - match counter { - 1 => { - assert_eq!(program, "ip"); - assert_eq!(args, ["route", "list", "default"]); - Ok(Output { - stdout: b"default via 192.168.1.1 dev eth0 proto static metric 600\n" - .to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 2 => { - assert_eq!(program, "ip"); - assert_eq!( - args, - [ - "route", - "add", - "1.1.1.1", - "via", - "192.168.1.1", - "dev", - "eth0", - "proto", - "static", - "metric", - "600" - ] - ); - Ok(Output { - stdout: b"ok".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 3 => { - assert_eq!(program, "ip"); - assert_eq!(args, link_args); - Ok(Output { - stdout: b"82: wg0: mtu 1420 qdisc noop state DOWN mode DEFAULT group default qlen 1000".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 4 => { - assert_eq!(program, "ip"); - assert_eq!(args, link_add); - Ok(Output { - stdout: b"".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - _ => panic!("command called too many times"), - } - })); - - let sys = System::new("test"); - - System::current().registry().set( - HTTPClient::mock(Box::new(|msg, _ctx| { - assert_eq!( - msg.downcast_ref::(), - Some(&Hello { - my_id: SETTING.get_identity(), - to: SocketAddr::V4(SocketAddrV4::new("1.1.1.1".parse().unwrap(), 4876)) - }) - ); - - let ret: Result = Ok(LocalIdentity { - wg_port: 60000, - global: SETTING.get_identity(), - }); - Box::new(Some(ret)) - })).start(), - ); - - System::current().registry().set( - Resolver::mock(Box::new(|msg, _ctx| { - assert_eq!( - msg.downcast_ref::(), - Some(&actors::resolver::Resolve::host("test.altheamesh.com")) + // Unwrap is safe because we confirm membership + let iface_name = self.tunnels.get(key).unwrap().iface_name.clone(); + let port = self.tunnels.get(key).unwrap().listen_port.clone(); + let res = KI.del_interface(&iface_name); + if res.is_err() { + warn!( + "We failed to delete the interface {:?} with {:?} it's now orphaned", + iface_name, res ); - - let ret: Result, ResolverError> = Ok({ - let mut ips = VecDeque::new(); - ips.push_back(SocketAddr::new(IpAddr::V4(Ipv4Addr::new(1, 1, 1, 1)), 0)); - ips - }); - Box::new(Some(ret)) - })).start(), - ); - - let mut tm = TunnelManager::new(); - let res = tm.neighbor_inquiry("test.altheamesh.com".to_string(), None); - - Arbiter::spawn(res.then(|res| { - assert_eq!( - res.unwrap(), - ( - LocalIdentity { - wg_port: 60000, - global: SETTING.get_identity(), - }, - "wg1".to_string(), - "1.1.1.1".parse().unwrap() - ) - ); - - System::current().stop(); - future::result(Ok(())) - })); - - sys.run(); - } - - #[test] - fn test_neighbor_inquiry_ip() { - let link_args = &["link"]; - let link_add = &["link", "add", "wg1", "type", "wireguard"]; - - let mut counter = 0; - KI.set_mock(Box::new(move |program, args| { - counter += 1; - trace!( - "program {:?}, args {:?}, counter {}", - program, - args, - counter - ); - - match counter { - 1 => { - assert_eq!(program, "ip"); - assert_eq!(args, ["route", "list", "default"]); - Ok(Output { - stdout: b"default via 192.168.1.1 dev eth0 proto static metric 600\n" - .to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 2 => { - assert_eq!(program, "ip"); - assert_eq!( - args, - [ - "route", - "add", - "1.1.1.1", - "via", - "192.168.1.1", - "dev", - "eth0", - "proto", - "static", - "metric", - "600" - ] - ); - Ok(Output { - stdout: b"ok".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 3 => { - assert_eq!(program, "ip"); - assert_eq!(args, link_args); - Ok(Output { - stdout: b"82: wg0: mtu 1420 qdisc noop state DOWN mode DEFAULT group default qlen 1000".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 4 => { - assert_eq!(program, "ip"); - assert_eq!(args, link_add); - Ok(Output { - stdout: b"".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - _ => panic!("command called too many times"), } - })); - - let sys = System::new("test"); - - System::current().registry().set( - HTTPClient::mock(Box::new(|msg, _ctx| { - assert_eq!( - msg.downcast_ref::(), - Some(&Hello { - my_id: SETTING.get_identity(), - to: SocketAddr::V4(SocketAddrV4::new("1.1.1.1".parse().unwrap(), 4876)) - }) - ); - - let ret: Result = Ok(LocalIdentity { - wg_port: 60000, - global: SETTING.get_identity(), - }); - Box::new(Some(ret)) - })).start(), - ); - System::current().registry().set( - Resolver::mock(Box::new(|msg, _ctx| { - assert_eq!( - msg.downcast_ref::(), - Some(&actors::resolver::Resolve::host("1.1.1.1")) - ); + // In the case that we have a tunnel and they don't we drop our existing one + // and agree on the new parameters in this message + self.tunnels.remove(key); + self.free_ports.push(port); + return_bool = true; + } - let ret: Result, ResolverError> = - Err(ResolverError::Resolver("Thats an IP address!".to_string())); - Box::new(Some(ret)) - })).start(), + trace!( + "no tunnel found for {:?}%{:?} creating", + peer.contact_socket.ip(), + peer.ifidx, + ); + let tunnel = Tunnel::new( + peer.contact_socket.ip(), + our_port, + peer.ifidx, + their_localid.clone(), ); - let mut tm = TunnelManager::new(); - let res = tm.neighbor_inquiry("1.1.1.1".to_string(), None); - - Arbiter::spawn(res.then(|res| { - assert_eq!( - res.unwrap(), - ( - LocalIdentity { - wg_port: 60000, - global: SETTING.get_identity(), - }, - "wg1".to_string(), - "1.1.1.1".parse().unwrap() - ) - ); - - System::current().stop(); - future::result(Ok(())) - })); - - sys.run(); - } - - fn get_inc_id(ctr: u16) -> Identity { - let mut their_id = SETTING.get_identity(); - match their_id.mesh_ip { - IpAddr::V6(address) => { - let mut segments = address.segments(); - segments[7] = ctr; - their_id.mesh_ip = segments.into(); + match tunnel { + Ok(tunnel) => { + let new_key = (tunnel.localid.global.clone(), tunnel.listen_ifidx.clone()); + self.tunnels.insert(new_key, tunnel.clone()); + Ok((tunnel, return_bool)) + } + Err(e) => { + warn!("Open Tunnel failed with {:?}", e); + return Err(e); } - _ => panic!("Mesh IP must be ipv6"), } - their_id } +} - #[test] - fn test_get_neighbors() { - let mut ip_route_add_counter = 0; - let mut iface_counter = 0; - - let external_ips = ["fe80::1234", "2.2.2.2", "1.1.1.1"]; - let wg_ifaces = ["wg0", "wg1", "wg2"]; - - KI.set_mock(Box::new(move |program, args| { - match (program.as_str(), &vec_string_to_str(&args)[..]) { - ("ping6", _) => { - return Ok(Output { - stdout: b"".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - ("ip", ["neighbor"]) => { - return Ok(Output { - stdout: b"fe80::1234 dev eth0 lladdr dc:6d:cd:ae:bd:a6 REACHABLE".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - ("ip", ["route", "list", "default"]) => { - return Ok(Output { - stdout: b"default via 192.168.1.1 dev eth0 proto static metric 600\n" - .to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - ( - "ip", - ["route", "add", external_ip, "via", "192.168.1.1", "dev", "eth0", "proto", "static", "metric", "600"], - ) => { - assert_eq!(external_ip, &external_ips[ip_route_add_counter]); - ip_route_add_counter += 1; - return Ok(Output { - stdout: b"ok".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }); - } - ("ip", ["link", "add", iface_name, "type", "wireguard"]) => { - assert_eq!(iface_name, &wg_ifaces[iface_counter]); - iface_counter += 1; - return Ok(Output { - stdout: b"".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - ("ip", ["link"]) => { - match iface_counter { - 0 => { - return Ok(Output { - stdout: b"82: eth0: mtu 1420 qdisc noop state DOWN mode DEFAULT group default qlen 1000".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 1 => { - return Ok(Output { - stdout: b"82: eth0: mtu 1420 qdisc noop state DOWN mode DEFAULT group default qlen 1000\ -83: wg0: mtu 1420 qdisc noop state DOWN mode DEFAULT group default qlen 1000".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - 2 => { - return Ok(Output { - stdout: b"82: eth0: mtu 1420 qdisc noop state DOWN mode DEFAULT group default qlen 1000\ -83: wg0: mtu 1420 qdisc noop state DOWN mode DEFAULT group default qlen 1000\ -84: wg1: mtu 1420 qdisc noop state DOWN mode DEFAULT group default qlen 1000".to_vec(), - stderr: b"".to_vec(), - status: ExitStatus::from_raw(0), - }) - } - _ => { - panic!("ip link called too many times") - } - } - } - (program, args) => ( - panic!("unimplemented program: {} {:?}", program, args) - ), - } - })); - - let sys = System::new("test"); - - SETTING.get_network_mut().manual_peers = - vec!["test.altheamesh.com".to_string(), "2.2.2.2".to_string()]; - SETTING.get_network_mut().is_gateway = true; - SETTING - .get_network_mut() - .peer_interfaces - .insert("eth0".to_string()); - SETTING.get_network_mut().external_nic = Some("eth0".to_string()); - - let mut ctr = 1; - - System::current().registry().set( - HTTPClient::mock(Box::new(move |msg, _ctx| { - trace!("{:?}", msg.downcast_ref::()); - let ret: Result = match msg.downcast_ref::() { - Some(&Hello { - my_id: ref id, - to: _, - }) => { - assert_eq!(id, &SETTING.get_identity()); - Ok(LocalIdentity { - wg_port: 60000 + ctr, - global: get_inc_id(ctr), - }) - } - _ => { - panic!("Wrong message sent to HTTPClient"); - } - }; - ctr += 1; - Box::new(Some(ret)) - })).start(), - ); - - System::current().registry().set( - Resolver::mock(Box::new(|msg, _ctx| { - let msg = msg.downcast_ref::().unwrap(); - let ret: Result, ResolverError> = if msg - == &actors::resolver::Resolve::host("fe80::1234") - { - Err(ResolverError::Resolver("Thats an IP address!".to_string())) - } else if msg == &actors::resolver::Resolve::host("2.2.2.2") { - Err(ResolverError::Resolver("Thats an IP address!".to_string())) - } else if msg == &actors::resolver::Resolve::host("test.altheamesh.com") { - Ok({ - let mut ips = VecDeque::new(); - ips.push_back(SocketAddr::new(IpAddr::V4(Ipv4Addr::new(1, 1, 1, 1)), 0)); - ips - }) - } else { - panic!("unexpected host found") - }; - Box::new(Some(ret)) - })).start(), - ); - - let mut tm = TunnelManager::new(); - let res = tm.get_neighbors(); - - Arbiter::spawn(res.then(|res| { - assert_eq!( - res.unwrap(), - vec![ - ( - LocalIdentity { - wg_port: 60001, - global: get_inc_id(1), - }, - "wg0".to_string(), - "fe80::1234".parse().unwrap(), - ), - ( - LocalIdentity { - wg_port: 60003, - global: get_inc_id(3), - }, - "wg2".to_string(), - "1.1.1.1".parse().unwrap(), - ), - ( - LocalIdentity { - wg_port: 60002, - global: get_inc_id(2), - }, - "wg1".to_string(), - "2.2.2.2".parse().unwrap(), - ), - ] - ); - - System::current().stop(); - future::result(Ok(())) - })); - - sys.run(); - } +#[test] +pub fn test_tunnel_manager() { + let mut tunnel_manager = TunnelManager::new(); + assert_eq!(tunnel_manager.free_ports.pop().unwrap(), 65534); } diff --git a/rita/src/rita_exit/db_client/mod.rs b/rita/src/rita_exit/db_client/mod.rs index 3cb031cfc..2ae4bf745 100644 --- a/rita/src/rita_exit/db_client/mod.rs +++ b/rita/src/rita_exit/db_client/mod.rs @@ -230,7 +230,6 @@ fn client_to_new_db_client( let mut rng = rand::thread_rng(); let rand_code: u64 = rng.gen_range(0, 999999); models::Client { - luci_pass: "".into(), wg_port: client.wg_port.to_string(), mesh_ip: client.global.mesh_ip.to_string(), wg_pubkey: client.global.wg_public_key.clone(), @@ -274,8 +273,7 @@ fn send_mail(client: &models::Client) -> Result<(), Error> { .credentials(Credentials::new( SETTING.get_mailer().unwrap().smtp_username, SETTING.get_mailer().unwrap().smtp_password, - )) - .smtp_utf8(true) + )).smtp_utf8(true) .authentication_mechanism(Mechanism::Plain) .connection_reuse(ConnectionReuseParameters::ReuseUnlimited) .build(); @@ -462,3 +460,20 @@ impl Handler for DbClient { }) } } + +pub struct TruncateTables; +impl Message for TruncateTables { + type Result = Result<(), Error>; +} + +impl Handler for DbClient { + type Result = Result<(), Error>; + + fn handle(&mut self, _: TruncateTables, _: &mut Self::Context) -> Self::Result { + use self::schema::clients::dsl::*; + info!("Deleting all clients in {:?}", &SETTING.get_db_file()); + let connection = SqliteConnection::establish(&SETTING.get_db_file()).unwrap(); + try!(delete(clients).execute(&connection)); + Ok(()) + } +} diff --git a/rita/src/rita_exit/network_endpoints/mod.rs b/rita/src/rita_exit/network_endpoints/mod.rs index 74812b3a1..dfc24b479 100644 --- a/rita/src/rita_exit/network_endpoints/mod.rs +++ b/rita/src/rita_exit/network_endpoints/mod.rs @@ -84,3 +84,19 @@ pub fn rtt(_req: HttpRequest) -> Result> { exit_tx: SystemTime::now(), })) } + +#[cfg(not(feature = "development"))] +pub fn nuke_db(_req: HttpRequest) -> Result { + // This is returned on production builds. + Ok(HttpResponse::NotFound().finish()) +} + +#[cfg(feature = "development")] +pub fn nuke_db(_req: HttpRequest) -> Box> { + trace!("nuke_db: Truncating all data from the database"); + DbClient::from_registry() + .send(TruncateTables {}) + .from_err() + .and_then(move |_| Ok(HttpResponse::NoContent().finish())) + .responder() +} diff --git a/rita/src/rita_exit/rita_loop/mod.rs b/rita/src/rita_exit/rita_loop/mod.rs index 7bf09517a..0dc919e76 100644 --- a/rita/src/rita_exit/rita_loop/mod.rs +++ b/rita/src/rita_exit/rita_loop/mod.rs @@ -1,4 +1,4 @@ -use std::time::Duration; +use std::time::{Duration, Instant}; use actix::prelude::*; use actix::registry::SystemService; @@ -25,7 +25,10 @@ impl Actor for RitaLoop { fn started(&mut self, ctx: &mut Context) { info!("exit loop started"); - ctx.notify_later(Tick {}, Duration::from_secs(5)); + ctx.run_interval(Duration::from_secs(5), |_act, ctx| { + let addr: Addr = ctx.address(); + addr.do_send(Tick); + }); } } @@ -55,13 +58,14 @@ fn to_exit_client(client: Client) -> Result { impl Handler for RitaLoop { type Result = Result<(), Error>; fn handle(&mut self, _: Tick, ctx: &mut Context) -> Self::Result { + let start = Instant::now(); trace!("Exit tick!"); ctx.spawn( DbClient::from_registry() .send(ListClients {}) .into_actor(self) - .then(|res, _act, ctx| { + .then(|res, _act, _ctx| { let clients = res.unwrap().unwrap(); let ids = clients .clone() @@ -96,11 +100,15 @@ impl Handler for RitaLoop { Err(e) => warn!("Error in Exit WG setup {:?}", e), } - ctx.notify_later(Tick {}, Duration::from_secs(5)); actix::fut::ok(()) }), ); + info!( + "Rita Exit loop completed in {}s {}ms", + start.elapsed().as_secs(), + start.elapsed().subsec_nanos() / 1000000 + ); Ok(()) } } diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 000000000..0ef5137d8 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +edition = "Edition2018" diff --git a/scripts/.git-hooks/pre-commit b/scripts/.git-hooks/pre-commit new file mode 100755 index 000000000..23e8acd36 --- /dev/null +++ b/scripts/.git-hooks/pre-commit @@ -0,0 +1,23 @@ +#!/bin/bash + +inconsistent_files=() +result=0 + +while read file; do + if [ ${file: -3} == ".rs" ]; then + rustfmt +nightly --skip-children --check $file 1>/dev/null; + if [ $? != 0 ]; then + inconsistent_files+=($file); + result=1 + fi + fi +done < <(git diff --name-only --cached) + +if [ $result != 0 ]; then + printf "Detected inconsistent formatting in: \n" + for file in $inconsistent_files; do + printf " rustfmt +nightly $file\n"; + done + printf "Or run 'rustfmt +nightly --all' to fix formatting across the codebase.\n"; + exit 1 +fi \ No newline at end of file diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 000000000..ee3244889 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,32 @@ +**Build scripts** + +These build scripts are used to allow easy cross compilation. They download a tarred copy of all the OpenWRT toolchains we use from updates.altheamesh.com if one is not already found locally. The main script you should interact with is `openwrt-upload.sh` you simply need to edit the target arch and then the Rust target before running it. + +**Device to arch mappings** + +MIPS +* WD MyNet n600 +* WD MyNet n750 +* Archer C7 (all variants) +* Unifi AP AC lite (all variants) + +MIPSEL +* EdgerouterX +* D-link dir860l + +MVEBU +* Turris Omnia +* espressobin + +IPQ40xx +* Zyxel Armor V2 +* Gil Inet B1300 + +OCTEON +* Edgerouter Lite + + +**x86 Linux static builds** + +The script `linux-build-static.sh` uses the musl Rust docker container to make portalbe x86 binaries that are totally statically linked, these sometimes have issues with opt parameters, so I suggest building them with no opt and debug or on Stable rust. + diff --git a/scripts/build_common.sh b/scripts/build_common.sh new file mode 100644 index 000000000..9336fad54 --- /dev/null +++ b/scripts/build_common.sh @@ -0,0 +1,57 @@ +# This bash script contains shared logic that is used to parse +# command line arguments. It is meant to be sourced from within the +# build scripts. +# This script parses command line arguments and exposes variables such +# as $PROFILE, and $FEATURES. +# +# Variables: +# +# $PROFILE: Can contain "--release" or "". By default it is set to +# "--release". +# $FEATURES: Contains a value of a feature passed by "--feature foo", +# as "--feature foo". In case of no --feature switch is +# found in $@ then empty string is used. +# +# Example: +# +# $ source ./build_common.sh --release --feature foo +# $ echo $FEATURES +# --features foo +# $ echo $PROFILE +# --release + +# Builds release profile unless specified other +PROFILE="--release" +# Features switch that will be passed to cargo in a docker container +FEATURES="" + +# Parse arguemnmts +while [[ $# -gt 0 ]] +do + key="$1" + case $key in + --debug) + # Without this argument cargo builds dev binary by default + PROFILE="" + shift + ;; + --release) + PROFILE="--release" + shift + ;; + --features) + FEATURES="$2" + shift + shift + ;; + *) + shift + ;; + esac +done + +# Prepare `--features $FOO` only if --features is passed to this script. +if [ "$FEATURES" != '' ]; then + # Add --features with the input provided + FEATURES="--features $FEATURES" +fi \ No newline at end of file diff --git a/scripts/linux_build_static.sh b/scripts/linux_build_static.sh index 1f2605961..ec0bd07f3 100755 --- a/scripts/linux_build_static.sh +++ b/scripts/linux_build_static.sh @@ -1,8 +1,28 @@ #!/bin/bash -# You may need to disable or modify selinux +# Usage: ./linux_build_static [--debug] [--release] +# +# This script builds a static Linux binaries. +# +# Options: +# --debug (optional) Use debug profile +# --release (optional) Use release profile (default) +# --feature (optional) List of features to build +# +# Note: You may need to disable or modify selinux, or add $USER to docker group +# to be able to use `docker`. set -eux -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BUILDER="docker run --rm -it -v $(pwd):/home/rust/src ekidd/rust-musl-builder" -pushd $DIR -cargo clean -$BUILDER cargo build --all --release + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" + +# Parse command line arguments +source $DIR/build_common.sh + +RUST_TOOLCHAIN="stable" +CARGO_ROOT="$HOME/.cargo" +CARGO_GIT="$CARGO_ROOT/.git" +CARGO_REGISTRY="$CARGO_ROOT/registry" + +RUST_MUSL_BUILDER="docker run --rm -it -v "$(pwd)":/home/rust/src -v $CARGO_GIT:/home/rust/.cargo/git -v $CARGO_REGISTRY:/home/rust/.cargo/registry ekidd/rust-musl-builder:$RUST_TOOLCHAIN" +$RUST_MUSL_BUILDER sudo chown -R rust:rust /home/rust/.cargo/git /home/rust/.cargo/registry + +$RUST_MUSL_BUILDER cargo build --all ${PROFILE} ${FEATURES} diff --git a/scripts/openwrt_build_ipq40xx.sh b/scripts/openwrt_build_ipq40xx.sh new file mode 100755 index 000000000..0a49058c2 --- /dev/null +++ b/scripts/openwrt_build_ipq40xx.sh @@ -0,0 +1,26 @@ +#!/bin/bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Parse command line arguments +source $DIR/build_common.sh + +if [[ ! -d $DIR/staging_dir ]]; then + pushd $DIR + wget -N https://updates.altheamesh.com/staging.tar.xz -O staging.tar.xz > /dev/null; tar -xf staging.tar.xz +fi + + + +export TOOLCHAIN=toolchain-arm_cortex-a7+neon-vfpv4_gcc-7.3.0_musl_eabi +export TARGET_CC=$DIR/staging_dir/$TOOLCHAIN/bin/arm-openwrt-linux-gcc +export TARGET_LD=$DIR/staging_dir/$TOOLCHAIN/bin/arm-openwrt-linux-ld +export TARGET_AR=$DIR/staging_dir/$TOOLCHAIN/bin/arm-openwrt-linux-ar +export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER=$TARGET_CC +export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_AR=$TARGET_AR +export SQLITE3_LIB_DIR=$DIR/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/lib/ +export ARMV7_UNKNOWN_LINUX_MUSLEABIHF_OPENSSL_DIR=$DIR/staging_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/usr/ +export OPENSSL_STATIC=1 + +rustup target add armv7-unknown-linux-musleabihf + +cargo build --target armv7-unknown-linux-musleabihf ${PROFILE} ${FEATURES} -p rita --bin rita diff --git a/scripts/openwrt_build_mips.sh b/scripts/openwrt_build_mips.sh index a01bd4d7b..e3e014703 100755 --- a/scripts/openwrt_build_mips.sh +++ b/scripts/openwrt_build_mips.sh @@ -1,5 +1,9 @@ #!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Parse command line arguments +source $DIR/build_common.sh + if [[ ! -d $DIR/staging_dir ]]; then pushd $DIR wget -N https://updates.altheamesh.com/staging.tar.xz -O staging.tar.xz > /dev/null; tar -xf staging.tar.xz @@ -17,4 +21,4 @@ export OPENSSL_STATIC=1 rustup target add mips-unknown-linux-musl -cargo build --target mips-unknown-linux-musl --release -p rita --bin rita +cargo build --target mips-unknown-linux-musl ${PROFILE} ${FEATURES} -p rita --bin rita diff --git a/scripts/openwrt_build_mipsel.sh b/scripts/openwrt_build_mipsel.sh index 9aa643b0e..94198f9eb 100755 --- a/scripts/openwrt_build_mipsel.sh +++ b/scripts/openwrt_build_mipsel.sh @@ -1,5 +1,9 @@ #!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Parse command line arguments +source $DIR/build_common.sh + if [[ ! -d $DIR/staging_dir ]]; then pushd $DIR wget -N https://updates.altheamesh.com/staging.tar.xz -O staging.tar.xz > /dev/null; tar -xf staging.tar.xz @@ -17,4 +21,4 @@ export OPENSSL_STATIC=1 rustup target add mipsel-unknown-linux-musl -cargo build --target mipsel-unknown-linux-musl --release -p rita --bin rita +cargo build --target mipsel-unknown-linux-musl ${PROFILE} ${FEATURES} -p rita --bin rita diff --git a/scripts/openwrt_build_mvebu.sh b/scripts/openwrt_build_mvebu.sh index 507e4edb8..f713ebe84 100755 --- a/scripts/openwrt_build_mvebu.sh +++ b/scripts/openwrt_build_mvebu.sh @@ -1,5 +1,9 @@ #!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Parse command line arguments +source $DIR/build_common.sh + if [[ ! -d $DIR/staging_dir ]]; then pushd $DIR wget -N https://updates.altheamesh.com/staging.tar.xz -O staging.tar.xz > /dev/null; tar -xf staging.tar.xz @@ -9,12 +13,12 @@ export TOOLCHAIN=toolchain-arm_cortex-a9+vfpv3_gcc-7.3.0_musl_eabi export TARGET_CC=$DIR/staging_dir/$TOOLCHAIN/bin/arm-openwrt-linux-gcc export TARGET_LD=$DIR/staging_dir/$TOOLCHAIN/bin/arm-openwrt-linux-ld export TARGET_AR=$DIR/staging_dir/$TOOLCHAIN/bin/arm-openwrt-linux-ar -export CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=$TARGET_CC -export CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_AR=$TARGET_AR +export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER=$TARGET_CC +export CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_AR=$TARGET_AR export SQLITE3_LIB_DIR=$DIR/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/usr/lib/ -export ARM_UNKNOWN_LINUX_MUSLEABIHF_OPENSSL_DIR=$DIR/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/usr/ +export ARMV7_UNKNOWN_LINUX_MUSLEABIHF_OPENSSL_DIR=$DIR/staging_dir/target-arm_cortex-a9+vfpv3_musl_eabi/usr/ export OPENSSL_STATIC=1 -rustup target add arm-unknown-linux-musleabihf +rustup target add armv7-unknown-linux-musleabihf -cargo build --target arm-unknown-linux-musleabihf --release -p rita --bin rita +cargo build --target armv7-unknown-linux-musleabihf ${PROFILE} ${FEATURES} -p rita --bin rita diff --git a/scripts/openwrt_build_octeon.sh b/scripts/openwrt_build_octeon.sh index 370b19a47..52740c4bb 100755 --- a/scripts/openwrt_build_octeon.sh +++ b/scripts/openwrt_build_octeon.sh @@ -1,5 +1,9 @@ #!/bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Parse command line arguments +source $DIR/build_common.sh + if [[ ! -d $DIR/staging_dir ]]; then pushd $DIR wget -N https://updates.altheamesh.com/staging.tar.xz -O staging.tar.xz > /dev/null; tar -xf staging.tar.xz @@ -17,4 +21,4 @@ export OPENSSL_STATIC=1 rustup target add mips64-unknown-linux-gnuabi64 -cargo build --target mips64-unknown-linux-gnuabi64 --release -p rita --bin rita +cargo build --target mips64-unknown-linux-gnuabi64 ${PROFILE} ${FEATURES} -p rita --bin rita diff --git a/scripts/openwrt_upload.sh b/scripts/openwrt_upload.sh index 3f1895b9e..be44bec6f 100755 --- a/scripts/openwrt_upload.sh +++ b/scripts/openwrt_upload.sh @@ -1,8 +1,11 @@ #!/usr/bin/env bash set -eux -export TARGET=mipsel -export TRIPLE=mipsel-unknown-linux-musl +export TARGET=mips +export TRIPLE=mips-unknown-linux-musl export ROUTER_IP=192.168.10.1 -bash scripts/openwrt_build_$TARGET.sh +bash scripts/openwrt_build_$TARGET.sh $@ +set +e +ssh root@$ROUTER_IP killall -9 rita +set -e scp target/$TRIPLE/release/rita root@$ROUTER_IP:/tmp/rita ssh root@$ROUTER_IP RUST_BACKTRACE=FULL RUST_LOG=TRACE /tmp/rita --config=/etc/rita.toml --platform=linux &> out.log diff --git a/settings/Cargo.toml b/settings/Cargo.toml index b1bad4f4d..b3f87e56e 100644 --- a/settings/Cargo.toml +++ b/settings/Cargo.toml @@ -4,16 +4,16 @@ version = "0.1.0" authors = ["Ben "] [dependencies] -config = "0.8.0" +config = "0.9.0" althea_types = { path = "../althea_types", features = ["actix"]} althea_kernel_interface = { path = "../althea_kernel_interface" } eui48 = {git="https://github.com/althea-mesh/eui48.git"} num256 = { path = "../num256" } -serde = "1.0" -serde_derive = "1.0" -serde_json = "1.0" -toml = "0.4.5" -log = "^0.4" -failure = "0.1.1" +serde = "1.0.70" +serde_derive = "1.0.70" +serde_json = "1.0.24" +toml = "0.4.6" +log = "0.4.3" +failure = "0.1.2" owning_ref = {git="https://github.com/kingoflolz/owning-ref-rs/", branch="fix-bug"} -lazy_static = "1.0" \ No newline at end of file +lazy_static = "1.0.2" diff --git a/settings/default.toml b/settings/default.toml index c98c93146..14fdc6bbc 100644 --- a/settings/default.toml +++ b/settings/default.toml @@ -8,6 +8,7 @@ eth_address = "0x0101010101010101010101010101010101010101" [network] own_ip = "fd00::1" bounty_ip = "fd00::3" +discovery_ip = "ff02::1:8" babel_port = 6872 rita_hello_port = 4876 rita_contact_port = 4874 @@ -24,4 +25,4 @@ default_route = [] [exit_client] wg_listen_port = 59999 -lan_nics = ["lo"] \ No newline at end of file +lan_nics = ["lo"] diff --git a/settings/default_exit.toml b/settings/default_exit.toml index 43be9b244..4264d69eb 100644 --- a/settings/default_exit.toml +++ b/settings/default_exit.toml @@ -11,6 +11,7 @@ eth_address = "0x0101010101010101010101010101010101010101" [network] own_ip = "fd00::1" bounty_ip = "fd00::3" +discovery_ip = "ff02::1:8" babel_port = 6872 rita_hello_port = 4876 rita_contact_port = 4874 diff --git a/settings/src/lib.rs b/settings/src/lib.rs index a17fb762e..ffb9bab66 100644 --- a/settings/src/lib.rs +++ b/settings/src/lib.rs @@ -27,7 +27,7 @@ use owning_ref::{RwLockReadGuardRef, RwLockWriteGuardRefMut}; use std::collections::{HashMap, HashSet}; use std::fs::File; use std::io::Write; -use std::net::IpAddr; +use std::net::{IpAddr, Ipv6Addr}; use std::sync::{Arc, RwLock}; use std::thread; use std::time::Duration; @@ -66,12 +66,20 @@ lazy_static! { static ref KI: Box = Box::new(LinuxCommandRunner {}); } +fn default_discovery_ip() -> Ipv6Addr { + warn!("Add discovery_ip to network, removed in the next version!"); + Ipv6Addr::new(0xff02, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x8) +} + #[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] pub struct NetworkSettings { /// Our own mesh IP (in fd00::/8) pub own_ip: IpAddr, /// Mesh IP of bounty hunter (in fd00::/8) pub bounty_ip: IpAddr, + /// Broadcast ip address used for peer discovery (in ff02::/8) + #[serde(default = "default_discovery_ip")] + pub discovery_ip: Ipv6Addr, /// Port on which we connect to a local babel instance (read-write connection required) pub babel_port: u16, /// Port on which rita starts the per hop tunnel handshake on (needs to be constant across an @@ -120,6 +128,7 @@ impl Default for NetworkSettings { NetworkSettings { own_ip: "fd00::1".parse().unwrap(), bounty_ip: "fd00::3".parse().unwrap(), + discovery_ip: Ipv6Addr::new(0xff02, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x8), babel_port: 6872, rita_hello_port: 4876, rita_dashboard_port: 4877, diff --git a/stats_server/Cargo.toml b/stats_server/Cargo.toml index 47beb9dc9..6c3634105 100644 --- a/stats_server/Cargo.toml +++ b/stats_server/Cargo.toml @@ -4,14 +4,14 @@ version = "0.1.0" authors = ["kingoflolz "] [dependencies] -actix = { git = "https://github.com/actix/actix" } +actix = { git = "https://github.com/kingoflolz/actix", branch = "althea-mesh"} actix-web = { git = "https://github.com/actix/actix-web", default-features = false, branch = "fix-missing-content-length"} -serde = "1.0.24" -serde_derive = "1.0.24" -serde_json = "1.0.8" -failure = "0.1.1" -log = "^0.4" -env_logger = "^0.5.5" -futures = "0.1" +serde = "1.0.70" +serde_derive = "1.0.70" +serde_json = "1.0.24" +failure = "0.1.2" +log = "0.4.3" +env_logger = "0.5.11" +futures = "0.1.23" althea_types = { path = "../althea_types", features = ["actix"]} docopt = "0.8.3" diff --git a/stats_server/src/main.rs b/stats_server/src/main.rs index 6dc0b821f..a8e1e2636 100644 --- a/stats_server/src/main.rs +++ b/stats_server/src/main.rs @@ -52,8 +52,7 @@ fn index( resp.body() .from_err() .and_then(|body| Ok(HttpResponse::Ok().body(body))) - }) - .responder() + }).responder() } fn main() { @@ -72,10 +71,10 @@ fn main() { App::with_state(ProxyState { insert_url: insert_url.clone(), }).middleware(middleware::Logger::default()) - .resource("/stats/", |r| r.method(http::Method::POST).with(index)) + .resource("/stats/", |r| r.method(http::Method::POST).with(index)) }).bind(args.flag_bind_url) - .unwrap() - .start(); + .unwrap() + .start(); let _ = sys.run(); }