feat: init 0.15

This commit is contained in:
veeso
2024-09-30 12:06:03 +02:00
parent 707a3faa54
commit 17719ea370
11 changed files with 982 additions and 1498 deletions

View File

@@ -1,6 +1,7 @@
# Changelog
- [Changelog](#changelog)
- [0.15.0](#0150)
- [0.14.0](#0140)
- [0.13.0](#0130)
- [0.12.3](#0123)
@@ -36,6 +37,10 @@
---
## 0.15.0
Released on
## 0.14.0
Released on 17/07/2024

2307
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@ license = "MIT"
name = "termscp"
readme = "README.md"
repository = "https://github.com/veeso/termscp"
version = "0.14.0"
version = "0.15.0"
[package.metadata.rpm]
package = "termscp"
@@ -38,32 +38,32 @@ path = "src/main.rs"
[dependencies]
argh = "^0.1"
bitflags = "^2.1"
bytesize = "^1.1"
bitflags = "^2"
bytesize = "^1"
chrono = "^0.4"
content_inspector = "^0.2"
dirs = "^5.0"
edit = "^0.1"
filetime = "^0.2"
hostname = "^0.4"
keyring = { version = "^2.0", optional = true }
lazy-regex = "^3.1"
lazy_static = "^1.4"
keyring = { version = "^3", optional = true }
lazy-regex = "^3"
lazy_static = "^1"
log = "^0.4"
magic-crypt = "^3.1"
magic-crypt = "^3"
notify = "=4.0.17"
notify-rust = { version = "^4.5", default-features = false, features = ["d"] }
open = "^5.0"
rand = "^0.8.5"
regex = "^1"
remotefs = "^0.2.0"
remotefs-aws-s3 = { version = "^0.2.4", default-features = false, features = [
remotefs = "^0.3"
remotefs-aws-s3 = { version = "^0.3", default-features = false, features = [
"find",
"rustls",
] }
remotefs-kube = "0.2"
remotefs-webdav = "^0.1.1"
rpassword = "^7.0"
remotefs-kube = "0.4"
remotefs-webdav = "^0.2"
rpassword = "^7"
self_update = { version = "^0.41", default-features = false, features = [
"rustls",
"archive-tar",
@@ -74,19 +74,19 @@ self_update = { version = "^0.41", default-features = false, features = [
serde = { version = "^1", features = ["derive"] }
simplelog = "^0.12"
ssh2-config = "^0.2"
tempfile = "^3.4"
tempfile = "^3"
thiserror = "^1"
tokio = { version = "=1.38.1", features = ["rt"] }
toml = "^0.8"
tui-realm-stdlib = "^1.3.1"
tuirealm = "^1.9.1"
unicode-width = "^0.1"
tui-realm-stdlib = "^1.3"
tuirealm = "^1.9"
unicode-width = "^0.2"
version-compare = "^0.2"
whoami = "^1.4"
wildmatch = "^2.1"
whoami = "^1.5"
wildmatch = "^2.3"
[dev-dependencies]
pretty_assertions = "^1.3"
pretty_assertions = "^1"
serial_test = "^3"
[build-dependencies]
@@ -99,17 +99,17 @@ with-keyring = ["keyring"]
smb = ["remotefs-smb"]
[target."cfg(not(target_os = \"macos\"))".dependencies]
remotefs-smb = { version = "^0.2", optional = true }
remotefs-smb = { version = "^0.3", optional = true }
[target."cfg(target_family = \"windows\")"]
[target."cfg(target_family = \"windows\")".dependencies]
remotefs-ftp = { version = "^0.1.2", features = ["native-tls"] }
remotefs-ssh = "^0.3.1"
remotefs-ssh = "^0.4"
[target."cfg(target_family = \"unix\")"]
[target."cfg(target_family = \"unix\")".dependencies]
remotefs-ftp = { version = "^0.1.2", features = ["vendored", "native-tls"] }
remotefs-ssh = { version = "^0.3.1", features = ["ssh2-vendored"] }
remotefs-ftp = { version = "^0.2", features = ["vendored", "native-tls"] }
remotefs-ssh = { version = "^0.4", features = ["ssh2-vendored"] }
users = "0.11.0"
[profile.dev]

View File

@@ -71,7 +71,7 @@
</p>
<p align="center">Developed by <a href="https://veeso.dev/" target="_blank">@veeso</a></p>
<p align="center">Current version: 0.14.0 (17/07/2024)</p>
<p align="center">Current version: 0.15.0 (17/07/2024)</p>
<p align="center">
<a href="https://opensource.org/licenses/MIT"

View File

@@ -8,7 +8,7 @@ use std::sync::Arc;
use remotefs::RemoteFs;
use remotefs_aws_s3::AwsS3Fs;
use remotefs_ftp::FtpFs;
use remotefs_kube::KubeFs;
use remotefs_kube::KubeContainerFs as KubeFs;
#[cfg(smb_unix)]
use remotefs_smb::SmbOptions;
#[cfg(smb)]

View File

@@ -89,7 +89,7 @@ mod tests {
let app_name: &str = "termscp-test2";
let secret: &str = "Th15-15/My-Супер-Секрет";
let kring: Keyring = Keyring::new(app_name, username.as_str()).unwrap();
let _ = kring.delete_password();
let _ = kring.delete_credential();
drop(kring);
// Secret should not exist
assert!(storage.get_key(app_name).is_err());
@@ -100,6 +100,6 @@ mod tests {
// Delete the key manually...
let kring: Keyring = Keyring::new(app_name, username.as_str()).unwrap();
assert!(kring.delete_password().is_ok());
assert!(kring.delete_credential().is_ok());
}
}

View File

@@ -149,86 +149,18 @@ impl AuthActivity {
.direction(Direction::Vertical)
.split(main_chunks[0]);
// Input mask chunks
let input_mask = match self.input_mask() {
InputMask::AwsS3 => Layout::default()
.constraints(
[
Constraint::Length(3), // bucket
Constraint::Length(3), // region
Constraint::Length(3), // profile
Constraint::Length(3), // access_key
Constraint::Length(3), // remote directory
]
.as_ref(),
)
.direction(Direction::Vertical)
.split(auth_chunks[4]),
InputMask::Kube => Layout::default()
.constraints([
Constraint::Length(3), // ...
Constraint::Length(3), // ...
Constraint::Length(3), // ...
Constraint::Length(3), // ...
Constraint::Length(3), // remote directory
])
.direction(Direction::Vertical)
.split(auth_chunks[4]),
InputMask::Generic => Layout::default()
.constraints(
[
Constraint::Length(3), // address
Constraint::Length(3), // port
Constraint::Length(3), // username
Constraint::Length(3), // password
Constraint::Length(3), // remote directory
]
.as_ref(),
)
.direction(Direction::Vertical)
.split(auth_chunks[4]),
#[cfg(unix)]
InputMask::Smb => Layout::default()
.constraints(
[
Constraint::Length(3), // address
Constraint::Length(3), // port
Constraint::Length(3), // share
Constraint::Length(3), // username
Constraint::Length(3), // password
Constraint::Length(3), // workgroup
Constraint::Length(3), // remote directory
]
.as_ref(),
)
.direction(Direction::Vertical)
.split(auth_chunks[4]),
#[cfg(windows)]
InputMask::Smb => Layout::default()
.constraints(
[
Constraint::Length(3), // address
Constraint::Length(3), // share
Constraint::Length(3), // username
Constraint::Length(3), // password
Constraint::Length(3), // remote directory
]
.as_ref(),
)
.direction(Direction::Vertical)
.split(auth_chunks[4]),
InputMask::WebDAV => Layout::default()
.constraints(
[
Constraint::Length(3), // uri
Constraint::Length(3), // username
Constraint::Length(3), // password
Constraint::Length(3), // dir
]
.as_ref(),
)
.direction(Direction::Vertical)
.split(auth_chunks[4]),
};
let input_mask = Layout::default()
.constraints(
[
Constraint::Length(3), // uri
Constraint::Length(3), // username
Constraint::Length(3), // password
Constraint::Length(3), // dir
]
.as_ref(),
)
.direction(Direction::Vertical)
.split(auth_chunks[4]);
// Create bookmark chunks
let bookmark_chunks = Layout::default()
.constraints([Constraint::Percentage(50), Constraint::Percentage(50)].as_ref())
@@ -347,7 +279,7 @@ impl AuthActivity {
.constraints(
[
Constraint::Length(3), // Input form
Constraint::Length(2), // Yes/No
Constraint::Length(4), // Yes/No
]
.as_ref(),
)
@@ -1069,10 +1001,7 @@ impl AuthActivity {
pub(super) fn get_input_port(&self) -> u16 {
match self.app.state(&Id::Port) {
Ok(State::One(StateValue::String(x))) => match u16::from_str(x.as_str()) {
Ok(v) => v,
_ => 0,
},
Ok(State::One(StateValue::String(x))) => u16::from_str(x.as_str()).unwrap_or_default(),
_ => 0,
}
}

View File

@@ -5,8 +5,7 @@
use tuirealm::command::{Cmd, CmdResult, Direction, Position};
use tuirealm::event::{Key, KeyEvent};
use tuirealm::props::{Alignment, AttrValue, Attribute, Borders, Color, Style, Table};
use tuirealm::tui::layout::Corner;
use tuirealm::tui::widgets::{List as TuiList, ListItem, ListState};
use tuirealm::tui::widgets::{List as TuiList, ListDirection, ListItem, ListState};
use tuirealm::{Component, Event, MockComponent, NoUserEvent, Props, State, StateValue};
use super::{Msg, UiMsg};
@@ -63,7 +62,7 @@ impl MockComponent for Log {
focus,
None,
))
.start_corner(Corner::BottomLeft)
.direction(ListDirection::BottomToTop)
.highlight_symbol(">> ")
.style(Style::default().bg(bg))
.highlight_style(Style::default());

View File

@@ -6,9 +6,8 @@ use tuirealm::command::{Cmd, CmdResult, Direction, Position};
use tuirealm::props::{
Alignment, AttrValue, Attribute, Borders, Color, Style, Table, TextModifiers,
};
use tuirealm::tui::layout::Corner;
use tuirealm::tui::text::{Line, Span};
use tuirealm::tui::widgets::{List as TuiList, ListItem, ListState};
use tuirealm::tui::widgets::{List as TuiList, ListDirection, ListItem, ListState};
use tuirealm::{MockComponent, Props, State, StateValue};
pub const FILE_LIST_CMD_SELECT_ALL: &str = "A";
@@ -235,7 +234,7 @@ impl MockComponent for FileList {
// Make list
let mut list = TuiList::new(list_items)
.block(div)
.start_corner(Corner::TopLeft);
.direction(ListDirection::TopToBottom);
if let Some(highlighted_color) = highlighted_color {
list = list.highlight_style(
Style::default()

View File

@@ -87,7 +87,7 @@ impl FileTransferActivity {
Err(err) => {
// Set popup fatal error
self.umount_wait();
self.mount_fatal(&err.to_string());
self.mount_fatal(err.to_string());
}
}
}

View File

@@ -100,8 +100,7 @@ static REMOTE_SMB_OPT_REGEX: Lazy<Regex> =
/**
* Regex matches:
* - group 1: Version
* E.g. termscp-0.3.2 => 0.3.2
* v0.4.0 => 0.4.0
* E.g. termscp-0.3.2 => 0.3.2; v0.4.0 => 0.4.0
*/
static SEMVER_REGEX: Lazy<Regex> = lazy_regex!(r".*(:?[0-9]\.[0-9]\.[0-9])");