mirror of
https://github.com/creating2morrow/neveko.git
synced 2024-12-22 19:49:24 +00:00
integrate embedded i2p with j4i2prs
This commit is contained in:
parent
efaf76da93
commit
b766faa81b
19 changed files with 702 additions and 355 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,5 +11,4 @@ notes.txt
|
||||||
*.bz2
|
*.bz2
|
||||||
*.zip
|
*.zip
|
||||||
*/monero-x86_64-linux-gnu-v0.18.3.3/**
|
*/monero-x86_64-linux-gnu-v0.18.3.3/**
|
||||||
*/i2p-zero-linux.v1.20/**
|
|
||||||
*.jar
|
*.jar
|
||||||
|
|
10
README.md
10
README.md
|
@ -19,7 +19,7 @@ NEVidebla-EKOnomia (invisible economy)
|
||||||
|
|
||||||
## Dev
|
## Dev
|
||||||
|
|
||||||
* stack - rust (egui, rocket), lmdb, i2p-zero, monero(rpc, daemon)
|
* stack - rust (egui, rocket), lmdb, i2p, monero(rpc, daemon)
|
||||||
* install dependencies
|
* install dependencies
|
||||||
* ubuntu example: `sudo apt update -y && sudo apt upgrade -y`
|
* ubuntu example: `sudo apt update -y && sudo apt upgrade -y`
|
||||||
* `sudo apt install -y libssl-dev build-essential`
|
* `sudo apt install -y libssl-dev build-essential`
|
||||||
|
@ -30,10 +30,10 @@ NEVidebla-EKOnomia (invisible economy)
|
||||||
* the `--monero-location` flag is needed even when using a remote node because
|
* the `--monero-location` flag is needed even when using a remote node because
|
||||||
neveko has its own monero-wallet-rpc instance
|
neveko has its own monero-wallet-rpc instance
|
||||||
* remote nodes are forced over the `--i2p-proxy-host`
|
* remote nodes are forced over the `--i2p-proxy-host`
|
||||||
* Recommended neveko-core startup with full node and i2p-zero locally running:
|
* Recommended neveko-core startup with full node:
|
||||||
* ` ./scripts/build_all_and_run.sh "-- --monero-blockchain-dir=/home/user/.bitmonero --monero-location monero-x86_64-linux-gnu-v0.18.3.3 --i2p-zero-dir /home/user/i2p-zero-linux.v1.21/ --monero-blockchain-dir /home/user/.bitmonero"`
|
* ` ./scripts/build_all_and_run.sh "-- --monero-blockchain-dir=/home/user/.bitmonero --monero-location monero-x86_64-linux-gnu-v0.18.3.3 --monero-blockchain-dir /home/user/.bitmonero"`
|
||||||
* monerod doesn't need to be running because neveko will start it and monero-wallet-rpc
|
* monerod doesn't need to be running because neveko will start it and monero-wallet-rpc
|
||||||
* gui will automatically detect monerod, rpc and i2p-zero if neveko core is started first
|
* gui will automatically detect monerod, rpc if neveko core is started first
|
||||||
* Neveko doesn't write logs to file. Use the command below to write to a log file:
|
* Neveko doesn't write logs to file. Use the command below to write to a log file:
|
||||||
```bash
|
```bash
|
||||||
{NEVEKO_START_CMDS} > neveko.log 2>&1
|
{NEVEKO_START_CMDS} > neveko.log 2>&1
|
||||||
|
@ -47,7 +47,6 @@ NEVidebla-EKOnomia (invisible economy)
|
||||||
|
|
||||||
* additional required software can be downloaded from the gui home or `Binaries` links below
|
* additional required software can be downloaded from the gui home or `Binaries` links below
|
||||||
* hashes are in core [lib.rs](./neveko-core/src/lib.rs)
|
* hashes are in core [lib.rs](./neveko-core/src/lib.rs)
|
||||||
* download i2p-zero, put the path in the connection manager or cli `--i2p-zero-dir` flag
|
|
||||||
* download monero, update connection manager or cli
|
* download monero, update connection manager or cli
|
||||||
* `--monero-blockchain-dir`, where to put lmdb for monero (e.g. path/to/ssd)
|
* `--monero-blockchain-dir`, where to put lmdb for monero (e.g. path/to/ssd)
|
||||||
* `--monero-location`, path to monero download
|
* `--monero-location`, path to monero download
|
||||||
|
@ -101,7 +100,6 @@ NEVidebla-EKOnomia (invisible economy)
|
||||||
* can be overriden with remote node
|
* can be overriden with remote node
|
||||||
* use the `--remote-node` flag
|
* use the `--remote-node` flag
|
||||||
* [monero-wallet-rpc](https://www.getmonero.org/downloads/#cli) - (not included) interface for xmr wallet ops
|
* [monero-wallet-rpc](https://www.getmonero.org/downloads/#cli) - (not included) interface for xmr wallet ops
|
||||||
* [i2p-zero](https://github.com/creating2morrow/i2p-zero/releases/tag/v1.21-neveko) - (not included) tunnel creation and http proxy
|
|
||||||
|
|
||||||
most of the complex logic stays in neveko-core, exported from [lib.rs](./neveko-core/src/lib.rs)
|
most of the complex logic stays in neveko-core, exported from [lib.rs](./neveko-core/src/lib.rs)
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 76f6ee1ff79bd2f9096d91e393dcd8c28968ca3d
|
Subproject commit e21f15f9366a8079ec0be61a96c1285db2d7d0e4
|
385
neveko-core/Cargo.lock
generated
385
neveko-core/Cargo.lock
generated
|
@ -17,7 +17,7 @@ version = "0.1.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
|
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -126,6 +126,15 @@ version = "0.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72"
|
checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bincode"
|
||||||
|
version = "1.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "1.3.2"
|
version = "1.3.2"
|
||||||
|
@ -174,6 +183,12 @@ version = "1.0.79"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
|
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cesu8"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
|
@ -280,7 +295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
|
checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -295,9 +310,34 @@ version = "0.2.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181"
|
checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crossbeam-deque"
|
||||||
|
version = "0.8.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
|
||||||
|
dependencies = [
|
||||||
|
"crossbeam-epoch",
|
||||||
|
"crossbeam-utils",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crossbeam-epoch"
|
||||||
|
version = "0.9.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e"
|
||||||
|
dependencies = [
|
||||||
|
"crossbeam-utils",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crossbeam-utils"
|
||||||
|
version = "0.8.20"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crypto-common"
|
name = "crypto-common"
|
||||||
version = "0.1.6"
|
version = "0.1.6"
|
||||||
|
@ -465,6 +505,12 @@ dependencies = [
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dunce"
|
||||||
|
version = "1.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "either"
|
name = "either"
|
||||||
version = "1.8.1"
|
version = "1.8.1"
|
||||||
|
@ -500,7 +546,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0"
|
checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"errno-dragonfly",
|
"errno-dragonfly",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"windows-sys 0.45.0",
|
"windows-sys 0.45.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -511,7 +557,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
|
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -573,6 +619,12 @@ dependencies = [
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fs_extra"
|
||||||
|
version = "1.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures"
|
name = "futures"
|
||||||
version = "0.3.27"
|
version = "0.3.27"
|
||||||
|
@ -581,6 +633,7 @@ checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
|
"futures-executor",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
"futures-task",
|
"futures-task",
|
||||||
|
@ -603,12 +656,34 @@ version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd"
|
checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-executor"
|
||||||
|
version = "0.3.27"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83"
|
||||||
|
dependencies = [
|
||||||
|
"futures-core",
|
||||||
|
"futures-task",
|
||||||
|
"futures-util",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-io"
|
name = "futures-io"
|
||||||
version = "0.3.27"
|
version = "0.3.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91"
|
checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-macro"
|
||||||
|
version = "0.3.27"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 1.0.109",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-sink"
|
name = "futures-sink"
|
||||||
version = "0.3.27"
|
version = "0.3.27"
|
||||||
|
@ -630,6 +705,7 @@ dependencies = [
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
|
"futures-macro",
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
"futures-task",
|
"futures-task",
|
||||||
"memchr",
|
"memchr",
|
||||||
|
@ -651,7 +727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "33a20a288a94683f5f4da0adecdbe095c94a77c295e514cc6484e9394dd8376e"
|
checksum = "33a20a288a94683f5f4da0adecdbe095c94a77c295e514cc6484e9394dd8376e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"log",
|
"log",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"windows 0.44.0",
|
"windows 0.44.0",
|
||||||
|
@ -674,7 +750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
|
checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -721,7 +797,7 @@ version = "0.2.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
|
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -889,7 +965,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb"
|
checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi 0.3.1",
|
"hermit-abi 0.3.1",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"windows-sys 0.45.0",
|
"windows-sys 0.45.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -917,6 +993,67 @@ version = "1.0.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
|
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "j4-i2p-rs"
|
||||||
|
version = "0.2.0-alpha"
|
||||||
|
dependencies = [
|
||||||
|
"hex",
|
||||||
|
"j4rs",
|
||||||
|
"log",
|
||||||
|
"rand",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "j4rs"
|
||||||
|
version = "0.20.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "689ae4f2bd4eba82601592f3d22b7e7147b1df52d3b525223f5218990501b4eb"
|
||||||
|
dependencies = [
|
||||||
|
"cesu8",
|
||||||
|
"dunce",
|
||||||
|
"fs_extra",
|
||||||
|
"futures",
|
||||||
|
"glob",
|
||||||
|
"java-locator",
|
||||||
|
"jni-sys",
|
||||||
|
"lazy_static 1.4.0",
|
||||||
|
"libc 0.2.158",
|
||||||
|
"libloading",
|
||||||
|
"log",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "java-locator"
|
||||||
|
version = "0.1.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d2abecabd9961c5e01405a6426687fcf1bd94a269927137e4c3cc1a7419b93fd"
|
||||||
|
dependencies = [
|
||||||
|
"glob",
|
||||||
|
"lazy_static 1.4.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "jni-sys"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c30a312d782b8d56a1e0897d45c1af33f31f9b4a4d13d31207a8675e0223b818"
|
||||||
|
dependencies = [
|
||||||
|
"jni-sys-macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "jni-sys-macros"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e6c199962dfd5610ced8eca382606e349f7940a4ac7d867b58a046123411cbb4"
|
||||||
|
dependencies = [
|
||||||
|
"quote",
|
||||||
|
"syn 1.0.109",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.61"
|
version = "0.3.61"
|
||||||
|
@ -948,7 +1085,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "29e0b46b27729cc3238baa573fe2f4df74af76ad1fdb576ff9ccabb97ecf756c"
|
checksum = "29e0b46b27729cc3238baa573fe2f4df74af76ad1fdb576ff9ccabb97ecf756c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.6.0",
|
"bitflags 2.6.0",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"liblmdb-sys",
|
"liblmdb-sys",
|
||||||
"log",
|
"log",
|
||||||
]
|
]
|
||||||
|
@ -973,9 +1110,9 @@ checksum = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.140"
|
version = "0.2.158"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c"
|
checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "liblmdb-sys"
|
name = "liblmdb-sys"
|
||||||
|
@ -984,7 +1121,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "feed38a3a580f60bf61aaa067b0ff4123395966839adeaf67258a9e50c4d2e49"
|
checksum = "feed38a3a580f60bf61aaa067b0ff4123395966839adeaf67258a9e50c4d2e49"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gcc",
|
"gcc",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libloading"
|
||||||
|
version = "0.8.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1071,7 +1218,7 @@ version = "0.8.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
|
checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"log",
|
"log",
|
||||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||||
"windows-sys 0.45.0",
|
"windows-sys 0.45.0",
|
||||||
|
@ -1104,7 +1251,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e"
|
checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static 1.4.0",
|
"lazy_static 1.4.0",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"log",
|
"log",
|
||||||
"openssl",
|
"openssl",
|
||||||
"openssl-probe",
|
"openssl-probe",
|
||||||
|
@ -1119,6 +1266,7 @@ dependencies = [
|
||||||
name = "neveko_core"
|
name = "neveko_core"
|
||||||
version = "0.1.2-beta"
|
version = "0.1.2-beta"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"bincode",
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap",
|
"clap",
|
||||||
"curve25519-dalek",
|
"curve25519-dalek",
|
||||||
|
@ -1126,6 +1274,7 @@ dependencies = [
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"hex",
|
"hex",
|
||||||
"hmac",
|
"hmac",
|
||||||
|
"j4-i2p-rs",
|
||||||
"jwt",
|
"jwt",
|
||||||
"kn0sys-lmdb-rs",
|
"kn0sys-lmdb-rs",
|
||||||
"lazy_static 1.4.0",
|
"lazy_static 1.4.0",
|
||||||
|
@ -1140,9 +1289,20 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2 0.10.6",
|
"sha2 0.10.6",
|
||||||
|
"sysinfo",
|
||||||
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ntapi"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4"
|
||||||
|
dependencies = [
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-ansi-term"
|
name = "nu-ansi-term"
|
||||||
version = "0.46.0"
|
version = "0.46.0"
|
||||||
|
@ -1242,7 +1402,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
|
checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi 0.2.6",
|
"hermit-abi 0.2.6",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1266,7 +1426,7 @@ dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"foreign-types",
|
"foreign-types",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"openssl-macros",
|
"openssl-macros",
|
||||||
"openssl-sys",
|
"openssl-sys",
|
||||||
|
@ -1297,7 +1457,7 @@ checksum = "666416d899cf077260dac8698d60a60b435a46d57e82acb1be3d0dad87284e5b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"cc",
|
"cc",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
"vcpkg",
|
"vcpkg",
|
||||||
]
|
]
|
||||||
|
@ -1325,7 +1485,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
|
checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"redox_syscall 0.2.16",
|
"redox_syscall 0.2.16",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"windows-sys 0.45.0",
|
"windows-sys 0.45.0",
|
||||||
|
@ -1427,7 +1587,7 @@ version = "0.8.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"rand_chacha",
|
"rand_chacha",
|
||||||
"rand_core",
|
"rand_core",
|
||||||
]
|
]
|
||||||
|
@ -1451,6 +1611,26 @@ dependencies = [
|
||||||
"getrandom",
|
"getrandom",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rayon"
|
||||||
|
version = "1.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
"rayon-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rayon-core"
|
||||||
|
version = "1.12.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2"
|
||||||
|
dependencies = [
|
||||||
|
"crossbeam-deque",
|
||||||
|
"crossbeam-utils",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "redox_syscall"
|
name = "redox_syscall"
|
||||||
version = "0.2.16"
|
version = "0.2.16"
|
||||||
|
@ -1662,7 +1842,7 @@ dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"errno",
|
"errno",
|
||||||
"io-lifetimes",
|
"io-lifetimes",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys",
|
||||||
"windows-sys 0.45.0",
|
"windows-sys 0.45.0",
|
||||||
]
|
]
|
||||||
|
@ -1724,7 +1904,7 @@ dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"core-foundation",
|
"core-foundation",
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"security-framework-sys",
|
"security-framework-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1735,7 +1915,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4"
|
checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"core-foundation-sys",
|
"core-foundation-sys",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1826,7 +2006,7 @@ version = "1.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
|
checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1850,7 +2030,7 @@ version = "0.4.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662"
|
checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1912,6 +2092,20 @@ dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sysinfo"
|
||||||
|
version = "0.31.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be"
|
||||||
|
dependencies = [
|
||||||
|
"core-foundation-sys",
|
||||||
|
"libc 0.2.158",
|
||||||
|
"memchr",
|
||||||
|
"ntapi",
|
||||||
|
"rayon",
|
||||||
|
"windows 0.57.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "3.5.0"
|
version = "3.5.0"
|
||||||
|
@ -1943,6 +2137,26 @@ dependencies = [
|
||||||
"libc 0.1.12",
|
"libc 0.1.12",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thiserror"
|
||||||
|
version = "1.0.63"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
|
||||||
|
dependencies = [
|
||||||
|
"thiserror-impl",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "thiserror-impl"
|
||||||
|
version = "1.0.63"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.58",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thread_local"
|
name = "thread_local"
|
||||||
version = "1.1.7"
|
version = "1.1.7"
|
||||||
|
@ -1959,7 +2173,7 @@ version = "0.1.45"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
|
checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"wasi 0.10.0+wasi-snapshot-preview1",
|
"wasi 0.10.0+wasi-snapshot-preview1",
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
@ -2018,7 +2232,7 @@ checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"bytes",
|
"bytes",
|
||||||
"libc 0.2.140",
|
"libc 0.2.158",
|
||||||
"mio",
|
"mio",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
|
@ -2397,6 +2611,59 @@ dependencies = [
|
||||||
"windows-targets 0.47.0",
|
"windows-targets 0.47.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows"
|
||||||
|
version = "0.57.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"
|
||||||
|
dependencies = [
|
||||||
|
"windows-core",
|
||||||
|
"windows-targets 0.52.6",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-core"
|
||||||
|
version = "0.57.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d"
|
||||||
|
dependencies = [
|
||||||
|
"windows-implement",
|
||||||
|
"windows-interface",
|
||||||
|
"windows-result",
|
||||||
|
"windows-targets 0.52.6",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-implement"
|
||||||
|
version = "0.57.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.58",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-interface"
|
||||||
|
version = "0.57.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.58",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-result"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets 0.52.6",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
version = "0.42.0"
|
version = "0.42.0"
|
||||||
|
@ -2451,6 +2718,22 @@ dependencies = [
|
||||||
"windows_x86_64_msvc 0.47.0",
|
"windows_x86_64_msvc 0.47.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-targets"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||||
|
dependencies = [
|
||||||
|
"windows_aarch64_gnullvm 0.52.6",
|
||||||
|
"windows_aarch64_msvc 0.52.6",
|
||||||
|
"windows_i686_gnu 0.52.6",
|
||||||
|
"windows_i686_gnullvm",
|
||||||
|
"windows_i686_msvc 0.52.6",
|
||||||
|
"windows_x86_64_gnu 0.52.6",
|
||||||
|
"windows_x86_64_gnullvm 0.52.6",
|
||||||
|
"windows_x86_64_msvc 0.52.6",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_gnullvm"
|
name = "windows_aarch64_gnullvm"
|
||||||
version = "0.42.2"
|
version = "0.42.2"
|
||||||
|
@ -2463,6 +2746,12 @@ version = "0.47.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "831d567d53d4f3cb1db332b68e6e2b6260228eb4d99a777d8b2e8ed794027c90"
|
checksum = "831d567d53d4f3cb1db332b68e6e2b6260228eb4d99a777d8b2e8ed794027c90"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_gnullvm"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.42.2"
|
version = "0.42.2"
|
||||||
|
@ -2475,6 +2764,12 @@ version = "0.47.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6a42d54a417c60ce4f0e31661eed628f0fa5aca73448c093ec4d45fab4c51cdf"
|
checksum = "6a42d54a417c60ce4f0e31661eed628f0fa5aca73448c093ec4d45fab4c51cdf"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_msvc"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.42.2"
|
version = "0.42.2"
|
||||||
|
@ -2487,6 +2782,18 @@ version = "0.47.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c1925beafdbb22201a53a483db861a5644123157c1c3cee83323a2ed565d71e3"
|
checksum = "c1925beafdbb22201a53a483db861a5644123157c1c3cee83323a2ed565d71e3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_gnu"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_gnullvm"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.42.2"
|
version = "0.42.2"
|
||||||
|
@ -2499,6 +2806,12 @@ version = "0.47.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3a8ef8f2f1711b223947d9b69b596cf5a4e452c930fb58b6fc3fdae7d0ec6b31"
|
checksum = "3a8ef8f2f1711b223947d9b69b596cf5a4e452c930fb58b6fc3fdae7d0ec6b31"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_msvc"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.42.2"
|
version = "0.42.2"
|
||||||
|
@ -2511,6 +2824,12 @@ version = "0.47.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7acaa0c2cf0d2ef99b61c308a0c3dbae430a51b7345dedec470bd8f53f5a3642"
|
checksum = "7acaa0c2cf0d2ef99b61c308a0c3dbae430a51b7345dedec470bd8f53f5a3642"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnu"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnullvm"
|
name = "windows_x86_64_gnullvm"
|
||||||
version = "0.42.2"
|
version = "0.42.2"
|
||||||
|
@ -2523,6 +2842,12 @@ version = "0.47.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e5a0628f71be1d11e17ca4a0e9e15b3a5180f6fbf1c2d55e3ba3f850378052c1"
|
checksum = "e5a0628f71be1d11e17ca4a0e9e15b3a5180f6fbf1c2d55e3ba3f850378052c1"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnullvm"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.42.2"
|
version = "0.42.2"
|
||||||
|
@ -2535,6 +2860,12 @@ version = "0.47.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9d6e62c256dc6d40b8c8707df17df8d774e60e39db723675241e7c15e910bce7"
|
checksum = "9d6e62c256dc6d40b8c8707df17df8d774e60e39db723675241e7c15e910bce7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_msvc"
|
||||||
|
version = "0.52.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winreg"
|
name = "winreg"
|
||||||
version = "0.10.1"
|
version = "0.10.1"
|
||||||
|
|
|
@ -17,7 +17,7 @@ pub struct Args {
|
||||||
#[arg(
|
#[arg(
|
||||||
long,
|
long,
|
||||||
help = "Monero download absolute path.",
|
help = "Monero download absolute path.",
|
||||||
default_value = "monero-x86_64-linux-gnu-v0.18.3.3"
|
default_value = "monero-x86_64-linux-gnu-v0.18.3.4"
|
||||||
)]
|
)]
|
||||||
pub monero_location: String,
|
pub monero_location: String,
|
||||||
/// Monero RPC host
|
/// Monero RPC host
|
||||||
|
@ -142,7 +142,7 @@ pub struct Args {
|
||||||
default_value = "/home/user/neveko/i2p-manual"
|
default_value = "/home/user/neveko/i2p-manual"
|
||||||
)]
|
)]
|
||||||
pub i2p_tunnels_json: String,
|
pub i2p_tunnels_json: String,
|
||||||
/// Dummy flag for normal neveko i2p-zero config. Future use.
|
/// Dummy flag for normal neveko i2p config. Future use.
|
||||||
#[arg(
|
#[arg(
|
||||||
long,
|
long,
|
||||||
help = "Normal mode. Neveko will handle i2p proxy tunnels and identity.",
|
help = "Normal mode. Neveko will handle i2p proxy tunnels and identity.",
|
||||||
|
|
|
@ -274,11 +274,13 @@ impl<'r> FromRequest<'r> for BearerToken {
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use crate::error::NevekoError;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
fn find_test_auth(k: &String) -> Result<Authorization, MdbError> {
|
fn find_test_auth(k: &String) -> Result<Authorization, MdbError> {
|
||||||
let s: db::Interface = db::DatabaseEnvironment::open()?;
|
let db = &DATABASE_LOCK;
|
||||||
let v = db::DatabaseEnvironment::read(&db.env, &s.handle, &k.as_bytes().to_vec())?;
|
let v = db::DatabaseEnvironment::read(&db.env, &db.handle, &k.as_bytes().to_vec())?;
|
||||||
let result: Authorization = bincode::deserialize(&v[..]).unwrap_or_default();
|
let result: Authorization = bincode::deserialize(&v[..]).unwrap_or_default();
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
@ -290,16 +292,17 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn create_test() {
|
fn create_test() -> Result<(), MdbError> {
|
||||||
use tokio::runtime::Runtime;
|
use tokio::runtime::Runtime;
|
||||||
let rt = Runtime::new().expect("Unable to create Runtime for test");
|
let rt = Runtime::new().expect("Unable to create Runtime for test");
|
||||||
let _enter = rt.enter();
|
let _enter = rt.enter();
|
||||||
let address: String = String::from(
|
let address: String = String::from(
|
||||||
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
||||||
);
|
);
|
||||||
let test_auth = create(&address);
|
let test_auth = create(&address)?;
|
||||||
assert_eq!(test_auth.xmr_address, address);
|
assert_eq!(test_auth.xmr_address, address);
|
||||||
cleanup(&test_auth.aid);
|
let _ = cleanup(&test_auth.aid);
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -307,32 +310,34 @@ mod tests {
|
||||||
let address: String = String::from(
|
let address: String = String::from(
|
||||||
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
||||||
);
|
);
|
||||||
let test_auth = create(&address);
|
let test_auth = create(&address)?;
|
||||||
let aid = String::from(&test_auth.aid);
|
let aid = String::from(&test_auth.aid);
|
||||||
let f_auth: Authorization = find_test_auth(&aid);
|
let f_auth: Authorization = find_test_auth(&aid)?;
|
||||||
assert_ne!(f_auth.xmr_address, address);
|
assert_eq!(f_auth.xmr_address, address);
|
||||||
cleanup(&test_auth.aid);
|
cleanup(&test_auth.aid)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn update_expiration_test() {
|
fn update_expiration_test() -> Result<(), MdbError> {
|
||||||
let address: String = String::from(
|
let address: String = String::from(
|
||||||
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
||||||
);
|
);
|
||||||
let test_auth = create(&address);
|
let test_auth = create(&address)?;
|
||||||
let aid = String::from(&test_auth.aid);
|
let aid = String::from(&test_auth.aid);
|
||||||
let f_auth = find_test_auth(&aid);
|
let f_auth = find_test_auth(&aid)?;
|
||||||
let u_auth = update_expiration(&f_auth, &address);
|
std::thread::sleep(std::time::Duration::from_secs(1));
|
||||||
|
let u_auth = update_expiration(&f_auth, &address)?;
|
||||||
assert!(f_auth.created < u_auth.created);
|
assert!(f_auth.created < u_auth.created);
|
||||||
cleanup(&test_auth.aid);
|
let _ = cleanup(&test_auth.aid)?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn create_token_test() {
|
fn create_token_test() -> Result<(), NevekoError> {
|
||||||
let test_value = "test";
|
let test_value = "test";
|
||||||
let test_jwt = create_token(String::from(test_value), 0);
|
let test_jwt = create_token(String::from(test_value), 0);
|
||||||
let jwt_secret_key = utils::get_jwt_secret_key();
|
let jwt_secret_key = utils::get_jwt_secret_key().unwrap_or_default();
|
||||||
let key: Hmac<Sha384> = Hmac::new_from_slice(&jwt_secret_key.as_bytes()).expect("");
|
let key: Hmac<Sha384> = Hmac::new_from_slice(&jwt_secret_key.as_bytes()).expect("");
|
||||||
let jwt: Result<
|
let jwt: Result<
|
||||||
Token<jwt::Header, BTreeMap<std::string::String, std::string::String>, _>,
|
Token<jwt::Header, BTreeMap<std::string::String, std::string::String>, _>,
|
||||||
|
@ -346,6 +351,7 @@ mod tests {
|
||||||
assert_eq!(expected, actual);
|
assert_eq!(expected, actual);
|
||||||
}
|
}
|
||||||
Err(_) => error!("create_token_test error"),
|
Err(_) => error!("create_token_test error"),
|
||||||
}
|
};
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ pub async fn share() -> Result<Contact, NevekoError> {
|
||||||
let m_address: reqres::XmrRpcAddressResponse = monero::get_address().await;
|
let m_address: reqres::XmrRpcAddressResponse = monero::get_address().await;
|
||||||
monero::close_wallet(&wallet_name, &wallet_password).await;
|
monero::close_wallet(&wallet_name, &wallet_password).await;
|
||||||
let nmpk = utils::get_nmpk()?;
|
let nmpk = utils::get_nmpk()?;
|
||||||
let i2p_address = i2p::get_destination(None);
|
let i2p_address = i2p::get_destination(i2p::ServerTunnelType::App)?;
|
||||||
let xmr_address = m_address.result.address;
|
let xmr_address = m_address.result.address;
|
||||||
Ok(Contact {
|
Ok(Contact {
|
||||||
cid: String::new(),
|
cid: String::new(),
|
||||||
|
@ -221,9 +221,10 @@ pub async fn add_contact_request(contact: String) -> Result<Contact, Box<dyn Err
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
fn cleanup(k: &String) {
|
fn cleanup(k: &String) -> Result<(), MdbError> {
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
let _ = db::DatabaseEnvironment::delete(&db.env, &s.handle, k)?;
|
let _ = db::DatabaseEnvironment::delete(&db.env, &db.handle, k.as_bytes())?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -244,7 +245,7 @@ mod tests {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let test_contact = create(&j_contact).await;
|
let test_contact = create(&j_contact).await;
|
||||||
let expected: Contact = Default::default();
|
let expected: Contact = Default::default();
|
||||||
assert_eq!(test_contact.xmr_address, expected.xmr_address);
|
assert_eq!(test_contact.unwrap_or_default().xmr_address, expected.xmr_address);
|
||||||
});
|
});
|
||||||
Runtime::shutdown_background(rt);
|
Runtime::shutdown_background(rt);
|
||||||
}
|
}
|
||||||
|
@ -266,10 +267,10 @@ mod tests {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
let v = bincode::serialize(&expected_contact).unwrap_or_default();
|
let v = bincode::serialize(&expected_contact).unwrap_or_default();
|
||||||
db::write_chunks(&db.env, &db.handle, k.as_bytes(), &v);
|
let _ = db::write_chunks(&db.env, &db.handle, k.as_bytes(), &v);
|
||||||
let actual_contact: Contact = find(&String::from(k));
|
let actual_contact: Contact = find(&String::from(k)).unwrap_or_default();
|
||||||
assert_eq!(expected_contact.xmr_address, actual_contact.xmr_address);
|
assert_eq!(expected_contact.xmr_address, actual_contact.xmr_address);
|
||||||
cleanup(&String::from(k));
|
let _ = cleanup(&String::from(k));
|
||||||
});
|
});
|
||||||
Runtime::shutdown_background(rt);
|
Runtime::shutdown_background(rt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,7 +196,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn environment_test() -> Result<(), MdbError> {
|
fn environment_test() -> Result<(), MdbError> {
|
||||||
let db: DatabaseEnvironment = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
const DATA_SIZE_10MB: usize = 10000000;
|
const DATA_SIZE_10MB: usize = 10000000;
|
||||||
let mut data = vec![0u8; DATA_SIZE_10MB];
|
let mut data = vec![0u8; DATA_SIZE_10MB];
|
||||||
rand::thread_rng().fill_bytes(&mut data);
|
rand::thread_rng().fill_bytes(&mut data);
|
||||||
|
|
|
@ -1,27 +1,46 @@
|
||||||
//! TODO: replace i2p-zero with i2pd bindings
|
//! embedded i2p module
|
||||||
|
|
||||||
use crate::{
|
use std::{thread,fs::File, io::{self, BufRead}, path::Path};
|
||||||
args,
|
use j4i2prs::router_wrapper as rw;
|
||||||
utils,
|
use j4i2prs::tunnel_control as tc;
|
||||||
};
|
use kn0sys_lmdb_rs::MdbError;
|
||||||
use clap::Parser;
|
use log::*;
|
||||||
use log::{
|
|
||||||
debug,
|
|
||||||
info,
|
|
||||||
warn,
|
|
||||||
};
|
|
||||||
use serde::{
|
use serde::{
|
||||||
Deserialize,
|
Deserialize,
|
||||||
Serialize,
|
Serialize,
|
||||||
};
|
};
|
||||||
use std::{
|
use std::sync::mpsc::{
|
||||||
env,
|
Receiver,
|
||||||
fs,
|
Sender,
|
||||||
process::Command,
|
};
|
||||||
time::Duration,
|
use crate::{
|
||||||
|
db::{self, DATABASE_LOCK}, error::NevekoError, monero::get_anon_inbound_port, utils, DEFAULT_APP_PORT, DEFAULT_SOCKS_PORT
|
||||||
};
|
};
|
||||||
|
|
||||||
const TODO: &str = "test";
|
struct Listener {
|
||||||
|
is_running: bool,
|
||||||
|
run_tx: Sender<bool>,
|
||||||
|
run_rx: Receiver<bool>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for Listener {
|
||||||
|
fn default() -> Self {
|
||||||
|
let is_running = false;
|
||||||
|
let (run_tx, run_rx) = std::sync::mpsc::channel();
|
||||||
|
Listener {
|
||||||
|
is_running,
|
||||||
|
run_tx,
|
||||||
|
run_rx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// https://doc.rust-lang.org/rust-by-example/std_misc/file/read_lines.html
|
||||||
|
fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>>
|
||||||
|
where P: AsRef<Path>, {
|
||||||
|
let file = File::open(filename)?;
|
||||||
|
Ok(io::BufReader::new(file).lines())
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize, Serialize)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub struct HttpProxyStatus {
|
pub struct HttpProxyStatus {
|
||||||
|
@ -43,134 +62,11 @@ impl ProxyStatus {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
|
||||||
struct Tunnel {
|
|
||||||
// http proxy tunnel wont have this field
|
|
||||||
dest: Option<String>,
|
|
||||||
port: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
|
||||||
#[derive(Default)]
|
|
||||||
struct Tunnels {
|
|
||||||
tunnels: Vec<Tunnel>,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Looks for the `tunnels-config.json` at /home/$USER/.i2p-zero/config/
|
|
||||||
///
|
|
||||||
/// and attempts to extract the app and http proxy tunnel information.
|
|
||||||
async fn find_tunnels() {
|
|
||||||
let args = args::Args::parse();
|
|
||||||
let app_port = utils::get_app_port();
|
|
||||||
let file_path = format!(
|
|
||||||
"/home/{}/.i2p-zero/config/tunnels.json",
|
|
||||||
env::var("USER").unwrap_or(String::from("user"))
|
|
||||||
);
|
|
||||||
let contents = fs::read_to_string(file_path).unwrap_or(String::new());
|
|
||||||
debug!("i2p tunnels: {}", contents);
|
|
||||||
let has_app_tunnel = contents.contains(&format!("{}", app_port));
|
|
||||||
let proxy_port = get_i2p_proxy_port();
|
|
||||||
let socks_proxy_port = get_i2p_socks_proxy_port();
|
|
||||||
let has_http_tunnel = contents.contains(&proxy_port);
|
|
||||||
let has_socks_proxy_tunnel = contents.contains(&socks_proxy_port.to_string());
|
|
||||||
let has_anon_inbound_tunnel = contents.contains(&format!("{}", args.anon_inbound_port));
|
|
||||||
if !has_app_tunnel || !has_http_tunnel || !has_anon_inbound_tunnel || !has_socks_proxy_tunnel {
|
|
||||||
tokio::time::sleep(Duration::new(120, 0)).await;
|
|
||||||
}
|
|
||||||
if !has_app_tunnel {
|
|
||||||
debug!("creating app tunnel");
|
|
||||||
create_tunnel();
|
|
||||||
}
|
|
||||||
if !has_http_tunnel {
|
|
||||||
debug!("creating http tunnel");
|
|
||||||
create_http_proxy();
|
|
||||||
}
|
|
||||||
if !has_anon_inbound_tunnel {
|
|
||||||
debug!("creating anon inbound tunnel");
|
|
||||||
create_anon_inbound_tunnel();
|
|
||||||
}
|
|
||||||
if !has_socks_proxy_tunnel {
|
|
||||||
debug!("creating socks proxy tunnel");
|
|
||||||
create_socks_proxy_tunnel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Called on application startup for i2p tunnel creation,
|
|
||||||
///
|
|
||||||
/// proxy tunnel, etc. Logs proxy status every 10 minutes.
|
|
||||||
pub async fn start() {
|
|
||||||
info!("starting i2p-zero");
|
|
||||||
let path = TODO;
|
|
||||||
let output = Command::new(format!("{}/router/bin/i2p-zero", path)).spawn();
|
|
||||||
match output {
|
|
||||||
Ok(child) => debug!("{:?}", child.stdout),
|
|
||||||
_ => {
|
|
||||||
warn!("i2p-zero not installed, manual tunnel creation required");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
find_tunnels().await;
|
|
||||||
{
|
|
||||||
tokio::spawn(async move {
|
|
||||||
let tick: std::sync::mpsc::Receiver<()> =
|
|
||||||
schedule_recv::periodic_ms(crate::I2P_CONNECTIVITY_CHECK_INTERVAL);
|
|
||||||
loop {
|
|
||||||
tick.recv().unwrap();
|
|
||||||
check_connection().await;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create an i2p tunnel for the NEVEKO application
|
|
||||||
fn create_tunnel() {
|
|
||||||
info!("creating tunnel");
|
|
||||||
let path = TODO;
|
|
||||||
let output = Command::new(format!("{}/router/bin/tunnel-control.sh", path))
|
|
||||||
.args([
|
|
||||||
"server.create",
|
|
||||||
"127.0.0.1",
|
|
||||||
&format!("{}", utils::get_app_port()),
|
|
||||||
])
|
|
||||||
.spawn()
|
|
||||||
.expect("i2p-zero failed to create a app tunnel");
|
|
||||||
debug!("{:?}", output.stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create an i2p tunnel for the monero wallet socks proxy
|
|
||||||
fn create_socks_proxy_tunnel() {
|
|
||||||
info!("creating monerod socks proxy tunnel");
|
|
||||||
let path = TODO;
|
|
||||||
let output = Command::new(format!("{}/router/bin/tunnel-control.sh", path))
|
|
||||||
.args(["socks.create", &get_i2p_socks_proxy_port().to_string()])
|
|
||||||
.spawn()
|
|
||||||
.expect("i2p-zero failed to create a socks proxy tunnel");
|
|
||||||
debug!("{:?}", output.stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create an i2p tunnel for the monero tx proxy
|
|
||||||
fn create_anon_inbound_tunnel() {
|
|
||||||
info!("creating monerod anon inbound proxy tunnel");
|
|
||||||
let args = args::Args::parse();
|
|
||||||
let path = TODO;
|
|
||||||
let output = Command::new(format!("{}/router/bin/tunnel-control.sh", path))
|
|
||||||
.args([
|
|
||||||
"server.create",
|
|
||||||
"127.0.0.1",
|
|
||||||
&format!("{}", args.anon_inbound_port),
|
|
||||||
])
|
|
||||||
.spawn()
|
|
||||||
.expect("i2p-zero failed to create a anon inbound tunnel");
|
|
||||||
debug!("{:?}", output.stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Extract i2p port from command line arg
|
/// Extract i2p port from command line arg
|
||||||
fn get_i2p_proxy_port() -> String {
|
fn get_i2p_proxy_port() -> String {
|
||||||
let proxy_host = utils::get_i2p_http_proxy();
|
let proxy_host = utils::get_i2p_http_proxy();
|
||||||
let values = proxy_host.split(":");
|
let values = proxy_host.split(":");
|
||||||
let mut v: Vec<String> = values.map(String::from).collect();
|
let mut v: Vec<String> = values.map(String::from).collect();
|
||||||
|
|
||||||
v.remove(2)
|
v.remove(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,79 +75,210 @@ fn get_i2p_socks_proxy_port() -> String {
|
||||||
let proxy_host = utils::get_i2p_wallet_proxy_host();
|
let proxy_host = utils::get_i2p_wallet_proxy_host();
|
||||||
let values = proxy_host.split(":");
|
let values = proxy_host.split(":");
|
||||||
let mut v: Vec<String> = values.map(String::from).collect();
|
let mut v: Vec<String> = values.map(String::from).collect();
|
||||||
|
|
||||||
v.remove(2)
|
v.remove(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create the http proxy if it doesn't exist
|
|
||||||
fn create_http_proxy() {
|
|
||||||
let path = TODO;
|
|
||||||
info!("creating http proxy");
|
|
||||||
let port = get_i2p_proxy_port();
|
|
||||||
let output = Command::new(format!("{}/router/bin/tunnel-control.sh", path))
|
|
||||||
.args(["http.create", &port])
|
|
||||||
.spawn()
|
|
||||||
.expect("i2p-zero failed to create a http proxy");
|
|
||||||
debug!("{:?}", output.stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This is the `dest` value of the app i2p tunnels
|
/// This is the `dest` value of the app i2p tunnels
|
||||||
///
|
///
|
||||||
/// in `tunnels-config.json`.
|
/// `st` - ServerTunnelType (App or AnonInbound)
|
||||||
///
|
pub fn get_destination(st: ServerTunnelType) -> Result<String, NevekoError> {
|
||||||
/// `port` - the port of the tunnel (e.g. `utils::get_app_port()`)
|
let db = &DATABASE_LOCK;
|
||||||
pub fn get_destination(port: Option<u16>) -> String {
|
let r_anon_b32_dest = db::DatabaseEnvironment::read(
|
||||||
let mut file_path = format!(
|
&db.env,
|
||||||
"/home/{}/.i2p-zero/config/tunnels.json",
|
&db.handle,
|
||||||
env::var("USER").unwrap_or(String::from("user"))
|
&crate::APP_ANON_IN_B32_DEST.as_bytes().to_vec(),
|
||||||
);
|
).map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
||||||
let args = args::Args::parse();
|
let r_app_b32_dest = db::DatabaseEnvironment::read(
|
||||||
let is_advanced_mode =
|
&db.env,
|
||||||
std::env::var(crate::NEVEKO_I2P_ADVANCED_MODE).unwrap_or(String::new());
|
&db.handle,
|
||||||
if args.i2p_advanced || is_advanced_mode == *"1" {
|
&crate::APP_I2P_SK.as_bytes().to_vec(),
|
||||||
let advanced_tunnel =
|
).map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
||||||
std::env::var(crate::NEVEKO_I2P_TUNNELS_JSON).unwrap_or(String::new());
|
let anon_b32_dest: String = bincode::deserialize(&r_anon_b32_dest[..]).unwrap_or_default();
|
||||||
let manual_tunnel = if advanced_tunnel.is_empty() {
|
let app_b32_dest: String = bincode::deserialize(&&r_app_b32_dest[..]).unwrap_or_default();
|
||||||
args.i2p_tunnels_json
|
match st {
|
||||||
} else {
|
ServerTunnelType::App => Ok(app_b32_dest),
|
||||||
advanced_tunnel
|
ServerTunnelType::AnonInbound => Ok(anon_b32_dest)
|
||||||
};
|
|
||||||
file_path = format!("{}/tunnels.json", manual_tunnel);
|
|
||||||
}
|
}
|
||||||
// Don't panic if i2p-zero isn't installed
|
|
||||||
let contents = match fs::read_to_string(file_path) {
|
|
||||||
Ok(file) => file,
|
|
||||||
_ => String::new(),
|
|
||||||
};
|
|
||||||
if !contents.is_empty() {
|
|
||||||
let input = contents.to_string();
|
|
||||||
let j: Tunnels = serde_json::from_str(&input).unwrap_or(Default::default());
|
|
||||||
let mut destination: String = String::new();
|
|
||||||
let tunnels: Vec<Tunnel> = j.tunnels;
|
|
||||||
for tunnel in tunnels {
|
|
||||||
if tunnel.port == format!("{}", port.unwrap_or(utils::get_app_port())) {
|
|
||||||
destination = tunnel.dest.unwrap_or(String::new());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return destination;
|
|
||||||
}
|
|
||||||
String::new()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Ping the i2p-zero http proxy `tunnel-control http.state <port>`
|
/// Ping our base 32 destination address over the http proxy
|
||||||
pub async fn check_connection() -> ProxyStatus {
|
pub async fn check_connection() -> Result<ProxyStatus, NevekoError> {
|
||||||
let path = TODO;
|
let host = utils::get_i2p_http_proxy();
|
||||||
let port = get_i2p_proxy_port();
|
let proxy = reqwest::Proxy::http(&host).map_err(|_| NevekoError::I2P)?;
|
||||||
let output = Command::new(format!("{}/router/bin/tunnel-control.sh", path))
|
let client = reqwest::Client::builder().proxy(proxy).build();
|
||||||
.args(["http.state", &port])
|
let b32_dest = get_destination(ServerTunnelType::App)?;
|
||||||
.output()
|
match client.map_err(|_| NevekoError::I2P)?
|
||||||
.expect("check i2p connection failed");
|
.get(format!("http://{}/status", b32_dest))
|
||||||
let str_status = String::from_utf8(output.stdout).unwrap();
|
.send()
|
||||||
if str_status == ProxyStatus::Open.value() {
|
.await
|
||||||
debug!("http proxy is open");
|
{
|
||||||
ProxyStatus::Open
|
Ok(response) => {
|
||||||
} else {
|
let res = response.json::<HttpProxyStatus>().await;
|
||||||
debug!("http proxy is opening");
|
debug!("check_connection response: {:?}", res);
|
||||||
ProxyStatus::Opening
|
return match res {
|
||||||
|
Ok(r) => if r.open { Ok(ProxyStatus::Open) } else { Ok(ProxyStatus::Opening) },
|
||||||
|
_ => Err(NevekoError::I2P),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
error!("failed to generate invoice due to: {:?}", e);
|
||||||
|
return Err(NevekoError::I2P);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(PartialEq)]
|
||||||
|
pub enum ServerTunnelType {
|
||||||
|
App,
|
||||||
|
AnonInbound,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create app and anon inbound server tunnels if they don't exist yet
|
||||||
|
fn create_server_tunnel(st: ServerTunnelType) -> Result<tc::Tunnel, NevekoError> {
|
||||||
|
let port: u16 = if st == ServerTunnelType::App {
|
||||||
|
utils::get_app_port()
|
||||||
|
} else {
|
||||||
|
get_anon_inbound_port()
|
||||||
|
};
|
||||||
|
let b32_key = if st == ServerTunnelType::App {
|
||||||
|
crate::APP_B32_DEST.as_bytes()
|
||||||
|
} else {
|
||||||
|
crate::APP_ANON_IN_B32_DEST.as_bytes()
|
||||||
|
};
|
||||||
|
let sk_key = if st == ServerTunnelType::App {
|
||||||
|
crate::APP_I2P_SK.as_bytes()
|
||||||
|
} else {
|
||||||
|
crate::APP_ANON_IN_SK.as_bytes()
|
||||||
|
};
|
||||||
|
let db = &DATABASE_LOCK;
|
||||||
|
let tunnel: tc::Tunnel = tc::Tunnel::new(
|
||||||
|
"127.0.0.1".to_string(),
|
||||||
|
port,
|
||||||
|
tc::TunnelType::Server
|
||||||
|
).unwrap_or_default();
|
||||||
|
let b32_dest: String = tunnel.get_destination();
|
||||||
|
log::debug!("destination: {}", &b32_dest);
|
||||||
|
let v_b32_dest = bincode::serialize(&b32_dest).unwrap_or_default();
|
||||||
|
let v_sk = bincode::serialize(&tunnel.get_sk()).unwrap_or_default();
|
||||||
|
db::write_chunks(
|
||||||
|
&db.env,
|
||||||
|
&db.handle,
|
||||||
|
b32_key,
|
||||||
|
&v_b32_dest,
|
||||||
|
).map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
||||||
|
db::write_chunks(
|
||||||
|
&db.env,
|
||||||
|
&db.handle,
|
||||||
|
sk_key,
|
||||||
|
&v_sk,
|
||||||
|
).map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
||||||
|
Ok(tunnel)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Start router and automatic i2p tunnel creation
|
||||||
|
///
|
||||||
|
/// We'll check for an existing i2p secret key. If it doesn't
|
||||||
|
///
|
||||||
|
/// exist create a new one.
|
||||||
|
pub fn start() -> Result<(), NevekoError> {
|
||||||
|
let http_proxy_port: u16 = get_i2p_proxy_port().parse::<u16>()
|
||||||
|
.unwrap_or(DEFAULT_APP_PORT);
|
||||||
|
let socks_port: u16 = get_i2p_socks_proxy_port().parse::<u16>()
|
||||||
|
.unwrap_or(DEFAULT_SOCKS_PORT);
|
||||||
|
// check for existing app and anon inbound server tunnels
|
||||||
|
let db = &DATABASE_LOCK;
|
||||||
|
let r_anon_in_sk = db::DatabaseEnvironment::read(
|
||||||
|
&db.env,
|
||||||
|
&db.handle,
|
||||||
|
&crate::APP_ANON_IN_SK.as_bytes().to_vec(),
|
||||||
|
).map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
||||||
|
let r_app_sk = db::DatabaseEnvironment::read(
|
||||||
|
&db.env,
|
||||||
|
&db.handle,
|
||||||
|
&crate::APP_I2P_SK.as_bytes().to_vec(),
|
||||||
|
).map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
||||||
|
let anon_in_sk: String = bincode::deserialize(&r_anon_in_sk[..]).unwrap_or_default();
|
||||||
|
let app_sk: String = bincode::deserialize(&r_app_sk[..]).unwrap_or_default();
|
||||||
|
log::info!("starting j4i2prs...");
|
||||||
|
let r = rw::Wrapper::create_router().map_err(|_| NevekoError::I2P)?;
|
||||||
|
let mut l: Listener = Default::default();
|
||||||
|
let run_tx = l.run_tx.clone();
|
||||||
|
let _ = thread::spawn(move || {
|
||||||
|
log::info!("run thread started");
|
||||||
|
run_tx.send(true).unwrap_or_else(|_| log::error!("failed to run router"));
|
||||||
|
});
|
||||||
|
// run the main thread forever unless we get a router shutdown signal
|
||||||
|
let _ = thread::spawn(move || {
|
||||||
|
std::thread::sleep(std::time::Duration::from_secs(10));
|
||||||
|
loop {
|
||||||
|
if let Ok(run) = l.run_rx.try_recv() {
|
||||||
|
if run {
|
||||||
|
log::info!("starting router");
|
||||||
|
r.invoke_router(rw::METHOD_RUN).unwrap_or_else(|_| log::error!("failed to run router"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !l.is_running {
|
||||||
|
let is_router_on = r.is_running().unwrap_or_default();
|
||||||
|
if !is_router_on {
|
||||||
|
log::info!("router is warming up, please wait...");
|
||||||
|
}
|
||||||
|
std::thread::sleep(std::time::Duration::from_secs(60));
|
||||||
|
if is_router_on {
|
||||||
|
// check router config
|
||||||
|
if let Ok(lines) = read_lines("./router.config") {
|
||||||
|
for line in lines.map_while(Result::ok) {
|
||||||
|
if line.contains("i2np.udp.port") {
|
||||||
|
let port = line.split("=").collect::<Vec<&str>>()[1];
|
||||||
|
log::info!("router is running on external port = {}", port);
|
||||||
|
log::info!("open this port for better connectivity");
|
||||||
|
log::info!("this port was randomly assigned, keep it private");
|
||||||
|
l.is_running = true;
|
||||||
|
// start the http proxy
|
||||||
|
let http_proxy: tc::Tunnel = tc::Tunnel::new(
|
||||||
|
"127.0.0.1".to_string(),
|
||||||
|
http_proxy_port,
|
||||||
|
tc::TunnelType::Http
|
||||||
|
).unwrap_or_default();
|
||||||
|
let _ = http_proxy.start(None);
|
||||||
|
// start the socks proxy
|
||||||
|
let socks_proxy: tc::Tunnel = tc::Tunnel::new(
|
||||||
|
"127.0.0.1".to_string(),
|
||||||
|
socks_port,
|
||||||
|
tc::TunnelType::Socks
|
||||||
|
).unwrap_or_default();
|
||||||
|
let _ = socks_proxy.start(None);
|
||||||
|
log::info!("http proxy on port {}", http_proxy.get_port());
|
||||||
|
log::info!("socks proxy on port {}", socks_proxy.get_port());
|
||||||
|
if app_sk.is_empty() {
|
||||||
|
let t = create_server_tunnel(ServerTunnelType::App)
|
||||||
|
.unwrap_or_default();
|
||||||
|
let _ = t.start(None);
|
||||||
|
} else {
|
||||||
|
let app_tunnel = tc::Tunnel::new(
|
||||||
|
"127.0.0.1".to_string(),
|
||||||
|
utils::get_app_port(),
|
||||||
|
tc::TunnelType::ExistingServer
|
||||||
|
).unwrap_or_default();
|
||||||
|
let _ = app_tunnel.start(Some(String::from(&app_sk)));
|
||||||
|
}
|
||||||
|
if anon_in_sk.is_empty() {
|
||||||
|
let t = create_server_tunnel(ServerTunnelType::AnonInbound)
|
||||||
|
.unwrap_or_default();
|
||||||
|
let _ = t.start(None);
|
||||||
|
} else {
|
||||||
|
let anon_tunnel = tc::Tunnel::new(
|
||||||
|
"127.0.0.1".to_string(),
|
||||||
|
get_anon_inbound_port(),
|
||||||
|
tc::TunnelType::ExistingServer
|
||||||
|
).unwrap_or_default();
|
||||||
|
let _ = anon_tunnel.start(Some(String::from(&anon_in_sk)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Ok(())
|
||||||
|
}
|
|
@ -22,6 +22,10 @@ pub const NEVEKO_JWT_SECRET_KEY: &str = "NEVEKO_JWT_SECRET_KEY";
|
||||||
pub const NEVEKO_NMPK: &str = "NEVEKO_NMPK";
|
pub const NEVEKO_NMPK: &str = "NEVEKO_NMPK";
|
||||||
|
|
||||||
// LMDB Keys
|
// LMDB Keys
|
||||||
|
pub const APP_B32_DEST: &str = "app-b32";
|
||||||
|
pub const APP_ANON_IN_B32_DEST: &str = "app-anon-in-b32";
|
||||||
|
pub const APP_I2P_SK: &str = "app-i2p-sk";
|
||||||
|
pub const APP_ANON_IN_SK: &str = "app-anon-in-sk";
|
||||||
pub const AUTH_DB_KEY: &str = "a";
|
pub const AUTH_DB_KEY: &str = "a";
|
||||||
pub const CONTACT_DB_KEY: &str = "c";
|
pub const CONTACT_DB_KEY: &str = "c";
|
||||||
pub const DISPUTE_DB_KEY: &str = "d";
|
pub const DISPUTE_DB_KEY: &str = "d";
|
||||||
|
@ -38,7 +42,7 @@ pub const RX_MESSAGE_DB_KEY: &str = "rx";
|
||||||
pub const DISPUTE_LAST_CHECK_DB_KEY: &str = "dlc";
|
pub const DISPUTE_LAST_CHECK_DB_KEY: &str = "dlc";
|
||||||
pub const FTS_DB_KEY: &str = "fts";
|
pub const FTS_DB_KEY: &str = "fts";
|
||||||
pub const CUSTOMER_ORDER_LIST_DB_KEY: &str = "olc";
|
pub const CUSTOMER_ORDER_LIST_DB_KEY: &str = "olc";
|
||||||
pub const ADJUDICATOR_DB_KEY: &str = "med8";
|
pub const ADJUDICATOR_DB_KEY: &str = "med8";
|
||||||
pub const MSIG_MESSAGE_DB_KEY: &str = "msig";
|
pub const MSIG_MESSAGE_DB_KEY: &str = "msig";
|
||||||
pub const MSIG_MESSAGE_LIST_DB_KEY: &str = "msigl";
|
pub const MSIG_MESSAGE_LIST_DB_KEY: &str = "msigl";
|
||||||
pub const FTS_JWP_DB_KEY: &str = "fts-jwp";
|
pub const FTS_JWP_DB_KEY: &str = "fts-jwp";
|
||||||
|
@ -49,8 +53,6 @@ pub const DELIVERY_INFO_DB_KEY: &str = "delivery";
|
||||||
pub const MONERO_WALLET_PASSWORD: &str = "MONERO_WALLET_PASSWORD";
|
pub const MONERO_WALLET_PASSWORD: &str = "MONERO_WALLET_PASSWORD";
|
||||||
/// Environment variable for I2P proxy host
|
/// Environment variable for I2P proxy host
|
||||||
pub const NEVEKO_I2P_PROXY_HOST: &str = "NEVEKO_I2P_PROXY_HOST";
|
pub const NEVEKO_I2P_PROXY_HOST: &str = "NEVEKO_I2P_PROXY_HOST";
|
||||||
/// Environment variable for I2P manual tunnels.json
|
|
||||||
pub const NEVEKO_I2P_TUNNELS_JSON: &str = "NEVEKO_I2P_TUNNELS_JSON";
|
|
||||||
/// Environment variable for I2P advanced mode
|
/// Environment variable for I2P advanced mode
|
||||||
pub const NEVEKO_I2P_ADVANCED_MODE: &str = "NEVEKO_I2P_ADVANCED_MODE";
|
pub const NEVEKO_I2P_ADVANCED_MODE: &str = "NEVEKO_I2P_ADVANCED_MODE";
|
||||||
/// Environment variable for I2P advanced mode
|
/// Environment variable for I2P advanced mode
|
||||||
|
@ -68,4 +70,8 @@ pub const FTS_RETRY_INTERVAL: u32 = 60000;
|
||||||
pub const DISPUTE_AUTO_SETTLE: u32 = 1000 * 60 * 60 * 24 * 7;
|
pub const DISPUTE_AUTO_SETTLE: u32 = 1000 * 60 * 60 * 24 * 7;
|
||||||
/// Daily dispute auto-settle check interval
|
/// Daily dispute auto-settle check interval
|
||||||
pub const DISPUTE_CHECK_INTERVAL: u32 = 1000 * 60 * 60 * 24;
|
pub const DISPUTE_CHECK_INTERVAL: u32 = 1000 * 60 * 60 * 24;
|
||||||
|
/// Default app port
|
||||||
|
pub const DEFAULT_APP_PORT: u16 = 9000;
|
||||||
|
/// Default app port
|
||||||
|
pub const DEFAULT_SOCKS_PORT: u16 = 9051;
|
||||||
// DO NOT EDIT BELOW THIS LINE
|
// DO NOT EDIT BELOW THIS LINE
|
||||||
|
|
|
@ -63,7 +63,7 @@ pub async fn create(m: Json<Message>, jwp: String, m_type: MessageType) -> Resul
|
||||||
let new_message = Message {
|
let new_message = Message {
|
||||||
mid: String::from(&f_mid),
|
mid: String::from(&f_mid),
|
||||||
uid: String::from(&m.uid),
|
uid: String::from(&m.uid),
|
||||||
from: i2p::get_destination(None),
|
from: i2p::get_destination(i2p::ServerTunnelType::App)?,
|
||||||
body: e_body,
|
body: e_body,
|
||||||
created,
|
created,
|
||||||
to: String::from(&m.to),
|
to: String::from(&m.to),
|
||||||
|
@ -186,10 +186,10 @@ async fn parse_multisig_message(mid: String) -> Result<MultisigMessageData, Neve
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
/// // lookup prepare info for vendor
|
/// // lookup prepare info for vendor
|
||||||
/// use neveko_core::db;
|
/// use neveko_core::db::*;
|
||||||
/// let s = db::DatabaseEnvironment::open();
|
/// let db = &DATABASE_LOCK;
|
||||||
/// let key = "prepare-o123-test.b32.i2p";
|
/// let key = "prepare-o123-test.b32.i2p";
|
||||||
/// let info_str = db::DatabaseEnvironment::read(&db.env, &s.handle, &key);
|
/// let info_str = DatabaseEnvironment::read(&db.env, &db.handle, &key.as_bytes().to_vec());
|
||||||
/// ```
|
/// ```
|
||||||
pub async fn rx_multisig(m: Json<Message>) -> Result<(), NevekoError> {
|
pub async fn rx_multisig(m: Json<Message>) -> Result<(), NevekoError> {
|
||||||
info!("rx multisig from: {}", &m.from);
|
info!("rx multisig from: {}", &m.from);
|
||||||
|
@ -527,7 +527,7 @@ fn validate_message(j: &Json<Message>) -> bool {
|
||||||
info!("validating message: {}", &j.mid);
|
info!("validating message: {}", &j.mid);
|
||||||
j.mid.len() < utils::string_limit()
|
j.mid.len() < utils::string_limit()
|
||||||
&& j.body.len() < utils::message_limit()
|
&& j.body.len() < utils::message_limit()
|
||||||
&& j.to == i2p::get_destination(None)
|
&& j.to == i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default()
|
||||||
&& j.uid.len() < utils::string_limit()
|
&& j.uid.len() < utils::string_limit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -764,50 +764,53 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
fn cleanup(k: &String) -> Result<(), NevekoError> {
|
fn cleanup(k: &String) -> Result<(), NevekoError> {
|
||||||
let s = db::DatabaseEnvironment::open()
|
let db = &DATABASE_LOCK;
|
||||||
.map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
let _ = db::DatabaseEnvironment::delete(&db.env, &db.handle, k.as_bytes())
|
||||||
let _ = db::DatabaseEnvironment::delete(&db.env, &s.handle, k.as_bytes())
|
|
||||||
.map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
.map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn create_test() {
|
fn create_test() -> Result<(), NevekoError> {
|
||||||
// run and async cleanup so the test doesn't fail when deleting test data
|
// run and async cleanup so the test doesn't fail when deleting test data
|
||||||
use tokio::runtime::Runtime;
|
use tokio::runtime::Runtime;
|
||||||
let rt = Runtime::new().expect("Unable to create Runtime for test");
|
let rt = Runtime::new().expect("Unable to create Runtime for test");
|
||||||
let _enter = rt.enter();
|
let _enter = rt.enter();
|
||||||
let body: String = String::from("test body");
|
let body: String = String::from("test body");
|
||||||
let message = Message {
|
let message = Message {
|
||||||
body: body,
|
body,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let j_message = utils::message_to_json(&message);
|
let j_message = utils::message_to_json(&message);
|
||||||
let jwp = String::from("test-jwp");
|
let jwp = String::from("test-jwp");
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let test_message = create(j_message, jwp, MessageType::Normal).await;
|
let a_test_message = create(j_message, jwp, MessageType::Normal).await;
|
||||||
|
let test_message = a_test_message.unwrap_or_default();
|
||||||
let expected: Message = Default::default();
|
let expected: Message = Default::default();
|
||||||
assert_eq!(test_message.body, expected.body);
|
assert_eq!(test_message.body, expected.body);
|
||||||
cleanup(&test_message.mid).await;
|
cleanup(&test_message.mid).unwrap();
|
||||||
});
|
});
|
||||||
Runtime::shutdown_background(rt);
|
Runtime::shutdown_background(rt);
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn find_test() {
|
fn find_test() -> Result<(), NevekoError> {
|
||||||
// run and async cleanup so the test doesn't fail when deleting test data
|
// run and async cleanup so the test doesn't fail when deleting test data
|
||||||
let body: String = String::from("test body");
|
let body: String = String::from("test body");
|
||||||
let expected_message = Message {
|
let expected_message = Message {
|
||||||
body: body,
|
body,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let k = "test-key";
|
let k = "test-key";
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
let message = bincode::serialize(&new_message).unwrap_or_default();
|
let message = bincode::serialize(&expected_message).unwrap_or_default();
|
||||||
db::write_chunks(&db.env, &s.handle, k, &message);
|
db::write_chunks(&db.env, &db.handle, k.as_bytes(), &message)
|
||||||
let actual_message: Message = find(&String::from(k));
|
.map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
||||||
|
let actual_message: Message = find(&String::from(k))?;
|
||||||
assert_eq!(expected_message.body, actual_message.body);
|
assert_eq!(expected_message.body, actual_message.body);
|
||||||
cleanup(&String::from(k));
|
cleanup(&String::from(k))?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -818,7 +821,7 @@ mod tests {
|
||||||
let _enter = rt.enter();
|
let _enter = rt.enter();
|
||||||
let body: String = String::from("test body");
|
let body: String = String::from("test body");
|
||||||
let message = Message {
|
let message = Message {
|
||||||
body: body,
|
body,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let j_message = utils::message_to_json(&message);
|
let j_message = utils::message_to_json(&message);
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
//! TODO: replace with monero bindings
|
//! TODO: replace with monero bindings
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
args,
|
args, error::NevekoError, i2p, proof, reqres, utils
|
||||||
i2p,
|
|
||||||
proof,
|
|
||||||
reqres,
|
|
||||||
utils,
|
|
||||||
};
|
};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use diqwest::WithDigestAuth;
|
use diqwest::WithDigestAuth;
|
||||||
|
@ -172,7 +168,7 @@ impl LockTimeLimit {
|
||||||
/// Start monerod from the `--monero-location` flag
|
/// Start monerod from the `--monero-location` flag
|
||||||
///
|
///
|
||||||
/// default: /home/$USER/monero-xxx-xxx
|
/// default: /home/$USER/monero-xxx-xxx
|
||||||
pub fn start_daemon() {
|
pub fn start_daemon() -> Result<(), NevekoError>{
|
||||||
info!("starting monerod");
|
info!("starting monerod");
|
||||||
let blockchain_dir = get_blockchain_dir();
|
let blockchain_dir = get_blockchain_dir();
|
||||||
let bin_dir = get_monero_location();
|
let bin_dir = get_monero_location();
|
||||||
|
@ -186,7 +182,7 @@ pub fn start_daemon() {
|
||||||
let tx_proxy = format!("i2p,{}", socks_proxy_host);
|
let tx_proxy = format!("i2p,{}", socks_proxy_host);
|
||||||
// proxy host can't have protocol
|
// proxy host can't have protocol
|
||||||
let anon_in_port = get_anon_inbound_port();
|
let anon_in_port = get_anon_inbound_port();
|
||||||
let destination = i2p::get_destination(Some(anon_in_port));
|
let destination = i2p::get_destination(i2p::ServerTunnelType::App)?;
|
||||||
let anon_inbound = format!("{},127.0.0.1:{}", destination, anon_in_port);
|
let anon_inbound = format!("{},127.0.0.1:{}", destination, anon_in_port);
|
||||||
let mut args = vec!["--data-dir", &blockchain_dir, "--detach"];
|
let mut args = vec!["--data-dir", &blockchain_dir, "--detach"];
|
||||||
if release_env == utils::ReleaseEnvironment::Development {
|
if release_env == utils::ReleaseEnvironment::Development {
|
||||||
|
@ -196,6 +192,7 @@ pub fn start_daemon() {
|
||||||
.spawn()
|
.spawn()
|
||||||
.expect("monerod failed to start");
|
.expect("monerod failed to start");
|
||||||
debug!("{:?}", output.stdout);
|
debug!("{:?}", output.stdout);
|
||||||
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
args.push("--tx-proxy");
|
args.push("--tx-proxy");
|
||||||
args.push(&tx_proxy);
|
args.push(&tx_proxy);
|
||||||
|
@ -206,6 +203,7 @@ pub fn start_daemon() {
|
||||||
.spawn()
|
.spawn()
|
||||||
.expect("monerod failed to start");
|
.expect("monerod failed to start");
|
||||||
debug!("{:?}", output.stdout);
|
debug!("{:?}", output.stdout);
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,7 +220,7 @@ pub fn find_all_vendor_orders() -> Result<Vec<Order>, NevekoError> {
|
||||||
let i_v_oid = de.split(",");
|
let i_v_oid = de.split(",");
|
||||||
let i_v: Vec<String> = i_v_oid.map(String::from).collect();
|
let i_v: Vec<String> = i_v_oid.map(String::from).collect();
|
||||||
let mut orders: Vec<Order> = Vec::new();
|
let mut orders: Vec<Order> = Vec::new();
|
||||||
let vendor_b32: String = i2p::get_destination(None);
|
let vendor_b32: String = i2p::get_destination(i2p::ServerTunnelType::App)?;
|
||||||
for o in i_v {
|
for o in i_v {
|
||||||
let order: Order = find(&o)?;
|
let order: Order = find(&o)?;
|
||||||
if !order.orid.is_empty() && order.cid != vendor_b32 {
|
if !order.orid.is_empty() && order.cid != vendor_b32 {
|
||||||
|
@ -467,7 +467,7 @@ pub async fn upload_delivery_info(
|
||||||
modify(Json(m_order))?;
|
modify(Json(m_order))?;
|
||||||
// trigger nasr, this will cause the customer's neveko instance to request the
|
// trigger nasr, this will cause the customer's neveko instance to request the
|
||||||
// txset
|
// txset
|
||||||
let i2p_address = i2p::get_destination(None);
|
let i2p_address = i2p::get_destination(i2p::ServerTunnelType::App)?;
|
||||||
// get jwp from db
|
// get jwp from db
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ pub fn create(address: &String) -> Result<User, MdbError> {
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
let k = &new_user.uid;
|
let k = &new_user.uid;
|
||||||
let v = bincode::serialize(&new_user).unwrap_or_default();
|
let v = bincode::serialize(&new_user).unwrap_or_default();
|
||||||
db::write_chunks(&db.env, &db.handle, k.as_bytes(), &v)?;
|
let _ = db::write_chunks(&db.env, &db.handle, k.as_bytes(), &v)?;
|
||||||
Ok(new_user)
|
Ok(new_user)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,28 +51,28 @@ mod tests {
|
||||||
|
|
||||||
fn cleanup(k: &String) -> Result<(), MdbError> {
|
fn cleanup(k: &String) -> Result<(), MdbError> {
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
db::DatabaseEnvironment::delete(&db.env, &db.handle, k.as_bytes());
|
db::DatabaseEnvironment::delete(&db.env, &db.handle, k.as_bytes())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn create_test() {
|
fn create_test() -> Result<(), MdbError> {
|
||||||
// run and async cleanup so the test doesn't fail when deleting test data
|
// run and async cleanup so the test doesn't fail when deleting test data
|
||||||
let address: String = String::from(
|
let address: String = String::from(
|
||||||
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
||||||
);
|
);
|
||||||
let test_user = create(&address);
|
let test_user = create(&address)?;
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
let r = db::DatabaseEnvironment::read(&db.env, &db.handle, &test_user.uid);
|
let r = db::DatabaseEnvironment::read(&db.env, &db.handle, &test_user.uid.as_bytes().to_vec())?;
|
||||||
let id = String::from(&test_user.uid);
|
|
||||||
let cleanup_id = String::from(&test_user.uid);
|
let cleanup_id = String::from(&test_user.uid);
|
||||||
let expected_user = User::from_db(id, r);
|
let expected_user: User = bincode::deserialize(&r[..]).unwrap_or_default();
|
||||||
assert_eq!(test_user.xmr_address, expected_user.xmr_address);
|
assert_eq!(test_user.xmr_address, expected_user.xmr_address);
|
||||||
cleanup(&cleanup_id);
|
cleanup(&cleanup_id)?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn find_test() {
|
fn find_test() -> Result<(), MdbError> {
|
||||||
let address: String = String::from(
|
let address: String = String::from(
|
||||||
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
"73a4nWuvkYoYoksGurDjKZQcZkmaxLaKbbeiKzHnMmqKivrCzq5Q2JtJG1UZNZFqLPbQ3MiXCk2Q5bdwdUNSr7X9QrPubkn"
|
||||||
);
|
);
|
||||||
|
@ -82,9 +82,11 @@ mod tests {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
db::DatabaseEnvironment::write_chunks(&db.env, &db.handle, k, &User::to_db(&expected_user));
|
let v = bincode::serialize(&expected_user).unwrap_or_default();
|
||||||
let actual_user: User = find(&String::from(k));
|
db::write_chunks(&db.env, &db.handle, k.as_bytes(), &v)?;
|
||||||
|
let actual_user: User = find(&String::from(k))?;
|
||||||
assert_eq!(expected_user.xmr_address, actual_user.xmr_address);
|
assert_eq!(expected_user.xmr_address, actual_user.xmr_address);
|
||||||
cleanup(&String::from(k));
|
cleanup(&String::from(k))?;
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,9 +57,6 @@ pub struct Connections {
|
||||||
pub daemon_host: String,
|
pub daemon_host: String,
|
||||||
pub i2p_proxy_host: String,
|
pub i2p_proxy_host: String,
|
||||||
pub i2p_socks_host: String,
|
pub i2p_socks_host: String,
|
||||||
/// path to manually created tunnels json
|
|
||||||
pub i2p_tunnels_json: String,
|
|
||||||
pub i2p_zero_dir: String,
|
|
||||||
pub is_remote_node: bool,
|
pub is_remote_node: bool,
|
||||||
pub is_i2p_advanced: bool,
|
pub is_i2p_advanced: bool,
|
||||||
pub mainnet: bool,
|
pub mainnet: bool,
|
||||||
|
@ -76,8 +73,6 @@ impl Default for Connections {
|
||||||
daemon_host: String::from("http://127.0.0.1:38081"),
|
daemon_host: String::from("http://127.0.0.1:38081"),
|
||||||
i2p_proxy_host: String::from("http://127.0.0.1:4444"),
|
i2p_proxy_host: String::from("http://127.0.0.1:4444"),
|
||||||
i2p_socks_host: String::from("http://127.0.0.1:9051"),
|
i2p_socks_host: String::from("http://127.0.0.1:9051"),
|
||||||
i2p_tunnels_json: String::from("/home/user/neveko/i2p-manual"),
|
|
||||||
i2p_zero_dir: String::from("/home/user/i2p-zero-linux.v1.21"),
|
|
||||||
is_remote_node: false,
|
is_remote_node: false,
|
||||||
is_i2p_advanced: false,
|
is_i2p_advanced: false,
|
||||||
mainnet: false,
|
mainnet: false,
|
||||||
|
@ -145,14 +140,10 @@ pub fn start_core(conn: &Connections) {
|
||||||
&conn.rpc_username,
|
&conn.rpc_username,
|
||||||
"--monero-rpc-cred",
|
"--monero-rpc-cred",
|
||||||
&conn.rpc_credential,
|
&conn.rpc_credential,
|
||||||
"--i2p-zero-dir",
|
|
||||||
&conn.i2p_zero_dir,
|
|
||||||
"-r",
|
"-r",
|
||||||
env,
|
env,
|
||||||
remote_node,
|
remote_node,
|
||||||
i2p_advanced,
|
i2p_advanced,
|
||||||
"--i2p-tunnels-json",
|
|
||||||
&conn.i2p_tunnels_json,
|
|
||||||
"--i2p-proxy-host",
|
"--i2p-proxy-host",
|
||||||
&conn.i2p_proxy_host,
|
&conn.i2p_proxy_host,
|
||||||
"--i2p-socks-proxy-host",
|
"--i2p-socks-proxy-host",
|
||||||
|
@ -161,10 +152,6 @@ pub fn start_core(conn: &Connections) {
|
||||||
if conn.is_i2p_advanced {
|
if conn.is_i2p_advanced {
|
||||||
// set the i2p proxy host for advanced user re-use
|
// set the i2p proxy host for advanced user re-use
|
||||||
std::env::set_var(crate::NEVEKO_I2P_PROXY_HOST, conn.i2p_proxy_host.clone());
|
std::env::set_var(crate::NEVEKO_I2P_PROXY_HOST, conn.i2p_proxy_host.clone());
|
||||||
std::env::set_var(
|
|
||||||
crate::NEVEKO_I2P_TUNNELS_JSON,
|
|
||||||
conn.i2p_tunnels_json.clone(),
|
|
||||||
);
|
|
||||||
std::env::set_var(crate::NEVEKO_I2P_ADVANCED_MODE, String::from("1"));
|
std::env::set_var(crate::NEVEKO_I2P_ADVANCED_MODE, String::from("1"));
|
||||||
}
|
}
|
||||||
if conn.is_remote_node {
|
if conn.is_remote_node {
|
||||||
|
@ -398,7 +385,6 @@ fn gen_signing_keys() -> Result<(), NevekoError> {
|
||||||
let mut data = [0u8; 32];
|
let mut data = [0u8; 32];
|
||||||
rand::thread_rng().fill_bytes(&mut data);
|
rand::thread_rng().fill_bytes(&mut data);
|
||||||
let db = &DATABASE_LOCK;
|
let db = &DATABASE_LOCK;
|
||||||
|
|
||||||
db::write_chunks(&db.env, &db.handle, crate::NEVEKO_JWT_SECRET_KEY.as_bytes(), &data)
|
db::write_chunks(&db.env, &db.handle, crate::NEVEKO_JWT_SECRET_KEY.as_bytes(), &data)
|
||||||
.map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
.map_err(|_| NevekoError::Database(MdbError::Panic))?;
|
||||||
}
|
}
|
||||||
|
@ -482,7 +468,7 @@ pub async fn start_up() -> Result<(), NevekoError> {
|
||||||
}
|
}
|
||||||
gen_signing_keys()?;
|
gen_signing_keys()?;
|
||||||
if !is_using_remote_node() {
|
if !is_using_remote_node() {
|
||||||
monero::start_daemon();
|
let _ = monero::start_daemon();
|
||||||
}
|
}
|
||||||
create_wallet_dir();
|
create_wallet_dir();
|
||||||
// wait for daemon for a bit
|
// wait for daemon for a bit
|
||||||
|
@ -504,7 +490,7 @@ pub async fn start_up() -> Result<(), NevekoError> {
|
||||||
generate_nmpk().await?;
|
generate_nmpk().await?;
|
||||||
let env: String = get_release_env().value();
|
let env: String = get_release_env().value();
|
||||||
if !args.i2p_advanced {
|
if !args.i2p_advanced {
|
||||||
i2p::start().await;
|
let _ = i2p::start();
|
||||||
}
|
}
|
||||||
gen_app_wallet(&wallet_password).await;
|
gen_app_wallet(&wallet_password).await;
|
||||||
// start async background tasks here
|
// start async background tasks here
|
||||||
|
|
|
@ -802,7 +802,7 @@ fn send_message_req(tx: Sender<bool>, ctx: egui::Context, body: String, to: Stri
|
||||||
mid: String::new(),
|
mid: String::new(),
|
||||||
uid: String::new(),
|
uid: String::new(),
|
||||||
created: 0,
|
created: 0,
|
||||||
from: i2p::get_destination(None),
|
from: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
};
|
};
|
||||||
let j_message = utils::message_to_json(&m);
|
let j_message = utils::message_to_json(&m);
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
|
|
|
@ -189,7 +189,8 @@ impl eframe::App for HomeApp {
|
||||||
.title_bar(false)
|
.title_bar(false)
|
||||||
.vscroll(true)
|
.vscroll(true)
|
||||||
.show(ctx, |ui| {
|
.show(ctx, |ui| {
|
||||||
let mut i2p_address = i2p::get_destination(None);
|
let mut i2p_address = i2p::get_destination(i2p::ServerTunnelType::App)
|
||||||
|
.unwrap_or_default();
|
||||||
if !self.is_qr_set && !i2p_address.is_empty() {
|
if !self.is_qr_set && !i2p_address.is_empty() {
|
||||||
let code = QrCode::new(&i2p_address).unwrap();
|
let code = QrCode::new(&i2p_address).unwrap();
|
||||||
let image = code.render::<Luma<u8>>().build();
|
let image = code.render::<Luma<u8>>().build();
|
||||||
|
@ -253,13 +254,6 @@ impl eframe::App for HomeApp {
|
||||||
ui.text_edit_singleline(&mut self.connections.monero_location)
|
ui.text_edit_singleline(&mut self.connections.monero_location)
|
||||||
.labelled_by(cm_xmr_dir_label.id);
|
.labelled_by(cm_xmr_dir_label.id);
|
||||||
});
|
});
|
||||||
if !self.connections.is_i2p_advanced {
|
|
||||||
ui.horizontal(|ui| {
|
|
||||||
let cm_i2p_dir_label = ui.label("i2p-zero path: \t");
|
|
||||||
ui.text_edit_singleline(&mut self.connections.i2p_zero_dir)
|
|
||||||
.labelled_by(cm_i2p_dir_label.id);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if self.connections.is_i2p_advanced {
|
if self.connections.is_i2p_advanced {
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
let cm_i2p_proxy_label = ui.label("i2p proxy host: \t");
|
let cm_i2p_proxy_label = ui.label("i2p proxy host: \t");
|
||||||
|
@ -271,11 +265,6 @@ impl eframe::App for HomeApp {
|
||||||
ui.text_edit_singleline(&mut self.connections.i2p_socks_host)
|
ui.text_edit_singleline(&mut self.connections.i2p_socks_host)
|
||||||
.labelled_by(cm_i2p_socks_label.id);
|
.labelled_by(cm_i2p_socks_label.id);
|
||||||
});
|
});
|
||||||
ui.horizontal(|ui| {
|
|
||||||
let cm_i2p_tunnels_label = ui.label("tunnels.json dir: ");
|
|
||||||
ui.text_edit_singleline(&mut self.connections.i2p_tunnels_json)
|
|
||||||
.labelled_by(cm_i2p_tunnels_label.id);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
let mut is_remote_node = self.connections.is_remote_node;
|
let mut is_remote_node = self.connections.is_remote_node;
|
||||||
if ui.checkbox(&mut is_remote_node, "remote node").changed() {
|
if ui.checkbox(&mut is_remote_node, "remote node").changed() {
|
||||||
|
@ -350,7 +339,8 @@ impl eframe::App for HomeApp {
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
self.logo_i2p.show(ui);
|
self.logo_i2p.show(ui);
|
||||||
ui.horizontal(|ui| {
|
ui.horizontal(|ui| {
|
||||||
let i2p_address = i2p::get_destination(None);
|
let i2p_address = i2p::get_destination(i2p::ServerTunnelType::App)
|
||||||
|
.unwrap_or_default();
|
||||||
ui.label(
|
ui.label(
|
||||||
RichText::new(format!("- status: {}\n- address: {}", str_i2p_status, i2p_address))
|
RichText::new(format!("- status: {}\n- address: {}", str_i2p_status, i2p_address))
|
||||||
.size(16.0)
|
.size(16.0)
|
||||||
|
@ -463,7 +453,7 @@ fn send_wallet_req(
|
||||||
fn send_i2p_status_req(tx: Sender<i2p::ProxyStatus>, ctx: egui::Context) {
|
fn send_i2p_status_req(tx: Sender<i2p::ProxyStatus>, ctx: egui::Context) {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let status = i2p::check_connection().await;
|
let status = i2p::check_connection().await;
|
||||||
let _ = tx.send(status);
|
let _ = tx.send(status.unwrap_or(i2p::ProxyStatus::Opening));
|
||||||
ctx.request_repaint();
|
ctx.request_repaint();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1445,7 +1445,7 @@ impl eframe::App for MarketApp {
|
||||||
} else {
|
} else {
|
||||||
if ui.button("Create Order").clicked() {
|
if ui.button("Create Order").clicked() {
|
||||||
self.new_order.pid = p.pid.clone();
|
self.new_order.pid = p.pid.clone();
|
||||||
self.new_order.cid = i2p::get_destination(None);
|
self.new_order.cid = i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default();
|
||||||
self.new_order_price = p.price;
|
self.new_order_price = p.price;
|
||||||
self.is_ordering = true;
|
self.is_ordering = true;
|
||||||
}
|
}
|
||||||
|
@ -1906,7 +1906,7 @@ fn send_prepare_info_req(
|
||||||
message::PREPARE_MSIG
|
message::PREPARE_MSIG
|
||||||
);
|
);
|
||||||
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
||||||
contact: i2p::get_destination(None),
|
contact: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
info: Vec::new(),
|
info: Vec::new(),
|
||||||
init_adjudicator: false,
|
init_adjudicator: false,
|
||||||
kex_init: false,
|
kex_init: false,
|
||||||
|
@ -1921,7 +1921,7 @@ fn send_prepare_info_req(
|
||||||
message::PREPARE_MSIG
|
message::PREPARE_MSIG
|
||||||
);
|
);
|
||||||
let m_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
let m_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
||||||
contact: i2p::get_destination(None),
|
contact: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
info: Vec::new(),
|
info: Vec::new(),
|
||||||
init_adjudicator: true,
|
init_adjudicator: true,
|
||||||
kex_init: false,
|
kex_init: false,
|
||||||
|
@ -2034,7 +2034,7 @@ fn send_make_info_req(
|
||||||
if v_make.is_empty() {
|
if v_make.is_empty() {
|
||||||
log::debug!("constructing vendor {} msig messages", message::MAKE_MSIG);
|
log::debug!("constructing vendor {} msig messages", message::MAKE_MSIG);
|
||||||
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
||||||
contact: i2p::get_destination(None),
|
contact: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
info: v_prepare_info_send,
|
info: v_prepare_info_send,
|
||||||
init_adjudicator: false,
|
init_adjudicator: false,
|
||||||
kex_init: false,
|
kex_init: false,
|
||||||
|
@ -2049,7 +2049,7 @@ fn send_make_info_req(
|
||||||
message::MAKE_MSIG
|
message::MAKE_MSIG
|
||||||
);
|
);
|
||||||
let m_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
let m_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
||||||
contact: i2p::get_destination(None),
|
contact: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
info: m_prepare_info_send,
|
info: m_prepare_info_send,
|
||||||
init_adjudicator: false,
|
init_adjudicator: false,
|
||||||
kex_init: false,
|
kex_init: false,
|
||||||
|
@ -2165,7 +2165,7 @@ fn send_kex_initial_req(
|
||||||
message::KEX_ONE_MSIG
|
message::KEX_ONE_MSIG
|
||||||
);
|
);
|
||||||
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
||||||
contact: i2p::get_destination(None),
|
contact: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
info: v_kex_init_send,
|
info: v_kex_init_send,
|
||||||
init_adjudicator: false,
|
init_adjudicator: false,
|
||||||
kex_init: true,
|
kex_init: true,
|
||||||
|
@ -2180,7 +2180,7 @@ fn send_kex_initial_req(
|
||||||
message::KEX_ONE_MSIG
|
message::KEX_ONE_MSIG
|
||||||
);
|
);
|
||||||
let m_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
let m_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
||||||
contact: i2p::get_destination(None),
|
contact: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
info: m_kex_init_send,
|
info: m_kex_init_send,
|
||||||
init_adjudicator: false,
|
init_adjudicator: false,
|
||||||
kex_init: true,
|
kex_init: true,
|
||||||
|
@ -2293,7 +2293,7 @@ fn send_kex_final_req(
|
||||||
message::KEX_TWO_MSIG
|
message::KEX_TWO_MSIG
|
||||||
);
|
);
|
||||||
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
||||||
contact: i2p::get_destination(None),
|
contact: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
info: v_kex_final_send,
|
info: v_kex_final_send,
|
||||||
init_adjudicator: false,
|
init_adjudicator: false,
|
||||||
kex_init: false,
|
kex_init: false,
|
||||||
|
@ -2308,7 +2308,7 @@ fn send_kex_final_req(
|
||||||
message::KEX_TWO_MSIG
|
message::KEX_TWO_MSIG
|
||||||
);
|
);
|
||||||
let m_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
let m_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
||||||
contact: i2p::get_destination(None),
|
contact: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
info: m_kex_final_send,
|
info: m_kex_final_send,
|
||||||
init_adjudicator: false,
|
init_adjudicator: false,
|
||||||
kex_init: false,
|
kex_init: false,
|
||||||
|
@ -2417,7 +2417,7 @@ fn send_import_info_req(tx: Sender<String>, ctx: egui::Context, orid: &String, v
|
||||||
if v_export.is_empty() {
|
if v_export.is_empty() {
|
||||||
log::debug!("constructing vendor {} msig messages", message::EXPORT_MSIG);
|
log::debug!("constructing vendor {} msig messages", message::EXPORT_MSIG);
|
||||||
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
let v_msig_request: reqres::MultisigInfoRequest = reqres::MultisigInfoRequest {
|
||||||
contact: i2p::get_destination(None),
|
contact: i2p::get_destination(i2p::ServerTunnelType::App).unwrap_or_default(),
|
||||||
info,
|
info,
|
||||||
init_adjudicator: false,
|
init_adjudicator: false,
|
||||||
kex_init: false,
|
kex_init: false,
|
||||||
|
|
|
@ -31,8 +31,8 @@ pub async fn get_version(_jwp: proof::PaymentProof) -> Custom<Json<reqres::XmrRp
|
||||||
/// This also functions as a health check
|
/// This also functions as a health check
|
||||||
#[get("/status")]
|
#[get("/status")]
|
||||||
pub async fn get_i2p_status() -> Custom<Json<i2p::HttpProxyStatus>> {
|
pub async fn get_i2p_status() -> Custom<Json<i2p::HttpProxyStatus>> {
|
||||||
let status: i2p::ProxyStatus = i2p::check_connection().await;
|
let status = i2p::check_connection().await;
|
||||||
if status == i2p::ProxyStatus::Open {
|
if status.unwrap_or(i2p::ProxyStatus::Opening) == i2p::ProxyStatus::Open {
|
||||||
Custom(Status::Ok, Json(i2p::HttpProxyStatus { open: true }))
|
Custom(Status::Ok, Json(i2p::HttpProxyStatus { open: true }))
|
||||||
} else {
|
} else {
|
||||||
Custom(Status::Ok, Json(i2p::HttpProxyStatus { open: false }))
|
Custom(Status::Ok, Json(i2p::HttpProxyStatus { open: false }))
|
||||||
|
|
Loading…
Reference in a new issue