From 679a8297442f17d8adc9428aca304c8892d0eee9 Mon Sep 17 00:00:00 2001 From: Christian Visintin Date: Fri, 1 Mar 2024 10:01:25 +0100 Subject: [PATCH 1/8] 233 feature request subcommands (#234) --- CHANGELOG.md | 10 ++++ README.md | 4 +- docs/de/man.md | 17 +++++- docs/es/man.md | 3 - docs/fr/man.md | 3 - docs/it/man.md | 3 - docs/man.md | 16 ++++- docs/zh-CN/man.md | 2 - src/cli_opts.rs | 89 +++++++++++++++++++-------- src/config/mod.rs | 1 - src/host/mod.rs | 5 +- src/main.rs | 93 ++++++++++++++--------------- src/system/config_client.rs | 2 +- src/system/sshkey_storage.rs | 2 +- src/ui/activities/setup/view/mod.rs | 3 - src/utils/path.rs | 4 +- 16 files changed, 154 insertions(+), 103 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2704c89..0924def 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog - [Changelog](#changelog) + - [0.13.0](#0130) - [0.12.3](#0123) - [0.12.2](#0122) - [0.12.1](#0121) @@ -34,6 +35,15 @@ --- +## 0.13.0 + +Released on + +- Added CLI subcommands + - Changed `-t` to `theme` + - Changed `-u` to `update` + - Changed `-c` to `config` + ## 0.12.3 Released on 06/10/2023 diff --git a/README.md b/README.md index 01c1544..48628cd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # termscp

- + termscp logo

~ A feature rich terminal file transfer ~

@@ -73,7 +73,7 @@ /> Repo stars ` if address is provided, password will be this argument - `-b, --address-as-bookmark` resolve address argument as a bookmark name -- `-c, --config` Open termscp starting from the configuration page - `-q, --quiet` Disable logging -- `-t, --theme ` Import specified theme -- `-u, --update` Update termscp to latest version - `-v, --version` Print version info - `-h, --help` Print help page @@ -131,6 +131,17 @@ Password can be basically provided through 3 ways when address argument is provi - Via `sshpass`: you can provide password via `sshpass`, e.g. `sshpass -f ~/.ssh/topsecret.key termscp cvisintin@192.168.1.31` - You will be prompted for it: if you don't use any of the previous methods, you will be prompted for the password, as happens with the more classics tools such as `scp`, `ssh`, etc. + +### Subcommands + +#### Import a theme + +Run termscp as `termscp theme ` + +#### Install latest version + +Run termscp as `termscp update` + --- ## S3 connection parameters diff --git a/docs/es/man.md b/docs/es/man.md index 243eb01..569ce68 100644 --- a/docs/es/man.md +++ b/docs/es/man.md @@ -45,10 +45,7 @@ OR - `-P, --password ` si se proporciona la dirección, la contraseña será este argumento - `-b, --address-as-bookmark` resuelve el argumento de la dirección como un nombre de marcador -- `-c, --config` Abrir termscp comenzando desde la página de configuración - `-q, --quiet` Deshabilitar el registro -- `-t, --theme ` Importar tema especificado -- `-u, --update` Actualizar termscp a la última versión - `-v, --version` Imprimir información de la versión - `-h, --help` Imprimir página de ayuda diff --git a/docs/fr/man.md b/docs/fr/man.md index bb1d575..185b1fe 100644 --- a/docs/fr/man.md +++ b/docs/fr/man.md @@ -43,10 +43,7 @@ ou - `-P, --password ` si l'adresse est fournie, le mot de passe sera cet argument - `-b, --address-as-bookmark` résoudre l'argument d'adresse en tant que nom de signet -- `-c, --config` Ouvrir termscp à partir de la page de configuration - `-q, --quiet` Désactiver la journalisation -- `-t, --theme ` Importer le thème spécifié -- `-u, --update` Mettre à jour termscp vers la dernière version - `-v, --version` Imprimer les informations sur la version - `-h, --help` Imprimer la page d'aide diff --git a/docs/it/man.md b/docs/it/man.md index f707c79..f11705c 100644 --- a/docs/it/man.md +++ b/docs/it/man.md @@ -43,10 +43,7 @@ O - `-P, --password ` Se viene fornito l'argomento indirizzo, questa sarà la password utilizzata per autenticarsi - `-b, --address-as-bookmark` risolve l'argomento indirizzo come nome di un segnalibro -- `-c, --config` Apri la configurazione di termscp - `-q, --quiet` Disabilita i log -- `-t, --theme ` Importa il tema al percorso fornito -- `-u, --update` Aggiorna termscp all'ultima versione - `-v, --version` Mostra a video le informazioni sulla versione attualmente installata - `-h, --help` Mostra la pagina di aiuto. diff --git a/docs/man.md b/docs/man.md index 4059f3f..850ed1a 100644 --- a/docs/man.md +++ b/docs/man.md @@ -6,6 +6,9 @@ - [AWS S3 address argument](#aws-s3-address-argument) - [SMB address argument](#smb-address-argument) - [How Password can be provided 🔐](#how-password-can-be-provided-) + - [Subcommands](#subcommands) + - [Import a theme](#import-a-theme) + - [Install latest version](#install-latest-version) - [S3 connection parameters](#s3-connection-parameters) - [S3 credentials 🦊](#s3-credentials-) - [File explorer 📂](#file-explorer-) @@ -43,10 +46,7 @@ OR - `-P, --password ` if address is provided, password will be this argument - `-b, --address-as-bookmark` resolve address argument as a bookmark name -- `-c, --config` Open termscp starting from the configuration page - `-q, --quiet` Disable logging -- `-t, --theme ` Import specified theme -- `-u, --update` Update termscp to latest version - `-v, --version` Print version info - `-h, --help` Print help page @@ -129,6 +129,16 @@ Password can be basically provided through 3 ways when address argument is provi - Via `sshpass`: you can provide password via `sshpass`, e.g. `sshpass -f ~/.ssh/topsecret.key termscp cvisintin@192.168.1.31` - You will be prompted for it: if you don't use any of the previous methods, you will be prompted for the password, as happens with the more classics tools such as `scp`, `ssh`, etc. +### Subcommands + +#### Import a theme + +Run termscp as `termscp theme ` + +#### Install latest version + +Run termscp as `termscp update` + --- ## S3 connection parameters diff --git a/docs/zh-CN/man.md b/docs/zh-CN/man.md index 6138d11..fce5b7e 100644 --- a/docs/zh-CN/man.md +++ b/docs/zh-CN/man.md @@ -43,9 +43,7 @@ termscp启动时可以使用以下选项: - `-P, --password ` 登陆密码 - `-b, --address-as-bookmark` 将地址参数解析为书签名称 -- `-c, --config` 打开termscp时打开配置页面 - `-q, --quiet` 禁用日志 -- `-t, --theme ` 导入自定义主题 - `-v, --version` 打印版本信息 - `-h, --help` 打开帮助 diff --git a/src/cli_opts.rs b/src/cli_opts.rs index 44c7f0e..fddba55 100644 --- a/src/cli_opts.rs +++ b/src/cli_opts.rs @@ -34,36 +34,25 @@ Address syntax can be: Please, report issues to Please, consider supporting the author ")] pub struct Args { - #[argh( - switch, - short = 'b', - description = "resolve address argument as a bookmark name" - )] + #[argh(subcommand)] + pub nested: Option, + /// resolve address argument as a bookmark name + #[argh(switch, short = 'b')] pub address_as_bookmark: bool, - #[argh(switch, short = 'c', description = "open termscp configuration")] - pub config: bool, - #[argh(switch, short = 'D', description = "enable TRACE log level")] + /// enable TRACE log level + #[argh(switch, short = 'D')] pub debug: bool, - #[argh(option, short = 'P', description = "provide password from CLI")] + /// provide password from CLI + #[argh(option, short = 'P')] pub password: Option, - #[argh(switch, short = 'q', description = "disable logging")] + /// disable logging + #[argh(switch, short = 'q')] pub quiet: bool, - #[argh(option, short = 't', description = "import specified theme")] - pub theme: Option, - #[argh( - switch, - short = 'u', - description = "update termscp to the latest version" - )] - pub update: bool, - #[argh( - option, - short = 'T', - default = "10", - description = "set UI ticks; default 10ms" - )] + /// set UI ticks; default 10ms + #[argh(option, short = 'T', default = "10")] pub ticks: u64, - #[argh(switch, short = 'v', description = "print version")] + /// print version + #[argh(switch, short = 'v')] pub version: bool, // -- positional #[argh( @@ -73,6 +62,33 @@ pub struct Args { pub positional: Vec, } +#[derive(FromArgs)] +#[argh(subcommand)] +pub enum ArgsSubcommands { + Config(ConfigArgs), + LoadTheme(LoadThemeArgs), + Update(UpdateArgs), +} + +#[derive(FromArgs)] +/// open termscp configuration +#[argh(subcommand, name = "config")] +pub struct ConfigArgs {} + +#[derive(FromArgs)] +/// import the specified theme +#[argh(subcommand, name = "update")] +pub struct UpdateArgs {} + +#[derive(FromArgs)] +/// import the specified theme +#[argh(subcommand, name = "theme")] +pub struct LoadThemeArgs { + #[argh(positional)] + /// theme file + pub theme: PathBuf, +} + pub struct RunOpts { pub remote: Remote, pub ticks: Duration, @@ -80,6 +96,29 @@ pub struct RunOpts { pub task: Task, } +impl RunOpts { + pub fn config() -> Self { + Self { + task: Task::Activity(NextActivity::SetupActivity), + ..Default::default() + } + } + + pub fn update() -> Self { + Self { + task: Task::InstallUpdate, + ..Default::default() + } + } + + pub fn import_theme(theme: PathBuf) -> Self { + Self { + task: Task::ImportTheme(theme), + ..Default::default() + } + } +} + impl Default for RunOpts { fn default() -> Self { Self { diff --git a/src/config/mod.rs b/src/config/mod.rs index f279682..bbd7a8b 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -3,7 +3,6 @@ //! `config` is the module which provides access to all the termscp configurations // export -pub use params::*; pub mod bookmarks; pub mod params; diff --git a/src/host/mod.rs b/src/host/mod.rs index b0d45f1..4679cd6 100644 --- a/src/host/mod.rs +++ b/src/host/mod.rs @@ -1081,10 +1081,7 @@ mod tests { let tmpdir: tempfile::TempDir = tempfile::TempDir::new().unwrap(); let host: Localhost = Localhost::new(PathBuf::from(tmpdir.path())).ok().unwrap(); // Execute - #[cfg(unix)] - assert_eq!(host.exec("echo 5").ok().unwrap().as_str(), "5\n"); - #[cfg(windows)] - assert_eq!(host.exec("echo 5").ok().unwrap().as_str(), "5\r\n"); + assert!(host.exec("echo 5").ok().unwrap().as_str().contains("5")); } #[test] diff --git a/src/main.rs b/src/main.rs index 9b39251..9e1e839 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,7 +32,7 @@ mod utils; // namespaces use activity_manager::{ActivityManager, NextActivity}; -use cli_opts::{Args, BookmarkParams, HostParams, Remote, RunOpts, Task}; +use cli_opts::{Args, ArgsSubcommands, BookmarkParams, HostParams, Remote, RunOpts, Task}; use filetransfer::FileTransferParams; use system::logging::{self, LogLevel}; @@ -63,59 +63,57 @@ fn main() { /// In case of success returns `RunOpts` /// in case something is wrong returns the error message fn parse_args(args: Args) -> Result { - let mut run_opts: RunOpts = RunOpts::default(); - // Version - if args.version { - return Err(format!( - "termscp - {TERMSCP_VERSION} - Developed by {TERMSCP_AUTHORS}", - )); - } - // Setup activity? - if args.config { - run_opts.task = Task::Activity(NextActivity::SetupActivity); - } - // Logging - if args.debug { - run_opts.log_level = LogLevel::Trace; - } else if args.quiet { - run_opts.log_level = LogLevel::Off; - } - // Match ticks - run_opts.ticks = Duration::from_millis(args.ticks); - // @! extra modes - if let Some(theme) = args.theme.as_deref() { - run_opts.task = Task::ImportTheme(PathBuf::from(theme)); - } - if args.update { - run_opts.task = Task::InstallUpdate; - } - // @! Ordinary mode - // Remote argument - match parse_address_arg(&args) { - Err(err) => return Err(err), - Ok(Remote::None) => {} - Ok(remote) => { - // Set params - run_opts.remote = remote; - // In this case the first activity will be FileTransfer - run_opts.task = Task::Activity(NextActivity::FileTransfer); - } - } + let run_opts = match args.nested { + Some(ArgsSubcommands::Update(_)) => RunOpts::update(), + Some(ArgsSubcommands::LoadTheme(args)) => RunOpts::import_theme(args.theme), + Some(ArgsSubcommands::Config(_)) => RunOpts::config(), + None => { + let mut run_opts: RunOpts = RunOpts::default(); + // Version + if args.version { + return Err(format!( + "termscp - {TERMSCP_VERSION} - Developed by {TERMSCP_AUTHORS}", + )); + } + // Logging + if args.debug { + run_opts.log_level = LogLevel::Trace; + } else if args.quiet { + run_opts.log_level = LogLevel::Off; + } + // Match ticks + run_opts.ticks = Duration::from_millis(args.ticks); + // Remote argument + match parse_address_arg(&args) { + Err(err) => return Err(err), + Ok(Remote::None) => {} + Ok(remote) => { + // Set params + run_opts.remote = remote; + // In this case the first activity will be FileTransfer + run_opts.task = Task::Activity(NextActivity::FileTransfer); + } + } - // Local directory - if let Some(localdir) = args.positional.get(1) { - // Change working directory if local dir is set - let localdir: PathBuf = PathBuf::from(localdir); - if let Err(err) = env::set_current_dir(localdir.as_path()) { - return Err(format!("Bad working directory argument: {err}")); + // Local directory + if let Some(localdir) = args.positional.get(1) { + // Change working directory if local dir is set + let localdir: PathBuf = PathBuf::from(localdir); + if let Err(err) = env::set_current_dir(localdir.as_path()) { + return Err(format!("Bad working directory argument: {err}")); + } + } + + run_opts } - } + }; + Ok(run_opts) } /// Parse address argument from cli args fn parse_address_arg(args: &Args) -> Result { - if let Some(remote) = args.positional.get(0) { + if let Some(remote) = args.positional.first() { if args.address_as_bookmark { Ok(Remote::Bookmark(BookmarkParams::new( remote, @@ -197,5 +195,6 @@ fn run_activity(activity: NextActivity, ticks: Duration, remote: Remote) -> i32 Remote::None => {} } manager.run(activity); + 0 } diff --git a/src/system/config_client.rs b/src/system/config_client.rs index 716f91f..7d79999 100644 --- a/src/system/config_client.rs +++ b/src/system/config_client.rs @@ -419,7 +419,7 @@ mod tests { use tempfile::TempDir; use super::*; - use crate::config::UserConfig; + use crate::config::params::UserConfig; use crate::utils::random::random_alphanumeric_with_len; #[test] diff --git a/src/system/sshkey_storage.rs b/src/system/sshkey_storage.rs index 60cf63d..477b378 100644 --- a/src/system/sshkey_storage.rs +++ b/src/system/sshkey_storage.rs @@ -48,7 +48,7 @@ impl SshKeyStorage { .query(host) .identity_file .as_ref() - .and_then(|x| x.get(0).cloned()); + .and_then(|x| x.first().cloned()); key }) diff --git a/src/ui/activities/setup/view/mod.rs b/src/ui/activities/setup/view/mod.rs index 1e9b174..2cd56bb 100644 --- a/src/ui/activities/setup/view/mod.rs +++ b/src/ui/activities/setup/view/mod.rs @@ -7,9 +7,6 @@ pub mod setup; pub mod ssh_keys; pub mod theme; -pub use setup::*; -pub use ssh_keys::*; -pub use theme::*; use tuirealm::event::{Key, KeyEvent, KeyModifiers}; use tuirealm::tui::widgets::Clear; use tuirealm::{Frame, Sub, SubClause, SubEventClause}; diff --git a/src/utils/path.rs b/src/utils/path.rs index f121833..ea90e73 100644 --- a/src/utils/path.rs +++ b/src/utils/path.rs @@ -60,8 +60,8 @@ where } (None, _) => comps.push(Component::ParentDir), (Some(a), Some(b)) if comps.is_empty() && a == b => (), - (Some(a), Some(b)) if b == Component::CurDir => comps.push(a), - (Some(_), Some(b)) if b == Component::ParentDir => return None, + (Some(a), Some(Component::CurDir)) => comps.push(a), + (Some(_), Some(Component::ParentDir)) => return None, (Some(a), Some(_)) => { comps.push(Component::ParentDir); for _ in itb { From 5dfee2cbd9c19e9a8cef1dec73fa46d9b9e9ba64 Mon Sep 17 00:00:00 2001 From: veeso Date: Fri, 1 Mar 2024 17:02:58 +0100 Subject: [PATCH 2/8] fix: AWS S3 wasn't working anymore due to rust-s3 outdate --- CHANGELOG.md | 2 + Cargo.lock | 326 ++++++++++++++++++++++++++++----------------------- Cargo.toml | 2 +- 3 files changed, 181 insertions(+), 149 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0924def..ea8fb0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,8 @@ Released on - Changed `-t` to `theme` - Changed `-u` to `update` - Changed `-c` to `config` +- Bugfix: + - [Issue 232](https://github.com/veeso/termscp/issues/232): AWS S3 wasn't working anymore due to rust-s3 outdate ## 0.12.3 diff --git a/Cargo.lock b/Cargo.lock index 47046b8..6992f9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,12 +29,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "ahash" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" - [[package]] name = "ahash" version = "0.7.6" @@ -70,12 +64,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anyhow" -version = "1.0.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" - [[package]] name = "argh" version = "0.1.10" @@ -234,19 +222,17 @@ checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[package]] name = "attohttpc" -version = "0.18.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69e13a99a7e6e070bb114f7ff381e58c7ccc188630121fc4c2fe4bcf24cd072" +checksum = "0f77d243921b0979fbbd728dd2d5162e68ac8252976797c24eb5b3a6af9090dc" dependencies = [ "http", "log", - "rustls 0.20.8", + "rustls", "serde", "serde_json", "url", - "webpki", - "webpki-roots", - "wildmatch", + "webpki-roots 0.25.4", ] [[package]] @@ -257,27 +243,28 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "aws-creds" -version = "0.27.1" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460a75eac8f3cb7683e0a9a588a83c3ff039331ea7bfbfbfcecf1dacab276e11" +checksum = "390ad3b77f3e21e01a4a0355865853b681daf1988510b0b15e31c0c4ae7eb0f6" dependencies = [ - "anyhow", "attohttpc", - "dirs 4.0.0", + "home", + "log", + "quick-xml 0.30.0", "rust-ini", "serde", - "serde-xml-rs", - "serde_derive", + "thiserror", + "time 0.3.22", "url", ] [[package]] name = "aws-region" -version = "0.23.5" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10110ddbd800fb47e6bef95e88fc13495795d252f585272a4fa3ac4f5b2e0a4d" +checksum = "42fed2b9fca70f2908268d057a607f2a906f47edbf856ea8587de9038d264e22" dependencies = [ - "anyhow", + "thiserror", ] [[package]] @@ -475,6 +462,26 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "const-random" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aaf16c9c2c612020bcfd042e170f6e32de9b9d75adb5277cdbbd2e2c8c8299a" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + [[package]] name = "content_inspector" version = "0.2.4" @@ -561,6 +568,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -571,16 +584,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "ctor" version = "0.1.26" @@ -669,22 +672,13 @@ dependencies = [ "subtle", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys 0.3.7", -] - [[package]] name = "dirs" version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys 0.4.1", + "dirs-sys", ] [[package]] @@ -697,17 +691,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi 0.3.9", -] - [[package]] name = "dirs-sys" version = "0.4.1" @@ -733,11 +716,11 @@ dependencies = [ [[package]] name = "dlv-list" -version = "0.2.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68df3f2b690c1b86e65ef7830956aededf3cb0a16f898f79b9a6f421a7b6211b" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" dependencies = [ - "rand", + "const-random", ] [[package]] @@ -1071,24 +1054,21 @@ dependencies = [ "tracing", ] -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" -dependencies = [ - "ahash 0.4.7", -] - [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + [[package]] name = "hashbrown" version = "0.14.0" @@ -1113,17 +1093,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" dependencies = [ - "hmac 0.12.1", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest 0.9.0", + "hmac", ] [[package]] @@ -1135,6 +1105,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -1213,7 +1192,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.3", + "rustls", "tokio", "tokio-rustls", ] @@ -1959,12 +1938,12 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-multimap" -version = "0.3.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c672c7ad9ec066e428c00eb917124a06f08db19e2584de982cc34b1f4c12485" +checksum = "4ed8acf08e98e744e5384c8bc63ceb0364e68a6854187221c18df61c4797690e" dependencies = [ "dlv-list", - "hashbrown 0.9.1", + "hashbrown 0.13.2", ] [[package]] @@ -2164,6 +2143,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "quote" version = "1.0.29" @@ -2275,13 +2264,13 @@ dependencies = [ [[package]] name = "remotefs-aws-s3" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "896bc1b45d85d017e632b79faf8f78eccf5ca6f372baf541977b9274a1446b05" +checksum = "d3bf9e4443bef2d0f148bbcc99b852b59a12372e240ea8dc69a6f1609e90938c" dependencies = [ "chrono", "log", - "path-slash 0.1.5", + "path-slash 0.2.1", "remotefs", "rust-s3", "thiserror", @@ -2355,7 +2344,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.3", + "rustls", "rustls-pemfile", "serde", "serde_json", @@ -2367,7 +2356,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", + "webpki-roots 0.22.6", "winreg", ] @@ -2409,9 +2398,9 @@ dependencies = [ [[package]] name = "rust-ini" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63471c4aa97a1cf8332a5f97709a79a4234698de6a1f5087faf66f2dae810e22" +checksum = "7e2a3bcec1f113553ef1c88aae6c020a369d03d55b58de9869a0908930385091" dependencies = [ "cfg-if 1.0.0", "ordered-multimap", @@ -2419,30 +2408,31 @@ dependencies = [ [[package]] name = "rust-s3" -version = "0.28.1" +version = "0.34.0-rc4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc0e521d1084d6950e050d4e2595f0fbdaa2b96bb795bab3d90a282288c5e49" +checksum = "0533896b025761b23147ca1a168c436e1b87d14e460b1f19a6442882d2a3e07f" dependencies = [ - "anyhow", "async-trait", "attohttpc", "aws-creds", "aws-region", - "base64 0.13.1", + "base64 0.21.2", + "bytes", "cfg-if 1.0.0", - "chrono", "hex", - "hmac 0.11.0", + "hmac", "http", "log", "maybe-async", "md5", "percent-encoding", + "quick-xml 0.30.0", "serde", - "serde-xml-rs", "serde_derive", - "sha2 0.9.9", - "tokio-stream", + "serde_json", + "sha2 0.10.7", + "thiserror", + "time 0.3.22", "url", ] @@ -2466,18 +2456,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rustls" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" -dependencies = [ - "log", - "ring", - "sct", - "webpki", -] - [[package]] name = "rustls" version = "0.21.3" @@ -2602,7 +2580,7 @@ dependencies = [ "hyper", "indicatif", "log", - "quick-xml", + "quick-xml 0.23.1", "regex", "reqwest", "semver", @@ -2628,18 +2606,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-xml-rs" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65162e9059be2f6a3421ebbb4fef3e74b7d9e7c60c50a0e292c6239f19f1edfa" -dependencies = [ - "log", - "serde", - "thiserror", - "xml-rs", -] - [[package]] name = "serde_derive" version = "1.0.166" @@ -2851,7 +2817,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e31d9bb8e97972d6541ccf32ed51294e4e16feeef06a0e77a6272d041f0f5bc7" dependencies = [ "bitflags 2.3.3", - "dirs 5.0.1", + "dirs", "thiserror", "wildmatch", ] @@ -2920,7 +2886,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f5bff1d532fead7c43324a0fa33643b8621a47ce2944a633be4cb6c0240898f" dependencies = [ - "quick-xml", + "quick-xml 0.23.1", "windows 0.39.0", ] @@ -2957,7 +2923,7 @@ dependencies = [ "cfg_aliases", "chrono", "content_inspector", - "dirs 5.0.1", + "dirs", "edit", "filetime", "hostname", @@ -3076,6 +3042,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -3114,18 +3089,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.3", - "tokio", -] - -[[package]] -name = "tokio-stream" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" -dependencies = [ - "futures-core", - "pin-project-lite", + "rustls", "tokio", ] @@ -3512,6 +3476,12 @@ dependencies = [ "webpki", ] +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + [[package]] name = "which" version = "4.4.0" @@ -3622,6 +3592,15 @@ dependencies = [ "windows-targets 0.48.1", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -3652,6 +3631,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.0", ] +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -3664,6 +3658,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + [[package]] name = "windows_aarch64_msvc" version = "0.39.0" @@ -3682,6 +3682,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + [[package]] name = "windows_i686_gnu" version = "0.39.0" @@ -3700,6 +3706,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + [[package]] name = "windows_i686_msvc" version = "0.39.0" @@ -3718,6 +3730,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + [[package]] name = "windows_x86_64_gnu" version = "0.39.0" @@ -3736,6 +3754,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -3748,6 +3772,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + [[package]] name = "windows_x86_64_msvc" version = "0.39.0" @@ -3766,6 +3796,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + [[package]] name = "winnow" version = "0.4.7" @@ -3813,12 +3849,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "xml-rs" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a56c84a8ccd4258aed21c92f70c0f6dea75356b6892ae27c24139da456f9336" - [[package]] name = "yansi" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index deb6509..9c3b1d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ notify-rust = { version = "^4.5", default-features = false, features = ["d"] } open = "^5.0" rand = "^0.8.5" remotefs = "^0.2.0" -remotefs-aws-s3 = { version = "^0.2.1", default-features = false, features = [ +remotefs-aws-s3 = { version = "^0.2.3", default-features = false, features = [ "find", "rustls", ] } From c7469b8594ce0309deff494b2fbac97589496b9d Mon Sep 17 00:00:00 2001 From: Christian Visintin Date: Sat, 2 Mar 2024 19:23:27 +0100 Subject: [PATCH 3/8] feat: WebDAV support (#235) --- CHANGELOG.md | 4 + Cargo.lock | 234 ++++++++++++++----- Cargo.toml | 3 +- README.md | 1 + docs/de/README.md | 1 + docs/es/README.md | 1 + docs/es/man.md | 15 ++ docs/fr/README.md | 1 + docs/fr/man.md | 15 ++ docs/it/README.md | 1 + docs/it/man.md | 15 ++ docs/man.md | 15 ++ docs/zh-CN/README.md | 1 + docs/zh-CN/man.md | 14 ++ site/changelog.html | 2 +- site/html/home.html | 11 +- site/index.html | 11 +- src/config/bookmarks.rs | 49 ++++ src/filetransfer/builder.rs | 9 + src/filetransfer/mod.rs | 11 + src/filetransfer/params.rs | 64 +++++ src/ui/activities/auth/bookmarks.rs | 11 +- src/ui/activities/auth/components/form.rs | 45 +++- src/ui/activities/auth/components/mod.rs | 2 +- src/ui/activities/auth/misc.rs | 15 ++ src/ui/activities/auth/mod.rs | 8 +- src/ui/activities/auth/update.rs | 15 +- src/ui/activities/auth/view.rs | 74 +++++- src/ui/activities/filetransfer/misc.rs | 8 + src/ui/activities/setup/components/config.rs | 5 +- src/ui/activities/setup/mod.rs | 1 + src/ui/activities/setup/view/setup.rs | 5 +- src/utils/parser.rs | 74 +++++- 33 files changed, 656 insertions(+), 85 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea8fb0c..898753e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,8 +43,12 @@ Released on - Changed `-t` to `theme` - Changed `-u` to `update` - Changed `-c` to `config` +- Introduced support for [WebDAV](https://www.rfc-editor.org/rfc/rfc4918) + - It is now possible also to connect directly to WebDAV server with the syntax `http(s)://username:password@google.com` - Bugfix: - [Issue 232](https://github.com/veeso/termscp/issues/232): AWS S3 wasn't working anymore due to rust-s3 outdate +- Dependencies: + - Added `remotefs-webdav 0.1.1` ## 0.12.3 diff --git a/Cargo.lock b/Cargo.lock index 6992f9d..9f5c880 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -194,7 +194,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -211,7 +211,7 @@ checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -226,7 +226,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f77d243921b0979fbbd728dd2d5162e68ac8252976797c24eb5b3a6af9090dc" dependencies = [ - "http", + "http 0.2.9", "log", "rustls", "serde", @@ -254,7 +254,7 @@ dependencies = [ "rust-ini", "serde", "thiserror", - "time 0.3.22", + "time 0.3.34", "url", ] @@ -376,9 +376,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytesize" @@ -386,6 +386,15 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" +[[package]] +name = "bytestring" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d80203ea6b29df88012294f62733de21cfeab47f17b41af3a38bc30a03ee72" +dependencies = [ + "bytes", +] + [[package]] name = "cassowary" version = "0.3.0" @@ -624,6 +633,16 @@ version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f578e8e2c440e7297e008bb5486a3a8a194775224bbc23729b0dbdfaeebf162e" +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + [[package]] name = "derivative" version = "2.2.0" @@ -772,7 +791,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -975,7 +994,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -1046,7 +1065,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.9", "indexmap 1.9.3", "slab", "tokio", @@ -1071,9 +1090,9 @@ checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "hermit-abi" @@ -1136,6 +1155,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.5" @@ -1143,7 +1173,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", - "http", + "http 0.2.9", "pin-project-lite", ] @@ -1155,9 +1185,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" @@ -1170,7 +1200,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.9", "http-body", "httparse", "httpdate", @@ -1190,13 +1220,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ "futures-util", - "http", + "http 0.2.9", "hyper", "rustls", "tokio", "tokio-rustls", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "iana-time-zone" version = "0.1.57" @@ -1242,12 +1285,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.3", ] [[package]] @@ -1494,7 +1537,7 @@ dependencies = [ "dirs-next", "objc-foundation", "objc_id", - "time 0.3.22", + "time 0.3.34", ] [[package]] @@ -1684,6 +1727,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "nonempty" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "995defdca0a589acfdd1bd2e8e3b896b4d4f7675a31fd14c32611440c7f608e6" + [[package]] name = "notify" version = "4.0.17" @@ -1748,6 +1797,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.45" @@ -1899,7 +1954,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -2097,6 +2152,12 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "767eb9f07d4a5ebcb39bbf2d452058a93c011373abf6832e24194a1c3f004794" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2127,9 +2188,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -2154,10 +2215,19 @@ dependencies = [ ] [[package]] -name = "quote" -version = "1.0.29" +name = "quick-xml" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2264,13 +2334,13 @@ dependencies = [ [[package]] name = "remotefs-aws-s3" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3bf9e4443bef2d0f148bbcc99b852b59a12372e240ea8dc69a6f1609e90938c" +checksum = "ff8527f19059c3246d85fa8e81be1b720eeae28099d9e6debe6d7d214875c2aa" dependencies = [ "chrono", "log", - "path-slash 0.2.1", + "path-slash 0.1.5", "remotefs", "rust-s3", "thiserror", @@ -2321,6 +2391,27 @@ dependencies = [ "users", ] +[[package]] +name = "remotefs-webdav" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88503e1cd53067ab639150625718bb8d88e6bcd1e165205de0d941beca66bde" +dependencies = [ + "bytes", + "bytestring", + "http 1.0.0", + "httpdate", + "indexmap 2.2.5", + "log", + "mime", + "nonempty", + "quick-xml 0.31.0", + "remotefs", + "rustydav", + "thiserror", + "time 0.3.34", +] + [[package]] name = "reqwest" version = "0.11.18" @@ -2333,14 +2424,16 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.9", "http-body", "hyper", "hyper-rustls", + "hyper-tls", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -2350,6 +2443,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "tokio", + "tokio-native-tls", "tokio-rustls", "tower-service", "url", @@ -2421,7 +2515,7 @@ dependencies = [ "cfg-if 1.0.0", "hex", "hmac", - "http", + "http 0.2.9", "log", "maybe-async", "md5", @@ -2432,7 +2526,7 @@ dependencies = [ "serde_json", "sha2 0.10.7", "thiserror", - "time 0.3.22", + "time 0.3.34", "url", ] @@ -2487,6 +2581,15 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustydav" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc4c86c47126ac8bfc573084610e93f4ca8726f3ae7bf6c64bd60476731b6e42" +dependencies = [ + "reqwest", +] + [[package]] name = "ryu" version = "1.0.14" @@ -2599,22 +2702,22 @@ checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" [[package]] name = "serde" -version = "1.0.166" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.166" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -2636,7 +2739,7 @@ checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -2682,7 +2785,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -2758,7 +2861,7 @@ checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" dependencies = [ "log", "termcolor", - "time 0.3.22", + "time 0.3.34", ] [[package]] @@ -2860,9 +2963,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -2942,6 +3045,7 @@ dependencies = [ "remotefs-ftp", "remotefs-smb", "remotefs-ssh", + "remotefs-webdav", "rpassword", "self_update", "serde", @@ -2973,22 +3077,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.41" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c16a64ba9387ef3fdae4f9c1a7f07a0997fce91985c0336f1ddc1822b3b37802" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.41" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d14928354b01c4d6a4f0e549069adef399a284e7995c7ccca94e8a07a5346c59" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -3015,13 +3119,16 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ + "deranged", "itoa", "libc", + "num-conv", "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -3029,16 +3136,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -3083,6 +3191,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.24.1" @@ -3134,7 +3252,7 @@ version = "0.19.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", @@ -3167,7 +3285,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", ] [[package]] @@ -3402,7 +3520,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", "wasm-bindgen-shared", ] @@ -3436,7 +3554,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3931,7 +4049,7 @@ dependencies = [ "crc32fast", "crossbeam-utils", "flate2", - "time 0.3.22", + "time 0.3.34", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 9c3b1d6..34689a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,10 +56,11 @@ notify-rust = { version = "^4.5", default-features = false, features = ["d"] } open = "^5.0" rand = "^0.8.5" remotefs = "^0.2.0" -remotefs-aws-s3 = { version = "^0.2.3", default-features = false, features = [ +remotefs-aws-s3 = { version = "^0.2.4", default-features = false, features = [ "find", "rustls", ] } +remotefs-webdav = "^0.1.1" rpassword = "^7.0" self_update = { version = "^0.37", default-features = false, features = [ "rustls", diff --git a/README.md b/README.md index 48628cd..f284997 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ Termscp is a feature rich terminal file transfer and explorer, with support for - **FTP** and **FTPS** - **S3** - **SMB** + - **WebDAV** - 🖥 Explore and operate on the remote and on the local machine file system with a handy UI - Create, remove, rename, search, view and edit files - ⭐ Connect to your favourite hosts through built-in bookmarks and recent connections diff --git a/docs/de/README.md b/docs/de/README.md index 6f3fb4d..8fb0b45 100644 --- a/docs/de/README.md +++ b/docs/de/README.md @@ -138,6 +138,7 @@ Termscp ist ein funktionsreicher Terminal-Dateitransfer und Explorer mit Unterst - **FTP** und **FTPS** - **S3** - **SMB** + - **WebDAV** - 🖥 Erkunden und bedienen Sie das Dateisystem der Fernbedienung und des lokalen Computers mit einer praktischen Benutzeroberfläche - Erstellen, Entfernen, Umbenennen, Suchen, Anzeigen und Bearbeiten von Dateien - ⭐ Verbinden Sie sich über integrierte Lesezeichen und aktuelle Verbindungen mit Ihren Lieblingshosts diff --git a/docs/es/README.md b/docs/es/README.md index 0c7d860..6e768be 100644 --- a/docs/es/README.md +++ b/docs/es/README.md @@ -138,6 +138,7 @@ Termscp es un explorador y transferencia de archivos de terminal rico en funcion - **FTP** y **FTPS** - **S3** - **SMB** + - **WebDAV** - 🖥 Explore y opere en el sistema de archivos de la máquina local y remota con una interfaz de usuario práctica - Cree, elimine, cambie el nombre, busque, vea y edite archivos - ⭐ Conéctese a sus hosts favoritos y conexiones recientes diff --git a/docs/es/man.md b/docs/es/man.md index 569ce68..69f0ec0 100644 --- a/docs/es/man.md +++ b/docs/es/man.md @@ -4,6 +4,7 @@ - [Uso ❓](#uso-) - [Argumento dirección 🌎](#argumento-dirección-) - [Argumento dirección por AWS S3](#argumento-dirección-por-aws-s3) + - [Argumento de dirección de WebDAV](#argumento-de-dirección-de-webdav) - [Argumento dirección por SMB](#argumento-dirección-por-smb) - [Cómo se puede proporcionar la contraseña 🔐](#cómo-se-puede-proporcionar-la-contraseña-) - [S3 parámetros de conexión](#s3-parámetros-de-conexión) @@ -103,6 +104,20 @@ por ejemplo s3://buckethead@eu-central-1:default:/assets ``` +#### Argumento de dirección de WebDAV + +En caso de que quieras conectarte a WebDAV utiliza la siguiente sintaxis + +```txt +http://:@ +``` + +o en caso de que quieras usar https + +```txt +https://:@ +``` + #### Argumento dirección por SMB SMB tiene una sintaxis diferente para el argumento de la dirección CLI, que es diferente si está en Windows u otros sistemas: diff --git a/docs/fr/README.md b/docs/fr/README.md index 6d85380..9c144e7 100644 --- a/docs/fr/README.md +++ b/docs/fr/README.md @@ -138,6 +138,7 @@ Termscp est un file transfer et explorateur de fichiers de terminal riche en fon - **FTP** et **FTPS** - **S3** - **SMB** + - **WebDAV** - 🖥 Explorer et opérer sur le système de fichiers distant et local avec une interface utilisateur pratique. - Créer, supprimer, renommer, rechercher, afficher et modifier des fichiers - ⭐ Connectez-vous à vos hôtes préférés via des signets et des connexions récentes. diff --git a/docs/fr/man.md b/docs/fr/man.md index 185b1fe..8a8619e 100644 --- a/docs/fr/man.md +++ b/docs/fr/man.md @@ -4,6 +4,7 @@ - [Usage ❓](#usage-) - [Argument d'adresse 🌎](#argument-dadresse-) - [Argument d'adresse AWS S3](#argument-dadresse-aws-s3) + - [Argument d'adresse WebDAV](#argument-dadresse-webdav) - [Argument d'adresse SMB](#argument-dadresse-smb) - [Comment le mot de passe peut être fourni 🔐](#comment-le-mot-de-passe-peut-être-fourni-) - [S3 paramètres de connexion](#s3-paramètres-de-connexion) @@ -101,6 +102,20 @@ e.g. s3://buckethead@eu-central-1:default:/assets ``` +#### Argument d'adresse WebDAV + +Dans le cas où vous souhaitez vous connecter à WebDAV, utilisez la syntaxe suivante + +```txt +http://:@ +``` + +ou dans le cas où vous souhaitez utiliser https + +```txt +https://:@ +``` + #### Argument d'adresse SMB SMB a une syntaxe différente pour l'argument d'adresse CLI, qui est différente que vous soyez sur Windows ou sur d'autres systèmes : diff --git a/docs/it/README.md b/docs/it/README.md index 09c0bb5..9012cb1 100644 --- a/docs/it/README.md +++ b/docs/it/README.md @@ -138,6 +138,7 @@ Termscp è un file transfer ed explorer ricco di funzionalità, con supporto a S - **FTP** and **FTPS** - **S3** - **SMB** + - **WebDAV** - 🖥 Esplora e opera sia sul file system locale che su quello remoto con una UI di facile utilizzo. - Crea, rimuove, rinomina, cerca, visualizza e modifica file - ⭐ Connettiti ai tuoi host preferiti tramite la funzionalità integrata dei segnalibri e delle connessioni recenti. diff --git a/docs/it/man.md b/docs/it/man.md index f11705c..bf823c6 100644 --- a/docs/it/man.md +++ b/docs/it/man.md @@ -4,6 +4,7 @@ - [Argomenti da linea di comando ❓](#argomenti-da-linea-di-comando-) - [Argomento indirizzo 🌎](#argomento-indirizzo-) - [Argomento indirizzo per AWS S3](#argomento-indirizzo-per-aws-s3) + - [Argomento indirizzo per WebDAV](#argomento-indirizzo-per-webdav) - [Indirizzo SMB](#indirizzo-smb) - [Come fornire la password 🔐](#come-fornire-la-password-) - [Parametri di connessione S3](#parametri-di-connessione-s3) @@ -99,6 +100,20 @@ e.g. s3://buckethead@eu-central-1:default:/assets ``` +#### Argomento indirizzo per WebDAV + +Nel caso in cui si desideri connettersi a WebDAV utilizzare la seguente sintassi + +```txt +http://:@ +``` + +oppure nel caso in cui si desideri utilizzare https + +```txt +https://:@ +``` + #### Indirizzo SMB SMB ha una sintassi differente rispetto agli altri protocolli e cambia in base al sistema operativo: diff --git a/docs/man.md b/docs/man.md index 850ed1a..a3bb8dc 100644 --- a/docs/man.md +++ b/docs/man.md @@ -4,6 +4,7 @@ - [Usage ❓](#usage-) - [Address argument 🌎](#address-argument-) - [AWS S3 address argument](#aws-s3-address-argument) + - [WebDAV address argument](#webdav-address-argument) - [SMB address argument](#smb-address-argument) - [How Password can be provided 🔐](#how-password-can-be-provided-) - [Subcommands](#subcommands) @@ -104,6 +105,20 @@ e.g. s3://buckethead@eu-central-1:default:/assets ``` +#### WebDAV address argument + +In case you want to connect to webDAV use the following syntax + +```txt +http://:@ +``` + +or in case you want to use https + +```txt +https://:@ +``` + #### SMB address argument SMB has a different syntax for CLI address argument, which is different whether you're on Windows or other systems: diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index 080a970..278c28c 100644 --- a/docs/zh-CN/README.md +++ b/docs/zh-CN/README.md @@ -140,6 +140,7 @@ termscp 是一个功能丰富的终端文件浏览和传输工具,支持 SCP/S - **FTP** and **FTPS** - **S3** - **SMB** + - **WebDAV** - 🖥 使用便捷的 UI 在远程和本地文件系统上浏览和操作 - 创建、删除、重命名、搜索、查看和编辑文件 - ⭐ 通过“内置书签”和“最近连接”快速连接到您的主机 diff --git a/docs/zh-CN/man.md b/docs/zh-CN/man.md index fce5b7e..16245f6 100644 --- a/docs/zh-CN/man.md +++ b/docs/zh-CN/man.md @@ -4,6 +4,7 @@ - [用法](#用法) - [地址参数](#地址参数) - [AWS S3 地址参数](#aws-s3-地址参数) + - [WebDAV 地址参数](#webdav-地址参数) - [SMB 地址参数](#smb-地址参数) - [如何输入密码](#如何输入密码) - [S3 连接参数](#s3-连接参数) @@ -101,6 +102,19 @@ s3://@[:profile][:/wrkdir] s3://buckethead@eu-central-1:default:/assets ``` +#### WebDAV 地址参数 + +如果您想要连接到 WebDAV,请使用以下语法 + +```txt +http://:@ +或者如果您想要使用 https +``` + +```txt +https://:@ +``` + #### SMB 地址参数 SMB 对 CLI 地址参数有不同的语法,无论您是在 Windows 还是其他系统上,这都是不同的: diff --git a/site/changelog.html b/site/changelog.html index 83bfc69..c7ce21d 100644 --- a/site/changelog.html +++ b/site/changelog.html @@ -3,7 +3,7 @@ - termscp is a terminal file transfer and explorer for SCP/SFTP/FTP/S3/SMB | termscp + termscp is a terminal file transfer and explorer for SCP/SFTP/FTP/S3/SMB/WebDAV | termscp diff --git a/site/html/home.html b/site/html/home.html index cd9f604..3b43938 100644 --- a/site/html/home.html +++ b/site/html/home.html @@ -1,10 +1,11 @@ -
+

termscp

logo

A feature rich terminal UI file transfer and explorer with support for - SCP/SFTP/FTP/S3/SMB + SCP/SFTP/FTP/S3/SMB/WebDAV

- termscp 0.12.3 is NOW out! Download it from  + termscp 0.13.0 is NOW out! Download it from  here!

diff --git a/site/lang/en.json b/site/lang/en.json index a2f19dd..898ec6f 100644 --- a/site/lang/en.json +++ b/site/lang/en.json @@ -12,7 +12,7 @@ "intro": { "caption": "A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3", "getStarted": "Get started →", - "versionAlert": "termscp 0.12.3 is NOW out! Download it from", + "versionAlert": "termscp 0.13.0 is NOW out! Download it from", "here": "here", "features": { "handy": { diff --git a/site/lang/es.json b/site/lang/es.json index 0d21cd9..aedbda3 100644 --- a/site/lang/es.json +++ b/site/lang/es.json @@ -12,7 +12,7 @@ "intro": { "caption": "Un explorador y transferencia de archivos de terminal rico en funciones, con apoyo para SCP/SFTP/FTP/S3", "getStarted": "Para iniciar →", - "versionAlert": "termscp 0.12.3 ya está disponible! Descárgalo desde", + "versionAlert": "termscp 0.13.0 ya está disponible! Descárgalo desde", "here": "aquì", "features": { "handy": { diff --git a/site/lang/fr.json b/site/lang/fr.json index a6a4416..6a9327e 100644 --- a/site/lang/fr.json +++ b/site/lang/fr.json @@ -12,7 +12,7 @@ "intro": { "caption": "Un file transfer et navigateur de terminal riche en fonctionnalités avec support pour SCP/SFTP/FTP/S3", "getStarted": "Pour commencer →", - "versionAlert": "termscp 0.12.3 est maintenant sorti! Télécharge-le depuis", + "versionAlert": "termscp 0.13.0 est maintenant sorti! Télécharge-le depuis", "here": "ici", "features": { "handy": { diff --git a/site/lang/it.json b/site/lang/it.json index cca9105..d490c2c 100644 --- a/site/lang/it.json +++ b/site/lang/it.json @@ -12,7 +12,7 @@ "intro": { "caption": "Un file transfer ed explorer ricco di funzionalità con supporto per SFTP/SCP/FTP/S3", "getStarted": "Installa termscp →", - "versionAlert": "termscp 0.12.3 è ORA disponbile! Scaricalo da", + "versionAlert": "termscp 0.13.0 è ORA disponbile! Scaricalo da", "here": "qui", "features": { "handy": { diff --git a/site/lang/zh-CN.json b/site/lang/zh-CN.json index 254bd0e..5a1b194 100644 --- a/site/lang/zh-CN.json +++ b/site/lang/zh-CN.json @@ -12,7 +12,7 @@ "intro": { "caption": "功能丰富的终端 UI 文件传输和浏览器,支持 SCP/SFTP/FTP/S3", "getStarted": "开始 →", - "versionAlert": "termscp 0.12.3 现已发布! 从下载", + "versionAlert": "termscp 0.13.0 现已发布! 从下载", "here": "这里", "features": { "handy": { diff --git a/src/ui/activities/filetransfer/components/transfer/file_list.rs b/src/ui/activities/filetransfer/components/transfer/file_list.rs index d17cc2d..011d9e1 100644 --- a/src/ui/activities/filetransfer/components/transfer/file_list.rs +++ b/src/ui/activities/filetransfer/components/transfer/file_list.rs @@ -7,7 +7,7 @@ use tuirealm::props::{ Alignment, AttrValue, Attribute, Borders, Color, Style, Table, TextModifiers, }; use tuirealm::tui::layout::Corner; -use tuirealm::tui::text::{Span, Spans}; +use tuirealm::tui::text::{Line, Span}; use tuirealm::tui::widgets::{List as TuiList, ListItem, ListState}; use tuirealm::{MockComponent, Props, State, StateValue}; @@ -211,7 +211,7 @@ impl MockComponent for FileList { ) }) .collect(); - ListItem::new(Spans::from(columns)) + ListItem::new(Line::from(columns)) }) .collect(), // Make List item from TextSpan _ => Vec::new(), @@ -245,7 +245,7 @@ impl MockComponent for FileList { if matches!(attr, Attribute::Content) { self.states.init_list_states( match self.props.get(Attribute::Content).map(|x| x.unwrap_table()) { - Some(spans) => spans.len(), + Some(line) => line.len(), _ => 0, }, ); From 7dccac6105086f4cd6dc20427522c314fe57ba38 Mon Sep 17 00:00:00 2001 From: veeso Date: Sat, 2 Mar 2024 19:31:36 +0100 Subject: [PATCH 5/8] fix: test --- src/utils/ui.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/ui.rs b/src/utils/ui.rs index 3791c8e..f92e43a 100644 --- a/src/utils/ui.rs +++ b/src/utils/ui.rs @@ -67,7 +67,7 @@ mod tests { let child: Rect = Popup(Size::Percentage(75), Size::Percentage(30)).draw_in(area); assert_eq!(child.x, 43); assert_eq!(child.y, 63); - assert_eq!(child.width, 271); - assert_eq!(child.height, 54); + assert_eq!(child.width, 272); + assert_eq!(child.height, 55); } } From 89ab53a71ba207c6c816fd3e592f6788844a7049 Mon Sep 17 00:00:00 2001 From: veeso Date: Sat, 2 Mar 2024 19:35:18 +0100 Subject: [PATCH 6/8] fix: debian script --- dist/build/linux-aarch64.sh | 2 +- dist/build/linux-x86_64.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/build/linux-aarch64.sh b/dist/build/linux-aarch64.sh index b0b72e7..c9c7494 100755 --- a/dist/build/linux-aarch64.sh +++ b/dist/build/linux-aarch64.sh @@ -40,7 +40,7 @@ mkdir -p ${PKGS_DIR}/deb/ mkdir -p ${PKGS_DIR}/aarch64-unknown-linux-gnu/ docker run --name "$ARM64_DEB_NAME" -d "$ARM64_DEB_NAME" || docker start "$ARM64_DEB_NAME" docker exec -it "$ARM64_DEB_NAME" bash -c ". \$HOME/.cargo/env && git fetch origin && git checkout origin/$BRANCH && cargo build --release && cargo deb" -docker cp ${ARM64_DEB_NAME}:/usr/src/termscp/target/debian/termscp_${VERSION}_arm64.deb ${PKGS_DIR}/deb/ +docker cp ${ARM64_DEB_NAME}:/usr/src/termscp/target/debian/termscp_${VERSION}_arm64-1.deb ${PKGS_DIR}/deb/ docker cp ${ARM64_DEB_NAME}:/usr/src/termscp/target/release/termscp ${PKGS_DIR}/aarch64-unknown-linux-gnu/ docker stop "$ARM64_DEB_NAME" # Make tar.gz diff --git a/dist/build/linux-x86_64.sh b/dist/build/linux-x86_64.sh index b9f04c4..aa331ff 100755 --- a/dist/build/linux-x86_64.sh +++ b/dist/build/linux-x86_64.sh @@ -38,7 +38,7 @@ mkdir -p ${PKGS_DIR}/deb/ mkdir -p ${PKGS_DIR}/x86_64-unknown-linux-gnu/ docker run --name "$X86_64_DEB_NAME" -d "$X86_64_DEB_NAME" || docker start "$X86_64_DEB_NAME" docker exec -it "$X86_64_DEB_NAME" bash -c ". \$HOME/.cargo/env && git fetch origin && git checkout origin/$BRANCH && cargo build --release && cargo deb" -docker cp ${X86_64_DEB_NAME}:/usr/src/termscp/target/debian/termscp_${VERSION}_amd64.deb ${PKGS_DIR}/deb/ +docker cp ${X86_64_DEB_NAME}:/usr/src/termscp/target/debian/termscp_${VERSION}-1_amd64.deb ${PKGS_DIR}/deb/ docker cp ${X86_64_DEB_NAME}:/usr/src/termscp/target/release/termscp ${PKGS_DIR}/x86_64-unknown-linux-gnu/ docker stop "$X86_64_DEB_NAME" # Make tar.gz From 905fe5fc9f1a3d8e84fbc711fdc046238c4c55cd Mon Sep 17 00:00:00 2001 From: veeso Date: Sat, 2 Mar 2024 19:36:01 +0100 Subject: [PATCH 7/8] fix: debian script --- dist/build/linux-aarch64.sh | 2 +- dist/build/linux-x86_64.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/build/linux-aarch64.sh b/dist/build/linux-aarch64.sh index c9c7494..edf0637 100755 --- a/dist/build/linux-aarch64.sh +++ b/dist/build/linux-aarch64.sh @@ -40,7 +40,7 @@ mkdir -p ${PKGS_DIR}/deb/ mkdir -p ${PKGS_DIR}/aarch64-unknown-linux-gnu/ docker run --name "$ARM64_DEB_NAME" -d "$ARM64_DEB_NAME" || docker start "$ARM64_DEB_NAME" docker exec -it "$ARM64_DEB_NAME" bash -c ". \$HOME/.cargo/env && git fetch origin && git checkout origin/$BRANCH && cargo build --release && cargo deb" -docker cp ${ARM64_DEB_NAME}:/usr/src/termscp/target/debian/termscp_${VERSION}_arm64-1.deb ${PKGS_DIR}/deb/ +docker cp ${ARM64_DEB_NAME}:/usr/src/termscp/target/debian/termscp_${VERSION}-1_arm64.deb ${PKGS_DIR}/deb/termscp_${VERSION}_arm64.deb docker cp ${ARM64_DEB_NAME}:/usr/src/termscp/target/release/termscp ${PKGS_DIR}/aarch64-unknown-linux-gnu/ docker stop "$ARM64_DEB_NAME" # Make tar.gz diff --git a/dist/build/linux-x86_64.sh b/dist/build/linux-x86_64.sh index aa331ff..45f116b 100755 --- a/dist/build/linux-x86_64.sh +++ b/dist/build/linux-x86_64.sh @@ -38,7 +38,7 @@ mkdir -p ${PKGS_DIR}/deb/ mkdir -p ${PKGS_DIR}/x86_64-unknown-linux-gnu/ docker run --name "$X86_64_DEB_NAME" -d "$X86_64_DEB_NAME" || docker start "$X86_64_DEB_NAME" docker exec -it "$X86_64_DEB_NAME" bash -c ". \$HOME/.cargo/env && git fetch origin && git checkout origin/$BRANCH && cargo build --release && cargo deb" -docker cp ${X86_64_DEB_NAME}:/usr/src/termscp/target/debian/termscp_${VERSION}-1_amd64.deb ${PKGS_DIR}/deb/ +docker cp ${X86_64_DEB_NAME}:/usr/src/termscp/target/debian/termscp_${VERSION}-1_amd64.deb ${PKGS_DIR}/deb/termscp_${VERSION}_amd64.deb docker cp ${X86_64_DEB_NAME}:/usr/src/termscp/target/release/termscp ${PKGS_DIR}/x86_64-unknown-linux-gnu/ docker stop "$X86_64_DEB_NAME" # Make tar.gz From c0c9f7c0ddba0cfa419dd9d55dc46b7ddc92ba2d Mon Sep 17 00:00:00 2001 From: veeso Date: Sat, 2 Mar 2024 19:41:07 +0100 Subject: [PATCH 8/8] fix: lint??? --- src/filetransfer/params.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filetransfer/params.rs b/src/filetransfer/params.rs index f5f6321..c87f915 100644 --- a/src/filetransfer/params.rs +++ b/src/filetransfer/params.rs @@ -543,7 +543,7 @@ mod test { } #[test] - #[cfg(linux)] + #[cfg(unix)] fn set_default_secret_smb() { let mut params = FileTransferParams::new( FileTransferProtocol::Scp,