cli fix
This commit is contained in:
parent
d96e5a131c
commit
e31aa84db0
47
Cargo.lock
generated
47
Cargo.lock
generated
@ -369,7 +369,7 @@ dependencies = [
|
|||||||
"futures-io",
|
"futures-io",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"log",
|
"log",
|
||||||
"pin-project 0.4.29",
|
"pin-project 0.4.30",
|
||||||
"tungstenite 0.11.1",
|
"tungstenite 0.11.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1217,10 +1217,8 @@ dependencies = [
|
|||||||
"lazy_static",
|
"lazy_static",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"maplit",
|
|
||||||
"ncurses",
|
|
||||||
"signal-hook",
|
"signal-hook",
|
||||||
"term_size",
|
"tokio",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
]
|
]
|
||||||
@ -1265,6 +1263,7 @@ dependencies = [
|
|||||||
"num 0.4.0",
|
"num 0.4.0",
|
||||||
"owning_ref",
|
"owning_ref",
|
||||||
"time 0.3.11",
|
"time 0.3.11",
|
||||||
|
"tokio",
|
||||||
"toml",
|
"toml",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
@ -2641,17 +2640,6 @@ dependencies = [
|
|||||||
"socket2",
|
"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]]
|
[[package]]
|
||||||
name = "ndk"
|
name = "ndk"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
@ -3273,11 +3261,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project"
|
name = "pin-project"
|
||||||
version = "0.4.29"
|
version = "0.4.30"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9615c18d31137579e9ff063499264ddc1278e7b1982757ebc111028c4d1dc909"
|
checksum = "3ef0f924a5ee7ea9cbcea77529dba45f8a9ba9f622419fe3386ca581a3ae9d5a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"pin-project-internal 0.4.29",
|
"pin-project-internal 0.4.30",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3291,9 +3279,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project-internal"
|
name = "pin-project-internal"
|
||||||
version = "0.4.29"
|
version = "0.4.30"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "044964427019eed9d49d9d5bbce6047ef18f37100ea400912a9fa4a3523ab12a"
|
checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -4348,16 +4336,6 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "term_size"
|
|
||||||
version = "0.3.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
|
|
||||||
dependencies = [
|
|
||||||
"libc",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "termcolor"
|
name = "termcolor"
|
||||||
version = "1.1.3"
|
version = "1.1.3"
|
||||||
@ -4549,6 +4527,7 @@ checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes 1.1.0",
|
"bytes 1.1.0",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
|
"futures-io",
|
||||||
"futures-sink",
|
"futures-sink",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tokio",
|
"tokio",
|
||||||
@ -5004,7 +4983,7 @@ dependencies = [
|
|||||||
"flexi_logger",
|
"flexi_logger",
|
||||||
"futures",
|
"futures",
|
||||||
"log",
|
"log",
|
||||||
"parking_lot 0.12.1",
|
"parking_lot 0.11.2",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serial_test",
|
"serial_test",
|
||||||
@ -5090,7 +5069,7 @@ dependencies = [
|
|||||||
"thiserror",
|
"thiserror",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
"tokio-util 0.6.10",
|
"tokio-util 0.7.3",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-error",
|
"tracing-error",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
@ -5131,7 +5110,7 @@ dependencies = [
|
|||||||
"serde_json",
|
"serde_json",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
"tokio-util 0.6.10",
|
"tokio-util 0.7.3",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-opentelemetry",
|
"tracing-opentelemetry",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
@ -5174,7 +5153,7 @@ dependencies = [
|
|||||||
"stop-token",
|
"stop-token",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
"tokio-util 0.6.10",
|
"tokio-util 0.7.3",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-appender",
|
"tracing-appender",
|
||||||
"tracing-journald",
|
"tracing-journald",
|
||||||
|
@ -12,16 +12,11 @@ path = "src/main.rs"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "rt-tokio" ]
|
default = [ "rt-tokio" ]
|
||||||
rt-async-std = [ "async-std", "veilid-core/rt-async-std" ]
|
rt-async-std = [ "async-std", "veilid-core/rt-async-std", "cursive/rt-async-std" ]
|
||||||
rt-tokio = [ "tokio", "tokio-util", "veilid-core/rt-tokio" ]
|
rt-tokio = [ "tokio", "tokio-util", "veilid-core/rt-tokio", "cursive/rt-tokio" ]
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
|
||||||
cursive = { path = "../external/cursive/cursive", default-features = false, features = ["ncurses-backend", "toml", "rt-async-std"]}
|
|
||||||
|
|
||||||
[target.'cfg(not(unix))'.dependencies]
|
|
||||||
cursive = { path = "../external/cursive/cursive", default-features = false, features = ["crossterm-backend", "toml", "rt-async-std"]}
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
cursive = { path = "../external/cursive/cursive", default-features = false, features = [ "crossterm", "toml"]}
|
||||||
async-std = { version = "^1.9", features = ["unstable", "attributes"], optional = true }
|
async-std = { version = "^1.9", features = ["unstable", "attributes"], optional = true }
|
||||||
tokio = { version = "^1", features = ["full"], optional = true }
|
tokio = { version = "^1", features = ["full"], optional = true }
|
||||||
tokio-util = { version = "^0", features = ["compat"], optional = true}
|
tokio-util = { version = "^0", features = ["compat"], optional = true}
|
||||||
|
@ -104,6 +104,7 @@ fn main() -> Result<(), String> {
|
|||||||
specbuilder.module("cursive", LevelFilter::Off);
|
specbuilder.module("cursive", LevelFilter::Off);
|
||||||
specbuilder.module("cursive_core", LevelFilter::Off);
|
specbuilder.module("cursive_core", LevelFilter::Off);
|
||||||
specbuilder.module("cursive_buffered_backend", LevelFilter::Off);
|
specbuilder.module("cursive_buffered_backend", LevelFilter::Off);
|
||||||
|
specbuilder.module("tokio_util", LevelFilter::Off);
|
||||||
specbuilder.module("mio", LevelFilter::Off);
|
specbuilder.module("mio", LevelFilter::Off);
|
||||||
specbuilder.module("async_std", LevelFilter::Off);
|
specbuilder.module("async_std", LevelFilter::Off);
|
||||||
specbuilder.module("async_io", LevelFilter::Off);
|
specbuilder.module("async_io", LevelFilter::Off);
|
||||||
|
@ -16,7 +16,7 @@ logging:
|
|||||||
enabled: false
|
enabled: false
|
||||||
file:
|
file:
|
||||||
enabled: true
|
enabled: true
|
||||||
directory: "%LOGGING_FILE_DIRECTORY%"
|
directory: '%LOGGING_FILE_DIRECTORY%'
|
||||||
append: true
|
append: true
|
||||||
interface:
|
interface:
|
||||||
node_log:
|
node_log:
|
||||||
|
@ -649,31 +649,13 @@ impl UI {
|
|||||||
cursive_flexi_logger_view::resize(node_log_scrollback);
|
cursive_flexi_logger_view::resize(node_log_scrollback);
|
||||||
|
|
||||||
// Instantiate the cursive runnable
|
// Instantiate the cursive runnable
|
||||||
let runnable;
|
let runnable = CursiveRunnable::new(
|
||||||
cfg_if::cfg_if! {
|
|
||||||
if #[cfg(unix)] {
|
|
||||||
runnable = CursiveRunnable::new(
|
|
||||||
|| -> Result<Box<dyn cursive_buffered_backend::Backend>, Box<DumbError>> {
|
|| -> Result<Box<dyn cursive_buffered_backend::Backend>, Box<DumbError>> {
|
||||||
let ncurses_backend = cursive::backends::curses::n::Backend::init().unwrap();
|
let backend = cursive::backends::crossterm::Backend::init().unwrap();
|
||||||
let buffered_backend =
|
let buffered_backend = cursive_buffered_backend::BufferedBackend::new(backend);
|
||||||
cursive_buffered_backend::BufferedBackend::new(ncurses_backend);
|
|
||||||
|
|
||||||
Ok(Box::new(buffered_backend))
|
Ok(Box::new(buffered_backend))
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
runnable = CursiveRunnable::new(
|
|
||||||
|| -> Result<Box<dyn cursive_buffered_backend::Backend>, Box<DumbError>> {
|
|
||||||
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
|
// Make the callback mechanism easily reachable
|
||||||
let cb_sink = runnable.cb_sink().clone();
|
let cb_sink = runnable.cb_sink().clone();
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
use crate::xx::*;
|
use crate::xx::*;
|
||||||
use crate::*;
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
mod tools;
|
mod tools;
|
||||||
|
|
||||||
|
@ -205,8 +205,8 @@ cfg_if::cfg_if! {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
} else if #[cfg(windows)] {
|
} else if #[cfg(windows)] {
|
||||||
use std::os::windows::fs::MetadataExt;
|
//use std::os::windows::fs::MetadataExt;
|
||||||
use windows_permissions::*;
|
//use windows_permissions::*;
|
||||||
|
|
||||||
pub fn ensure_file_private_owner<P:AsRef<Path>>(path: P) -> Result<(),String>
|
pub fn ensure_file_private_owner<P:AsRef<Path>>(path: P) -> Result<(),String>
|
||||||
{
|
{
|
||||||
@ -217,11 +217,11 @@ cfg_if::cfg_if! {
|
|||||||
|
|
||||||
// let uid = Uid::effective();
|
// let uid = Uid::effective();
|
||||||
// let gid = Gid::effective();
|
// let gid = Gid::effective();
|
||||||
let meta = std::fs::metadata(path).map_err(|e| format!("unable to get metadata for path '{:?}': {}",path, e))?;
|
//let meta = std::fs::metadata(path).map_err(|e| format!("unable to get metadata for path '{:?}': {}",path, e))?;
|
||||||
|
|
||||||
if meta.mode() != 0o600 {
|
//if meta.mode() != 0o600 {
|
||||||
std::fs::set_permissions(path,std::fs::Permissions::from_mode(0o600)).map_err(|e| format!("unable to set correct permissions on path '{:?}': {}", path, e))?;
|
// std::fs::set_permissions(path,std::fs::Permissions::from_mode(0o600)).map_err(|e| format!("unable to set correct permissions on path '{:?}': {}", path, e))?;
|
||||||
}
|
//}
|
||||||
|
|
||||||
//if meta.uid() != uid.as_raw() || meta.gid() != gid.as_raw() {
|
//if meta.uid() != uid.as_raw() || meta.gid() != gid.as_raw() {
|
||||||
// chown(path, Some(uid), Some(gid)).map_err(|e| format!("unable to set correct owner on path '{:?}': {}", path, e))?;
|
// chown(path, Some(uid), Some(gid)).map_err(|e| format!("unable to set correct owner on path '{:?}': {}", path, e))?;
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
use crate::settings::*;
|
use crate::settings::*;
|
||||||
use crate::tools::*;
|
|
||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
use log::*;
|
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
use tracing::*;
|
||||||
use windows_service::service::{
|
use windows_service::service::{
|
||||||
ServiceControl, ServiceControlAccept, ServiceExitCode, ServiceState, ServiceStatus, ServiceType,
|
ServiceControl, ServiceControlAccept, ServiceExitCode, ServiceState, ServiceStatus, ServiceType,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user