mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
appmgr: basic tor sync
This commit is contained in:
389
appmgr/Cargo.lock
generated
389
appmgr/Cargo.lock
generated
@@ -59,9 +59,9 @@ version = "0.1.51"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"
|
checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -105,6 +105,15 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa"
|
checksum = "23ce669cd6c8588f79e15cf450314f9638f967fc5770ff1c7c1deb0925ea7cfa"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "base64"
|
||||||
|
version = "0.10.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
|
||||||
|
dependencies = [
|
||||||
|
"byteorder",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64"
|
name = "base64"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
@@ -127,8 +136,8 @@ dependencies = [
|
|||||||
"lazycell",
|
"lazycell",
|
||||||
"log",
|
"log",
|
||||||
"peeking_take_while",
|
"peeking_take_while",
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"regex",
|
"regex",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"shlex",
|
"shlex",
|
||||||
@@ -164,13 +173,34 @@ dependencies = [
|
|||||||
"constant_time_eq",
|
"constant_time_eq",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "block-buffer"
|
||||||
|
version = "0.7.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
|
||||||
|
dependencies = [
|
||||||
|
"block-padding",
|
||||||
|
"byte-tools",
|
||||||
|
"byteorder",
|
||||||
|
"generic-array 0.12.4",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block-buffer"
|
name = "block-buffer"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"generic-array",
|
"generic-array 0.14.4",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "block-padding"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
|
||||||
|
dependencies = [
|
||||||
|
"byte-tools",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -179,7 +209,7 @@ version = "0.10.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "699194c00f3a2effd3358d47f880646818e3d483190b17ebcdf598c654fb77e9"
|
checksum = "699194c00f3a2effd3358d47f880646818e3d483190b17ebcdf598c654fb77e9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64 0.13.0",
|
||||||
"bollard-stubs",
|
"bollard-stubs",
|
||||||
"bytes 1.0.1",
|
"bytes 1.0.1",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -239,6 +269,12 @@ version = "3.7.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631"
|
checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "byte-tools"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "byteorder"
|
name = "byteorder"
|
||||||
version = "1.4.3"
|
version = "1.4.3"
|
||||||
@@ -432,6 +468,16 @@ dependencies = [
|
|||||||
"lazy_static",
|
"lazy_static",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crypto-mac"
|
||||||
|
version = "0.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array 0.12.4",
|
||||||
|
"subtle 1.0.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "csv"
|
name = "csv"
|
||||||
version = "1.1.6"
|
version = "1.1.6"
|
||||||
@@ -470,9 +516,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61"
|
checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"digest",
|
"digest 0.9.0",
|
||||||
"rand_core 0.5.1",
|
"rand_core 0.5.1",
|
||||||
"subtle",
|
"subtle 2.4.1",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -494,10 +540,10 @@ checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"fnv",
|
"fnv",
|
||||||
"ident_case",
|
"ident_case",
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"strsim 0.10.0",
|
"strsim 0.10.0",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -507,8 +553,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc"
|
checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling_core",
|
"darling_core",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "derive_more"
|
||||||
|
version = "0.15.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7a141330240c921ec6d074a3e188a7c7ef95668bb95e7d44fa0e5778ec2a7afe"
|
||||||
|
dependencies = [
|
||||||
|
"lazy_static",
|
||||||
|
"proc-macro2 0.4.30",
|
||||||
|
"quote 0.6.13",
|
||||||
|
"regex",
|
||||||
|
"rustc_version",
|
||||||
|
"syn 0.15.44",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "digest"
|
||||||
|
version = "0.8.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array 0.12.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -517,7 +586,7 @@ version = "0.9.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
|
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"generic-array",
|
"generic-array 0.14.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -585,7 +654,7 @@ dependencies = [
|
|||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_bytes",
|
"serde_bytes",
|
||||||
"sha2",
|
"sha2 0.9.5",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -606,7 +675,7 @@ dependencies = [
|
|||||||
"bollard",
|
"bollard",
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
"digest",
|
"digest 0.9.0",
|
||||||
"ed25519-dalek",
|
"ed25519-dalek",
|
||||||
"emver",
|
"emver",
|
||||||
"futures",
|
"futures",
|
||||||
@@ -635,7 +704,7 @@ dependencies = [
|
|||||||
"serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_yaml",
|
"serde_yaml",
|
||||||
"sha2",
|
"sha2 0.9.5",
|
||||||
"simple-logging",
|
"simple-logging",
|
||||||
"sqlx",
|
"sqlx",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
@@ -645,6 +714,7 @@ dependencies = [
|
|||||||
"tokio-tar",
|
"tokio-tar",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"toml",
|
"toml",
|
||||||
|
"torut",
|
||||||
"typed-builder",
|
"typed-builder",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
@@ -689,6 +759,12 @@ dependencies = [
|
|||||||
"termcolor",
|
"termcolor",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fake-simd"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fd-lock-rs"
|
name = "fd-lock-rs"
|
||||||
version = "0.1.3"
|
version = "0.1.3"
|
||||||
@@ -812,9 +888,9 @@ checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"proc-macro-hack",
|
"proc-macro-hack",
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -850,6 +926,15 @@ dependencies = [
|
|||||||
"slab",
|
"slab",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "generic-array"
|
||||||
|
version = "0.12.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
|
||||||
|
dependencies = [
|
||||||
|
"typenum",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "generic-array"
|
name = "generic-array"
|
||||||
version = "0.14.4"
|
version = "0.14.4"
|
||||||
@@ -899,9 +984,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f"
|
checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-hack",
|
"proc-macro-hack",
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -977,6 +1062,16 @@ version = "0.4.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hmac"
|
||||||
|
version = "0.7.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-mac",
|
||||||
|
"digest 0.8.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "http"
|
name = "http"
|
||||||
version = "0.2.4"
|
version = "0.2.4"
|
||||||
@@ -1187,6 +1282,12 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "keccak"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lazy_static"
|
name = "lazy_static"
|
||||||
version = "1.4.0"
|
version = "1.4.0"
|
||||||
@@ -1427,6 +1528,12 @@ version = "1.8.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
|
checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "opaque-debug"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "opaque-debug"
|
name = "opaque-debug"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
@@ -1517,8 +1624,8 @@ name = "patch-db-macro"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"patch-db-macro-internals",
|
"patch-db-macro-internals",
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1526,9 +1633,9 @@ name = "patch-db-macro-internals"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck",
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1558,9 +1665,9 @@ version = "1.0.8"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389"
|
checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1619,13 +1726,22 @@ version = "0.1.7"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
|
checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "0.4.30"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-xid 0.1.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.28"
|
version = "1.0.28"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
|
checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-xid",
|
"unicode-xid 0.2.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1634,13 +1750,22 @@ version = "1.2.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
|
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "0.6.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2 0.4.30",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.9"
|
version = "1.0.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
|
checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1812,7 +1937,7 @@ version = "0.11.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22"
|
checksum = "246e9f61b9bb77df069a947682be06e31ac43ea37862e244a69f177694ea6d22"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64 0.13.0",
|
||||||
"bytes 1.0.1",
|
"bytes 1.0.1",
|
||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
@@ -1889,18 +2014,18 @@ dependencies = [
|
|||||||
name = "rpc-toolkit-macro"
|
name = "rpc-toolkit-macro"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"rpc-toolkit-macro-internals",
|
"rpc-toolkit-macro-internals",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rpc-toolkit-macro-internals"
|
name = "rpc-toolkit-macro-internals"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1909,7 +2034,7 @@ version = "0.8.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb"
|
checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64 0.13.0",
|
||||||
"blake2b_simd",
|
"blake2b_simd",
|
||||||
"constant_time_eq",
|
"constant_time_eq",
|
||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
@@ -1921,13 +2046,22 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustc_version"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
||||||
|
dependencies = [
|
||||||
|
"semver",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls"
|
name = "rustls"
|
||||||
version = "0.19.1"
|
version = "0.19.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7"
|
checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64 0.13.0",
|
||||||
"log",
|
"log",
|
||||||
"ring",
|
"ring",
|
||||||
"sct",
|
"sct",
|
||||||
@@ -1995,6 +2129,21 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "semver"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
||||||
|
dependencies = [
|
||||||
|
"semver-parser",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "semver-parser"
|
||||||
|
version = "0.7.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.127"
|
version = "1.0.127"
|
||||||
@@ -2037,9 +2186,9 @@ version = "1.0.127"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc"
|
checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2084,9 +2233,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e1569374bd54623ec8bd592cf22ba6e03c0f177ff55fbc8c29a49e296e7adecf"
|
checksum = "e1569374bd54623ec8bd592cf22ba6e03c0f177ff55fbc8c29a49e296e7adecf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"darling",
|
"darling",
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2101,17 +2250,48 @@ dependencies = [
|
|||||||
"yaml-rust",
|
"yaml-rust",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sha1"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sha2"
|
||||||
|
version = "0.8.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69"
|
||||||
|
dependencies = [
|
||||||
|
"block-buffer 0.7.3",
|
||||||
|
"digest 0.8.1",
|
||||||
|
"fake-simd",
|
||||||
|
"opaque-debug 0.2.3",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sha2"
|
name = "sha2"
|
||||||
version = "0.9.5"
|
version = "0.9.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12"
|
checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-buffer",
|
"block-buffer 0.9.0",
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
"digest",
|
"digest 0.9.0",
|
||||||
"opaque-debug",
|
"opaque-debug 0.3.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sha3"
|
||||||
|
version = "0.8.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf"
|
||||||
|
dependencies = [
|
||||||
|
"block-buffer 0.7.3",
|
||||||
|
"byte-tools",
|
||||||
|
"digest 0.8.1",
|
||||||
|
"keccak",
|
||||||
|
"opaque-debug 0.2.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2227,7 +2407,7 @@ dependencies = [
|
|||||||
"parking_lot",
|
"parking_lot",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"rustls",
|
"rustls",
|
||||||
"sha2",
|
"sha2 0.9.5",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"sqlformat",
|
"sqlformat",
|
||||||
"sqlx-rt",
|
"sqlx-rt",
|
||||||
@@ -2251,12 +2431,12 @@ dependencies = [
|
|||||||
"futures",
|
"futures",
|
||||||
"heck",
|
"heck",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"sha2",
|
"sha2 0.9.5",
|
||||||
"sqlx-core",
|
"sqlx-core",
|
||||||
"sqlx-rt",
|
"sqlx-rt",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2299,21 +2479,38 @@ version = "0.10.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "subtle"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "subtle"
|
name = "subtle"
|
||||||
version = "2.4.1"
|
version = "2.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
|
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "0.15.44"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2 0.4.30",
|
||||||
|
"quote 0.6.13",
|
||||||
|
"unicode-xid 0.1.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "1.0.74"
|
version = "1.0.74"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c"
|
checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"unicode-xid",
|
"unicode-xid 0.2.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2322,10 +2519,10 @@ version = "0.12.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa"
|
checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
"unicode-xid",
|
"unicode-xid 0.2.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2392,9 +2589,9 @@ version = "1.0.26"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745"
|
checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2486,9 +2683,9 @@ version = "1.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110"
|
checksum = "54473be61f4ebe4efd09cec9bd5d16fa51d70ea0192213d754d2d500457db110"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2561,6 +2758,28 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "torut"
|
||||||
|
version = "0.1.10"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5b2cdfcb8b9dccc90fd618101a6f0a5a1f9e23e36956da9a2fe0abee901b04cc"
|
||||||
|
dependencies = [
|
||||||
|
"base32",
|
||||||
|
"base64 0.10.1",
|
||||||
|
"derive_more",
|
||||||
|
"ed25519-dalek",
|
||||||
|
"hex",
|
||||||
|
"hmac",
|
||||||
|
"openssl",
|
||||||
|
"rand 0.7.3",
|
||||||
|
"serde",
|
||||||
|
"serde_derive",
|
||||||
|
"sha1",
|
||||||
|
"sha2 0.8.2",
|
||||||
|
"sha3",
|
||||||
|
"tokio 1.9.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tower-service"
|
name = "tower-service"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
@@ -2608,9 +2827,9 @@ version = "0.9.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "345426c7406aa355b60c5007c79a2d1f5b605540072795222f17f6443e6a9c6f"
|
checksum = "345426c7406aa355b60c5007c79a2d1f5b605540072795222f17f6443e6a9c6f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2649,6 +2868,12 @@ version = "0.1.8"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
|
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-xid"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-xid"
|
name = "unicode-xid"
|
||||||
version = "0.2.2"
|
version = "0.2.2"
|
||||||
@@ -2741,9 +2966,9 @@ dependencies = [
|
|||||||
"bumpalo",
|
"bumpalo",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"log",
|
"log",
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2765,7 +2990,7 @@ version = "0.2.75"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "171ebf0ed9e1458810dfcb31f2e766ad6b3a89dbda42d8901f2b268277e5f09c"
|
checksum = "171ebf0ed9e1458810dfcb31f2e766ad6b3a89dbda42d8901f2b268277e5f09c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"wasm-bindgen-macro-support",
|
"wasm-bindgen-macro-support",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2775,9 +3000,9 @@ version = "0.2.75"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6c2657dd393f03aa2a659c25c6ae18a13a4048cebd220e147933ea837efc589f"
|
checksum = "6c2657dd393f03aa2a659c25c6ae18a13a4048cebd220e147933ea837efc589f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
"wasm-bindgen-backend",
|
"wasm-bindgen-backend",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
@@ -2925,8 +3150,8 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1"
|
checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2 1.0.28",
|
||||||
"quote",
|
"quote 1.0.9",
|
||||||
"syn",
|
"syn 1.0.74",
|
||||||
"synstructure",
|
"synstructure",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -45,19 +45,19 @@ production = []
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.40"
|
anyhow = "1.0.40"
|
||||||
async-trait = "0.1.42"
|
async-trait = "0.1.42"
|
||||||
avahi-sys = { git = "https://github.com/Start9Labs/avahi-sys", version = "0.10.0", branch = "feature/dynamic-linking", features = ["dynamic"], optional = true }
|
avahi-sys = { git="https://github.com/Start9Labs/avahi-sys", version="0.10.0", branch="feature/dynamic-linking", features=["dynamic"], optional=true }
|
||||||
base32 = "0.4.0"
|
base32 = "0.4.0"
|
||||||
bollard = "0.10.1"
|
bollard = "0.10.1"
|
||||||
chrono = { version = "0.4.19", features = ["serde"] }
|
chrono = { version="0.4.19", features=["serde"] }
|
||||||
clap = "2.33"
|
clap = "2.33"
|
||||||
digest = "0.9.0"
|
digest = "0.9.0"
|
||||||
ed25519-dalek = { version = "1.0.1", features = ["serde"] }
|
ed25519-dalek = { version="1.0.1", features=["serde"] }
|
||||||
emver = { version = "0.1.2", features = ["serde"] }
|
emver = { version="0.1.2", features=["serde"] }
|
||||||
futures = "0.3.8"
|
futures = "0.3.8"
|
||||||
git-version = "0.3.4"
|
git-version = "0.3.4"
|
||||||
http = "0.2.3"
|
http = "0.2.3"
|
||||||
id-pool = { version = "0.2.1", features = ["u16", "serde"], default-features = false }
|
id-pool = { version="0.2.1", features=["u16", "serde"], default-features=false }
|
||||||
indexmap = { version = "1.6.2", features = ["serde"] }
|
indexmap = { version="1.6.2", features=["serde"] }
|
||||||
itertools = "0.10.0"
|
itertools = "0.10.0"
|
||||||
jsonpath_lib = "0.2.6"
|
jsonpath_lib = "0.2.6"
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
@@ -65,29 +65,30 @@ libc = "0.2.86"
|
|||||||
log = "0.4.11"
|
log = "0.4.11"
|
||||||
nix = "0.20.0"
|
nix = "0.20.0"
|
||||||
openssl = "0.10.30"
|
openssl = "0.10.30"
|
||||||
patch-db = { version = "*", path = "../../patch-db/patch-db" }
|
patch-db = { version="*", path="../../patch-db/patch-db" }
|
||||||
pin-project = "1.0.6"
|
pin-project = "1.0.6"
|
||||||
prettytable-rs = "0.8.0"
|
prettytable-rs = "0.8.0"
|
||||||
rand = "0.8.3"
|
rand = "0.8.3"
|
||||||
regex = "1.4.2"
|
regex = "1.4.2"
|
||||||
reqwest = { version = "0.11.2", features = ["stream", "json"] }
|
reqwest = { version="0.11.2", features=["stream", "json"] }
|
||||||
rpassword = "5.0.0"
|
rpassword = "5.0.0"
|
||||||
rpc-toolkit = { version = "*", path = "../../rpc-toolkit/rpc-toolkit" }
|
rpc-toolkit = { version="*", path="../../rpc-toolkit/rpc-toolkit" }
|
||||||
rust-argon2 = "0.8.3"
|
rust-argon2 = "0.8.3"
|
||||||
scopeguard = "1.1" # because avahi-sys fucks your shit up
|
scopeguard = "1.1" # because avahi-sys fucks your shit up
|
||||||
serde = { version = "1.0.118", features = ["derive", "rc"] }
|
serde = { version="1.0.118", features=["derive", "rc"] }
|
||||||
serde_cbor = "0.11.1"
|
serde_cbor = "0.11.1"
|
||||||
serde_json = "1.0.59"
|
serde_json = "1.0.59"
|
||||||
serde_toml = { package = "toml", version = "0.5.8" }
|
serde_toml = { package="toml", version="0.5.8" }
|
||||||
serde_yaml = "0.8.14"
|
serde_yaml = "0.8.14"
|
||||||
sha2 = "0.9.3"
|
sha2 = "0.9.3"
|
||||||
simple-logging = "2.0"
|
simple-logging = "2.0"
|
||||||
sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite"] }
|
sqlx = { version="0.5", features=["runtime-tokio-rustls", "sqlite"] }
|
||||||
thiserror = "1.0.24"
|
thiserror = "1.0.24"
|
||||||
tokio = { version = "1.5.0", features = ["full"] }
|
tokio = { version="1.5.0", features=["full"] }
|
||||||
tokio-compat-02 = "0.2.0"
|
tokio-compat-02 = "0.2.0"
|
||||||
tokio-stream = { version = "0.1.5", features = ["io-util"] }
|
tokio-stream = { version="0.1.5", features=["io-util"] }
|
||||||
tokio-tar = "0.3.0"
|
tokio-tar = "0.3.0"
|
||||||
tokio-util = { version = "0.6.6", features = ["io"] }
|
tokio-util = { version="0.6.6", features=["io"] }
|
||||||
|
torut = "0.1.9"
|
||||||
typed-builder = "0.9.0"
|
typed-builder = "0.9.0"
|
||||||
url = { version = "2.2.1", features = ["serde"] }
|
url = { version="2.2.1", features=["serde"] }
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ async fn inner_main(cfg_path: Option<&str>) -> Result<(), Error> {
|
|||||||
command: embassy::main_api,
|
command: embassy::main_api,
|
||||||
context: ctx,
|
context: ctx,
|
||||||
status: status_fn,
|
status: status_fn,
|
||||||
|
|
||||||
});
|
});
|
||||||
let status_ctx = rpc_ctx.clone();
|
let status_ctx = rpc_ctx.clone();
|
||||||
let status_daemon = daemon(
|
let status_daemon = daemon(
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ use serde::Deserialize;
|
|||||||
use sqlx::SqlitePool;
|
use sqlx::SqlitePool;
|
||||||
use tokio::fs::File;
|
use tokio::fs::File;
|
||||||
|
|
||||||
use crate::net::mdns::LanHandle;
|
use crate::net::mdns::{enable_lan, LanHandle};
|
||||||
|
use crate::net::tor::TorController;
|
||||||
use crate::util::{from_toml_async_reader, AsyncFileExt, Container};
|
use crate::util::{from_toml_async_reader, AsyncFileExt, Container};
|
||||||
use crate::{Error, ResultExt};
|
use crate::{Error, ResultExt};
|
||||||
|
|
||||||
@@ -30,8 +31,8 @@ pub struct RpcContextSeed {
|
|||||||
pub db: PatchDb,
|
pub db: PatchDb,
|
||||||
pub secret_store: SqlitePool,
|
pub secret_store: SqlitePool,
|
||||||
pub docker: Docker,
|
pub docker: Docker,
|
||||||
// pub lan_handle: Container<LanHandle>,
|
pub lan_handle: Container<LanHandle>,
|
||||||
// pub
|
pub tor_controller: TorController,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@@ -50,14 +51,19 @@ impl RpcContext {
|
|||||||
} else {
|
} else {
|
||||||
RpcContextConfig::default()
|
RpcContextConfig::default()
|
||||||
};
|
};
|
||||||
|
let db = PatchDb::open(
|
||||||
|
base.db
|
||||||
|
.unwrap_or_else(|| Path::new("/mnt/embassy-os/embassy.db").to_owned()),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
let mut db_handle = db.handle();
|
||||||
|
let lan_handle = Container::new();
|
||||||
|
lan_handle.set(enable_lan(&mut db_handle).await?).await;
|
||||||
|
let tor_controller = TorController::init(&mut db_handle).await?;
|
||||||
let seed = Arc::new(RpcContextSeed {
|
let seed = Arc::new(RpcContextSeed {
|
||||||
bind_rpc: base.bind_rpc.unwrap_or(([127, 0, 0, 1], 5959).into()),
|
bind_rpc: base.bind_rpc.unwrap_or(([127, 0, 0, 1], 5959).into()),
|
||||||
bind_ws: base.bind_ws.unwrap_or(([127, 0, 0, 1], 5960).into()),
|
bind_ws: base.bind_ws.unwrap_or(([127, 0, 0, 1], 5960).into()),
|
||||||
db: PatchDb::open(
|
db,
|
||||||
base.db
|
|
||||||
.unwrap_or_else(|| Path::new("/mnt/embassy-os/embassy.db").to_owned()),
|
|
||||||
)
|
|
||||||
.await?,
|
|
||||||
secret_store: SqlitePool::connect(&format!(
|
secret_store: SqlitePool::connect(&format!(
|
||||||
"sqlite://{}",
|
"sqlite://{}",
|
||||||
base.secret_store
|
base.secret_store
|
||||||
@@ -66,6 +72,8 @@ impl RpcContext {
|
|||||||
))
|
))
|
||||||
.await?,
|
.await?,
|
||||||
docker: Docker::connect_with_unix_defaults()?,
|
docker: Docker::connect_with_unix_defaults()?,
|
||||||
|
lan_handle,
|
||||||
|
tor_controller,
|
||||||
});
|
});
|
||||||
Ok(Self(seed))
|
Ok(Self(seed))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,6 +173,11 @@ impl From<bollard::errors::Error> for Error {
|
|||||||
Error::new(e, ErrorKind::Docker)
|
Error::new(e, ErrorKind::Docker)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
impl From<torut::control::ConnError> for Error {
|
||||||
|
fn from(e: torut::control::ConnError) -> Self {
|
||||||
|
Error::new(anyhow!("{:?}", e), ErrorKind::Tor)
|
||||||
|
}
|
||||||
|
}
|
||||||
impl From<Error> for RpcError {
|
impl From<Error> for RpcError {
|
||||||
fn from(e: Error) -> Self {
|
fn from(e: Error) -> Self {
|
||||||
let mut data_object = serde_json::Map::with_capacity(2);
|
let mut data_object = serde_json::Map::with_capacity(2);
|
||||||
|
|||||||
@@ -90,6 +90,12 @@ impl<'a> Id<&'a str> {
|
|||||||
Id(self.0.to_owned())
|
Id(self.0.to_owned())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
impl<S: AsRef<str>> std::ops::Deref for Id<S> {
|
||||||
|
type Target = S;
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
impl<S: AsRef<str>> std::fmt::Display for Id<S> {
|
impl<S: AsRef<str>> std::fmt::Display for Id<S> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
write!(f, "{}", self.0.as_ref())
|
write!(f, "{}", self.0.as_ref())
|
||||||
@@ -168,6 +174,12 @@ impl<S: AsRef<str>> std::fmt::Display for InterfaceId<S> {
|
|||||||
write!(f, "{}", &self.0)
|
write!(f, "{}", &self.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
impl<S: AsRef<str>> std::ops::Deref for InterfaceId<S> {
|
||||||
|
type Target = S;
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&*self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
impl<S: AsRef<str>> AsRef<str> for InterfaceId<S> {
|
impl<S: AsRef<str>> AsRef<str> for InterfaceId<S> {
|
||||||
fn as_ref(&self) -> &str {
|
fn as_ref(&self) -> &str {
|
||||||
self.0.as_ref()
|
self.0.as_ref()
|
||||||
|
|||||||
@@ -107,3 +107,5 @@ impl Drop for LanHandle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
unsafe impl Send for LanHandle {}
|
||||||
|
unsafe impl Sync for LanHandle {}
|
||||||
|
|||||||
@@ -1,664 +1,263 @@
|
|||||||
use std::collections::{BTreeSet, HashMap};
|
use std::net::{Ipv4Addr, SocketAddr};
|
||||||
use std::net::Ipv4Addr;
|
use std::sync::Arc;
|
||||||
use std::os::unix::process::ExitStatusExt;
|
|
||||||
use std::path::{Path, PathBuf};
|
|
||||||
use std::time::{Duration, Instant};
|
|
||||||
|
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
use futures::future::BoxFuture;
|
||||||
|
use futures::FutureExt;
|
||||||
|
use indexmap::IndexMap;
|
||||||
|
use patch_db::DbHandle;
|
||||||
|
use sqlx::pool::PoolConnection;
|
||||||
|
use sqlx::Sqlite;
|
||||||
|
use tokio::net::TcpStream;
|
||||||
|
use tokio::sync::RwLock;
|
||||||
|
use torut::control::{AsyncEvent, AuthenticatedConn, ConnError};
|
||||||
|
use torut::onion::TorSecretKeyV3;
|
||||||
|
|
||||||
use crate::util::Invoke;
|
use crate::s9pk::manifest::TorConfig;
|
||||||
use crate::{Error, ResultExt as _};
|
use crate::{Error, ResultExt as _};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, serde::Deserialize, serde::Serialize)]
|
fn event_handler(event: AsyncEvent<'static>) -> BoxFuture<'static, Result<(), ConnError>> {
|
||||||
#[serde(rename_all = "kebab-case")]
|
async move { Ok(()) }.boxed()
|
||||||
pub enum LanOptions {
|
|
||||||
Standard,
|
|
||||||
Custom { port: u16 },
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, serde::Serialize)]
|
#[derive(Clone)]
|
||||||
pub struct PortMapping {
|
pub struct TorController(Arc<RwLock<TorControllerInner>>);
|
||||||
pub internal: u16,
|
impl TorController {
|
||||||
pub tor: u16,
|
pub async fn init<Db: DbHandle>(
|
||||||
pub lan: Option<LanOptions>, // only for http interfaces
|
tor_cp: SocketAddr,
|
||||||
}
|
db: &mut Db,
|
||||||
impl<'de> serde::de::Deserialize<'de> for PortMapping {
|
secrets: &mut PoolConnection<Sqlite>,
|
||||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
) -> Result<Self, Error> {
|
||||||
where
|
Ok(TorController(Arc::new(RwLock::new(
|
||||||
D: serde::de::Deserializer<'de>,
|
TorControllerInner::init(tor_cp, db, secrets).await?,
|
||||||
{
|
))))
|
||||||
#[derive(serde::Deserialize)]
|
}
|
||||||
pub struct PortMappingIF {
|
|
||||||
pub internal: u16,
|
pub async fn sync<Db: DbHandle>(
|
||||||
pub tor: u16,
|
&self,
|
||||||
#[serde(default, deserialize_with = "deserialize_some")]
|
db: &mut Db,
|
||||||
pub lan: Option<Option<LanOptions>>,
|
secrets: &mut PoolConnection<Sqlite>,
|
||||||
|
) -> Result<(), Error> {
|
||||||
|
let new = TorControllerInner::get_services(db, secrets).await?;
|
||||||
|
if &new != &self.0.read().await.services {
|
||||||
|
self.0.write().await.sync(new).await?;
|
||||||
}
|
}
|
||||||
|
Ok(())
|
||||||
fn deserialize_some<'de, T, D>(deserializer: D) -> Result<Option<T>, D::Error>
|
|
||||||
where
|
|
||||||
T: serde::de::Deserialize<'de>,
|
|
||||||
D: serde::de::Deserializer<'de>,
|
|
||||||
{
|
|
||||||
serde::de::Deserialize::deserialize(deserializer).map(Some)
|
|
||||||
}
|
|
||||||
|
|
||||||
let input_format: PortMappingIF = serde::de::Deserialize::deserialize(deserializer)?;
|
|
||||||
Ok(PortMapping {
|
|
||||||
internal: input_format.internal,
|
|
||||||
tor: input_format.tor,
|
|
||||||
lan: if let Some(lan) = input_format.lan {
|
|
||||||
lan
|
|
||||||
} else if input_format.tor == 80 {
|
|
||||||
Some(LanOptions::Standard)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const ETC_TOR_RC: &'static str = "/etc/tor/torrc";
|
type AuthenticatedConnection = AuthenticatedConn<
|
||||||
pub const HIDDEN_SERVICE_DIR_ROOT: &'static str = "/var/lib/tor";
|
TcpStream,
|
||||||
pub const ETC_HOSTNAME: &'static str = "/etc/hostname";
|
fn(AsyncEvent<'static>) -> BoxFuture<'static, Result<(), ConnError>>,
|
||||||
pub const ETC_NGINX_SERVICES_CONF: &'static str = "/etc/nginx/sites-available/start9-services.conf";
|
>;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, serde::Deserialize, serde::Serialize)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
#[serde(rename_all = "lowercase")]
|
struct HiddenServiceConfig {
|
||||||
pub enum HiddenServiceVersion {
|
ip: Ipv4Addr,
|
||||||
V1,
|
cfg: TorConfig,
|
||||||
V2,
|
|
||||||
V3,
|
|
||||||
}
|
|
||||||
impl From<HiddenServiceVersion> for usize {
|
|
||||||
fn from(v: HiddenServiceVersion) -> Self {
|
|
||||||
match v {
|
|
||||||
HiddenServiceVersion::V1 => 1,
|
|
||||||
HiddenServiceVersion::V2 => 2,
|
|
||||||
HiddenServiceVersion::V3 => 3,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// impl std::convert::TryFrom<usize> for HiddenServiceVersion {
|
|
||||||
// type Error = anyhow::Error;
|
|
||||||
// fn try_from(v: usize) -> Result<Self, Self::Error> {
|
|
||||||
// Ok(match v {
|
|
||||||
// 1 => HiddenServiceVersion::V1,
|
|
||||||
// 2 => HiddenServiceVersion::V2,
|
|
||||||
// 3 => HiddenServiceVersion::V3,
|
|
||||||
// n => bail!("Invalid HiddenServiceVersion {}", n),
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
impl Default for HiddenServiceVersion {
|
|
||||||
fn default() -> Self {
|
|
||||||
HiddenServiceVersion::V3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
impl std::fmt::Display for HiddenServiceVersion {
|
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
||||||
write!(f, "HiddenServiceVersion {}", usize::from(*self))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
|
pub struct TorControllerInner {
|
||||||
pub struct Service {
|
connection: AuthenticatedConnection,
|
||||||
pub ip: Ipv4Addr,
|
services: IndexMap<[u8; 64], HiddenServiceConfig>,
|
||||||
pub ports: Vec<PortMapping>,
|
|
||||||
#[serde(default)]
|
|
||||||
pub hidden_service_version: HiddenServiceVersion,
|
|
||||||
}
|
}
|
||||||
|
impl TorControllerInner {
|
||||||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
|
async fn get_services<Db: DbHandle>(
|
||||||
pub struct NewService {
|
db: &mut Db,
|
||||||
pub ports: Vec<PortMapping>,
|
secrets: &mut PoolConnection<Sqlite>,
|
||||||
#[serde(default)]
|
) -> Result<IndexMap<[u8; 64], HiddenServiceConfig>, Error> {
|
||||||
pub hidden_service_version: HiddenServiceVersion,
|
let pkg_ids = crate::db::DatabaseModel::new()
|
||||||
}
|
.package_data()
|
||||||
|
.keys(db)
|
||||||
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
|
|
||||||
pub struct ServicesMap {
|
|
||||||
pub map: HashMap<String, Service>,
|
|
||||||
pub ips: BTreeSet<Ipv4Addr>,
|
|
||||||
}
|
|
||||||
impl Default for ServicesMap {
|
|
||||||
fn default() -> Self {
|
|
||||||
ServicesMap {
|
|
||||||
map: Default::default(),
|
|
||||||
ips: Default::default(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
impl ServicesMap {
|
|
||||||
pub fn add(&mut self, name: String, service: NewService) -> Ipv4Addr {
|
|
||||||
let ip = self
|
|
||||||
.map
|
|
||||||
.get(&name)
|
|
||||||
.map(|a| a.ip.clone())
|
|
||||||
.unwrap_or_else(|| {
|
|
||||||
Ipv4Addr::from(
|
|
||||||
u32::from(
|
|
||||||
self.ips
|
|
||||||
.range(..)
|
|
||||||
.next_back()
|
|
||||||
.cloned()
|
|
||||||
.unwrap_or_else(|| crate::HOST_IP.into()),
|
|
||||||
) + 1,
|
|
||||||
)
|
|
||||||
});
|
|
||||||
self.ips.insert(ip);
|
|
||||||
self.map.insert(
|
|
||||||
name,
|
|
||||||
Service {
|
|
||||||
ip,
|
|
||||||
ports: service.ports,
|
|
||||||
hidden_service_version: service.hidden_service_version,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
ip
|
|
||||||
}
|
|
||||||
pub fn remove(&mut self, name: &str) {
|
|
||||||
let s = self.map.remove(name);
|
|
||||||
if let Some(s) = s {
|
|
||||||
self.ips.remove(&s.ip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn write_services(hidden_services: &ServicesMap) -> Result<(), Error> {
|
|
||||||
tokio::fs::copy(crate::TOR_RC, ETC_TOR_RC)
|
|
||||||
.await
|
|
||||||
.with_ctx(|_| {
|
|
||||||
(
|
|
||||||
crate::ErrorKind::Filesystem,
|
|
||||||
format!("{} -> {}", crate::TOR_RC, ETC_TOR_RC),
|
|
||||||
)
|
|
||||||
})?;
|
|
||||||
let mut f = tokio::fs::OpenOptions::new()
|
|
||||||
.append(true)
|
|
||||||
.open(ETC_TOR_RC)
|
|
||||||
.await?;
|
|
||||||
f.write_all(b"\n").await?;
|
|
||||||
for (name, service) in &hidden_services.map {
|
|
||||||
if service.ports.is_empty() {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
f.write_all(b"\n").await?;
|
|
||||||
f.write_all(format!("# HIDDEN SERVICE FOR {}\n", name).as_bytes())
|
|
||||||
.await?;
|
.await?;
|
||||||
f.write_all(
|
let mut services = IndexMap::new();
|
||||||
format!(
|
for pkg_id in pkg_ids {
|
||||||
"HiddenServiceDir {}/app-{}/\n",
|
if let Some(installed) = crate::db::DatabaseModel::new()
|
||||||
HIDDEN_SERVICE_DIR_ROOT, name
|
.package_data()
|
||||||
)
|
.idx_model(&pkg_id)
|
||||||
.as_bytes(),
|
.expect(db)
|
||||||
)
|
.await?
|
||||||
.await?;
|
.installed()
|
||||||
f.write_all(format!("{}\n", service.hidden_service_version).as_bytes())
|
.check(db)
|
||||||
.await?;
|
.await?
|
||||||
for port in &service.ports {
|
{
|
||||||
f.write_all(
|
let ifaces = installed
|
||||||
format!(
|
.clone()
|
||||||
"HiddenServicePort {} {}:{}\n",
|
.manifest()
|
||||||
port.tor, service.ip, port.internal
|
.interfaces()
|
||||||
)
|
.get(db)
|
||||||
.as_bytes(),
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
}
|
|
||||||
f.write_all(b"\n").await?;
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn write_lan_services(hidden_services: &ServicesMap) -> Result<(), Error> {
|
|
||||||
let mut f = tokio::fs::File::create(ETC_NGINX_SERVICES_CONF).await?;
|
|
||||||
for (app_id, service) in &hidden_services.map {
|
|
||||||
let hostname = tokio::fs::read_to_string(
|
|
||||||
Path::new(HIDDEN_SERVICE_DIR_ROOT)
|
|
||||||
.join(format!("app-{}", app_id))
|
|
||||||
.join("hostname"),
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.with_ctx(|_| {
|
|
||||||
(
|
|
||||||
crate::ErrorKind::Filesystem,
|
|
||||||
format!("{}/app-{}/hostname", HIDDEN_SERVICE_DIR_ROOT, app_id),
|
|
||||||
)
|
|
||||||
})?;
|
|
||||||
let hostname_str = hostname
|
|
||||||
.trim()
|
|
||||||
.strip_suffix(".onion")
|
|
||||||
.ok_or_else(|| anyhow!("{}", hostname))
|
|
||||||
.with_kind(crate::ErrorKind::InvalidOnionAddress)?;
|
|
||||||
for mapping in &service.ports {
|
|
||||||
match &mapping.lan {
|
|
||||||
Some(LanOptions::Standard) => {
|
|
||||||
log::info!("Writing LAN certificates for {}", app_id);
|
|
||||||
let base_path: PathBuf = todo!(); //PersistencePath::from_ref("apps").join(&app_id);
|
|
||||||
let key_path = base_path.join("cert-local.key.pem");
|
|
||||||
let conf_path = base_path.join("cert-local.csr.conf");
|
|
||||||
let req_path = base_path.join("cert-local.csr");
|
|
||||||
let cert_path = base_path.join("cert-local.crt.pem");
|
|
||||||
let fullchain_path = base_path.join("cert-local.fullchain.crt.pem");
|
|
||||||
if !fullchain_path.exists() || tokio::fs::metadata(&key_path).await.is_err() {
|
|
||||||
let mut fullchain_file = tokio::fs::File::create(&fullchain_path).await?;
|
|
||||||
tokio::process::Command::new("openssl")
|
|
||||||
.arg("ecparam")
|
|
||||||
.arg("-genkey")
|
|
||||||
.arg("-name")
|
|
||||||
.arg("prime256v1")
|
|
||||||
.arg("-noout")
|
|
||||||
.arg("-out")
|
|
||||||
.arg(&key_path)
|
|
||||||
.invoke(crate::ErrorKind::OpenSSL)
|
|
||||||
.await
|
|
||||||
.map_err(|e| {
|
|
||||||
let ctx = format!("GenKey: {}", e);
|
|
||||||
crate::Error::new(e.source.context(ctx), e.kind)
|
|
||||||
})?;
|
|
||||||
tokio::fs::write(
|
|
||||||
&conf_path,
|
|
||||||
format!(
|
|
||||||
include_str!("cert-local.csr.conf.template"),
|
|
||||||
hostname = hostname_str
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
tokio::process::Command::new("openssl")
|
|
||||||
.arg("req")
|
|
||||||
.arg("-config")
|
|
||||||
.arg(&conf_path)
|
|
||||||
.arg("-key")
|
|
||||||
.arg(&key_path)
|
|
||||||
.arg("-new")
|
|
||||||
.arg("-addext")
|
|
||||||
.arg(format!(
|
|
||||||
"subjectAltName=DNS:{hostname}.local",
|
|
||||||
hostname = hostname_str
|
|
||||||
))
|
|
||||||
.arg("-out")
|
|
||||||
.arg(&req_path)
|
|
||||||
.invoke(crate::ErrorKind::OpenSSL)
|
|
||||||
.await
|
|
||||||
.map_err(|e| {
|
|
||||||
let ctx = format!("Req: {}", e);
|
|
||||||
crate::Error::new(e.source.context(ctx), e.kind)
|
|
||||||
})?;
|
|
||||||
tokio::process::Command::new("openssl")
|
|
||||||
.arg("ca")
|
|
||||||
.arg("-batch")
|
|
||||||
.arg("-config")
|
|
||||||
.arg("/root/agent/ca/intermediate/openssl.conf")
|
|
||||||
.arg("-rand_serial")
|
|
||||||
.arg("-keyfile")
|
|
||||||
.arg("/root/agent/ca/intermediate/private/embassy-int-ca.key.pem")
|
|
||||||
.arg("-cert")
|
|
||||||
.arg("/root/agent/ca/intermediate/certs/embassy-int-ca.crt.pem")
|
|
||||||
.arg("-extensions")
|
|
||||||
.arg("server_cert")
|
|
||||||
.arg("-days")
|
|
||||||
.arg("365")
|
|
||||||
.arg("-notext")
|
|
||||||
.arg("-in")
|
|
||||||
.arg(&req_path)
|
|
||||||
.arg("-out")
|
|
||||||
.arg(&cert_path)
|
|
||||||
.invoke(crate::ErrorKind::OpenSSL)
|
|
||||||
.await
|
|
||||||
.map_err(|e| {
|
|
||||||
let ctx = format!("CA: {}", e);
|
|
||||||
crate::Error::new(e.source.context(ctx), e.kind)
|
|
||||||
})?;
|
|
||||||
log::info!("Writing fullchain to: {}", fullchain_path.display());
|
|
||||||
tokio::io::copy(
|
|
||||||
&mut tokio::fs::File::open(&cert_path).await?,
|
|
||||||
&mut fullchain_file,
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
tokio::io::copy(
|
|
||||||
&mut tokio::fs::File::open(
|
|
||||||
"/root/agent/ca/intermediate/certs/embassy-int-ca.crt.pem",
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.with_ctx(|_| {
|
|
||||||
(
|
|
||||||
crate::ErrorKind::Filesystem,
|
|
||||||
"/root/agent/ca/intermediate/certs/embassy-int-ca.crt.pem",
|
|
||||||
)
|
|
||||||
})?,
|
|
||||||
&mut fullchain_file,
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
tokio::io::copy(
|
|
||||||
&mut tokio::fs::File::open(
|
|
||||||
"/root/agent/ca/certs/embassy-root-ca.cert.pem",
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.with_ctx(|_| {
|
|
||||||
(
|
|
||||||
crate::ErrorKind::Filesystem,
|
|
||||||
"/root/agent/ca/certs/embassy-root-ca.cert.pem",
|
|
||||||
)
|
|
||||||
})?,
|
|
||||||
&mut fullchain_file,
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
log::info!("{} written successfully", fullchain_path.display());
|
|
||||||
}
|
|
||||||
f.write_all(
|
|
||||||
format!(
|
|
||||||
include_str!("nginx-standard.conf.template"),
|
|
||||||
hostname = hostname_str,
|
|
||||||
app_ip = service.ip,
|
|
||||||
internal_port = mapping.internal,
|
|
||||||
app_id = app_id,
|
|
||||||
)
|
|
||||||
.as_bytes(),
|
|
||||||
)
|
|
||||||
.await?;
|
|
||||||
f.sync_all().await?;
|
|
||||||
}
|
|
||||||
Some(LanOptions::Custom { port }) => {
|
|
||||||
f.write_all(
|
|
||||||
format!(
|
|
||||||
include_str!("nginx.conf.template"),
|
|
||||||
hostname = hostname_str,
|
|
||||||
app_ip = service.ip,
|
|
||||||
port = port,
|
|
||||||
internal_port = mapping.internal,
|
|
||||||
)
|
|
||||||
.as_bytes(),
|
|
||||||
)
|
|
||||||
.await?
|
.await?
|
||||||
}
|
.to_owned();
|
||||||
None => (),
|
for (iface_id, cfgs) in ifaces.0 {
|
||||||
}
|
if let Some(tor_cfg) = cfgs.tor_config {
|
||||||
}
|
if let Some(key) = sqlx::query!(
|
||||||
}
|
"SELECT key FROM tor WHERE package = ? AND interface = ?",
|
||||||
|
*pkg_id,
|
||||||
Ok(())
|
*iface_id,
|
||||||
}
|
)
|
||||||
|
.fetch_optional(&mut *secrets)
|
||||||
pub async fn read_tor_address(name: &str, timeout: Option<Duration>) -> Result<String, Error> {
|
.await?
|
||||||
log::info!("Retrieving Tor hidden service address for {}.", name);
|
{
|
||||||
let addr_path = Path::new(HIDDEN_SERVICE_DIR_ROOT)
|
if key.key.len() != 64 {
|
||||||
.join(format!("app-{}", name))
|
return Err(Error::new(
|
||||||
.join("hostname");
|
anyhow!("Invalid key length"),
|
||||||
if let Some(timeout) = timeout {
|
crate::ErrorKind::Database,
|
||||||
let start = Instant::now();
|
));
|
||||||
while {
|
}
|
||||||
if addr_path.exists() {
|
let mut buf = [0; 64];
|
||||||
false
|
buf.clone_from_slice(&key.key);
|
||||||
} else {
|
services.insert(
|
||||||
if start.elapsed() >= timeout {
|
buf,
|
||||||
log::warn!("Timed out waiting for tor to start.");
|
HiddenServiceConfig {
|
||||||
false
|
ip: installed
|
||||||
} else {
|
.clone()
|
||||||
true
|
.interface_info()
|
||||||
|
.ip()
|
||||||
|
.get(db)
|
||||||
|
.await?
|
||||||
|
.to_owned(),
|
||||||
|
cfg: tor_cfg,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} {
|
|
||||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
|
||||||
}
|
}
|
||||||
|
Ok(services)
|
||||||
}
|
}
|
||||||
let tor_addr = match tokio::fs::read_to_string(&addr_path).await {
|
|
||||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
|
async fn add_svc(
|
||||||
Err(e).with_ctx(|_| (crate::ErrorKind::NotFound, addr_path.display().to_string()))
|
&mut self,
|
||||||
}
|
key: &TorSecretKeyV3,
|
||||||
a => a.with_ctx(|_| {
|
config: &HiddenServiceConfig,
|
||||||
(
|
) -> Result<(), Error> {
|
||||||
crate::ErrorKind::Filesystem,
|
self.connection
|
||||||
addr_path.display().to_string(),
|
.add_onion_v3(
|
||||||
|
key,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
None,
|
||||||
|
&mut config
|
||||||
|
.cfg
|
||||||
|
.port_mapping
|
||||||
|
.iter()
|
||||||
|
.map(|(external, internal)| {
|
||||||
|
(*external, SocketAddr::from((config.ip, *internal)))
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.iter(),
|
||||||
)
|
)
|
||||||
}),
|
.await?;
|
||||||
}?;
|
Ok(())
|
||||||
Ok(tor_addr.trim().to_owned())
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn read_tor_key(
|
async fn sync(
|
||||||
name: &str,
|
&mut self,
|
||||||
version: HiddenServiceVersion,
|
services: IndexMap<[u8; 64], HiddenServiceConfig>,
|
||||||
timeout: Option<Duration>,
|
) -> Result<(), Error> {
|
||||||
) -> Result<String, Error> {
|
for (key, new) in &services {
|
||||||
log::info!("Retrieving Tor hidden service key for {}.", name);
|
let tor_key = TorSecretKeyV3::from(key.clone());
|
||||||
let addr_path = Path::new(HIDDEN_SERVICE_DIR_ROOT)
|
if let Some(old) = self.services.remove(&key[..]) {
|
||||||
.join(format!("app-{}", name))
|
if new != &old {
|
||||||
.join(match version {
|
self.connection
|
||||||
HiddenServiceVersion::V3 => "hs_ed25519_secret_key",
|
.del_onion(
|
||||||
_ => "private_key",
|
&tor_key
|
||||||
});
|
.public()
|
||||||
if let Some(timeout) = timeout {
|
.get_onion_address()
|
||||||
let start = Instant::now();
|
.get_address_without_dot_onion(),
|
||||||
while {
|
)
|
||||||
if addr_path.exists() {
|
.await?;
|
||||||
false
|
self.add_svc(&tor_key, new).await?;
|
||||||
} else {
|
|
||||||
if start.elapsed() >= timeout {
|
|
||||||
log::warn!("Timed out waiting for tor to start.");
|
|
||||||
false
|
|
||||||
} else {
|
|
||||||
true
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
self.add_svc(&tor_key, new).await?;
|
||||||
}
|
}
|
||||||
} {
|
|
||||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
|
||||||
}
|
}
|
||||||
}
|
for (key, _) in self.services.drain(..) {
|
||||||
let tor_key = match version {
|
self.connection
|
||||||
HiddenServiceVersion::V3 => {
|
.del_onion(
|
||||||
let mut f = tokio::fs::File::open(&addr_path).await.with_ctx(|_| {
|
&TorSecretKeyV3::from(key)
|
||||||
(
|
.public()
|
||||||
crate::ErrorKind::Filesystem,
|
.get_onion_address()
|
||||||
addr_path.display().to_string(),
|
.get_address_without_dot_onion(),
|
||||||
)
|
)
|
||||||
})?;
|
.await?;
|
||||||
let mut buf = [0; 96];
|
|
||||||
f.read_exact(&mut buf).await?;
|
|
||||||
base32::encode(base32::Alphabet::RFC4648 { padding: false }, &buf[32..]).to_lowercase()
|
|
||||||
}
|
}
|
||||||
_ => tokio::fs::read_to_string(&addr_path)
|
self.services = services;
|
||||||
.await
|
Ok(())
|
||||||
.with_ctx(|_| {
|
|
||||||
(
|
|
||||||
crate::ErrorKind::Filesystem,
|
|
||||||
addr_path.display().to_string(),
|
|
||||||
)
|
|
||||||
})?
|
|
||||||
.trim_end_matches("\u{0}")
|
|
||||||
.to_string(),
|
|
||||||
};
|
|
||||||
Ok(tor_key.trim().to_owned())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn set_svc(
|
|
||||||
name: &str,
|
|
||||||
service: NewService,
|
|
||||||
) -> Result<(Ipv4Addr, Option<String>, Option<String>), Error> {
|
|
||||||
log::info!(
|
|
||||||
"Adding Tor hidden service {} to {}.",
|
|
||||||
name,
|
|
||||||
crate::SERVICES_YAML
|
|
||||||
);
|
|
||||||
let is_listening = !service.ports.is_empty();
|
|
||||||
// let path = PersistencePath::from_ref(crate::SERVICES_YAML);
|
|
||||||
let mut hidden_services: ServicesMap = todo!(); //services_map_mut(path).await?;
|
|
||||||
let ver = service.hidden_service_version;
|
|
||||||
let ip = hidden_services.add(name.to_owned(), service);
|
|
||||||
log::info!("Adding Tor hidden service {} to {}.", name, ETC_TOR_RC);
|
|
||||||
write_services(&hidden_services).await?;
|
|
||||||
let addr_path = Path::new(HIDDEN_SERVICE_DIR_ROOT)
|
|
||||||
.join(format!("app-{}", name))
|
|
||||||
.join("hostname");
|
|
||||||
tokio::fs::remove_file(addr_path).await.or_else(|e| {
|
|
||||||
if e.kind() == std::io::ErrorKind::NotFound {
|
|
||||||
Ok(())
|
|
||||||
} else {
|
|
||||||
Err(e)
|
|
||||||
}
|
|
||||||
})?;
|
|
||||||
#[cfg(target_os = "linux")]
|
|
||||||
nix::unistd::sync();
|
|
||||||
log::info!("Reloading Tor.");
|
|
||||||
let svc_exit = std::process::Command::new("service")
|
|
||||||
.args(&["tor", "reload"])
|
|
||||||
.status()?;
|
|
||||||
crate::ensure_code!(
|
|
||||||
svc_exit.success(),
|
|
||||||
crate::ErrorKind::Tor,
|
|
||||||
"Failed to Reload Tor: {}",
|
|
||||||
svc_exit
|
|
||||||
.code()
|
|
||||||
.or_else(|| { svc_exit.signal().map(|a| 128 + a) })
|
|
||||||
.unwrap_or(0)
|
|
||||||
);
|
|
||||||
let addr = if is_listening {
|
|
||||||
Some(read_tor_address(name, Some(Duration::from_secs(30))).await?)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
let key = if is_listening {
|
|
||||||
Some(read_tor_key(name, ver, Some(Duration::from_secs(30))).await?)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
write_lan_services(&hidden_services).await?;
|
|
||||||
log::info!("Reloading Nginx.");
|
|
||||||
let svc_exit = std::process::Command::new("service")
|
|
||||||
.args(&["nginx", "reload"])
|
|
||||||
.status()?;
|
|
||||||
crate::ensure_code!(
|
|
||||||
svc_exit.success(),
|
|
||||||
crate::ErrorKind::Nginx,
|
|
||||||
"Failed to Reload Nginx: {}",
|
|
||||||
svc_exit
|
|
||||||
.code()
|
|
||||||
.or_else(|| { svc_exit.signal().map(|a| 128 + a) })
|
|
||||||
.unwrap_or(0)
|
|
||||||
);
|
|
||||||
Ok((ip, addr, key))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn rm_svc(name: &str) -> Result<(), Error> {
|
|
||||||
log::info!(
|
|
||||||
"Removing Tor hidden service {} from {}.",
|
|
||||||
name,
|
|
||||||
crate::SERVICES_YAML
|
|
||||||
);
|
|
||||||
// let path = PersistencePath::from_ref(crate::SERVICES_YAML);
|
|
||||||
let mut hidden_services: ServicesMap = todo!(); //services_map_mut(path).await?;
|
|
||||||
hidden_services.remove(name);
|
|
||||||
let hidden_service_path = Path::new(HIDDEN_SERVICE_DIR_ROOT).join(format!("app-{}", name));
|
|
||||||
log::info!("Removing {}", hidden_service_path.display());
|
|
||||||
if hidden_service_path.exists() {
|
|
||||||
tokio::fs::remove_dir_all(hidden_service_path).await?;
|
|
||||||
}
|
}
|
||||||
log::info!("Removing Tor hidden service {} from {}.", name, ETC_TOR_RC);
|
|
||||||
write_services(&hidden_services).await?;
|
|
||||||
log::info!("Reloading Tor.");
|
|
||||||
let svc_exit = std::process::Command::new("service")
|
|
||||||
.args(&["tor", "reload"])
|
|
||||||
.status()?;
|
|
||||||
crate::ensure_code!(
|
|
||||||
svc_exit.success(),
|
|
||||||
crate::ErrorKind::Tor,
|
|
||||||
"Failed to Reload Tor: {}",
|
|
||||||
svc_exit.code().unwrap_or(0)
|
|
||||||
);
|
|
||||||
write_lan_services(&hidden_services).await?;
|
|
||||||
log::info!("Reloading Nginx.");
|
|
||||||
let svc_exit = std::process::Command::new("service")
|
|
||||||
.args(&["nginx", "reload"])
|
|
||||||
.status()?;
|
|
||||||
crate::ensure_code!(
|
|
||||||
svc_exit.success(),
|
|
||||||
crate::ErrorKind::Nginx,
|
|
||||||
"Failed to Reload Nginx: {}",
|
|
||||||
svc_exit
|
|
||||||
.code()
|
|
||||||
.or_else(|| { svc_exit.signal().map(|a| 128 + a) })
|
|
||||||
.unwrap_or(0)
|
|
||||||
);
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn change_key(
|
async fn init<Db: DbHandle>(
|
||||||
name: &str,
|
tor_cp: SocketAddr,
|
||||||
key: Option<&ed25519_dalek::ExpandedSecretKey>,
|
db: &mut Db,
|
||||||
) -> Result<(), Error> {
|
secrets: &mut PoolConnection<Sqlite>,
|
||||||
let hidden_service_path = Path::new(HIDDEN_SERVICE_DIR_ROOT).join(format!("app-{}", name));
|
) -> Result<Self, Error> {
|
||||||
log::info!("Removing {}", hidden_service_path.display());
|
let mut conn = torut::control::UnauthenticatedConn::new(
|
||||||
if hidden_service_path.exists() {
|
TcpStream::connect(tor_cp).await?, // TODO
|
||||||
tokio::fs::remove_dir_all(&hidden_service_path)
|
);
|
||||||
.await
|
let auth = conn
|
||||||
.with_ctx(|_| {
|
.load_protocol_info()
|
||||||
(
|
.await?
|
||||||
crate::ErrorKind::Filesystem,
|
.make_auth_data()?
|
||||||
hidden_service_path.display().to_string(),
|
.ok_or_else(|| anyhow!("Cookie Auth Not Available"))
|
||||||
)
|
.with_kind(crate::ErrorKind::Tor)?;
|
||||||
})?;
|
conn.authenticate(&auth).await?;
|
||||||
|
let mut connection: AuthenticatedConnection = conn.into_authenticated().await;
|
||||||
|
connection.set_async_event_handler(Some(event_handler));
|
||||||
|
let mut res = TorControllerInner {
|
||||||
|
connection,
|
||||||
|
services: IndexMap::new(),
|
||||||
|
};
|
||||||
|
res.sync(Self::get_services(db, secrets).await?).await?;
|
||||||
|
Ok(res)
|
||||||
}
|
}
|
||||||
if let Some(key) = key {
|
}
|
||||||
tokio::fs::create_dir_all(&hidden_service_path).await?;
|
|
||||||
let key_path = hidden_service_path.join("hs_ed25519_secret_key");
|
#[tokio::test]
|
||||||
let mut key_data = b"== ed25519v1-secret: type0 ==".to_vec();
|
async fn test() {
|
||||||
key_data.extend_from_slice(&key.to_bytes());
|
let mut conn = torut::control::UnauthenticatedConn::new(
|
||||||
tokio::fs::write(&key_path, key_data)
|
TcpStream::connect(SocketAddr::from(([127, 0, 0, 1], 9051)))
|
||||||
.await
|
.await
|
||||||
.with_ctx(|_| (crate::ErrorKind::Filesystem, key_path.display().to_string()))?;
|
.unwrap(), // TODO
|
||||||
}
|
|
||||||
log::info!("Reloading Tor.");
|
|
||||||
let svc_exit = std::process::Command::new("service")
|
|
||||||
.args(&["tor", "reload"])
|
|
||||||
.status()?;
|
|
||||||
crate::ensure_code!(
|
|
||||||
svc_exit.success(),
|
|
||||||
crate::ErrorKind::Tor,
|
|
||||||
"Failed to Reload Tor: {}",
|
|
||||||
svc_exit.code().unwrap_or(0)
|
|
||||||
);
|
);
|
||||||
// let mut info = crate::apps::list_info_mut().await?;
|
let auth = conn
|
||||||
// if let Some(mut i) = info.get_mut(name) {
|
.load_protocol_info()
|
||||||
// if i.tor_address.is_some() {
|
.await
|
||||||
// i.tor_address = Some(read_tor_address(name, Some(Duration::from_secs(30))).await?);
|
.unwrap()
|
||||||
// }
|
.make_auth_data()
|
||||||
// }
|
.unwrap()
|
||||||
Ok(())
|
.ok_or_else(|| anyhow!("Cookie Auth Not Available"))
|
||||||
}
|
.with_kind(crate::ErrorKind::Tor)
|
||||||
|
.unwrap();
|
||||||
pub async fn reload() -> Result<(), Error> {
|
conn.authenticate(&auth).await.unwrap();
|
||||||
// let path = PersistencePath::from_ref(crate::SERVICES_YAML);
|
let mut connection: AuthenticatedConn<
|
||||||
let hidden_services = todo!(); //services_map(&path).await?;
|
TcpStream,
|
||||||
log::info!("Syncing Tor hidden services to {}.", ETC_TOR_RC);
|
fn(AsyncEvent<'static>) -> BoxFuture<'static, Result<(), ConnError>>,
|
||||||
write_services(&hidden_services).await?;
|
> = conn.into_authenticated().await;
|
||||||
log::info!("Reloading Tor.");
|
let tor_key = torut::onion::TorSecretKeyV3::generate();
|
||||||
let svc_exit = std::process::Command::new("service")
|
dbg!(connection.get_conf("SocksPort").await.unwrap());
|
||||||
.args(&["tor", "reload"])
|
connection
|
||||||
.status()?;
|
.add_onion_v3(
|
||||||
crate::ensure_code!(
|
&tor_key,
|
||||||
svc_exit.success(),
|
false,
|
||||||
crate::ErrorKind::Tor,
|
false,
|
||||||
"Failed to Reload Tor: {}",
|
false,
|
||||||
svc_exit.code().unwrap_or(0)
|
None,
|
||||||
);
|
&mut [(443_u16, SocketAddr::from(([127, 0, 0, 1], 8443)))].iter(),
|
||||||
Ok(())
|
)
|
||||||
}
|
.await
|
||||||
|
.unwrap();
|
||||||
pub async fn restart() -> Result<(), Error> {
|
connection
|
||||||
// let path = PersistencePath::from_ref(crate::SERVICES_YAML);
|
.add_onion_v3(
|
||||||
let hidden_services = todo!(); //services_map(&path).await?;
|
&tor_key,
|
||||||
log::info!("Syncing Tor hidden services to {}.", ETC_TOR_RC);
|
false,
|
||||||
write_services(&hidden_services).await?;
|
false,
|
||||||
log::info!("Restarting Tor.");
|
false,
|
||||||
let svc_exit = std::process::Command::new("service")
|
None,
|
||||||
.args(&["tor", "restart"])
|
&mut [(8443_u16, SocketAddr::from(([127, 0, 0, 1], 8443)))].iter(),
|
||||||
.status()?;
|
)
|
||||||
crate::ensure_code!(
|
.await
|
||||||
svc_exit.success(),
|
.unwrap();
|
||||||
crate::ErrorKind::Tor,
|
|
||||||
"Failed to Restart Tor: {}",
|
|
||||||
svc_exit.code().unwrap_or(0)
|
|
||||||
);
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ use crate::dependencies::Dependencies;
|
|||||||
use crate::id::{Id, InterfaceId, InvalidId, SYSTEM_ID};
|
use crate::id::{Id, InterfaceId, InvalidId, SYSTEM_ID};
|
||||||
use crate::migration::Migrations;
|
use crate::migration::Migrations;
|
||||||
use crate::net::host::Hosts;
|
use crate::net::host::Hosts;
|
||||||
use crate::net::tor::HiddenServiceVersion;
|
|
||||||
use crate::status::health_check::{HealthCheckResult, HealthChecks};
|
use crate::status::health_check::{HealthCheckResult, HealthChecks};
|
||||||
use crate::util::Version;
|
use crate::util::Version;
|
||||||
use crate::volume::Volumes;
|
use crate::volume::Volumes;
|
||||||
@@ -33,6 +32,12 @@ impl FromStr for PackageId {
|
|||||||
Ok(PackageId(Id::try_from(s.to_owned())?))
|
Ok(PackageId(Id::try_from(s.to_owned())?))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
impl<S: AsRef<str>> std::ops::Deref for PackageId<S> {
|
||||||
|
type Target = S;
|
||||||
|
fn deref(&self) -> &Self::Target {
|
||||||
|
&*self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
impl<S: AsRef<str>> AsRef<PackageId<S>> for PackageId<S> {
|
impl<S: AsRef<str>> AsRef<PackageId<S>> for PackageId<S> {
|
||||||
fn as_ref(&self) -> &PackageId<S> {
|
fn as_ref(&self) -> &PackageId<S> {
|
||||||
self
|
self
|
||||||
@@ -129,7 +134,7 @@ pub struct Manifest {
|
|||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub struct Interfaces(IndexMap<InterfaceId, Interface>); // TODO
|
pub struct Interfaces(pub IndexMap<InterfaceId, Interface>); // TODO
|
||||||
impl Interfaces {
|
impl Interfaces {
|
||||||
pub async fn install(&self, ip: Ipv4Addr) -> Result<InterfaceInfo, Error> {
|
pub async fn install(&self, ip: Ipv4Addr) -> Result<InterfaceInfo, Error> {
|
||||||
todo!()
|
todo!()
|
||||||
@@ -139,37 +144,35 @@ impl Interfaces {
|
|||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub struct Interface {
|
pub struct Interface {
|
||||||
tor_config: Option<TorConfig>,
|
pub tor_config: Option<TorConfig>,
|
||||||
lan_config: Option<IndexMap<u16, LanPortConfig>>,
|
pub lan_config: Option<IndexMap<u16, LanPortConfig>>,
|
||||||
ui: bool,
|
pub ui: bool,
|
||||||
protocols: Vec<String>,
|
pub protocols: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub struct TorConfig {
|
pub struct TorConfig {
|
||||||
#[serde(default)]
|
pub port_mapping: IndexMap<u16, u16>,
|
||||||
hidden_service_version: HiddenServiceVersion,
|
|
||||||
port_mapping: IndexMap<u16, u16>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub struct LanPortConfig {
|
pub struct LanPortConfig {
|
||||||
ssl: bool,
|
pub ssl: bool,
|
||||||
mapping: u16,
|
pub mapping: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
pub struct Assets {
|
pub struct Assets {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
license: Option<PathBuf>,
|
pub license: Option<PathBuf>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
icon: Option<PathBuf>,
|
pub icon: Option<PathBuf>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
docker_images: Option<PathBuf>,
|
pub docker_images: Option<PathBuf>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
instructions: Option<PathBuf>,
|
pub instructions: Option<PathBuf>,
|
||||||
}
|
}
|
||||||
impl Assets {
|
impl Assets {
|
||||||
pub fn license_path(&self) -> &Path {
|
pub fn license_path(&self) -> &Path {
|
||||||
|
|||||||
@@ -798,6 +798,9 @@ pub fn parse_duration(arg: &str, matches: &ArgMatches<'_>) -> Result<Duration, E
|
|||||||
|
|
||||||
pub struct Container<T>(RwLock<Option<T>>);
|
pub struct Container<T>(RwLock<Option<T>>);
|
||||||
impl<T> Container<T> {
|
impl<T> Container<T> {
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Container(RwLock::new(None))
|
||||||
|
}
|
||||||
pub async fn set(&self, value: T) {
|
pub async fn set(&self, value: T) {
|
||||||
*self.0.write().await = Some(value);
|
*self.0.write().await = Some(value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user