diff options
-rw-r--r-- | Cargo.lock | 12 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | atuin-client/Cargo.toml | 2 | ||||
-rw-r--r-- | atuin-client/src/encryption.rs | 3 | ||||
-rw-r--r-- | atuin-client/src/kv.rs | 8 | ||||
-rw-r--r-- | atuin-client/src/record/sync.rs | 7 | ||||
-rw-r--r-- | atuin-server-database/Cargo.toml | 2 | ||||
-rw-r--r-- | atuin-server-postgres/Cargo.toml | 4 | ||||
-rw-r--r-- | atuin-server/Cargo.toml | 4 | ||||
-rw-r--r-- | atuin/Cargo.toml | 8 |
10 files changed, 32 insertions, 20 deletions
diff --git a/Cargo.lock b/Cargo.lock index faccd0963..7852a183f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -80,7 +80,7 @@ dependencies = [ [[package]] name = "atuin" -version = "15.0.0" +version = "16.0.0" dependencies = [ "async-trait", "atuin-client", @@ -120,7 +120,7 @@ dependencies = [ [[package]] name = "atuin-client" -version = "15.0.0" +version = "16.0.0" dependencies = [ "async-trait", "atuin-common", @@ -166,7 +166,7 @@ dependencies = [ [[package]] name = "atuin-common" -version = "15.0.0" +version = "16.0.0" dependencies = [ "chrono", "eyre", @@ -180,7 +180,7 @@ dependencies = [ [[package]] name = "atuin-server" -version = "15.0.0" +version = "16.0.0" dependencies = [ "argon2", "async-trait", @@ -208,7 +208,7 @@ dependencies = [ [[package]] name = "atuin-server-database" -version = "15.0.0" +version = "16.0.0" dependencies = [ "async-trait", "atuin-common", @@ -222,7 +222,7 @@ dependencies = [ [[package]] name = "atuin-server-postgres" -version = "15.0.0" +version = "16.0.0" dependencies = [ "async-trait", "atuin-common", diff --git a/Cargo.toml b/Cargo.toml index 1d55c34f7..47ac19163 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ [workspace.package] name = "atuin" -version = "15.0.0" +version = "16.0.0" authors = ["Ellie Huxtable <ellie@elliehuxtable.com>"] rust-version = "1.59" license = "MIT" diff --git a/atuin-client/Cargo.toml b/atuin-client/Cargo.toml index ca6206775..42513d3e5 100644 --- a/atuin-client/Cargo.toml +++ b/atuin-client/Cargo.toml @@ -23,7 +23,7 @@ sync = [ ] [dependencies] -atuin-common = { path = "../atuin-common", version = "15.0.0" } +atuin-common = { path = "../atuin-common", version = "16.0.0" } log = { workspace = true } base64 = { workspace = true } diff --git a/atuin-client/src/encryption.rs b/atuin-client/src/encryption.rs index 00185fb6f..d6c5f893d 100644 --- a/atuin-client/src/encryption.rs +++ b/atuin-client/src/encryption.rs @@ -147,8 +147,7 @@ fn encode(h: &History) -> Result<Vec<u8>> { encode::write_str(&mut output, &h.id)?; encode::write_str( &mut output, - &dbg!(h - .timestamp + &(h.timestamp .to_rfc3339_opts(chrono::SecondsFormat::AutoSi, true)), )?; encode::write_sint(&mut output, h.duration)?; diff --git a/atuin-client/src/kv.rs b/atuin-client/src/kv.rs index 30018d632..ad53a3d1e 100644 --- a/atuin-client/src/kv.rs +++ b/atuin-client/src/kv.rs @@ -7,6 +7,7 @@ use crate::settings::Settings; const KV_VERSION: &str = "v0"; const KV_TAG: &str = "kv"; +const KV_VAL_MAX_LEN: usize = 100 * 1024; #[derive(Debug, Clone, PartialEq, Eq)] pub struct KvRecord { @@ -91,6 +92,13 @@ impl KvStore { key: &str, value: &str, ) -> Result<()> { + if value.len() > KV_VAL_MAX_LEN { + return Err(eyre!( + "kv value too large: max len {} bytes", + KV_VAL_MAX_LEN + )); + } + let host_id = Settings::host_id().expect("failed to get host_id"); let record = KvRecord { diff --git a/atuin-client/src/record/sync.rs b/atuin-client/src/record/sync.rs index ebdb8eb2b..ad9079ed4 100644 --- a/atuin-client/src/record/sync.rs +++ b/atuin-client/src/record/sync.rs @@ -124,7 +124,12 @@ async fn sync_upload( // we need to iterate from the remote tail, and keep going until // remote tail = current local tail - let mut record = Some(store.get(start).await.unwrap()); + let mut record = if current_tail.is_some() { + let r = store.get(start).await.unwrap(); + store.next(&r).await? + } else { + Some(store.get(start).await.unwrap()) + }; let mut buf = Vec::with_capacity(upload_page_size); diff --git a/atuin-server-database/Cargo.toml b/atuin-server-database/Cargo.toml index 485b32462..8f1f775e9 100644 --- a/atuin-server-database/Cargo.toml +++ b/atuin-server-database/Cargo.toml @@ -10,7 +10,7 @@ homepage = { workspace = true } repository = { workspace = true } [dependencies] -atuin-common = { path = "../atuin-common", version = "15.0.0" } +atuin-common = { path = "../atuin-common", version = "16.0.0" } tracing = "0.1" chrono = { workspace = true } diff --git a/atuin-server-postgres/Cargo.toml b/atuin-server-postgres/Cargo.toml index bfec70a20..f490a9761 100644 --- a/atuin-server-postgres/Cargo.toml +++ b/atuin-server-postgres/Cargo.toml @@ -10,8 +10,8 @@ homepage = { workspace = true } repository = { workspace = true } [dependencies] -atuin-common = { path = "../atuin-common", version = "15.0.0" } -atuin-server-database = { path = "../atuin-server-database", version = "15.0.0" } +atuin-common = { path = "../atuin-common", version = "16.0.0" } +atuin-server-database = { path = "../atuin-server-database", version = "16.0.0" } tracing = "0.1" chrono = { workspace = true } diff --git a/atuin-server/Cargo.toml b/atuin-server/Cargo.toml index f308fa30f..f1c44b4ca 100644 --- a/atuin-server/Cargo.toml +++ b/atuin-server/Cargo.toml @@ -10,8 +10,8 @@ homepage = { workspace = true } repository = { workspace = true } [dependencies] -atuin-common = { path = "../atuin-common", version = "15.0.0" } -atuin-server-database = { path = "../atuin-server-database", version = "15.0.0" } +atuin-common = { path = "../atuin-common", version = "16.0.0" } +atuin-server-database = { path = "../atuin-server-database", version = "16.0.0" } tracing = "0.1" chrono = { workspace = true } diff --git a/atuin/Cargo.toml b/atuin/Cargo.toml index 551a1f160..5d9b862c6 100644 --- a/atuin/Cargo.toml +++ b/atuin/Cargo.toml @@ -39,10 +39,10 @@ sync = ["atuin-client/sync"] server = ["atuin-server", "atuin-server-postgres", "tracing-subscriber"] [dependencies] -atuin-server-postgres = { path = "../atuin-server-postgres", version = "15.0.0", optional = true } -atuin-server = { path = "../atuin-server", version = "15.0.0", optional = true } -atuin-client = { path = "../atuin-client", version = "15.0.0", optional = true, default-features = false } -atuin-common = { path = "../atuin-common", version = "15.0.0" } +atuin-server-postgres = { path = "../atuin-server-postgres", version = "16.0.0", optional = true } +atuin-server = { path = "../atuin-server", version = "16.0.0", optional = true } +atuin-client = { path = "../atuin-client", version = "16.0.0", optional = true, default-features = false } +atuin-common = { path = "../atuin-common", version = "16.0.0" } log = { workspace = true } env_logger = "0.10.0" |