From 0fb0a17d19a4cb66415960818741b00263dd745e Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Thu, 15 Jun 2023 18:36:41 +0200 Subject: [PATCH] refactor: move code into workspace package --- Cargo.lock | 180 ++++++++++++++++++ Cargo.toml | 131 +------------ iroh-bytes/Cargo.toml | 14 ++ iroh-bytes/README.md | 20 ++ iroh-bytes/src/lib.rs | 0 iroh-net/Cargo.toml | 14 ++ iroh-net/README.md | 19 ++ iroh-net/src/lib.rs | 0 iroh/Cargo.toml | 125 ++++++++++++ iroh/README.md | 19 ++ build.rs => iroh/build.rs | 0 {docs => iroh/docs}/img/get_machine.drawio | 0 .../docs}/img/get_machine.drawio.svg | 0 .../protocol/range_spec.txt | 0 .../proptest-regressions}/provider.txt | 0 {src => iroh/src}/bin/derper.rs | 0 {src => iroh/src}/blobs.rs | 0 {src => iroh/src}/config.rs | 0 {src => iroh/src}/doctor.rs | 0 {src => iroh/src}/get.rs | 0 {src => iroh/src}/hp.rs | 0 {src => iroh/src}/hp/cfg.rs | 0 {src => iroh/src}/hp/derp.rs | 0 {src => iroh/src}/hp/derp/client.rs | 0 {src => iroh/src}/hp/derp/client_conn.rs | 0 {src => iroh/src}/hp/derp/clients.rs | 0 {src => iroh/src}/hp/derp/http.rs | 0 {src => iroh/src}/hp/derp/http/client.rs | 0 {src => iroh/src}/hp/derp/http/server.rs | 0 {src => iroh/src}/hp/derp/map.rs | 0 {src => iroh/src}/hp/derp/server.rs | 0 {src => iroh/src}/hp/derp/types.rs | 0 {src => iroh/src}/hp/disco.rs | 0 {src => iroh/src}/hp/dns.rs | 0 {src => iroh/src}/hp/hostinfo.rs | 0 {src => iroh/src}/hp/key.rs | 0 {src => iroh/src}/hp/key/node.rs | 0 {src => iroh/src}/hp/magicsock.rs | 0 {src => iroh/src}/hp/magicsock/conn.rs | 0 {src => iroh/src}/hp/magicsock/derp_actor.rs | 0 {src => iroh/src}/hp/magicsock/endpoint.rs | 0 .../src}/hp/magicsock/rebinding_conn.rs | 0 {src => iroh/src}/hp/magicsock/timer.rs | 0 {src => iroh/src}/hp/magicsock/udp_actor.rs | 0 {src => iroh/src}/hp/netcheck.rs | 0 {src => iroh/src}/hp/netcheck/probe.rs | 0 {src => iroh/src}/hp/netmap.rs | 0 {src => iroh/src}/hp/ping.rs | 0 {src => iroh/src}/hp/portmapper.rs | 0 {src => iroh/src}/hp/stun.rs | 0 {src => iroh/src}/lib.rs | 0 {src => iroh/src}/main.rs | 0 {src => iroh/src}/main_util.rs | 0 {src => iroh/src}/metrics.rs | 0 {src => iroh/src}/metrics/core.rs | 0 {src => iroh/src}/metrics/iroh.rs | 0 {src => iroh/src}/metrics/macros.rs | 0 {src => iroh/src}/metrics/magicsock.rs | 0 {src => iroh/src}/metrics/netcheck.rs | 0 {src => iroh/src}/metrics/service.rs | 0 {src => iroh/src}/net.rs | 0 {src => iroh/src}/net/interfaces.rs | 0 {src => iroh/src}/net/interfaces/bsd.rs | 0 {src => iroh/src}/net/interfaces/linux.rs | 0 {src => iroh/src}/net/interfaces/windows.rs | 0 {src => iroh/src}/net/ip.rs | 0 {src => iroh/src}/progress.rs | 0 {src => iroh/src}/protocol.rs | 0 {src => iroh/src}/protocol/range_spec.rs | 0 {src => iroh/src}/provider.rs | 0 {src => iroh/src}/provider/collection.rs | 0 {src => iroh/src}/provider/database.rs | 0 {src => iroh/src}/provider/ticket.rs | 0 {src => iroh/src}/rpc_protocol.rs | 0 {src => iroh/src}/runtime.rs | 0 {src => iroh/src}/test_utils.rs | 0 {src => iroh/src}/tls.rs | 0 {src => iroh/src}/tls/certificate.rs | 0 {src => iroh/src}/tls/verifier.rs | 0 {src => iroh/src}/tokio_util.rs | 0 {src => iroh/src}/util.rs | 0 {tests => iroh/tests}/cli.rs | 0 82 files changed, 397 insertions(+), 125 deletions(-) create mode 100644 iroh-bytes/Cargo.toml create mode 100644 iroh-bytes/README.md create mode 100644 iroh-bytes/src/lib.rs create mode 100644 iroh-net/Cargo.toml create mode 100644 iroh-net/README.md create mode 100644 iroh-net/src/lib.rs create mode 100644 iroh/Cargo.toml create mode 100644 iroh/README.md rename build.rs => iroh/build.rs (100%) rename {docs => iroh/docs}/img/get_machine.drawio (100%) rename {docs => iroh/docs}/img/get_machine.drawio.svg (100%) rename {proptest-regressions => iroh/proptest-regressions}/protocol/range_spec.txt (100%) rename {proptest-regressions => iroh/proptest-regressions}/provider.txt (100%) rename {src => iroh/src}/bin/derper.rs (100%) rename {src => iroh/src}/blobs.rs (100%) rename {src => iroh/src}/config.rs (100%) rename {src => iroh/src}/doctor.rs (100%) rename {src => iroh/src}/get.rs (100%) rename {src => iroh/src}/hp.rs (100%) rename {src => iroh/src}/hp/cfg.rs (100%) rename {src => iroh/src}/hp/derp.rs (100%) rename {src => iroh/src}/hp/derp/client.rs (100%) rename {src => iroh/src}/hp/derp/client_conn.rs (100%) rename {src => iroh/src}/hp/derp/clients.rs (100%) rename {src => iroh/src}/hp/derp/http.rs (100%) rename {src => iroh/src}/hp/derp/http/client.rs (100%) rename {src => iroh/src}/hp/derp/http/server.rs (100%) rename {src => iroh/src}/hp/derp/map.rs (100%) rename {src => iroh/src}/hp/derp/server.rs (100%) rename {src => iroh/src}/hp/derp/types.rs (100%) rename {src => iroh/src}/hp/disco.rs (100%) rename {src => iroh/src}/hp/dns.rs (100%) rename {src => iroh/src}/hp/hostinfo.rs (100%) rename {src => iroh/src}/hp/key.rs (100%) rename {src => iroh/src}/hp/key/node.rs (100%) rename {src => iroh/src}/hp/magicsock.rs (100%) rename {src => iroh/src}/hp/magicsock/conn.rs (100%) rename {src => iroh/src}/hp/magicsock/derp_actor.rs (100%) rename {src => iroh/src}/hp/magicsock/endpoint.rs (100%) rename {src => iroh/src}/hp/magicsock/rebinding_conn.rs (100%) rename {src => iroh/src}/hp/magicsock/timer.rs (100%) rename {src => iroh/src}/hp/magicsock/udp_actor.rs (100%) rename {src => iroh/src}/hp/netcheck.rs (100%) rename {src => iroh/src}/hp/netcheck/probe.rs (100%) rename {src => iroh/src}/hp/netmap.rs (100%) rename {src => iroh/src}/hp/ping.rs (100%) rename {src => iroh/src}/hp/portmapper.rs (100%) rename {src => iroh/src}/hp/stun.rs (100%) rename {src => iroh/src}/lib.rs (100%) rename {src => iroh/src}/main.rs (100%) rename {src => iroh/src}/main_util.rs (100%) rename {src => iroh/src}/metrics.rs (100%) rename {src => iroh/src}/metrics/core.rs (100%) rename {src => iroh/src}/metrics/iroh.rs (100%) rename {src => iroh/src}/metrics/macros.rs (100%) rename {src => iroh/src}/metrics/magicsock.rs (100%) rename {src => iroh/src}/metrics/netcheck.rs (100%) rename {src => iroh/src}/metrics/service.rs (100%) rename {src => iroh/src}/net.rs (100%) rename {src => iroh/src}/net/interfaces.rs (100%) rename {src => iroh/src}/net/interfaces/bsd.rs (100%) rename {src => iroh/src}/net/interfaces/linux.rs (100%) rename {src => iroh/src}/net/interfaces/windows.rs (100%) rename {src => iroh/src}/net/ip.rs (100%) rename {src => iroh/src}/progress.rs (100%) rename {src => iroh/src}/protocol.rs (100%) rename {src => iroh/src}/protocol/range_spec.rs (100%) rename {src => iroh/src}/provider.rs (100%) rename {src => iroh/src}/provider/collection.rs (100%) rename {src => iroh/src}/provider/database.rs (100%) rename {src => iroh/src}/provider/ticket.rs (100%) rename {src => iroh/src}/rpc_protocol.rs (100%) rename {src => iroh/src}/runtime.rs (100%) rename {src => iroh/src}/test_utils.rs (100%) rename {src => iroh/src}/tls.rs (100%) rename {src => iroh/src}/tls/certificate.rs (100%) rename {src => iroh/src}/tls/verifier.rs (100%) rename {src => iroh/src}/tokio_util.rs (100%) rename {src => iroh/src}/util.rs (100%) rename {tests => iroh/tests}/cli.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 5b1a4a7c65..d8cef954e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1615,6 +1615,186 @@ dependencies = [ "zeroize", ] +[[package]] +name = "iroh-bytes" +version = "0.4.1" +dependencies = [ + "anyhow", + "backoff", + "bao-tree", + "blake3", + "build-data", + "bytes", + "clap", + "config", + "console", + "crypto_box", + "curve25519-dalek", + "data-encoding", + "default-net", + "der", + "derive_more", + "dirs-next", + "duct", + "ed25519-dalek", + "flume", + "futures", + "futures-rustls", + "governor", + "hex", + "hostname", + "http", + "http-body", + "hyper", + "indicatif", + "libc", + "multibase", + "netlink-packet-route", + "nix", + "num_cpus", + "once_cell", + "os_info", + "paste", + "portable-atomic", + "postcard", + "prometheus-client", + "proptest", + "quic-rpc", + "quinn", + "quinn-proto", + "quinn-udp", + "rand", + "range-collections", + "rcgen", + "regex", + "reqwest", + "ring", + "rtnetlink", + "rustls", + "rustls-pemfile", + "self_cell", + "serde", + "serde-error", + "serdect", + "smallvec", + "socket2 0.5.3", + "ssh-key", + "stun-rs", + "subtle", + "surge-ping", + "tempfile", + "testdir", + "thiserror", + "time 0.3.22", + "tokio", + "tokio-rustls", + "tokio-rustls-acme", + "tokio-stream", + "tokio-util", + "toml 0.7.4", + "tracing", + "tracing-futures", + "tracing-subscriber", + "trust-dns-resolver", + "walkdir", + "webpki", + "webpki-roots 0.23.1", + "wg", + "wmi", + "x509-parser", + "zeroize", +] + +[[package]] +name = "iroh-net" +version = "0.4.1" +dependencies = [ + "anyhow", + "backoff", + "bao-tree", + "blake3", + "build-data", + "bytes", + "clap", + "config", + "console", + "crypto_box", + "curve25519-dalek", + "data-encoding", + "default-net", + "der", + "derive_more", + "dirs-next", + "duct", + "ed25519-dalek", + "flume", + "futures", + "futures-rustls", + "governor", + "hex", + "hostname", + "http", + "http-body", + "hyper", + "indicatif", + "libc", + "multibase", + "netlink-packet-route", + "nix", + "num_cpus", + "once_cell", + "os_info", + "paste", + "portable-atomic", + "postcard", + "prometheus-client", + "proptest", + "quic-rpc", + "quinn", + "quinn-proto", + "quinn-udp", + "rand", + "range-collections", + "rcgen", + "regex", + "reqwest", + "ring", + "rtnetlink", + "rustls", + "rustls-pemfile", + "self_cell", + "serde", + "serde-error", + "serdect", + "smallvec", + "socket2 0.5.3", + "ssh-key", + "stun-rs", + "subtle", + "surge-ping", + "tempfile", + "testdir", + "thiserror", + "time 0.3.22", + "tokio", + "tokio-rustls", + "tokio-rustls-acme", + "tokio-stream", + "tokio-util", + "toml 0.7.4", + "tracing", + "tracing-futures", + "tracing-subscriber", + "trust-dns-resolver", + "walkdir", + "webpki", + "webpki-roots 0.23.1", + "wg", + "wmi", + "x509-parser", + "zeroize", +] + [[package]] name = "is-terminal" version = "0.4.7" diff --git a/Cargo.toml b/Cargo.toml index 3fef0b2910..32eb06e110 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,128 +1,9 @@ -[package] -name = "iroh" -version = "0.4.1" -edition = "2021" -readme = "README.md" -description = "IPFS reimagined" -license = "MIT/Apache-2.0" -authors = ["dignifiedquire ", "n0 team"] -repository = "/~https://github.com/n0-computer/iroh" -default-run = "iroh" - -# Sadly this also needs to be updated in .github/workflows/ci.yml -rust-version = "1.65" - -[dependencies] -anyhow = { version = "1", features = ["backtrace"] } -backoff = "0.4.0" -bao-tree = { version = "0.3.2", features = ["tokio_fsm"], default-features = false } -blake3 = "1.3.3" -bytes = { version = "1.4", features = ["serde"] } -clap = { version = "4", features = ["derive"], optional = true } -config = { version = "0.13.1", default-features = false, features = ["toml", "preserve_order"] } -console = { version = "0.15.5", optional = true } -crypto_box = { version = "0.9.0-rc.0", features = ["serde", "chacha20"] } -curve25519-dalek = "=4.0.0-rc.2" -data-encoding = { version = "2.3.3" } -default-net = "0.15" -der = { version = "0.7", features = ["alloc", "derive"] } -derive_more = { version = "0.99.17", git = "/~https://github.com/JelteF/derive_more", features = ["debug", "display", "from", "try_into"] } -dirs-next = "2.0.0" -ed25519-dalek = { version = "=2.0.0-rc.2", features = ["serde", "rand_core"] } -flume = "0.10.14" -futures = "0.3.25" -futures-rustls = "0.24.0" -governor = "0.5.1" -hex = "0.4.3" -hostname = "0.3.1" -http = "0.2.9" -hyper = { version = "0.14.25", features = ["server", "client", "http1", "tcp"] } -indicatif = { version = "0.17", features = ["tokio"], optional = true } -libc = "0.2.139" -multibase = { version = "0.9.1", optional = true } -num_cpus = "1.15.0" -once_cell = "1.17.0" -os_info = "3.6.0" -paste = "1.0.12" -portable-atomic = "1" -postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] } -prometheus-client = { version = "0.21.0", optional = true } -quic-rpc = { version = "0.6", default-features = false, features = ["quinn-transport", "flume-transport"] } -quinn = "0.10" -quinn-proto = "0.10" -quinn-udp = "0.4" -rand = "0.8" -range-collections = "0.4.0" -rcgen = "0.10" -regex = { version = "1.7.1", optional = true } -reqwest = { version = "0.11.14", default-features = false, features = ["rustls-tls"] } -ring = "0.16.20" -rustls = { version = "0.21", default-features = false, features = ["dangerous_configuration"] } -rustls-pemfile = { version = "1.0.2", optional = true } -self_cell = "1.0.1" -serde = { version = "1", features = ["derive"] } -serde-error = "0.1.2" -serdect = "0.2.0" -smallvec = { version = "1.10.0", features = ["serde", "const_new"] } -socket2 = "0.5.3" -ssh-key = { version = "0.6.0-rc.0", features = ["ed25519", "std", "rand_core"] } -stun-rs = "0.1.4" -subtle = "2.4" -surge-ping = "0.8.0" -tempfile = "3.4" -thiserror = "1" -time = "0.3.20" -tokio = { version = "1", features = ["full"] } -tokio-rustls = { version = "0.24", optional = true } -tokio-rustls-acme = { version = "0.1", optional = true } -tokio-stream = "0.1" -tokio-util = { version = "0.7", features = ["io-util", "io", "rt"] } -toml = { version = "0.7.3", optional = true } -tracing = "0.1" -tracing-futures = "0.2.5" -tracing-subscriber = { version = "0.3", features = ["env-filter"] } -trust-dns-resolver = "0.22.0" -walkdir = "2" -webpki = { version = "0.22", features = ["std"] } -webpki-roots = "0.23.0" -wg = "0.3.1" -x509-parser = "0.15" -zeroize = "1.5" - -[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] -netlink-packet-route = "0.15.0" -rtnetlink = "0.12.0" - -[target.'cfg(target_os = "windows")'.dependencies] -wmi = "0.13" - -[dev-dependencies] -duct = "0.13.6" -http-body = "0.4.5" -nix = "0.26.2" -proptest = "1.0.0" -rand = "0.8" -regex = { version = "1.7.1", features = ["std"] } -testdir = "0.7.2" -tokio = { version = "1", features = ["full", "test-util"] } - -[features] -cli = ["clap", "console", "indicatif", "multibase"] -default = ["cli", "derper", "metrics"] -derper = ["tokio-rustls", "tokio-rustls-acme", "toml", "rustls-pemfile", "regex"] -metrics = ["prometheus-client"] -test = [] - -[[bin]] -name = "iroh" -required-features = ["cli"] - -[[bin]] -name = "derper" -required-features = ["cli", "derper"] - -[build-dependencies] -build-data = "0.1.3" +[workspace] +members = [ + "iroh", + "iroh-net", + "iroh-bytes", +] [profile.optimized-release] inherits = 'release' diff --git a/iroh-bytes/Cargo.toml b/iroh-bytes/Cargo.toml new file mode 100644 index 0000000000..9cb2996013 --- /dev/null +++ b/iroh-bytes/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "iroh-bytes" +version = "0.4.1" +edition = "2021" +readme = "README.md" +description = "IPFS reimagined" +license = "MIT/Apache-2.0" +authors = ["dignifiedquire ", "n0 team"] +repository = "/~https://github.com/n0-computer/iroh" + +# Sadly this also needs to be updated in .github/workflows/ci.yml +rust-version = "1.65" + +[dependencies] diff --git a/iroh-bytes/README.md b/iroh-bytes/README.md new file mode 100644 index 0000000000..a34433d8eb --- /dev/null +++ b/iroh-bytes/README.md @@ -0,0 +1,20 @@ +# iroh-bytes + + +# License + +This project is licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in this project by you, as defined in the Apache-2.0 license, +shall be dual licensed as above, without any additional terms or conditions. + diff --git a/iroh-bytes/src/lib.rs b/iroh-bytes/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/iroh-net/Cargo.toml b/iroh-net/Cargo.toml new file mode 100644 index 0000000000..4474fd4481 --- /dev/null +++ b/iroh-net/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "iroh-net" +version = "0.4.1" +edition = "2021" +readme = "README.md" +description = "IPFS reimagined" +license = "MIT/Apache-2.0" +authors = ["dignifiedquire ", "n0 team"] +repository = "/~https://github.com/n0-computer/iroh" + +# Sadly this also needs to be updated in .github/workflows/ci.yml +rust-version = "1.65" + +[dependencies] diff --git a/iroh-net/README.md b/iroh-net/README.md new file mode 100644 index 0000000000..906a951bb3 --- /dev/null +++ b/iroh-net/README.md @@ -0,0 +1,19 @@ +# iroh-net + + +# License + +This project is licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in this project by you, as defined in the Apache-2.0 license, +shall be dual licensed as above, without any additional terms or conditions. diff --git a/iroh-net/src/lib.rs b/iroh-net/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/iroh/Cargo.toml b/iroh/Cargo.toml new file mode 100644 index 0000000000..88723ff543 --- /dev/null +++ b/iroh/Cargo.toml @@ -0,0 +1,125 @@ +[package] +name = "iroh" +version = "0.4.1" +edition = "2021" +readme = "README.md" +description = "IPFS reimagined" +license = "MIT/Apache-2.0" +authors = ["dignifiedquire ", "n0 team"] +repository = "/~https://github.com/n0-computer/iroh" +default-run = "iroh" + +# Sadly this also needs to be updated in .github/workflows/ci.yml +rust-version = "1.65" + +[dependencies] +anyhow = { version = "1", features = ["backtrace"] } +backoff = "0.4.0" +bao-tree = { version = "0.3.2", features = ["tokio_fsm"], default-features = false } +blake3 = "1.3.3" +bytes = { version = "1.4", features = ["serde"] } +clap = { version = "4", features = ["derive"], optional = true } +config = { version = "0.13.1", default-features = false, features = ["toml", "preserve_order"] } +console = { version = "0.15.5", optional = true } +crypto_box = { version = "0.9.0-rc.0", features = ["serde", "chacha20"] } +curve25519-dalek = "=4.0.0-rc.2" +data-encoding = { version = "2.3.3" } +default-net = "0.15" +der = { version = "0.7", features = ["alloc", "derive"] } +derive_more = { version = "0.99.17", git = "/~https://github.com/JelteF/derive_more", features = ["debug", "display", "from", "try_into"] } +dirs-next = "2.0.0" +ed25519-dalek = { version = "=2.0.0-rc.2", features = ["serde", "rand_core"] } +flume = "0.10.14" +futures = "0.3.25" +futures-rustls = "0.24.0" +governor = "0.5.1" +hex = "0.4.3" +hostname = "0.3.1" +http = "0.2.9" +hyper = { version = "0.14.25", features = ["server", "client", "http1", "tcp"] } +indicatif = { version = "0.17", features = ["tokio"], optional = true } +libc = "0.2.139" +multibase = { version = "0.9.1", optional = true } +num_cpus = "1.15.0" +once_cell = "1.17.0" +os_info = "3.6.0" +paste = "1.0.12" +portable-atomic = "1" +postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] } +prometheus-client = { version = "0.21.0", optional = true } +quic-rpc = { version = "0.6", default-features = false, features = ["quinn-transport", "flume-transport"] } +quinn = "0.10" +quinn-proto = "0.10" +quinn-udp = "0.4" +rand = "0.8" +range-collections = "0.4.0" +rcgen = "0.10" +regex = { version = "1.7.1", optional = true } +reqwest = { version = "0.11.14", default-features = false, features = ["rustls-tls"] } +ring = "0.16.20" +rustls = { version = "0.21", default-features = false, features = ["dangerous_configuration"] } +rustls-pemfile = { version = "1.0.2", optional = true } +self_cell = "1.0.1" +serde = { version = "1", features = ["derive"] } +serde-error = "0.1.2" +serdect = "0.2.0" +smallvec = { version = "1.10.0", features = ["serde", "const_new"] } +socket2 = "0.5.3" +ssh-key = { version = "0.6.0-rc.0", features = ["ed25519", "std", "rand_core"] } +stun-rs = "0.1.4" +subtle = "2.4" +surge-ping = "0.8.0" +tempfile = "3.4" +thiserror = "1" +time = "0.3.20" +tokio = { version = "1", features = ["full"] } +tokio-rustls = { version = "0.24", optional = true } +tokio-rustls-acme = { version = "0.1", optional = true } +tokio-stream = "0.1" +tokio-util = { version = "0.7", features = ["io-util", "io", "rt"] } +toml = { version = "0.7.3", optional = true } +tracing = "0.1" +tracing-futures = "0.2.5" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +trust-dns-resolver = "0.22.0" +walkdir = "2" +webpki = { version = "0.22", features = ["std"] } +webpki-roots = "0.23.0" +wg = "0.3.1" +x509-parser = "0.15" +zeroize = "1.5" + +[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] +netlink-packet-route = "0.15.0" +rtnetlink = "0.12.0" + +[target.'cfg(target_os = "windows")'.dependencies] +wmi = "0.13" + +[dev-dependencies] +duct = "0.13.6" +http-body = "0.4.5" +nix = "0.26.2" +proptest = "1.0.0" +rand = "0.8" +regex = { version = "1.7.1", features = ["std"] } +testdir = "0.7.2" +tokio = { version = "1", features = ["full", "test-util"] } + +[features] +cli = ["clap", "console", "indicatif", "multibase"] +default = ["cli", "derper", "metrics"] +derper = ["tokio-rustls", "tokio-rustls-acme", "toml", "rustls-pemfile", "regex"] +metrics = ["prometheus-client"] +test = [] + +[[bin]] +name = "iroh" +required-features = ["cli"] + +[[bin]] +name = "derper" +required-features = ["cli", "derper"] + +[build-dependencies] +build-data = "0.1.3" diff --git a/iroh/README.md b/iroh/README.md new file mode 100644 index 0000000000..a09d9fa268 --- /dev/null +++ b/iroh/README.md @@ -0,0 +1,19 @@ +# iroh + + +# License + +This project is licensed under either of + + * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + * MIT license ([LICENSE-MIT](LICENSE-MIT) or + http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in this project by you, as defined in the Apache-2.0 license, +shall be dual licensed as above, without any additional terms or conditions. diff --git a/build.rs b/iroh/build.rs similarity index 100% rename from build.rs rename to iroh/build.rs diff --git a/docs/img/get_machine.drawio b/iroh/docs/img/get_machine.drawio similarity index 100% rename from docs/img/get_machine.drawio rename to iroh/docs/img/get_machine.drawio diff --git a/docs/img/get_machine.drawio.svg b/iroh/docs/img/get_machine.drawio.svg similarity index 100% rename from docs/img/get_machine.drawio.svg rename to iroh/docs/img/get_machine.drawio.svg diff --git a/proptest-regressions/protocol/range_spec.txt b/iroh/proptest-regressions/protocol/range_spec.txt similarity index 100% rename from proptest-regressions/protocol/range_spec.txt rename to iroh/proptest-regressions/protocol/range_spec.txt diff --git a/proptest-regressions/provider.txt b/iroh/proptest-regressions/provider.txt similarity index 100% rename from proptest-regressions/provider.txt rename to iroh/proptest-regressions/provider.txt diff --git a/src/bin/derper.rs b/iroh/src/bin/derper.rs similarity index 100% rename from src/bin/derper.rs rename to iroh/src/bin/derper.rs diff --git a/src/blobs.rs b/iroh/src/blobs.rs similarity index 100% rename from src/blobs.rs rename to iroh/src/blobs.rs diff --git a/src/config.rs b/iroh/src/config.rs similarity index 100% rename from src/config.rs rename to iroh/src/config.rs diff --git a/src/doctor.rs b/iroh/src/doctor.rs similarity index 100% rename from src/doctor.rs rename to iroh/src/doctor.rs diff --git a/src/get.rs b/iroh/src/get.rs similarity index 100% rename from src/get.rs rename to iroh/src/get.rs diff --git a/src/hp.rs b/iroh/src/hp.rs similarity index 100% rename from src/hp.rs rename to iroh/src/hp.rs diff --git a/src/hp/cfg.rs b/iroh/src/hp/cfg.rs similarity index 100% rename from src/hp/cfg.rs rename to iroh/src/hp/cfg.rs diff --git a/src/hp/derp.rs b/iroh/src/hp/derp.rs similarity index 100% rename from src/hp/derp.rs rename to iroh/src/hp/derp.rs diff --git a/src/hp/derp/client.rs b/iroh/src/hp/derp/client.rs similarity index 100% rename from src/hp/derp/client.rs rename to iroh/src/hp/derp/client.rs diff --git a/src/hp/derp/client_conn.rs b/iroh/src/hp/derp/client_conn.rs similarity index 100% rename from src/hp/derp/client_conn.rs rename to iroh/src/hp/derp/client_conn.rs diff --git a/src/hp/derp/clients.rs b/iroh/src/hp/derp/clients.rs similarity index 100% rename from src/hp/derp/clients.rs rename to iroh/src/hp/derp/clients.rs diff --git a/src/hp/derp/http.rs b/iroh/src/hp/derp/http.rs similarity index 100% rename from src/hp/derp/http.rs rename to iroh/src/hp/derp/http.rs diff --git a/src/hp/derp/http/client.rs b/iroh/src/hp/derp/http/client.rs similarity index 100% rename from src/hp/derp/http/client.rs rename to iroh/src/hp/derp/http/client.rs diff --git a/src/hp/derp/http/server.rs b/iroh/src/hp/derp/http/server.rs similarity index 100% rename from src/hp/derp/http/server.rs rename to iroh/src/hp/derp/http/server.rs diff --git a/src/hp/derp/map.rs b/iroh/src/hp/derp/map.rs similarity index 100% rename from src/hp/derp/map.rs rename to iroh/src/hp/derp/map.rs diff --git a/src/hp/derp/server.rs b/iroh/src/hp/derp/server.rs similarity index 100% rename from src/hp/derp/server.rs rename to iroh/src/hp/derp/server.rs diff --git a/src/hp/derp/types.rs b/iroh/src/hp/derp/types.rs similarity index 100% rename from src/hp/derp/types.rs rename to iroh/src/hp/derp/types.rs diff --git a/src/hp/disco.rs b/iroh/src/hp/disco.rs similarity index 100% rename from src/hp/disco.rs rename to iroh/src/hp/disco.rs diff --git a/src/hp/dns.rs b/iroh/src/hp/dns.rs similarity index 100% rename from src/hp/dns.rs rename to iroh/src/hp/dns.rs diff --git a/src/hp/hostinfo.rs b/iroh/src/hp/hostinfo.rs similarity index 100% rename from src/hp/hostinfo.rs rename to iroh/src/hp/hostinfo.rs diff --git a/src/hp/key.rs b/iroh/src/hp/key.rs similarity index 100% rename from src/hp/key.rs rename to iroh/src/hp/key.rs diff --git a/src/hp/key/node.rs b/iroh/src/hp/key/node.rs similarity index 100% rename from src/hp/key/node.rs rename to iroh/src/hp/key/node.rs diff --git a/src/hp/magicsock.rs b/iroh/src/hp/magicsock.rs similarity index 100% rename from src/hp/magicsock.rs rename to iroh/src/hp/magicsock.rs diff --git a/src/hp/magicsock/conn.rs b/iroh/src/hp/magicsock/conn.rs similarity index 100% rename from src/hp/magicsock/conn.rs rename to iroh/src/hp/magicsock/conn.rs diff --git a/src/hp/magicsock/derp_actor.rs b/iroh/src/hp/magicsock/derp_actor.rs similarity index 100% rename from src/hp/magicsock/derp_actor.rs rename to iroh/src/hp/magicsock/derp_actor.rs diff --git a/src/hp/magicsock/endpoint.rs b/iroh/src/hp/magicsock/endpoint.rs similarity index 100% rename from src/hp/magicsock/endpoint.rs rename to iroh/src/hp/magicsock/endpoint.rs diff --git a/src/hp/magicsock/rebinding_conn.rs b/iroh/src/hp/magicsock/rebinding_conn.rs similarity index 100% rename from src/hp/magicsock/rebinding_conn.rs rename to iroh/src/hp/magicsock/rebinding_conn.rs diff --git a/src/hp/magicsock/timer.rs b/iroh/src/hp/magicsock/timer.rs similarity index 100% rename from src/hp/magicsock/timer.rs rename to iroh/src/hp/magicsock/timer.rs diff --git a/src/hp/magicsock/udp_actor.rs b/iroh/src/hp/magicsock/udp_actor.rs similarity index 100% rename from src/hp/magicsock/udp_actor.rs rename to iroh/src/hp/magicsock/udp_actor.rs diff --git a/src/hp/netcheck.rs b/iroh/src/hp/netcheck.rs similarity index 100% rename from src/hp/netcheck.rs rename to iroh/src/hp/netcheck.rs diff --git a/src/hp/netcheck/probe.rs b/iroh/src/hp/netcheck/probe.rs similarity index 100% rename from src/hp/netcheck/probe.rs rename to iroh/src/hp/netcheck/probe.rs diff --git a/src/hp/netmap.rs b/iroh/src/hp/netmap.rs similarity index 100% rename from src/hp/netmap.rs rename to iroh/src/hp/netmap.rs diff --git a/src/hp/ping.rs b/iroh/src/hp/ping.rs similarity index 100% rename from src/hp/ping.rs rename to iroh/src/hp/ping.rs diff --git a/src/hp/portmapper.rs b/iroh/src/hp/portmapper.rs similarity index 100% rename from src/hp/portmapper.rs rename to iroh/src/hp/portmapper.rs diff --git a/src/hp/stun.rs b/iroh/src/hp/stun.rs similarity index 100% rename from src/hp/stun.rs rename to iroh/src/hp/stun.rs diff --git a/src/lib.rs b/iroh/src/lib.rs similarity index 100% rename from src/lib.rs rename to iroh/src/lib.rs diff --git a/src/main.rs b/iroh/src/main.rs similarity index 100% rename from src/main.rs rename to iroh/src/main.rs diff --git a/src/main_util.rs b/iroh/src/main_util.rs similarity index 100% rename from src/main_util.rs rename to iroh/src/main_util.rs diff --git a/src/metrics.rs b/iroh/src/metrics.rs similarity index 100% rename from src/metrics.rs rename to iroh/src/metrics.rs diff --git a/src/metrics/core.rs b/iroh/src/metrics/core.rs similarity index 100% rename from src/metrics/core.rs rename to iroh/src/metrics/core.rs diff --git a/src/metrics/iroh.rs b/iroh/src/metrics/iroh.rs similarity index 100% rename from src/metrics/iroh.rs rename to iroh/src/metrics/iroh.rs diff --git a/src/metrics/macros.rs b/iroh/src/metrics/macros.rs similarity index 100% rename from src/metrics/macros.rs rename to iroh/src/metrics/macros.rs diff --git a/src/metrics/magicsock.rs b/iroh/src/metrics/magicsock.rs similarity index 100% rename from src/metrics/magicsock.rs rename to iroh/src/metrics/magicsock.rs diff --git a/src/metrics/netcheck.rs b/iroh/src/metrics/netcheck.rs similarity index 100% rename from src/metrics/netcheck.rs rename to iroh/src/metrics/netcheck.rs diff --git a/src/metrics/service.rs b/iroh/src/metrics/service.rs similarity index 100% rename from src/metrics/service.rs rename to iroh/src/metrics/service.rs diff --git a/src/net.rs b/iroh/src/net.rs similarity index 100% rename from src/net.rs rename to iroh/src/net.rs diff --git a/src/net/interfaces.rs b/iroh/src/net/interfaces.rs similarity index 100% rename from src/net/interfaces.rs rename to iroh/src/net/interfaces.rs diff --git a/src/net/interfaces/bsd.rs b/iroh/src/net/interfaces/bsd.rs similarity index 100% rename from src/net/interfaces/bsd.rs rename to iroh/src/net/interfaces/bsd.rs diff --git a/src/net/interfaces/linux.rs b/iroh/src/net/interfaces/linux.rs similarity index 100% rename from src/net/interfaces/linux.rs rename to iroh/src/net/interfaces/linux.rs diff --git a/src/net/interfaces/windows.rs b/iroh/src/net/interfaces/windows.rs similarity index 100% rename from src/net/interfaces/windows.rs rename to iroh/src/net/interfaces/windows.rs diff --git a/src/net/ip.rs b/iroh/src/net/ip.rs similarity index 100% rename from src/net/ip.rs rename to iroh/src/net/ip.rs diff --git a/src/progress.rs b/iroh/src/progress.rs similarity index 100% rename from src/progress.rs rename to iroh/src/progress.rs diff --git a/src/protocol.rs b/iroh/src/protocol.rs similarity index 100% rename from src/protocol.rs rename to iroh/src/protocol.rs diff --git a/src/protocol/range_spec.rs b/iroh/src/protocol/range_spec.rs similarity index 100% rename from src/protocol/range_spec.rs rename to iroh/src/protocol/range_spec.rs diff --git a/src/provider.rs b/iroh/src/provider.rs similarity index 100% rename from src/provider.rs rename to iroh/src/provider.rs diff --git a/src/provider/collection.rs b/iroh/src/provider/collection.rs similarity index 100% rename from src/provider/collection.rs rename to iroh/src/provider/collection.rs diff --git a/src/provider/database.rs b/iroh/src/provider/database.rs similarity index 100% rename from src/provider/database.rs rename to iroh/src/provider/database.rs diff --git a/src/provider/ticket.rs b/iroh/src/provider/ticket.rs similarity index 100% rename from src/provider/ticket.rs rename to iroh/src/provider/ticket.rs diff --git a/src/rpc_protocol.rs b/iroh/src/rpc_protocol.rs similarity index 100% rename from src/rpc_protocol.rs rename to iroh/src/rpc_protocol.rs diff --git a/src/runtime.rs b/iroh/src/runtime.rs similarity index 100% rename from src/runtime.rs rename to iroh/src/runtime.rs diff --git a/src/test_utils.rs b/iroh/src/test_utils.rs similarity index 100% rename from src/test_utils.rs rename to iroh/src/test_utils.rs diff --git a/src/tls.rs b/iroh/src/tls.rs similarity index 100% rename from src/tls.rs rename to iroh/src/tls.rs diff --git a/src/tls/certificate.rs b/iroh/src/tls/certificate.rs similarity index 100% rename from src/tls/certificate.rs rename to iroh/src/tls/certificate.rs diff --git a/src/tls/verifier.rs b/iroh/src/tls/verifier.rs similarity index 100% rename from src/tls/verifier.rs rename to iroh/src/tls/verifier.rs diff --git a/src/tokio_util.rs b/iroh/src/tokio_util.rs similarity index 100% rename from src/tokio_util.rs rename to iroh/src/tokio_util.rs diff --git a/src/util.rs b/iroh/src/util.rs similarity index 100% rename from src/util.rs rename to iroh/src/util.rs diff --git a/tests/cli.rs b/iroh/tests/cli.rs similarity index 100% rename from tests/cli.rs rename to iroh/tests/cli.rs