From 9e94a6a96fc72f44dd5c16fff437b0959c886036 Mon Sep 17 00:00:00 2001 From: John Smith Date: Mon, 22 Nov 2021 11:28:30 -0500 Subject: [PATCH] initial import of main veilid core --- .gitignore | 59 + .vscode/launch.json | 111 + .vscode/settings.json | 2 + external/keyring-rs | 2 +- setup_android.sh | 68 + setup_ios.sh | 35 + test/scripts/debug_main_node.sh | 2 + test/scripts/debug_subnode_1.sh | 2 + test/scripts/no-timeout.yml | 12 + test/scripts/run_20_no_timeout.sh | 4 + test/scripts/run_2_no_timeout.sh | 4 + test/scripts/run_4_no_timeout.sh | 4 + test/scripts/run_local_test.py | 173 + veilid-cli/.gitignore | 2 + veilid-cli/Cargo.lock | 3519 +++++++++++++++++ veilid-cli/Cargo.toml | 52 + veilid-cli/build.rs | 7 + veilid-cli/src/client_api_connection.rs | 214 + veilid-cli/src/command_processor.rs | 325 ++ veilid-cli/src/main.rs | 171 + veilid-cli/src/settings.rs | 269 ++ veilid-cli/src/ui.rs | 785 ++++ veilid-core/.gitignore | 6 + veilid-core/Cargo.lock | 2939 ++++++++++++++ veilid-core/Cargo.toml | 143 + veilid-core/build.rs | 6 + veilid-core/ios_build.sh | 30 + veilid-core/proto/veilid.capnp | 420 ++ veilid-core/src/attachment_manager.rs | 398 ++ veilid-core/src/callback_state_machine.rs | 125 + veilid-core/src/connection_table.rs | 116 + veilid-core/src/dht/crypto.rs | 287 ++ veilid-core/src/dht/envelope.rs | 267 ++ veilid-core/src/dht/key.rs | 432 ++ veilid-core/src/dht/mod.rs | 11 + veilid-core/src/dht/receipt.rs | 170 + veilid-core/src/dht/value.rs | 0 veilid-core/src/intf/mod.rs | 54 + veilid-core/src/intf/native/block_store.rs | 2 + veilid-core/src/intf/native/mod.rs | 12 + .../src/intf/native/network/listener_state.rs | 54 + veilid-core/src/intf/native/network/mod.rs | 1181 ++++++ .../src/intf/native/network/protocol/mod.rs | 63 + .../src/intf/native/network/protocol/tcp.rs | 234 ++ .../src/intf/native/network/protocol/udp.rs | 109 + .../src/intf/native/network/protocol/wrtc.rs | 0 .../src/intf/native/network/protocol/ws.rs | 302 ++ .../network/public_dialinfo_discovery.rs | 222 ++ .../src/intf/native/protected_store.rs | 58 + veilid-core/src/intf/native/system.rs | 102 + veilid-core/src/intf/native/table_store.rs | 121 + .../utils/android/android_get_if_addrs.rs | 192 + .../native/utils/android/get_directories.rs | 42 + .../src/intf/native/utils/android/mod.rs | 66 + .../intf/native/utils/async_peek_stream.rs | 171 + veilid-core/src/intf/native/utils/channel.rs | 83 + .../src/intf/native/utils/clone_stream.rs | 66 + veilid-core/src/intf/native/utils/ios/mod.rs | 99 + veilid-core/src/intf/native/utils/mod.rs | 8 + .../intf/native/utils/network_interfaces.rs | 110 + veilid-core/src/intf/table_db.rs | 138 + veilid-core/src/intf/wasm/block_store.rs | 1 + veilid-core/src/intf/wasm/mod.rs | 12 + veilid-core/src/intf/wasm/network/mod.rs | 179 + .../src/intf/wasm/network/protocol/mod.rs | 48 + .../src/intf/wasm/network/protocol/wrtc.rs | 0 .../src/intf/wasm/network/protocol/ws.rs | 116 + veilid-core/src/intf/wasm/protected_store.rs | 185 + veilid-core/src/intf/wasm/system.rs | 154 + veilid-core/src/intf/wasm/table_store.rs | 118 + veilid-core/src/intf/wasm/utils/channel.rs | 140 + veilid-core/src/intf/wasm/utils/mod.rs | 91 + veilid-core/src/lease_manager.rs | 188 + veilid-core/src/lib.rs | 33 + veilid-core/src/network_manager.rs | 650 +++ veilid-core/src/receipt_manager.rs | 418 ++ veilid-core/src/relay_manager.rs | 0 veilid-core/src/routing_table/bucket.rs | 142 + veilid-core/src/routing_table/bucket_entry.rs | 446 +++ .../src/routing_table/dial_info_entry.rs | 61 + veilid-core/src/routing_table/find_nodes.rs | 280 ++ veilid-core/src/routing_table/mod.rs | 731 ++++ veilid-core/src/routing_table/node_ref.rs | 108 + .../src/rpc_processor/coders/address.rs | 69 + .../src/rpc_processor/coders/dial_info.rs | 101 + veilid-core/src/rpc_processor/coders/mod.rs | 21 + .../coders/node_dial_info_single.rs | 29 + .../src/rpc_processor/coders/node_info.rs | 39 + veilid-core/src/rpc_processor/coders/nonce.rs | 33 + .../src/rpc_processor/coders/peer_info.rs | 50 + .../coders/private_safety_route.rs | 212 + .../src/rpc_processor/coders/public_key.rs | 49 + .../src/rpc_processor/coders/sender_info.rs | 34 + .../rpc_processor/coders/socket_address.rs | 72 + veilid-core/src/rpc_processor/mod.rs | 1747 ++++++++ veilid-core/src/supplier_table.rs | 0 veilid-core/src/tests/.gitignore | 4 + veilid-core/src/tests/android/.gitignore | 16 + .../src/tests/android/.idea/.gitignore | 3 + veilid-core/src/tests/android/.idea/.name | 1 + .../src/tests/android/.idea/compiler.xml | 6 + .../src/tests/android/.idea/gradle.xml | 22 + .../tests/android/.idea/jarRepositories.xml | 25 + veilid-core/src/tests/android/.idea/misc.xml | 9 + veilid-core/src/tests/android/.idea/vcs.xml | 6 + veilid-core/src/tests/android/.project | 28 + .../org.eclipse.buildship.core.prefs | 13 + veilid-core/src/tests/android/app/.classpath | 6 + veilid-core/src/tests/android/app/.gitignore | 4 + veilid-core/src/tests/android/app/.project | 34 + .../org.eclipse.buildship.core.prefs | 2 + .../src/tests/android/app/CMakeLists.txt | 3 + .../src/tests/android/app/build.gradle | 85 + veilid-core/src/tests/android/app/cpplink.cpp | 0 .../src/tests/android/app/proguard-rules.pro | 21 + .../android/app/src/main/AndroidManifest.xml | 25 + .../MainActivity.java | 37 + .../drawable-v24/ic_launcher_foreground.xml | 30 + .../res/drawable/ic_launcher_background.xml | 170 + .../app/src/main/res/layout/activity_main.xml | 18 + .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3593 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5339 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2636 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 3388 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4926 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7472 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 7909 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 11873 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 10652 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 16570 bytes .../app/src/main/res/values-night/themes.xml | 16 + .../app/src/main/res/values/colors.xml | 10 + .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/themes.xml | 16 + veilid-core/src/tests/android/build.gradle | 28 + .../src/tests/android/gradle.properties | 19 + .../android/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54329 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + veilid-core/src/tests/android/gradlew | 172 + veilid-core/src/tests/android/gradlew.bat | 84 + veilid-core/src/tests/android/settings.gradle | 2 + veilid-core/src/tests/common/mod.rs | 8 + .../src/tests/common/test_connection_table.rs | 104 + veilid-core/src/tests/common/test_crypto.rs | 140 + veilid-core/src/tests/common/test_dht_key.rs | 323 ++ .../src/tests/common/test_envelope_receipt.rs | 83 + .../src/tests/common/test_host_interface.rs | 533 +++ .../src/tests/common/test_table_store.rs | 184 + .../src/tests/common/test_veilid_config.rs | 307 ++ .../src/tests/common/test_veilid_core.rs | 53 + veilid-core/src/tests/files/cert.pem | 88 + veilid-core/src/tests/files/key.pem | 27 + veilid-core/src/tests/ios/.gitignore | 91 + .../tests/ios/veilidcore-tests/veilid-core.c | 8 + .../tests/ios/veilidcore-tests/veilid-core.h | 13 + .../veilidcore-tests-Bridging-Header.h | 5 + .../project.pbxproj | 413 ++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcschemes/veilidcore-tests.xcscheme | 78 + .../veilidcore-tests/AppDelegate.swift | 37 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 98 + .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 56 + .../Base.lproj/Main.storyboard | 70 + .../veilidcore-tests/Info.plist | 66 + .../veilidcore-tests/SceneDelegate.swift | 53 + .../veilidcore-tests/ViewController.swift | 19 + veilid-core/src/tests/mod.rs | 3 + veilid-core/src/tests/native/mod.rs | 195 + .../tests/native/test_async_peek_stream.rs | 280 ++ veilid-core/src/veilid_api.rs | 1197 ++++++ veilid-core/src/veilid_config.rs | 339 ++ veilid-core/src/veilid_core.rs | 183 + veilid-core/src/veilid_rng.rs | 28 + veilid-core/src/watcher_table.rs | 0 veilid-core/src/xx/bump_port.rs | 99 + veilid-core/src/xx/eventual.rs | 212 + veilid-core/src/xx/eventual_base.rs | 210 + veilid-core/src/xx/eventual_value.rs | 94 + veilid-core/src/xx/eventual_value_clone.rs | 98 + veilid-core/src/xx/ip_addr_port.rs | 68 + veilid-core/src/xx/ip_extra.rs | 198 + veilid-core/src/xx/mod.rs | 80 + veilid-core/src/xx/single_future.rs | 240 ++ veilid-core/src/xx/single_shot_eventual.rs | 39 + veilid-core/src/xx/tick_task.rs | 95 + veilid-core/src/xx/tools.rs | 101 + veilid-core/tests/node.rs | 73 + veilid-core/tests/web.rs | 73 + veilid-core/veilid-core-node/.gitignore | 116 + veilid-core/veilid-core-node/index.js | 1 + veilid-core/veilid-core-node/package.json | 14 + veilid-server/.gitignore | 1 + veilid-server/Cargo.lock | 3141 +++++++++++++++ veilid-server/Cargo.toml | 48 + veilid-server/build.rs | 6 + veilid-server/proto/veilid-client.capnp | 47 + veilid-server/src/client_api.rs | 316 ++ veilid-server/src/main.rs | 27 + veilid-server/src/settings.rs | 972 +++++ veilid-server/src/unix.rs | 336 ++ veilid-server/src/windows.rs | 1 + veilid-wasm/.appveyor.yml | 11 + veilid-wasm/.cargo-ok | 0 veilid-wasm/.gitignore | 6 + veilid-wasm/.travis.yml | 69 + veilid-wasm/Cargo.toml | 27 + veilid-wasm/LICENSE_APACHE | 176 + veilid-wasm/LICENSE_MIT | 25 + veilid-wasm/README.md | 69 + veilid-wasm/src/js_veilid_core.rs | 285 ++ veilid-wasm/src/lib.rs | 25 + veilid-wasm/src/utils.rs | 38 + veilid-wasm/tests/web.rs | 178 + 218 files changed, 34880 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100755 setup_android.sh create mode 100755 setup_ios.sh create mode 100755 test/scripts/debug_main_node.sh create mode 100755 test/scripts/debug_subnode_1.sh create mode 100644 test/scripts/no-timeout.yml create mode 100755 test/scripts/run_20_no_timeout.sh create mode 100755 test/scripts/run_2_no_timeout.sh create mode 100755 test/scripts/run_4_no_timeout.sh create mode 100755 test/scripts/run_local_test.py create mode 100644 veilid-cli/.gitignore create mode 100644 veilid-cli/Cargo.lock create mode 100644 veilid-cli/Cargo.toml create mode 100644 veilid-cli/build.rs create mode 100644 veilid-cli/src/client_api_connection.rs create mode 100644 veilid-cli/src/command_processor.rs create mode 100644 veilid-cli/src/main.rs create mode 100644 veilid-cli/src/settings.rs create mode 100644 veilid-cli/src/ui.rs create mode 100644 veilid-core/.gitignore create mode 100644 veilid-core/Cargo.lock create mode 100644 veilid-core/Cargo.toml create mode 100644 veilid-core/build.rs create mode 100755 veilid-core/ios_build.sh create mode 100644 veilid-core/proto/veilid.capnp create mode 100644 veilid-core/src/attachment_manager.rs create mode 100644 veilid-core/src/callback_state_machine.rs create mode 100644 veilid-core/src/connection_table.rs create mode 100644 veilid-core/src/dht/crypto.rs create mode 100644 veilid-core/src/dht/envelope.rs create mode 100644 veilid-core/src/dht/key.rs create mode 100644 veilid-core/src/dht/mod.rs create mode 100644 veilid-core/src/dht/receipt.rs create mode 100644 veilid-core/src/dht/value.rs create mode 100644 veilid-core/src/intf/mod.rs create mode 100644 veilid-core/src/intf/native/block_store.rs create mode 100644 veilid-core/src/intf/native/mod.rs create mode 100644 veilid-core/src/intf/native/network/listener_state.rs create mode 100644 veilid-core/src/intf/native/network/mod.rs create mode 100644 veilid-core/src/intf/native/network/protocol/mod.rs create mode 100644 veilid-core/src/intf/native/network/protocol/tcp.rs create mode 100644 veilid-core/src/intf/native/network/protocol/udp.rs create mode 100644 veilid-core/src/intf/native/network/protocol/wrtc.rs create mode 100644 veilid-core/src/intf/native/network/protocol/ws.rs create mode 100644 veilid-core/src/intf/native/network/public_dialinfo_discovery.rs create mode 100644 veilid-core/src/intf/native/protected_store.rs create mode 100644 veilid-core/src/intf/native/system.rs create mode 100644 veilid-core/src/intf/native/table_store.rs create mode 100644 veilid-core/src/intf/native/utils/android/android_get_if_addrs.rs create mode 100644 veilid-core/src/intf/native/utils/android/get_directories.rs create mode 100644 veilid-core/src/intf/native/utils/android/mod.rs create mode 100644 veilid-core/src/intf/native/utils/async_peek_stream.rs create mode 100644 veilid-core/src/intf/native/utils/channel.rs create mode 100644 veilid-core/src/intf/native/utils/clone_stream.rs create mode 100644 veilid-core/src/intf/native/utils/ios/mod.rs create mode 100644 veilid-core/src/intf/native/utils/mod.rs create mode 100644 veilid-core/src/intf/native/utils/network_interfaces.rs create mode 100644 veilid-core/src/intf/table_db.rs create mode 100644 veilid-core/src/intf/wasm/block_store.rs create mode 100644 veilid-core/src/intf/wasm/mod.rs create mode 100644 veilid-core/src/intf/wasm/network/mod.rs create mode 100644 veilid-core/src/intf/wasm/network/protocol/mod.rs create mode 100644 veilid-core/src/intf/wasm/network/protocol/wrtc.rs create mode 100644 veilid-core/src/intf/wasm/network/protocol/ws.rs create mode 100644 veilid-core/src/intf/wasm/protected_store.rs create mode 100644 veilid-core/src/intf/wasm/system.rs create mode 100644 veilid-core/src/intf/wasm/table_store.rs create mode 100644 veilid-core/src/intf/wasm/utils/channel.rs create mode 100644 veilid-core/src/intf/wasm/utils/mod.rs create mode 100644 veilid-core/src/lease_manager.rs create mode 100644 veilid-core/src/lib.rs create mode 100644 veilid-core/src/network_manager.rs create mode 100644 veilid-core/src/receipt_manager.rs create mode 100644 veilid-core/src/relay_manager.rs create mode 100644 veilid-core/src/routing_table/bucket.rs create mode 100644 veilid-core/src/routing_table/bucket_entry.rs create mode 100644 veilid-core/src/routing_table/dial_info_entry.rs create mode 100644 veilid-core/src/routing_table/find_nodes.rs create mode 100644 veilid-core/src/routing_table/mod.rs create mode 100644 veilid-core/src/routing_table/node_ref.rs create mode 100644 veilid-core/src/rpc_processor/coders/address.rs create mode 100644 veilid-core/src/rpc_processor/coders/dial_info.rs create mode 100644 veilid-core/src/rpc_processor/coders/mod.rs create mode 100644 veilid-core/src/rpc_processor/coders/node_dial_info_single.rs create mode 100644 veilid-core/src/rpc_processor/coders/node_info.rs create mode 100644 veilid-core/src/rpc_processor/coders/nonce.rs create mode 100644 veilid-core/src/rpc_processor/coders/peer_info.rs create mode 100644 veilid-core/src/rpc_processor/coders/private_safety_route.rs create mode 100644 veilid-core/src/rpc_processor/coders/public_key.rs create mode 100644 veilid-core/src/rpc_processor/coders/sender_info.rs create mode 100644 veilid-core/src/rpc_processor/coders/socket_address.rs create mode 100644 veilid-core/src/rpc_processor/mod.rs create mode 100644 veilid-core/src/supplier_table.rs create mode 100644 veilid-core/src/tests/.gitignore create mode 100644 veilid-core/src/tests/android/.gitignore create mode 100644 veilid-core/src/tests/android/.idea/.gitignore create mode 100644 veilid-core/src/tests/android/.idea/.name create mode 100644 veilid-core/src/tests/android/.idea/compiler.xml create mode 100644 veilid-core/src/tests/android/.idea/gradle.xml create mode 100644 veilid-core/src/tests/android/.idea/jarRepositories.xml create mode 100644 veilid-core/src/tests/android/.idea/misc.xml create mode 100644 veilid-core/src/tests/android/.idea/vcs.xml create mode 100644 veilid-core/src/tests/android/.project create mode 100644 veilid-core/src/tests/android/.settings/org.eclipse.buildship.core.prefs create mode 100644 veilid-core/src/tests/android/app/.classpath create mode 100644 veilid-core/src/tests/android/app/.gitignore create mode 100644 veilid-core/src/tests/android/app/.project create mode 100644 veilid-core/src/tests/android/app/.settings/org.eclipse.buildship.core.prefs create mode 100644 veilid-core/src/tests/android/app/CMakeLists.txt create mode 100644 veilid-core/src/tests/android/app/build.gradle create mode 100644 veilid-core/src/tests/android/app/cpplink.cpp create mode 100644 veilid-core/src/tests/android/app/proguard-rules.pro create mode 100644 veilid-core/src/tests/android/app/src/main/AndroidManifest.xml create mode 100644 veilid-core/src/tests/android/app/src/main/java/com/veilid/veilid-core/veilid-core_android_tests/MainActivity.java create mode 100644 veilid-core/src/tests/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 veilid-core/src/tests/android/app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 veilid-core/src/tests/android/app/src/main/res/layout/activity_main.xml create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 veilid-core/src/tests/android/app/src/main/res/values-night/themes.xml create mode 100644 veilid-core/src/tests/android/app/src/main/res/values/colors.xml create mode 100644 veilid-core/src/tests/android/app/src/main/res/values/strings.xml create mode 100644 veilid-core/src/tests/android/app/src/main/res/values/themes.xml create mode 100644 veilid-core/src/tests/android/build.gradle create mode 100644 veilid-core/src/tests/android/gradle.properties create mode 100644 veilid-core/src/tests/android/gradle/wrapper/gradle-wrapper.jar create mode 100644 veilid-core/src/tests/android/gradle/wrapper/gradle-wrapper.properties create mode 100755 veilid-core/src/tests/android/gradlew create mode 100644 veilid-core/src/tests/android/gradlew.bat create mode 100644 veilid-core/src/tests/android/settings.gradle create mode 100644 veilid-core/src/tests/common/mod.rs create mode 100644 veilid-core/src/tests/common/test_connection_table.rs create mode 100644 veilid-core/src/tests/common/test_crypto.rs create mode 100644 veilid-core/src/tests/common/test_dht_key.rs create mode 100644 veilid-core/src/tests/common/test_envelope_receipt.rs create mode 100644 veilid-core/src/tests/common/test_host_interface.rs create mode 100644 veilid-core/src/tests/common/test_table_store.rs create mode 100644 veilid-core/src/tests/common/test_veilid_config.rs create mode 100644 veilid-core/src/tests/common/test_veilid_core.rs create mode 100644 veilid-core/src/tests/files/cert.pem create mode 100644 veilid-core/src/tests/files/key.pem create mode 100644 veilid-core/src/tests/ios/.gitignore create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilid-core.c create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilid-core.h create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests-Bridging-Header.h create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests.xcodeproj/project.pbxproj create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests.xcodeproj/xcshareddata/xcschemes/veilidcore-tests.xcscheme create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/AppDelegate.swift create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/Assets.xcassets/Contents.json create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/Base.lproj/LaunchScreen.storyboard create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/Base.lproj/Main.storyboard create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/Info.plist create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/SceneDelegate.swift create mode 100644 veilid-core/src/tests/ios/veilidcore-tests/veilidcore-tests/ViewController.swift create mode 100644 veilid-core/src/tests/mod.rs create mode 100644 veilid-core/src/tests/native/mod.rs create mode 100644 veilid-core/src/tests/native/test_async_peek_stream.rs create mode 100644 veilid-core/src/veilid_api.rs create mode 100644 veilid-core/src/veilid_config.rs create mode 100644 veilid-core/src/veilid_core.rs create mode 100644 veilid-core/src/veilid_rng.rs create mode 100644 veilid-core/src/watcher_table.rs create mode 100644 veilid-core/src/xx/bump_port.rs create mode 100644 veilid-core/src/xx/eventual.rs create mode 100644 veilid-core/src/xx/eventual_base.rs create mode 100644 veilid-core/src/xx/eventual_value.rs create mode 100644 veilid-core/src/xx/eventual_value_clone.rs create mode 100644 veilid-core/src/xx/ip_addr_port.rs create mode 100644 veilid-core/src/xx/ip_extra.rs create mode 100644 veilid-core/src/xx/mod.rs create mode 100644 veilid-core/src/xx/single_future.rs create mode 100644 veilid-core/src/xx/single_shot_eventual.rs create mode 100644 veilid-core/src/xx/tick_task.rs create mode 100644 veilid-core/src/xx/tools.rs create mode 100644 veilid-core/tests/node.rs create mode 100644 veilid-core/tests/web.rs create mode 100644 veilid-core/veilid-core-node/.gitignore create mode 100644 veilid-core/veilid-core-node/index.js create mode 100644 veilid-core/veilid-core-node/package.json create mode 100644 veilid-server/.gitignore create mode 100644 veilid-server/Cargo.lock create mode 100644 veilid-server/Cargo.toml create mode 100644 veilid-server/build.rs create mode 100644 veilid-server/proto/veilid-client.capnp create mode 100644 veilid-server/src/client_api.rs create mode 100644 veilid-server/src/main.rs create mode 100644 veilid-server/src/settings.rs create mode 100644 veilid-server/src/unix.rs create mode 100644 veilid-server/src/windows.rs create mode 100644 veilid-wasm/.appveyor.yml create mode 100644 veilid-wasm/.cargo-ok create mode 100644 veilid-wasm/.gitignore create mode 100644 veilid-wasm/.travis.yml create mode 100644 veilid-wasm/Cargo.toml create mode 100644 veilid-wasm/LICENSE_APACHE create mode 100644 veilid-wasm/LICENSE_MIT create mode 100644 veilid-wasm/README.md create mode 100644 veilid-wasm/src/js_veilid_core.rs create mode 100644 veilid-wasm/src/lib.rs create mode 100644 veilid-wasm/src/utils.rs create mode 100644 veilid-wasm/tests/web.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..c243a5bf --- /dev/null +++ b/.gitignore @@ -0,0 +1,59 @@ +############################################################################## +### MacOS + +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +############################################################################## +### Windows + +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..ec4d4238 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,111 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "attach", + "name": "Attach to veilid-server", + "program": "${workspaceFolder}/veilid-server/target/debug/veilid-server", + "pid": "${command:pickMyProcess}" + }, + { + "type": "lldb", + "request": "launch", + "name": "Launch veilid-cli", + "args": ["--debug"], + "program": "${workspaceFolder}/veilid-cli/target/debug/veilid-cli", + "windows": { + "program": "${workspaceFolder}/veilid-cli/target/debug/veilid-cli.exe" + }, + "cwd": "${workspaceFolder}", + "sourceLanguages": ["rust"], + "terminal": "console" + }, + // { + // "type": "lldb", + // "request": "launch", + // "name": "Debug veilid-server", + // "cargo": { + // "args": ["run", "--manifest-path", "veilid-server/Cargo.toml"] + // }, + // "args": ["--trace"], + // "cwd": "${workspaceFolder}/veilid-server" + // } + + { + "type": "lldb", + "request": "launch", + "name": "Debug veilid-server", + "program": "${workspaceFolder}/veilid-server/target/debug/veilid-server", + "args": ["--trace", "--attach=true"], + "cwd": "${workspaceFolder}/veilid-server/target/debug/", + "env": { + "RUST_BACKTRACE": "1" + }, + "terminal": "console" + }, + + { + "type": "lldb", + "request": "launch", + "name": "Debug veilid-core unit test", + "cargo": { + "args": [ + "test", + "--no-run", + "--manifest-path", + "veilid-core/Cargo.toml" + ], + "filter": { + "kind": "cdylib", + "name": "veilid-core" + } + }, + "args": ["${selectedText}"], + "cwd": "${workspaceFolder}/veilid-core" + }, + + { + "type": "lldb", + "request": "launch", + "name": "Debug veilid-server unit test", + "cargo": { + "args": [ + "test", + "--no-run", + "--manifest-path", + "veilid-server/Cargo.toml" + ], + "filter": { + "kind": "bin", + "name": "veilid-server" + } + }, + "args": ["${selectedText}"], + "cwd": "${workspaceFolder}/veilid-server" + }, + + { + "type": "lldb", + "request": "launch", + "name": "Debug keyvaluedb-sqlite unit test", + "cargo": { + "args": [ + "test", + "--no-run", + "--manifest-path", + "external/keyvaluedb/keyvaluedb-sqlite/Cargo.toml" + ], + "filter": { + "kind": "lib", + "name": "keyvaluedb-sqlite" + } + }, + "args": ["${selectedText}"], + "cwd": "${workspaceFolder}/external/keyvaluedb/keyvaluedb-sqlite" + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/external/keyring-rs b/external/keyring-rs index 972802f4..6562019f 160000 --- a/external/keyring-rs +++ b/external/keyring-rs @@ -1 +1 @@ -Subproject commit 972802f4f57275a00c29158353adcf7d8ffc7fdc +Subproject commit 6562019f0b86f622ab5dcadede80f7c8c8ea1eea diff --git a/setup_android.sh b/setup_android.sh new file mode 100755 index 00000000..d0cfd1c1 --- /dev/null +++ b/setup_android.sh @@ -0,0 +1,68 @@ +#!/bin/bash +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +if [ ! "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then + echo Not a supported Linux + exit 1 +fi + +# ensure ANDROID_SDK_ROOT is defined and exists +if [ -d "$ANDROID_SDK_ROOT" ]; then + echo '[X] $ANDROID_SDK_ROOT is defined and exists' +else + echo '$ANDROID_SDK_ROOT is not defined or does not exist' + exit 1 +fi + + +# ensure ANDROID_NDK_HOME is defined and exists +if [ -d "$ANDROID_NDK_HOME" ]; then + echo '[X] $ANDROID_NDK_HOME is defined and exists' +else + echo '$ANDROID_NDK_HOME is not defined or does not exist' + exit 1 +fi + +# ensure ndk is installed +if [ -f "$ANDROID_NDK_HOME/ndk-build" ]; then + echo '[X] Android NDK is installed at the location $ANDROID_NDK_HOME' +else + echo 'Android NDK is not installed at the location $ANDROID_NDK_HOME' + exit 1 +fi + +# ensure cmake is installed +if [ -d "$ANDROID_SDK_ROOT/cmake" ]; then + echo '[X] Android SDK CMake is installed' +else + echo 'Android SDK CMake is not installed' + exit 1 +fi + +# ensure emulator is installed +if [ -d "$ANDROID_SDK_ROOT/emulator" ]; then + echo '[X] Android SDK emulator is installed' +else + echo 'Android SDK emulator is not installed' + exit 1 +fi + +# ensure adb is installed +if command -v adb &> /dev/null; then + echo '[X] adb is available in the path' +else + echo 'adb is not available in the path' + exit 1 +fi + +# install android targets +rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android + +# install cargo ndk +cargo install cargo-ndk +cargo install cargo-apk + +# Ensure packages are installed +sudo apt-get install libc6-dev-i386 libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 openjdk-11-jdk + + diff --git a/setup_ios.sh b/setup_ios.sh new file mode 100755 index 00000000..ba5ddce4 --- /dev/null +++ b/setup_ios.sh @@ -0,0 +1,35 @@ +#!/bin/bash +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +if [ ! "$(uname)" == "Darwin" ]; then + echo Not running on MacOS + exit 1 +fi + +# install android targets +rustup target add aarch64-apple-darwin aarch64-apple-ios x86_64-apple-darwin x86_64-apple-ios + +# xxx: install +ios-arm64-nightly-2021-06-12 toolchain for bitcode from https://github.com/getditto/rust-bitcode + +# Ensure brew is installed +if command -v brew &> /dev/null; then + echo '[X] brew is available in the path' +else + echo 'brew is not available in the path' + exit 1 +fi + +# Ensure xcode is installed +if command -v xcode-select &> /dev/null; then + echo '[X] XCode is available in the path' +else + echo 'XCode is not available in the path' + exit 1 +fi + +# Ensure we have command line tools +xcode-select --install + +# Ensure packages are installed +brew install capnp + diff --git a/test/scripts/debug_main_node.sh b/test/scripts/debug_main_node.sh new file mode 100755 index 00000000..f768c7bf --- /dev/null +++ b/test/scripts/debug_main_node.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exec ./run_local_test.py 20 -w 0 --config-file ./no-timeout.cfg $1 diff --git a/test/scripts/debug_subnode_1.sh b/test/scripts/debug_subnode_1.sh new file mode 100755 index 00000000..cee6a50e --- /dev/null +++ b/test/scripts/debug_subnode_1.sh @@ -0,0 +1,2 @@ +#!/bin/bash +exec ./run_local_test.py 2 -w 1 --log_trace --config-file ./no-timeout.cfg diff --git a/test/scripts/no-timeout.yml b/test/scripts/no-timeout.yml new file mode 100644 index 00000000..31294a68 --- /dev/null +++ b/test/scripts/no-timeout.yml @@ -0,0 +1,12 @@ +--- +core: + network: + rpc: + max_timestamp_behind: + max_timestamp_ahead: + timeout: 86400000000 + dht: + resolve_node_timeout: + get_value_timeout: + set_value_timeout: + address_filter: false diff --git a/test/scripts/run_20_no_timeout.sh b/test/scripts/run_20_no_timeout.sh new file mode 100755 index 00000000..02d9199b --- /dev/null +++ b/test/scripts/run_20_no_timeout.sh @@ -0,0 +1,4 @@ +#!/bin/bash +exec ./run_local_test.py 20 --config-file ./no-timeout.cfg $1 + + diff --git a/test/scripts/run_2_no_timeout.sh b/test/scripts/run_2_no_timeout.sh new file mode 100755 index 00000000..b945d44f --- /dev/null +++ b/test/scripts/run_2_no_timeout.sh @@ -0,0 +1,4 @@ +#!/bin/bash +exec ./run_local_test.py 2 --config-file ./no-timeout.cfg $1 + + diff --git a/test/scripts/run_4_no_timeout.sh b/test/scripts/run_4_no_timeout.sh new file mode 100755 index 00000000..829df0b9 --- /dev/null +++ b/test/scripts/run_4_no_timeout.sh @@ -0,0 +1,4 @@ +#!/bin/bash +exec ./run_local_test.py 4 --config-file ./no-timeout.cfg $1 + + diff --git a/test/scripts/run_local_test.py b/test/scripts/run_local_test.py new file mode 100755 index 00000000..3195414b --- /dev/null +++ b/test/scripts/run_local_test.py @@ -0,0 +1,173 @@ +#!/usr/bin/env python3 + +import sys +import os +import io +import argparse +import subprocess +import signal +import time +from threading import Thread + +if sys.version_info < (3, 0, 0): + print(__file__ + ' requires Python 3, while Python ' + + str(sys.version[0] + ' was detected. Terminating. ')) + sys.exit(1) + +script_dir = os.path.dirname(os.path.realpath(__file__)) +veilid_server_exe_debug = os.path.join(script_dir, '..', 'veilid-server', + 'target', 'debug', 'veilid-server') +veilid_server_exe_release = os.path.join( + script_dir, '..', 'veilid-server', 'target', 'release', 'veilid-server') +main_process = None +subindex_processes = [] + +try: + # Python 3, open as binary, then wrap in a TextIOWrapper with write-through. + sys.stdout = io.TextIOWrapper( + open(sys.stdout.fileno(), 'wb', 0), write_through=True) + sys.stderr = io.TextIOWrapper( + open(sys.stderr.fileno(), 'wb', 0), write_through=True) +except TypeError: + # Python 2 + sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) + sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0) + + +def tee(prefix, infile, *files): + """Print `infile` to `files` in a separate thread.""" + + def fanout(prefix, infile, *files): + with infile: + for line in iter(infile.readline, b""): + for f in files: + f.write(prefix + line) + f.flush() + + t = Thread(target=fanout, args=(prefix, infile,) + files) + t.daemon = True + t.start() + return t + + +def read_until_local_dial_info(proc, proto): + + local_dial_info_str = b"Local Dial Info: " + for ln in iter(proc.stdout.readline, ""): + sys.stdout.buffer.write(ln) + sys.stdout.flush() + + idx = ln.find(local_dial_info_str) + if idx != -1: + idx += len(local_dial_info_str) + di = ln[idx:] + if di.startswith(proto): + return di.decode("utf-8").strip() + + return None + + +class CleanChildProcesses: + def __enter__(self): + os.setpgrp() # create new process group, become its leader + + def __exit__(self, type, value, traceback): + try: + os.killpg(0, signal.SIGKILL) # kill all processes in my group + except KeyboardInterrupt: + pass + + +def main(): + threads = [] + + # Parse arguments + parser = argparse.ArgumentParser(description='Run veilid servers locally') + parser.add_argument("count", type=int, + help='number of instances to run') + parser.add_argument("--release", action='store_true', + help='use release mode build') + parser.add_argument("--log_trace", action='store_true', + help='use trace logging') + parser.add_argument("--log_info", action='store_true', + help='use info logging') + parser.add_argument("-w", "--wait-for-debug", action='append', + help='specify subnode index to wait for the debugger') + parser.add_argument("--config-file", type=str, + help='configuration file to specify for the bootstrap node') + parser.add_argument("--protocol", type=bytes, default=b"udp", + help='default protocol to choose for dial info') + args = parser.parse_args() + + if args.count < 1: + print("Must specify more than one instance") + sys.exit(1) + + veilid_server_exe = None + if args.release: + veilid_server_exe = veilid_server_exe_release + else: + veilid_server_exe = veilid_server_exe_debug + + base_args = [veilid_server_exe] + base_args.append("--attach=true") + if args.log_info: + pass + elif args.log_trace: + base_args.append("--trace") + else: + base_args.append("--debug") + + if args.config_file: + base_args.append("--config-file={}".format(args.config_file)) + + # Run primary node and get node id + main_args = base_args.copy() + if args.wait_for_debug and ("0" in args.wait_for_debug): + main_args.append("--wait-for-debug") + + print("Running main node: {}".format(str(main_args))) + main_proc = subprocess.Popen( + main_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + print(">>> MAIN NODE PID={}".format(main_proc.pid)) + + main_di = read_until_local_dial_info(main_proc, args.protocol) + + threads.append( + tee(b"Veilid-0: ", main_proc.stdout, open("/tmp/veilid-0-out", "wb"), + getattr(sys.stdout, "buffer", sys.stdout)) + ) + + # Run all secondaries and add primary to bootstrap + for n in range(1, args.count): + + # time.sleep(2) + + sub_args = base_args.copy() + sub_args.append("--subnode_index={}".format(n)) + sub_args.append("--bootstrap={}".format(main_di)) + if args.wait_for_debug and (str(n) in args.wait_for_debug): + sub_args.append("--wait-for-debug") + + print("Running subnode {}: {}".format(n, str(sub_args))) + + sub_proc = subprocess.Popen( + sub_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + + print(">>> SUBNODE {} NODE PID={}".format(n, sub_proc.pid)) + + threads.append( + tee("Veilid-{}: ".format(n).encode("utf-8"), sub_proc.stdout, open("/tmp/veilid-{}-out".format(n), "wb"), + getattr(sys.stdout, "buffer", sys.stdout)) + ) + + for t in threads: + t.join() # wait for IO completion + + sys.exit(0) + + +if __name__ == "__main__": + + with CleanChildProcesses(): + main() diff --git a/veilid-cli/.gitignore b/veilid-cli/.gitignore new file mode 100644 index 00000000..c0ed7d09 --- /dev/null +++ b/veilid-cli/.gitignore @@ -0,0 +1,2 @@ +/target +/logs \ No newline at end of file diff --git a/veilid-cli/Cargo.lock b/veilid-cli/Cargo.lock new file mode 100644 index 00000000..e03c6107 --- /dev/null +++ b/veilid-cli/Cargo.lock @@ -0,0 +1,3519 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +dependencies = [ + "aes-soft", + "aesni", + "cipher 0.2.5", +] + +[[package]] +name = "aes-soft" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" +dependencies = [ + "cipher 0.2.5", + "opaque-debug", +] + +[[package]] +name = "aesni" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" +dependencies = [ + "cipher 0.2.5", + "opaque-debug", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.3", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "android_log-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" + +[[package]] +name = "android_logger" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ec2333c185d826313162cee39d3fcc6a84ba08114a839bebf53b961e7e75773" +dependencies = [ + "android_log-sys", + "env_logger 0.7.1", + "lazy_static", + "log", +] + +[[package]] +name = "android_logger" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ed09b18365ed295d722d0b5ed59c01b79a826ff2d2a8f73d5ecca8e6fb2f66" +dependencies = [ + "android_log-sys", + "env_logger 0.8.4", + "lazy_static", + "log", +] + +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d9ff5d688f1c13395289f67db01d4826b46dd694e7580accdc3e8430f2d98e" + +[[package]] +name = "arraydeque" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0ffd3d69bd89910509a5d31d1f1353f38ccffdd116dd0099bbd6627f7bd8ad8" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-attributes" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "async-channel" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "once_cell", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-mutex", + "blocking", + "futures-lite", + "num_cpus", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +dependencies = [ + "concurrent-queue", + "futures-lite", + "libc", + "log", + "once_cell", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "winapi", +] + +[[package]] +name = "async-lock" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-process" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83137067e3a2a6a06d67168e49e68a0957d215410473a740cea95a2425c0b7c6" +dependencies = [ + "async-io", + "blocking", + "cfg-if 1.0.0", + "event-listener", + "futures-lite", + "libc", + "once_cell", + "signal-hook", + "winapi", +] + +[[package]] +name = "async-std" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" +dependencies = [ + "async-attributes", + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "async-process", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "num_cpus", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" + +[[package]] +name = "async-tls" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400" +dependencies = [ + "futures-core", + "futures-io", + "rustls", + "webpki 0.21.4", + "webpki-roots 0.21.1", +] + +[[package]] +name = "async-tungstenite" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5c45a0dd44b7e6533ac4e7acc38ead1a3b39885f5bbb738140d30ea528abc7c" +dependencies = [ + "async-std", + "futures-io", + "futures-util", + "log", + "pin-project 0.4.28", + "tungstenite 0.11.1", +] + +[[package]] +name = "async-tungstenite" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d06e9a20f1c0d64b6067ef6aa9fdf59e194ecde93575591fb4c78063692324" +dependencies = [ + "async-std", + "async-tls", + "futures-io", + "futures-util", + "log", + "pin-project-lite", + "tungstenite 0.16.0", +] + +[[package]] +name = "async_executors" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b13b311cd10e80105651ad640a6741991d147787badb4141e8e1b7fd59816f5" +dependencies = [ + "async-std", + "blanket", + "futures-core", + "futures-task", + "futures-util", + "pin-project 1.0.8", + "rustc_version", + "wasm-bindgen-futures", +] + +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures", + "pharos", + "rustc_version", +] + +[[package]] +name = "atomic-waker" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "backtrace" +version = "0.3.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "blake3" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "526c210b4520e416420759af363083471656e819a75e831b8d2c9d5a584f2413" +dependencies = [ + "arrayref", + "arrayvec 0.7.2", + "cc", + "cfg-if 1.0.0", + "constant_time_eq", +] + +[[package]] +name = "blanket" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b04ce3d2372d05d1ef4ea3fdf427da6ae3c17ca06d688a107b5344836276bc3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-modes" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" +dependencies = [ + "block-padding", + "cipher 0.2.5", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "blocking" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046e47d4b2d391b1f6f8b407b1deb8dee56c1852ccd868becf2710f601b5f427" +dependencies = [ + "async-channel", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "once_cell", +] + +[[package]] +name = "bugsalot" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ecfa84116fbdfe0a25779563defa5e6600ec6ef041017efe21ef494206e6928" + +[[package]] +name = "bumpalo" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cache-padded" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" + +[[package]] +name = "capnp" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae9b8a7119420b5279ddc2b4ee553ee15bcf4605df6135a26f03ffe153bee97c" + +[[package]] +name = "capnp-futures" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a15248c8facb189a3c5fee74fbf1ff3adc134261d27da663b89c7d19ebaf983" +dependencies = [ + "capnp", + "futures", +] + +[[package]] +name = "capnp-rpc" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4f17f96f68f2c1168ed7105d9e5cb4a095a5bef3578aee0f9c0644b85ca95e" +dependencies = [ + "capnp", + "capnp-futures", + "futures", +] + +[[package]] +name = "capnpc" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47bce811162518b5c38f746ed584bd2922ae7bb560ef64f230d2e4ee0d111fe" +dependencies = [ + "capnp", +] + +[[package]] +name = "cc" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chacha20" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01b72a433d0cf2aef113ba70f62634c56fddb0f244e6377185c56a7cadbd8f91" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.3.0", + "cpufeatures", + "zeroize", +] + +[[package]] +name = "chacha20poly1305" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b84ed6d1d5f7aa9bdde921a5090e0ca4d934d250ea3b402a5fab3a994e28a2a" +dependencies = [ + "aead", + "chacha20", + "cipher 0.3.0", + "poly1305", + "zeroize", +] + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits 0.2.14", + "time", + "winapi", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "clap" +version = "2.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim 0.8.0", + "textwrap", + "unicode-width", + "vec_map", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "combine" +version = "4.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b2f5d0ee456f3928812dfc8c6d9a1d592b98678f6d56db9b0cd2b7bc6c8db5" +dependencies = [ + "bytes 1.1.0", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", +] + +[[package]] +name = "config" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b076e143e1d9538dde65da30f8481c2a6c44040edb8e02b9bf1351edb92ce3" +dependencies = [ + "lazy_static", + "nom", + "rust-ini", + "serde 1.0.130", + "serde-hjson", + "serde_json", + "toml", + "yaml-rust", +] + +[[package]] +name = "config" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1b9d958c2b1368a663f05538fc1b5975adce1e19f435acceae987aceeeb369" +dependencies = [ + "lazy_static", + "nom", + "rust-ini", + "serde 1.0.130", + "serde-hjson", + "serde_json", + "toml", + "yaml-rust", +] + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "core-foundation" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" +dependencies = [ + "core-foundation-sys 0.6.2", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +dependencies = [ + "core-foundation-sys 0.8.3", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +dependencies = [ + "cfg-if 1.0.0", + "lazy_static", +] + +[[package]] +name = "crossterm" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486d44227f71a1ef39554c0dc47e44b9f4139927c75043312690c3f476d1d788" +dependencies = [ + "bitflags", + "crossterm_winapi", + "libc", + "mio", + "parking_lot 0.11.2", + "signal-hook", + "signal-hook-mio", + "winapi", +] + +[[package]] +name = "crossterm_winapi" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a6966607622438301997d3dac0d2f6e9a90c68bb6bc1785ea98456ab93c0507" +dependencies = [ + "winapi", +] + +[[package]] +name = "crypto-mac" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctor" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "cursive" +version = "0.17.0-alpha.0" +dependencies = [ + "ahash", + "cfg-if 1.0.0", + "crossbeam-channel", + "crossterm", + "cursive_core", + "lazy_static", + "libc", + "log", + "maplit", + "ncurses", + "signal-hook", + "term_size", + "unicode-segmentation", + "unicode-width", +] + +[[package]] +name = "cursive-flexi-logger-view" +version = "0.4.1-alpha.0" +dependencies = [ + "arraydeque", + "cursive", + "cursive_core", + "flexi_logger", + "lazy_static", + "log", + "unicode-width", +] + +[[package]] +name = "cursive_buffered_backend" +version = "0.6.0-alpha.0" +dependencies = [ + "cursive_core", + "enumset", + "log", + "smallvec", + "unicode-segmentation", + "unicode-width", +] + +[[package]] +name = "cursive_core" +version = "0.3.0-alpha.0" +dependencies = [ + "ahash", + "async-std", + "chrono", + "crossbeam-channel", + "enum-map", + "enumset", + "lazy_static", + "log", + "num 0.4.0", + "owning_ref", + "toml", + "unicode-segmentation", + "unicode-width", + "xi-unicode", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-ng" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" +dependencies = [ + "byteorder", + "digest", + "rand_core 0.6.3", + "subtle-ng", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core 0.10.2", + "darling_macro 0.10.2", +] + +[[package]] +name = "darling" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +dependencies = [ + "darling_core 0.13.0", + "darling_macro 0.13.0", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.9.3", + "syn", +] + +[[package]] +name = "darling_core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core 0.10.2", + "quote", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +dependencies = [ + "darling_core 0.13.0", + "quote", + "syn", +] + +[[package]] +name = "data-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "directories" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "ed25519" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74e1069e39f1454367eb2de793ed062fac4c35c2934b76a81d90dd9abcd28816" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "sha2", + "zeroize", +] + +[[package]] +name = "enum-map" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e893a7ba6116821058dec84a6fb14fb2a97cd8ce5fd0f85d5a4e760ecd7329d9" +dependencies = [ + "enum-map-derive", +] + +[[package]] +name = "enum-map-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84278eae0af6e34ff6c1db44c11634a694aafac559ff3080e4db4e4ac35907aa" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "enumflags2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c8d82922337cd23a15f88b70d8e4ef5f11da38dd7cdb55e84dd5de99695da0" +dependencies = [ + "enumflags2_derive", + "serde 1.0.130", +] + +[[package]] +name = "enumflags2_derive" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46cce" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "enumset" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6216d2c19a6fb5f29d1ada1dc7bc4367a8cbf0fa4af5cf12e07b5bbdde6b5b2c" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6451128aa6655d880755345d085494cf7561a6bee7c8dc821e5d77e6d267ecd4" +dependencies = [ + "darling 0.13.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "env_logger" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "event-listener" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fastrand" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b394ed3d285a429378d3b384b9eb1285267e7df4b166df24b7a6939a04dc392e" +dependencies = [ + "instant", +] + +[[package]] +name = "flexi_logger" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab94b6ac8eb69f1496a6993f26f785b5fd6d99b7416023eb2a6175c0b242b1" +dependencies = [ + "atty", + "chrono", + "glob", + "lazy_static", + "log", + "regex", + "thiserror", + "yansi", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" + +[[package]] +name = "futures-executor" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" +dependencies = [ + "autocfg", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" + +[[package]] +name = "futures-task" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" + +[[package]] +name = "futures-util" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" +dependencies = [ + "autocfg", + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.10.2+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "gloo-timers" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashlink" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7249a3129cbc1ffccd74857f81464a323a152173cdb134e0fd81bc803b29facf" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" +dependencies = [ + "digest", + "hmac", +] + +[[package]] +name = "hmac" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" +dependencies = [ + "crypto-mac", + "digest", +] + +[[package]] +name = "http" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" +dependencies = [ + "bytes 1.1.0", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "if-addrs" +version = "0.6.7" +dependencies = [ + "if-addrs-sys", + "libc", + "winapi", +] + +[[package]] +name = "if-addrs-sys" +version = "0.3.2" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "input_buffer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19a8a95243d5a0398cae618ec29477c6e3cb631152be5c19481f80bc71559754" +dependencies = [ + "bytes 0.5.6", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keychain-services" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fd01702fbd22eee99431f553959f86d558cfc1dbf7f98b8df159be14e29a349" +dependencies = [ + "core-foundation 0.6.4", + "failure", + "failure_derive", +] + +[[package]] +name = "keyring" +version = "0.10.1" +dependencies = [ + "byteorder", + "cfg-if 0.1.10", + "core-foundation 0.9.2", + "core-foundation-sys 0.8.3", + "jni", + "keychain-services", + "lazy_static", + "log", + "ndk", + "ndk-glue", + "secret-service", + "security-framework", + "security-framework-sys", + "winapi", +] + +[[package]] +name = "keyvaluedb" +version = "0.1.0" +dependencies = [ + "smallvec", +] + +[[package]] +name = "keyvaluedb-memorydb" +version = "0.1.0" +dependencies = [ + "keyvaluedb", + "parking_lot 0.11.2", +] + +[[package]] +name = "keyvaluedb-sqlite" +version = "0.1.0" +dependencies = [ + "hex", + "keyvaluedb", + "log", + "parking_lot 0.11.2", + "rusqlite", +] + +[[package]] +name = "keyvaluedb-web" +version = "0.1.0" +dependencies = [ + "futures", + "js-sys", + "keyvaluedb", + "keyvaluedb-memorydb", + "log", + "parking_lot 0.11.2", + "send_wrapper", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lexical-core" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" +dependencies = [ + "arrayvec 0.5.2", + "bitflags", + "cfg-if 1.0.0", + "ryu", + "static_assertions", +] + +[[package]] +name = "libc" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119" + +[[package]] +name = "libsqlite3-sys" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abd5850c449b40bacb498b2bbdfaff648b1b055630073ba8db499caf2d0ea9f2" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linked-hash-map" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd" +dependencies = [ + "serde 0.8.23", + "serde_test", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "lock_api" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if 1.0.0", + "value-bag", +] + +[[package]] +name = "lru" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c748cfe47cb8da225c37595b3108bea1c198c84aaae8ea0ba76d01dda9fc803" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + +[[package]] +name = "memchr" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg", +] + +[[package]] +name = "mio" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +dependencies = [ + "libc", + "log", + "miow", + "ntapi", + "winapi", +] + +[[package]] +name = "miow" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" +dependencies = [ + "winapi", +] + +[[package]] +name = "nb-connect" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1bb540dc6ef51cfe1916ec038ce7a620daf3a111e2502d745197cd53d6bca15" +dependencies = [ + "libc", + "socket2", +] + +[[package]] +name = "ncurses" +version = "5.101.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5d34d72657dc4b638a1c25d40aae81e4f1c699062f72f467237920752032" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "ndk" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64d6af06fde0e527b1ba5c7b79a6cc89cfc46325b0b2887dffe8f70197e0c3c" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk-glue" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e9e94628f24e7a3cb5b96a2dc5683acd9230bf11991c2a1677b87695138420" +dependencies = [ + "android_logger 0.9.2", + "lazy_static", + "libc", + "log", + "ndk", + "ndk-macro", + "ndk-sys", +] + +[[package]] +name = "ndk-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +dependencies = [ + "darling 0.10.2", + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" + +[[package]] +name = "nix" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" +dependencies = [ + "bitflags", + "cc", + "cfg-if 0.1.10", + "libc", + "void", +] + +[[package]] +name = "no-std-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + +[[package]] +name = "nom" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +dependencies = [ + "lexical-core", + "memchr", + "version_check", +] + +[[package]] +name = "ntapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +dependencies = [ + "winapi", +] + +[[package]] +name = "num" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7a8e9be5e039e2ff869df49155f1c06bd01ade2117ec783e56ab0932b67a8f" +dependencies = [ + "num-bigint", + "num-complex 0.3.1", + "num-integer", + "num-iter", + "num-rational 0.3.2", + "num-traits 0.2.14", +] + +[[package]] +name = "num" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +dependencies = [ + "num-complex 0.4.0", + "num-integer", + "num-iter", + "num-rational 0.4.0", + "num-traits 0.2.14", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-complex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "num-complex" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits 0.2.14", +] + +[[package]] +name = "num-iter" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" +dependencies = [ + "autocfg", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-rational" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +dependencies = [ + "autocfg", + "num-integer", + "num-traits 0.2.14", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.14", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" +dependencies = [ + "derivative", + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "object" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "owning_ref" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff55baddef9e4ad00f88b6c743a2a8062d4c6ade126c2a528644b8e444d52ce" +dependencies = [ + "stable_deref_trait", +] + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +dependencies = [ + "lock_api 0.3.4", + "parking_lot_core 0.7.2", +] + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api 0.4.5", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot_core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" +dependencies = [ + "cfg-if 0.1.10", + "cloudabi", + "libc", + "redox_syscall 0.1.57", + "smallvec", + "winapi", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall 0.2.10", + "smallvec", + "winapi", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures", + "rustc_version", +] + +[[package]] +name = "pin-project" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" +dependencies = [ + "pin-project-internal 0.4.28", +] + +[[package]] +name = "pin-project" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08" +dependencies = [ + "pin-project-internal 1.0.8", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" + +[[package]] +name = "polling" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "log", + "wepoll-ffi", + "winapi", +] + +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] +name = "proc-macro-nested" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" + +[[package]] +name = "proc-macro2" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", + "rand_hc 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.3", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core 0.6.3", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.3", + "redox_syscall 0.2.10", +] + +[[package]] +name = "regex" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rusqlite" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a82b0b91fad72160c56bf8da7a549b25d7c31109f52cc1437eac4c0ad2550a7" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "memchr", + "smallvec", +] + +[[package]] +name = "rust-fsm" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9ee4731a0f53c973772b83c43c57a26e146b6fa024af5aeab972b63d678b65" +dependencies = [ + "rust-fsm-dsl", +] + +[[package]] +name = "rust-fsm-dsl" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44237c429621e3606374941c3061fe95686bdaddb9b4f6524e4edc2d21da9c58" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "rust-ini" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.0", + "log", + "ring", + "sct", + "webpki 0.21.4", +] + +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64 0.13.0", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "secret-service" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2400fb1bf2a87b303ada204946294f932ade4929477e9e2bf66d7b49a66656ec" +dependencies = [ + "aes", + "block-modes", + "hkdf", + "lazy_static", + "num 0.3.1", + "rand 0.8.4", + "serde 1.0.130", + "sha2", + "zbus", + "zbus_macros", + "zvariant", + "zvariant_derive", +] + +[[package]] +name = "security-framework" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87" +dependencies = [ + "bitflags", + "core-foundation 0.9.2", + "core-foundation-sys 0.8.3", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" +dependencies = [ + "core-foundation-sys 0.8.3", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" + +[[package]] +name = "send_wrapper" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "930c0acf610d3fdb5e2ab6213019aaa04e227ebe9547b0649ba599b16d788bd7" + +[[package]] +name = "serde" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" + +[[package]] +name = "serde" +version = "1.0.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-big-array" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18b20e7752957bbe9661cff4e0bb04d183d0948cdab2ea58cdb9df36a61dfe62" +dependencies = [ + "serde 1.0.130", + "serde_derive", +] + +[[package]] +name = "serde-hjson" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a3a4e0ea8a88553209f6cc6cfe8724ecad22e1acf372793c27d995290fe74f8" +dependencies = [ + "lazy_static", + "linked-hash-map 0.3.0", + "num-traits 0.1.43", + "regex", + "serde 0.8.23", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde 1.0.130", +] + +[[package]] +name = "serde_derive" +version = "1.0.130" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063bf466a64011ac24040a49009724ee60a57da1b437617ceb32e53ad61bfb19" +dependencies = [ + "itoa", + "ryu", + "serde 1.0.130", +] + +[[package]] +name = "serde_repr" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_test" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "110b3dbdf8607ec493c22d5d947753282f3bae73c0f56d322af1e8c78e4c23d5" +dependencies = [ + "serde 0.8.23", +] + +[[package]] +name = "serial_test" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fef5f7c7434b2f2c598adc6f9494648a1e41274a75c0ba4056f680ae0c117fd6" +dependencies = [ + "lazy_static", + "parking_lot 0.10.2", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08338d8024b227c62bd68a12c7c9883f5c66780abaef15c550dc56f46ee6515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer", + "cfg-if 1.0.0", + "cpufeatures", + "digest", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" +dependencies = [ + "block-buffer", + "cfg-if 1.0.0", + "cpufeatures", + "digest", + "opaque-debug", +] + +[[package]] +name = "signal-hook" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c98891d737e271a2954825ef19e46bd16bdb98e2746f2eec4f7a4ef7946efd1" +dependencies = [ + "libc", + "signal-hook-registry", +] + +[[package]] +name = "signal-hook-mio" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29fd5867f1c4f2c5be079aee7a2adf1152ebb04a4bc4d341f504b7dece607ed4" +dependencies = [ + "libc", + "mio", + "signal-hook", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" + +[[package]] +name = "slab" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" + +[[package]] +name = "smallvec" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" + +[[package]] +name = "socket2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "subtle-ng" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" + +[[package]] +name = "syn" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "term_size" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thiserror" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "tinyvec" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "toml" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +dependencies = [ + "serde 1.0.130", +] + +[[package]] +name = "tungstenite" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0308d80d86700c5878b9ef6321f020f29b1bb9d5ff3cab25e75e23f3a492a23" +dependencies = [ + "base64 0.12.3", + "byteorder", + "bytes 0.5.6", + "http", + "httparse", + "input_buffer", + "log", + "rand 0.7.3", + "sha-1", + "url", + "utf-8", +] + +[[package]] +name = "tungstenite" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ad3713a14ae247f22a728a0456a545df14acf3867f905adff84be99e23b3ad1" +dependencies = [ + "base64 0.13.0", + "byteorder", + "bytes 1.1.0", + "http", + "httparse", + "log", + "rand 0.8.4", + "sha-1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec" + +[[package]] +name = "uluru" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794a32261a1f5eb6a4462c81b59cec87b5c27d5deea7dd1ac8fc781c41d226db" +dependencies = [ + "arrayvec 0.7.2", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" + +[[package]] +name = "unicode-normalization" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" + +[[package]] +name = "unicode-width" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" + +[[package]] +name = "unicode-xid" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "value-bag" +version = "1.0.0-alpha.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79923f7731dc61ebfba3633098bf3ac533bbd35ccd8c57e7088d9a5eebe0263f" +dependencies = [ + "ctor", + "version_check", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "veilid-cli" +version = "0.1.0" +dependencies = [ + "anyhow", + "async-std", + "async-tungstenite 0.8.0", + "bugsalot", + "capnp", + "capnp-rpc", + "capnpc", + "cfg-if 0.1.10", + "clap", + "config 0.10.1", + "crossbeam-channel", + "cursive", + "cursive-flexi-logger-view", + "cursive_buffered_backend", + "directories", + "flexi_logger", + "futures", + "log", + "parking_lot 0.11.2", + "serde 1.0.130", + "serde_derive", + "serial_test", + "thiserror", + "veilid-core", +] + +[[package]] +name = "veilid-core" +version = "0.1.0" +dependencies = [ + "android_logger 0.10.1", + "anyhow", + "async-std", + "async-tls", + "async-tungstenite 0.16.0", + "async_executors", + "backtrace", + "blake3", + "capnp", + "capnpc", + "cfg-if 0.1.10", + "chacha20poly1305", + "config 0.11.0", + "console_error_panic_hook", + "curve25519-dalek-ng", + "data-encoding", + "digest", + "directories", + "ed25519-dalek", + "futures-util", + "generic-array", + "getrandom 0.2.3", + "hashbrown", + "hex", + "if-addrs", + "jni", + "jni-sys", + "js-sys", + "keyring", + "keyvaluedb-sqlite", + "keyvaluedb-web", + "lazy_static", + "log", + "lru", + "maplit", + "ndk", + "ndk-glue", + "no-std-net", + "num_cpus", + "once_cell", + "parking_lot 0.11.2", + "rand 0.7.3", + "rusqlite", + "rust-fsm", + "rustls", + "rustls-pemfile", + "secrecy", + "serde 1.0.130", + "serde-big-array", + "serde_cbor", + "socket2", + "static_assertions", + "thiserror", + "uluru", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-logger", + "web-sys", + "webpki 0.22.0", + "webpki-roots 0.22.1", + "wee_alloc", + "ws_stream_wasm", + "x25519-dalek-ng", +] + +[[package]] +name = "version_check" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[package]] +name = "wasm-bindgen" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +dependencies = [ + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" + +[[package]] +name = "wasm-logger" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "074649a66bb306c8f2068c9016395fa65d8e08d2affcbf95acf3c24c3ab19718" +dependencies = [ + "log", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +dependencies = [ + "webpki 0.21.4", +] + +[[package]] +name = "webpki-roots" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c475786c6f47219345717a043a37ec04cb4bc185e28853adcc4fa0a947eba630" +dependencies = [ + "webpki 0.22.0", +] + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "ws_stream_wasm" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47ca1ab42f5afed7fc332b22b6e932ca5414b209465412c8cdf0ad23bc0de645" +dependencies = [ + "async_io_stream", + "futures", + "js-sys", + "pharos", + "rustc_version", + "send_wrapper", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "x25519-dalek-ng" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7074de8999662970c3c4c8f7f30925028dd8f4ca31ad4c055efa9cdf2ec326" +dependencies = [ + "curve25519-dalek-ng", + "rand 0.8.4", + "rand_core 0.6.3", + "zeroize", +] + +[[package]] +name = "xi-unicode" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map 0.5.4", +] + +[[package]] +name = "yansi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" + +[[package]] +name = "zbus" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2326acc379a3ac4e34b794089f5bdb17086bf29a5fdf619b7b4cc772dc2e9dad" +dependencies = [ + "async-io", + "byteorder", + "derivative", + "enumflags2", + "fastrand", + "futures", + "nb-connect", + "nix", + "once_cell", + "polling", + "scoped-tls", + "serde 1.0.130", + "serde_repr", + "zbus_macros", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a482c56029e48681b89b92b5db3c446db0915e8dd1052c0328a574eda38d5f93" +dependencies = [ + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d68d9dcec5f9b43a30d38c49f91dfedfaac384cb8f085faca366c26207dd1619" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65f1a51723ec88c66d5d1fe80c841f17f63587d6691901d66be9bec6c3b51f73" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zvariant" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68c7b55f2074489b7e8e07d2d0a6ee6b4f233867a653c664d8020ba53692525" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde 1.0.130", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ca5e22593eb4212382d60d26350065bf2a02c34b85bc850474a74b589a3de9" +dependencies = [ + "proc-macro-crate 1.1.0", + "proc-macro2", + "quote", + "syn", +] diff --git a/veilid-cli/Cargo.toml b/veilid-cli/Cargo.toml new file mode 100644 index 00000000..b79f303d --- /dev/null +++ b/veilid-cli/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "veilid-cli" +version = "0.1.0" +authors = ["John Smith "] +edition = "2018" +build = "build.rs" +license = "LGPL-2.0-or-later OR MPL-2.0 OR (MIT AND BSD-3-Clause)" + +[[bin]] +name = "veilid-cli" +path = "src/main.rs" + +[patch.crates-io] +cursive = { path = "../external/cursive/cursive", default-features = false, features = ["crossterm-backend", "toml"]} +cursive_core = { path = "../external/cursive/cursive-core" } + +[dependencies] +async-std = { version = "^1.9", features = ["unstable", "attributes"] } +async-tungstenite = { version = "^0.8", features = ["async-std-runtime"] } +cursive = { path = "../external/cursive/cursive", default-features = false, features = ["crossterm-backend", "toml"]} +cursive-flexi-logger-view = { path = "../external/cursive-flexi-logger-view" } +cursive_buffered_backend = { path = "../external/cursive_buffered_backend" } +# cursive-multiplex = "0.4.0" +# cursive_tree_view = "0.6.0" +# cursive_table_view = "0.12.0" +# cursive-tabs = "0.5.0" +clap = "^2.33.2" +directories = "^3" +log = "^0.4" +futures = "^0.3" +serde = "^1.0.122" +serde_derive = "^1.0.122" +parking_lot = "^0.11" +cfg-if = "^0.1" +capnp = "^0.14" +capnp-rpc = "^0.14" +config = { version = "0.10.1", features = ["yaml"] } +anyhow = "^1" +bugsalot = "^0.2" +flexi_logger = "0.17" +thiserror = "^1.0" +crossbeam-channel = "0.5" +veilid-core = { path = "../veilid-core" } + +[dev-dependencies] +serial_test = "^0.4" + +[build-dependencies] +capnpc = "^0.14" + +[profile.release] +lto = true diff --git a/veilid-cli/build.rs b/veilid-cli/build.rs new file mode 100644 index 00000000..fa57d860 --- /dev/null +++ b/veilid-cli/build.rs @@ -0,0 +1,7 @@ +fn main() { + ::capnpc::CompilerCommand::new() + .file("../veilid-server/proto/veilid-client.capnp") + .src_prefix("../veilid-server/") + .run() + .expect("compiling schema"); +} diff --git a/veilid-cli/src/client_api_connection.rs b/veilid-cli/src/client_api_connection.rs new file mode 100644 index 00000000..26303266 --- /dev/null +++ b/veilid-cli/src/client_api_connection.rs @@ -0,0 +1,214 @@ +use crate::command_processor::*; +use crate::veilid_client_capnp::*; +use anyhow::*; +use async_std::prelude::*; +use capnp::capability::Promise; +use capnp_rpc::{pry, rpc_twoparty_capnp, twoparty, Disconnector, RpcSystem}; +use futures::AsyncReadExt; +use log::*; +use std::cell::RefCell; +use std::net::SocketAddr; +use std::rc::Rc; + +struct VeilidClientImpl { + comproc: CommandProcessor, +} + +impl VeilidClientImpl { + pub fn new(comproc: CommandProcessor) -> Self { + Self { comproc: comproc } + } +} + +impl veilid_client::Server for VeilidClientImpl { + fn state_changed( + &mut self, + params: veilid_client::StateChangedParams, + _results: veilid_client::StateChangedResults, + ) -> Promise<(), ::capnp::Error> { + let changed = pry!(pry!(params.get()).get_changed()); + + if changed.has_attachment() { + let attachment = pry!(changed.get_attachment()); + let old_state = pry!(attachment.get_old_state()); + let new_state = pry!(attachment.get_new_state()); + + trace!( + "AttachmentStateChange: old_state={} new_state={}", + old_state as u16, + new_state as u16 + ); + self.comproc.set_attachment_state(new_state); + } + + Promise::ok(()) + } +} + +struct ClientApiConnectionInner { + comproc: CommandProcessor, + connect_addr: Option, + disconnector: Option>, + server: Option>>, + disconnect_requested: bool, +} + +type Handle = Rc>; + +#[derive(Clone)] +pub struct ClientApiConnection { + inner: Handle, +} + +impl ClientApiConnection { + pub fn new(comproc: CommandProcessor) -> Self { + Self { + inner: Rc::new(RefCell::new(ClientApiConnectionInner { + comproc: comproc, + connect_addr: None, + disconnector: None, + server: None, + disconnect_requested: false, + })), + } + } + + async fn handle_connection(&mut self) -> Result<()> { + trace!("ClientApiConnection::handle_connection"); + let connect_addr = self.inner.borrow().connect_addr.unwrap().clone(); + // Connect the TCP socket + let stream = async_std::net::TcpStream::connect(connect_addr.clone()).await?; + // If it succeed, disable nagle algorithm + stream.set_nodelay(true)?; + + // Create the VAT network + let (reader, writer) = stream.split(); + let rpc_network = Box::new(twoparty::VatNetwork::new( + reader, + writer, + rpc_twoparty_capnp::Side::Client, + Default::default(), + )); + // Create the rpc system + let mut rpc_system = RpcSystem::new(rpc_network, None); + let mut request; + { + let mut inner = self.inner.borrow_mut(); + + // Get the bootstrap server connection object + inner.server = Some(Rc::new(RefCell::new( + rpc_system.bootstrap(rpc_twoparty_capnp::Side::Server), + ))); + + // Store our disconnector future for later (must happen after bootstrap, contrary to documentation) + inner.disconnector = Some(rpc_system.get_disconnector()); + + // Get a client object to pass to the server for status update callbacks + let client = capnp_rpc::new_client(VeilidClientImpl::new(inner.comproc.clone())); + + // Register our client and get a registration object back + request = inner + .server + .as_ref() + .unwrap() + .borrow_mut() + .register_request(); + request.get().set_veilid_client(client); + + inner + .comproc + .set_connection_state(ConnectionState::Connected( + connect_addr, + std::time::SystemTime::now(), + )); + } + + // Don't drop the registration + rpc_system.try_join(request.send().promise).await?; + + // Drop the server and disconnector too (if we still have it) + let mut inner = self.inner.borrow_mut(); + let disconnect_requested = inner.disconnect_requested; + inner.server = None; + inner.disconnector = None; + inner.disconnect_requested = false; + + if !disconnect_requested { + // Connection lost + Err(anyhow!("Connection lost")) + } else { + // Connection finished + Ok(()) + } + } + + pub async fn server_attach(&mut self) -> Result { + trace!("ClientApiConnection::server_attach"); + let server = { + let inner = self.inner.borrow(); + inner + .server + .as_ref() + .ok_or(anyhow!("Not connected, ignoring attach request"))? + .clone() + }; + let request = server.borrow().attach_request(); + let response = request.send().promise.await?; + Ok(response.get()?.get_result()) + } + + pub async fn server_detach(&mut self) -> Result { + trace!("ClientApiConnection::server_detach"); + let server = { + let inner = self.inner.borrow(); + inner + .server + .as_ref() + .ok_or(anyhow!("Not connected, ignoring detach request"))? + .clone() + }; + let request = server.borrow().detach_request(); + let response = request.send().promise.await?; + Ok(response.get()?.get_result()) + } + + pub async fn server_shutdown(&mut self) -> Result { + trace!("ClientApiConnection::server_shutdown"); + let server = { + let inner = self.inner.borrow(); + inner + .server + .as_ref() + .ok_or(anyhow!("Not connected, ignoring attach request"))? + .clone() + }; + let request = server.borrow().shutdown_request(); + let response = request.send().promise.await?; + Ok(response.get()?.get_result()) + } + + // Start Client API connection + pub async fn connect(&mut self, connect_addr: SocketAddr) -> Result<()> { + trace!("ClientApiConnection::connect"); + // Save the address to connect to + self.inner.borrow_mut().connect_addr = Some(connect_addr); + + self.handle_connection().await + } + + // End Client API connection + pub async fn disconnect(&mut self) { + trace!("ClientApiConnection::disconnect"); + let disconnector = self.inner.borrow_mut().disconnector.take(); + match disconnector { + Some(d) => { + self.inner.borrow_mut().disconnect_requested = true; + d.await.unwrap(); + self.inner.borrow_mut().connect_addr = None; + } + None => { + debug!("disconnector doesn't exist"); + } + } + } +} diff --git a/veilid-cli/src/command_processor.rs b/veilid-cli/src/command_processor.rs new file mode 100644 index 00000000..c9a4de23 --- /dev/null +++ b/veilid-cli/src/command_processor.rs @@ -0,0 +1,325 @@ +use crate::client_api_connection::*; +use crate::settings::Settings; +use crate::ui::*; +use crate::veilid_client_capnp::*; +use async_std::prelude::FutureExt; +use log::*; +use std::cell::*; +use std::net::SocketAddr; +use std::rc::Rc; +use std::time::{Duration, SystemTime}; +use veilid_core::xx::{Eventual, EventualCommon}; + +#[derive(PartialEq, Clone)] +pub enum ConnectionState { + Disconnected, + Connected(SocketAddr, SystemTime), + Retrying(SocketAddr, SystemTime), +} +impl ConnectionState { + pub fn is_disconnected(&self) -> bool { + match *self { + Self::Disconnected => true, + _ => false, + } + } + pub fn is_connected(&self) -> bool { + match *self { + Self::Connected(_, _) => true, + _ => false, + } + } + pub fn is_retrying(&self) -> bool { + match *self { + Self::Retrying(_, _) => true, + _ => false, + } + } +} + +struct CommandProcessorInner { + ui: UI, + capi: Option, + reconnect: bool, + finished: bool, + autoconnect: bool, + autoreconnect: bool, + server_addr: Option, + connection_waker: Eventual, +} + +type Handle = Rc>; + +#[derive(Clone)] +pub struct CommandProcessor { + inner: Handle, +} + +impl CommandProcessor { + pub fn new(ui: UI, settings: &Settings) -> Self { + Self { + inner: Rc::new(RefCell::new(CommandProcessorInner { + ui: ui, + capi: None, + reconnect: settings.autoreconnect, + finished: false, + autoconnect: settings.autoconnect, + autoreconnect: settings.autoreconnect, + server_addr: None, + connection_waker: Eventual::new(), + })), + } + } + pub fn set_client_api_connection(&mut self, capi: ClientApiConnection) { + self.inner.borrow_mut().capi = Some(capi); + } + fn inner(&self) -> Ref { + self.inner.borrow() + } + fn inner_mut(&self) -> RefMut { + self.inner.borrow_mut() + } + fn ui(&self) -> UI { + self.inner.borrow().ui.clone() + } + fn capi(&self) -> ClientApiConnection { + self.inner.borrow().capi.as_ref().unwrap().clone() + } + + fn word_split(line: &str) -> (String, Option) { + let trimmed = line.trim(); + if let Some(p) = trimmed.find(char::is_whitespace) { + let first = trimmed[0..p].to_owned(); + let rest = trimmed[p..].trim_start().to_owned(); + (first, Some(rest)) + } else { + (trimmed.to_owned(), None) + } + } + + pub fn cmd_help(&self, _rest: Option, callback: UICallback) -> Result<(), String> { + trace!("CommandProcessor::cmd_help"); + self.ui().add_node_event( + r#"Commands: +exit/quit - exit the client +disconnect - disconnect the client from the Veilid node +shutdown - shut the server down +attach - attach the server to the Veilid network +detach - detach the server from the Veilid network +"#, + ); + let ui = self.ui(); + callback(ui); + Ok(()) + } + + pub fn cmd_exit(&self, callback: UICallback) -> Result<(), String> { + trace!("CommandProcessor::cmd_exit"); + let ui = self.ui(); + callback(ui); + // + self.ui().quit(); + Ok(()) + } + + pub fn cmd_shutdown(&self, callback: UICallback) -> Result<(), String> { + trace!("CommandProcessor::cmd_shutdown"); + let mut capi = self.capi(); + let ui = self.ui(); + async_std::task::spawn_local(async move { + if let Err(e) = capi.server_shutdown().await { + error!("Server command 'shutdown' failed to execute: {}", e); + } + callback(ui); + }); + Ok(()) + } + + pub fn cmd_attach(&self, callback: UICallback) -> Result<(), String> { + trace!("CommandProcessor::cmd_attach"); + let mut capi = self.capi(); + let ui = self.ui(); + async_std::task::spawn_local(async move { + if let Err(e) = capi.server_attach().await { + error!("Server command 'attach' failed to execute: {}", e); + } + callback(ui); + }); + Ok(()) + } + + pub fn cmd_detach(&self, callback: UICallback) -> Result<(), String> { + trace!("CommandProcessor::cmd_detach"); + let mut capi = self.capi(); + let ui = self.ui(); + async_std::task::spawn_local(async move { + if let Err(e) = capi.server_detach().await { + error!("Server command 'detach' failed to execute: {}", e); + } + callback(ui); + }); + Ok(()) + } + + pub fn cmd_disconnect(&self, callback: UICallback) -> Result<(), String> { + trace!("CommandProcessor::cmd_disconnect"); + let mut capi = self.capi(); + let ui = self.ui(); + async_std::task::spawn_local(async move { + capi.disconnect().await; + callback(ui); + }); + Ok(()) + } + + pub fn run_command(&self, command_line: &str, callback: UICallback) -> Result<(), String> { + // + let (cmd, rest) = Self::word_split(command_line); + + match cmd.as_str() { + "help" => self.cmd_help(rest, callback), + "exit" => self.cmd_exit(callback), + "quit" => self.cmd_exit(callback), + "disconnect" => self.cmd_disconnect(callback), + "shutdown" => self.cmd_shutdown(callback), + "attach" => self.cmd_attach(callback), + "detach" => self.cmd_detach(callback), + _ => { + callback(self.ui()); + Err(format!("Invalid command: {}", cmd)) + } + } + } + + pub async fn connection_manager(&mut self) { + // Connect until we're done + while !self.inner_mut().finished { + // Wait for connection request + if !self.inner().autoconnect { + let waker = self.inner_mut().connection_waker.instance_clone(()); + waker.await; + } else { + self.inner_mut().autoconnect = false; + } + self.inner_mut().connection_waker.reset(); + // Loop while we want to keep the connection + let mut first = true; + while self.inner().reconnect { + let server_addr_opt = self.inner_mut().server_addr.clone(); + let server_addr = match server_addr_opt { + None => break, + Some(addr) => addr, + }; + if first { + info!("Connecting to server at {}", server_addr); + self.set_connection_state(ConnectionState::Retrying( + server_addr.clone(), + SystemTime::now(), + )); + } else { + debug!("Retrying connection to {}", server_addr); + } + let mut capi = self.capi(); + let res = capi.connect(server_addr.clone()).await; + if let Ok(_) = res { + info!( + "Connection to server at {} terminated normally", + server_addr + ); + break; + } + if !self.inner().autoreconnect { + info!("Connection to server lost."); + break; + } + + self.set_connection_state(ConnectionState::Retrying( + server_addr.clone(), + SystemTime::now(), + )); + + debug!("Connection lost, retrying in 2 seconds"); + { + let waker = self.inner_mut().connection_waker.instance_clone(()); + waker + .race(async_std::task::sleep(Duration::from_millis(2000))) + .await; + } + self.inner_mut().connection_waker.reset(); + first = false; + } + info!("Disconnected."); + self.set_connection_state(ConnectionState::Disconnected); + self.inner_mut().reconnect = true; + } + } + + // called by ui + //////////////////////////////////////////// + pub fn set_server_address(&mut self, server_addr: Option) { + self.inner_mut().server_addr = server_addr; + } + pub fn get_server_address(&self) -> Option { + self.inner().server_addr.clone() + } + // called by client_api_connection + // calls into ui + //////////////////////////////////////////// + pub fn set_attachment_state(&mut self, state: AttachmentState) { + self.inner_mut().ui.set_attachment_state(state); + } + + // called by client_api_connection + // calls into ui + //////////////////////////////////////////// + pub fn set_connection_state(&mut self, state: ConnectionState) { + self.inner_mut().ui.set_connection_state(state); + } + // called by ui + //////////////////////////////////////////// + pub fn start_connection(&mut self) { + self.inner_mut().reconnect = true; + self.inner_mut().connection_waker.resolve(); + } + // pub fn stop_connection(&mut self) { + // self.inner_mut().reconnect = false; + // let mut capi = self.capi().clone(); + // async_std::task::spawn_local(async move { + // capi.disconnect().await; + // }); + // } + pub fn cancel_reconnect(&mut self) { + self.inner_mut().reconnect = false; + self.inner_mut().connection_waker.resolve(); + } + pub fn quit(&mut self) { + self.inner_mut().finished = true; + self.inner_mut().reconnect = false; + self.inner_mut().connection_waker.resolve(); + } + + // called by ui + // calls into client_api_connection + //////////////////////////////////////////// + pub fn attach(&mut self) { + trace!("CommandProcessor::attach"); + let mut capi = self.capi(); + + async_std::task::spawn_local(async move { + if let Err(e) = capi.server_attach().await { + error!("Server command 'attach' failed to execute: {}", e); + } + }); + } + + pub fn detach(&mut self) { + trace!("CommandProcessor::detach"); + let mut capi = self.capi(); + + async_std::task::spawn_local(async move { + if let Err(e) = capi.server_detach().await { + error!("Server command 'detach' failed to execute: {}", e); + } + }); + } +} diff --git a/veilid-cli/src/main.rs b/veilid-cli/src/main.rs new file mode 100644 index 00000000..61a29173 --- /dev/null +++ b/veilid-cli/src/main.rs @@ -0,0 +1,171 @@ +use anyhow::*; +use async_std::prelude::*; +use clap::{App, Arg}; +use flexi_logger::*; +use log::*; +use std::ffi::OsStr; +use std::net::ToSocketAddrs; + +mod client_api_connection; +mod command_processor; +mod settings; +mod ui; + +pub mod veilid_client_capnp { + include!(concat!(env!("OUT_DIR"), "/proto/veilid_client_capnp.rs")); +} + +fn parse_command_line<'a>( + default_config_path: &'a OsStr, +) -> Result, clap::Error> { + let matches = App::new("veilid-cli") + .version("0.1") + .about("Veilid Console Client") + .arg( + Arg::with_name("address") + .required(false) + .help("Address to connect to"), + ) + .arg( + Arg::with_name("debug") + .long("debug") + .help("Turn on debug logging"), + ) + .arg( + Arg::with_name("wait-for-debug") + .long("wait-for-debug") + .help("Wait for debugger to attach"), + ) + .arg( + Arg::with_name("trace") + .long("trace") + .conflicts_with("debug") + .help("Turn on trace logging"), + ) + .arg( + Arg::with_name("config-file") + .short("c") + .takes_value(true) + .value_name("FILE") + .default_value_os(default_config_path) + .help("Specify a configuration file to use"), + ) + .get_matches(); + + Ok(matches) +} + +#[async_std::main] +async fn main() -> Result<()> { + // Get command line options + let default_config_path = settings::Settings::get_default_config_path(); + let matches = parse_command_line(default_config_path.as_os_str())?; + if matches.occurrences_of("wait-for-debug") != 0 { + use bugsalot::debugger; + debugger::wait_until_attached(None).expect("state() not implemented on this platform"); + } + + // Attempt to load configuration + let mut settings = settings::Settings::new( + matches.occurrences_of("config-file") == 0, + matches.value_of_os("config-file").unwrap(), + ) + .map_err(|x| Box::new(x))?; + + // Set config from command line + if matches.occurrences_of("debug") != 0 { + settings.logging.level = settings::LogLevel::Debug; + settings.logging.terminal.enabled = true; + } + if matches.occurrences_of("trace") != 0 { + settings.logging.level = settings::LogLevel::Trace; + settings.logging.terminal.enabled = true; + } + + // Create UI object + let mut sivui = ui::UI::new(settings.interface.node_log.scrollback, &settings); + + // Set up loggers + { + let mut specbuilder = LogSpecBuilder::new(); + specbuilder.default(settings::convert_loglevel(settings.logging.level)); + specbuilder.module("cursive_core", LevelFilter::Off); + specbuilder.module("cursive_buffered_backend", LevelFilter::Off); + specbuilder.module("mio", LevelFilter::Off); + specbuilder.module("async_std", LevelFilter::Off); + specbuilder.module("async_io", LevelFilter::Off); + specbuilder.module("polling", LevelFilter::Off); + + let logger = Logger::with(specbuilder.build()); + + if settings.logging.terminal.enabled { + let flv = sivui.cursive_flexi_logger(); + if settings.logging.file.enabled { + std::fs::create_dir_all(settings.logging.file.directory.clone())?; + logger + .log_target(LogTarget::FileAndWriter(flv)) + .suppress_timestamp() + // .format(flexi_logger::colored_default_format) + .directory(settings.logging.file.directory.clone()) + .start() + .expect("failed to initialize logger!"); + } else { + logger + .log_target(LogTarget::Writer(flv)) + .suppress_timestamp() + .format(flexi_logger::colored_default_format) + .start() + .expect("failed to initialize logger!"); + } + } else if settings.logging.file.enabled { + std::fs::create_dir_all(settings.logging.file.directory.clone())?; + logger + .log_target(LogTarget::File) + .suppress_timestamp() + .directory(settings.logging.file.directory.clone()) + .start() + .expect("failed to initialize logger!"); + } + } + // Get client address + let server_addrs; + if let Some(address_arg) = matches.value_of("address") { + server_addrs = address_arg + .to_socket_addrs() + .context(format!("Invalid server address '{}'", address_arg))? + .collect() + } else { + server_addrs = settings.address.addrs.clone(); + } + let server_addr = server_addrs.first().cloned(); + + // Create command processor + debug!("Creating Command Processor "); + let mut comproc = command_processor::CommandProcessor::new(sivui.clone(), &settings); + sivui.set_command_processor(comproc.clone()); + + // Create client api client side + info!("Starting API connection"); + let mut capi = client_api_connection::ClientApiConnection::new(comproc.clone()); + + // Save client api in command processor + comproc.set_client_api_connection(capi.clone()); + + // Keep a connection to the server + comproc.set_server_address(server_addr); + let mut comproc2 = comproc.clone(); + let connection_future = comproc.connection_manager(); + // Start UI + let ui_future = async_std::task::spawn_local(async move { + sivui.run_async().await; + + // When UI quits, close connection and command processor cleanly + comproc2.quit(); + capi.disconnect().await; + }); + + // Wait for ui and connection to complete + ui_future.join(connection_future).await; + + Ok(()) +} diff --git a/veilid-cli/src/settings.rs b/veilid-cli/src/settings.rs new file mode 100644 index 00000000..c21edc1d --- /dev/null +++ b/veilid-cli/src/settings.rs @@ -0,0 +1,269 @@ +use config; +use directories::*; +use log; +use serde; +use serde_derive::*; +use std::ffi::OsStr; +use std::net::{SocketAddr, ToSocketAddrs}; +use std::path::{Path, PathBuf}; + +pub fn load_default_config(cfg: &mut config::Config) -> Result<(), config::ConfigError> { + let default_config = r###"--- +address: "localhost:5959" +autoconnect: true +autoreconnect: true +logging: + level: "info" + terminal: + enabled: false + file: + enabled: true + directory: "" + append: true +interface: + node_log: + scrollback: 2048 + command_line: + history_size: 2048 + theme: + shadow: false + borders: "simple" + colors: + background : "#333D3D" + shadow : "#000000" + view : "#1c2323" + primary : "#a6d8d3" + secondary : "#8cb4b7" + tertiary : "#eeeeee" + title_primary : "#f93fbd" + title_secondary : "#ff0000" + highlight : "#f93fbd" + highlight_inactive : "#a6d8d3" + highlight_text : "#333333" + log_colors: + trace : "#707070" + debug : "#a0a0a0" + info : "#5cd3c6" + warn : "#fedc50" + error : "#ff4a15" + "###; + cfg.merge(config::File::from_str( + default_config, + config::FileFormat::Yaml, + )) + .map(drop) +} + +pub fn load_config( + cfg: &mut config::Config, + config_file: &Path, +) -> Result<(), config::ConfigError> { + if let Some(config_file_str) = config_file.to_str() { + cfg.merge(config::File::new(config_file_str, config::FileFormat::Yaml)) + .map(drop) + } else { + Err(config::ConfigError::Message( + "config file path is not valid UTF-8".to_owned(), + )) + } +} + +#[derive(Copy, Clone, Debug)] +pub enum LogLevel { + Error, + Warn, + Info, + Debug, + Trace, +} +impl<'de> serde::Deserialize<'de> for LogLevel { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + match s.to_ascii_lowercase().as_str() { + "error" => Ok(LogLevel::Error), + "warn" => Ok(LogLevel::Warn), + "info" => Ok(LogLevel::Info), + "debug" => Ok(LogLevel::Debug), + "trace" => Ok(LogLevel::Trace), + _ => Err(serde::de::Error::custom(format!( + "Invalid log level: {}", + s + ))), + } + } +} +pub fn convert_loglevel(log_level: LogLevel) -> log::LevelFilter { + match log_level { + LogLevel::Error => log::LevelFilter::Error, + LogLevel::Warn => log::LevelFilter::Warn, + LogLevel::Info => log::LevelFilter::Info, + LogLevel::Debug => log::LevelFilter::Debug, + LogLevel::Trace => log::LevelFilter::Trace, + } +} + +#[derive(Debug)] +pub struct NamedSocketAddrs { + pub name: String, + pub addrs: Vec, +} +impl<'de> serde::Deserialize<'de> for NamedSocketAddrs { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + let addr_iter = s + .to_socket_addrs() + .map_err(|x| serde::de::Error::custom(x))?; + Ok(NamedSocketAddrs { + name: s, + addrs: addr_iter.collect(), + }) + } +} + +#[derive(Debug, Deserialize)] +pub struct Terminal { + pub enabled: bool, +} + +#[derive(Debug, Deserialize)] +pub struct File { + pub enabled: bool, + pub directory: String, + pub append: bool, +} + +#[derive(Debug, Deserialize)] +pub struct Logging { + pub terminal: Terminal, + pub file: File, + pub level: LogLevel, +} + +#[derive(Debug, Deserialize)] +pub struct Colors { + pub background: String, + pub shadow: String, + pub view: String, + pub primary: String, + pub secondary: String, + pub tertiary: String, + pub title_primary: String, + pub title_secondary: String, + pub highlight: String, + pub highlight_inactive: String, + pub highlight_text: String, +} + +#[derive(Debug, Deserialize)] +pub struct LogColors { + pub trace: String, + pub debug: String, + pub info: String, + pub warn: String, + pub error: String, +} + +#[derive(Debug, Deserialize)] +pub struct Theme { + pub shadow: bool, + pub borders: String, + pub colors: Colors, + pub log_colors: LogColors, +} + +#[derive(Debug, Deserialize)] +pub struct NodeLog { + pub scrollback: usize, +} + +#[derive(Debug, Deserialize)] +pub struct CommandLine { + pub history_size: usize, +} + +#[derive(Debug, Deserialize)] +pub struct Interface { + pub theme: Theme, + pub node_log: NodeLog, + pub command_line: CommandLine, +} + +#[derive(Debug, Deserialize)] +pub struct Settings { + pub address: NamedSocketAddrs, + pub autoconnect: bool, + pub autoreconnect: bool, + pub logging: Logging, + pub interface: Interface, +} + +impl Settings { + pub fn get_default_config_path() -> PathBuf { + // Get default configuration file location + let mut default_config_path; + + if let Some(my_proj_dirs) = ProjectDirs::from("org", "Veilid", "Veilid") { + default_config_path = PathBuf::from(my_proj_dirs.config_dir()); + } else { + default_config_path = PathBuf::from("./"); + } + default_config_path.push("veilid-client.conf"); + + default_config_path + } + + pub fn get_default_log_directory() -> PathBuf { + // Get default configuration file location + let mut default_log_directory; + + if let Some(my_proj_dirs) = ProjectDirs::from("org", "Veilid", "Veilid") { + default_log_directory = PathBuf::from(my_proj_dirs.config_dir()); + } else { + default_log_directory = PathBuf::from("./"); + } + default_log_directory.push("logs/"); + + default_log_directory + } + + pub fn new( + config_file_is_default: bool, + config_file: &OsStr, + ) -> Result { + // Create a config + let mut cfg = config::Config::default(); + + // Load the default config + load_default_config(&mut cfg)?; + + // Use default log directory for logs + cfg.set( + "logging.file.directory", + Settings::get_default_log_directory().to_str(), + )?; + + // Merge in the config file if we have one + let config_file_path = Path::new(config_file); + if !config_file_is_default || config_file_path.exists() { + // If the user specifies a config file on the command line then it must exist + load_config(&mut cfg, config_file_path)?; + } + cfg.try_into() + } +} + +#[test] +fn test_default_config() { + let mut cfg = config::Config::default(); + + load_default_config(&mut cfg).unwrap(); + let settings = cfg.try_into::().unwrap(); + + println!("default settings: {:?}", settings); +} diff --git a/veilid-cli/src/ui.rs b/veilid-cli/src/ui.rs new file mode 100644 index 00000000..de299163 --- /dev/null +++ b/veilid-cli/src/ui.rs @@ -0,0 +1,785 @@ +use crate::command_processor::*; +use crate::settings::Settings; +use crate::veilid_client_capnp::*; +use crossbeam_channel::Sender; +use cursive::align::*; +use cursive::event::*; +use cursive::theme::*; +use cursive::traits::*; +use cursive::utils::markup::StyledString; +use cursive::views::*; +use cursive::Cursive; +use cursive::CursiveRunnable; +use cursive_flexi_logger_view::{CursiveLogWriter, FlexiLoggerView}; +use log::*; +use std::cell::RefCell; +use std::collections::{HashMap, VecDeque}; +use std::rc::Rc; +use thiserror::Error; +////////////////////////////////////////////////////////////// +/// +struct Dirty { + pub value: T, + dirty: bool, +} + +impl Dirty { + pub fn new(value: T) -> Self { + Self { + value: value, + dirty: true, + } + } + pub fn set(&mut self, value: T) { + self.value = value; + self.dirty = true; + } + pub fn get(&self) -> &T { + &self.value + } + // pub fn get_mut(&mut self) -> &mut T { + // &mut self.value + // } + pub fn take_dirty(&mut self) -> bool { + let is_dirty = self.dirty; + self.dirty = false; + is_dirty + } +} + +pub type UICallback = Box; + +struct UIState { + attachment_state: Dirty, + connection_state: Dirty, +} + +impl UIState { + pub fn new() -> Self { + Self { + attachment_state: Dirty::new(AttachmentState::Detached), + connection_state: Dirty::new(ConnectionState::Disconnected), + } + } +} + +#[derive(Error, Debug)] +#[error("???")] +struct UIError; + +pub struct UIInner { + ui_state: UIState, + log_colors: HashMap, + cmdproc: Option, + cb_sink: Sender>, + cmd_history: VecDeque, + cmd_history_position: usize, + cmd_history_max_size: usize, + connection_dialog_state: Option, +} + +type Handle = Rc>; + +#[derive(Clone)] +pub struct UI { + siv: Handle, + inner: Handle, +} + +impl UI { + pub fn new(node_log_scrollback: usize, settings: &Settings) -> Self { + cursive_flexi_logger_view::resize(node_log_scrollback); + + // Instantiate the cursive runnable + /* + // reduces flicker, but it costs cpu + let mut runnable = CursiveRunnable::new( + || -> Result, UIError> { + let crossterm_backend = cursive::backends::crossterm::Backend::init().unwrap(); + let buffered_backend = + cursive_buffered_backend::BufferedBackend::new(crossterm_backend); + + Ok(Box::new(buffered_backend)) + }, + ); + */ + let runnable = cursive::default(); + // Make the callback mechanism easily reachable + let cb_sink = runnable.cb_sink().clone(); + + // Create the UI object + let this = Self { + siv: Rc::new(RefCell::new(runnable)), + inner: Rc::new(RefCell::new(UIInner { + ui_state: UIState::new(), + log_colors: Default::default(), + cmdproc: None, + cmd_history: { + let mut vd = VecDeque::new(); + vd.push_back("".to_string()); + vd + }, + cmd_history_position: 0, + cmd_history_max_size: settings.interface.command_line.history_size, + connection_dialog_state: None, + cb_sink: cb_sink, + })), + }; + + let mut siv = this.siv.borrow_mut(); + let mut inner = this.inner.borrow_mut(); + + // Make the inner object accessible in callbacks easily + siv.set_user_data(this.inner.clone()); + + // Create layouts + let mut mainlayout = LinearLayout::vertical().with_name("main-layout"); + mainlayout.get_mut().add_child( + Panel::new( + FlexiLoggerView::new_scrollable() + .with_name("node-events") + .full_screen(), + ) + .title_position(HAlign::Left) + .title("Node Events"), + ); + mainlayout.get_mut().add_child( + Panel::new(ScrollView::new( + TextView::new("Peer Table") + .with_name("peers") + .fixed_height(8) + .scrollable(), + )) + .title_position(HAlign::Left) + .title("Peers"), + ); + let mut command = StyledString::new(); + command.append_styled("Command> ", ColorStyle::title_primary()); + // + mainlayout.get_mut().add_child( + LinearLayout::horizontal() + .child(TextView::new(command)) + .child( + EditView::new() + .on_submit(|s, text| { + UI::on_command_line_entered(s, text); + }) + .on_edit(|s, text, cursor| UI::on_command_line_edit(s, text, cursor)) + .on_up_down(|s, dir| { + UI::on_command_line_history(s, dir); + }) + .style(ColorStyle::new( + PaletteColor::Background, + PaletteColor::Secondary, + )) + .with_name("command-line") + .full_screen() + .fixed_height(1), + ) + .child( + Button::new("Attach", |s| { + UI::on_button_attach_pressed(s); + }) + .with_name("button-attach"), + ), + ); + let mut version = StyledString::new(); + version.append_styled( + concat!(" | veilid-cli v", env!("CARGO_PKG_VERSION")), + ColorStyle::highlight_inactive(), + ); + + mainlayout.get_mut().add_child( + LinearLayout::horizontal() + .color(Some(ColorStyle::highlight_inactive())) + .child( + TextView::new("") + .with_name("status-bar") + .full_screen() + .fixed_height(1), + ) + .child(TextView::new(version)), + ); + + siv.add_fullscreen_layer(mainlayout); + + UI::setup_colors(&mut siv, &mut inner, &settings); + UI::setup_quit_handler(&mut siv); + + drop(inner); + drop(siv); + + this + } + + fn command_processor(s: &mut Cursive) -> CommandProcessor { + let inner = Self::inner(s); + inner.cmdproc.as_ref().unwrap().clone() + } + + fn inner(s: &mut Cursive) -> std::cell::Ref<'_, UIInner> { + s.user_data::>().unwrap().borrow() + } + fn inner_mut(s: &mut Cursive) -> std::cell::RefMut<'_, UIInner> { + s.user_data::>().unwrap().borrow_mut() + } + + fn setup_colors(siv: &mut CursiveRunnable, inner: &mut UIInner, settings: &Settings) { + // Make colors + let mut theme = cursive::theme::load_default(); + theme.shadow = settings.interface.theme.shadow; + theme.borders = BorderStyle::from(&settings.interface.theme.borders); + theme.palette.set_color( + "background", + Color::parse(settings.interface.theme.colors.background.as_str()).unwrap(), + ); + theme.palette.set_color( + "shadow", + Color::parse(settings.interface.theme.colors.shadow.as_str()).unwrap(), + ); + theme.palette.set_color( + "view", + Color::parse(settings.interface.theme.colors.view.as_str()).unwrap(), + ); + theme.palette.set_color( + "primary", + Color::parse(settings.interface.theme.colors.primary.as_str()).unwrap(), + ); + theme.palette.set_color( + "secondary", + Color::parse(settings.interface.theme.colors.secondary.as_str()).unwrap(), + ); + theme.palette.set_color( + "tertiary", + Color::parse(settings.interface.theme.colors.tertiary.as_str()).unwrap(), + ); + theme.palette.set_color( + "title_primary", + Color::parse(settings.interface.theme.colors.title_primary.as_str()).unwrap(), + ); + theme.palette.set_color( + "title_secondary", + Color::parse(settings.interface.theme.colors.title_secondary.as_str()).unwrap(), + ); + theme.palette.set_color( + "highlight", + Color::parse(settings.interface.theme.colors.highlight.as_str()).unwrap(), + ); + theme.palette.set_color( + "highlight_inactive", + Color::parse(settings.interface.theme.colors.highlight_inactive.as_str()).unwrap(), + ); + theme.palette.set_color( + "highlight_text", + Color::parse(settings.interface.theme.colors.highlight_text.as_str()).unwrap(), + ); + siv.set_theme(theme); + + // Make log colors + let mut colors = HashMap::::new(); + colors.insert( + Level::Trace, + Color::parse(settings.interface.theme.log_colors.trace.as_str()).unwrap(), + ); + colors.insert( + Level::Debug, + Color::parse(settings.interface.theme.log_colors.debug.as_str()).unwrap(), + ); + colors.insert( + Level::Info, + Color::parse(settings.interface.theme.log_colors.info.as_str()).unwrap(), + ); + colors.insert( + Level::Warn, + Color::parse(settings.interface.theme.log_colors.warn.as_str()).unwrap(), + ); + colors.insert( + Level::Error, + Color::parse(settings.interface.theme.log_colors.error.as_str()).unwrap(), + ); + inner.log_colors = colors; + } + fn setup_quit_handler(siv: &mut Cursive) { + siv.clear_global_callbacks(cursive::event::Event::CtrlChar('c')); + + siv.set_on_pre_event(cursive::event::Event::CtrlChar('c'), UI::quit_handler); + siv.set_global_callback(cursive::event::Event::Key(Key::Esc), UI::quit_handler); + } + + fn quit_handler(siv: &mut Cursive) { + siv.add_layer( + Dialog::text("Do you want to exit?") + .button("Yes", |s| s.quit()) + .button("No", |mut s| { + s.pop_layer(); + UI::setup_quit_handler(&mut s); + }), + ); + siv.set_on_pre_event(cursive::event::Event::CtrlChar('c'), |s| { + s.quit(); + }); + siv.set_global_callback(cursive::event::Event::Key(Key::Esc), |mut s| { + s.pop_layer(); + UI::setup_quit_handler(&mut s); + }); + } + + pub fn cursive_flexi_logger(&mut self) -> Box { + let mut flv = + cursive_flexi_logger_view::cursive_flexi_logger(self.siv.borrow().cb_sink().clone()); + flv.set_colors(self.inner.borrow().log_colors.clone()); + flv + } + pub fn set_command_processor(&mut self, cmdproc: CommandProcessor) { + let mut inner = self.inner.borrow_mut(); + inner.cmdproc = Some(cmdproc); + let _ = inner.cb_sink.send(Box::new(UI::update_cb)); + } + pub fn set_attachment_state(&mut self, state: AttachmentState) { + let mut inner = self.inner.borrow_mut(); + inner.ui_state.attachment_state.set(state); + let _ = inner.cb_sink.send(Box::new(UI::update_cb)); + } + pub fn set_connection_state(&mut self, state: ConnectionState) { + let mut inner = self.inner.borrow_mut(); + inner.ui_state.connection_state.set(state); + let _ = inner.cb_sink.send(Box::new(UI::update_cb)); + } + pub fn add_node_event(&mut self, event: &str) { + let inner = self.inner.borrow_mut(); + let color = inner.log_colors.get(&Level::Info).unwrap().clone(); + for line in event.lines() { + cursive_flexi_logger_view::push_to_log(StyledString::styled(line, color)); + } + let _ = inner.cb_sink.send(Box::new(UI::update_cb)); + } + pub fn quit(&mut self) { + let inner = self.inner.borrow_mut(); + let _ = inner.cb_sink.send(Box::new(|s| { + s.quit(); + })); + } + // Note: Cursive is not re-entrant, can't borrow_mut self.siv again after this + pub async fn run_async(&mut self) { + let mut siv = self.siv.borrow_mut(); + siv.run_async().await; + } + // pub fn run(&mut self) { + // let mut siv = self.siv.borrow_mut(); + // siv.run(); + // } + + ///////////////////////////////////////////////////////////////////////////////////// + // Private functions + // fn main_layout(s: &mut Cursive) -> ViewRef { + // s.find_name("main-layout").unwrap() + // } + // fn column_layout(s: &mut Cursive) -> ViewRef { + // s.find_name("column-layout").unwrap() + // } + // fn button_layout(s: &mut Cursive) -> ViewRef { + // s.find_name("button-layout").unwrap() + // } + // fn peers(s: &mut Cursive) -> ViewRef { + // s.find_name("peers").unwrap() + // } + // fn node_events(s: &mut Cursive) -> ViewRef { + // s.find_name("node-events").unwrap() + // } + fn command_line(s: &mut Cursive) -> ViewRef { + s.find_name("command-line").unwrap() + } + fn button_attach(s: &mut Cursive) -> ViewRef