diff --git a/Cargo.lock b/Cargo.lock index f4bc04a..45f7f7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1731,9 +1731,9 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "libsqlite3-sys" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f111c8c41e7c61a49cd34e44c7619462967221a6443b0ec299e0ac30cfb9b1" +checksum = "a76001fb4daed01e5f2b518aac0b4dc592e7c734da63dbffcf0c64fa612a8d0c" dependencies = [ "cc", "pkg-config", @@ -2707,9 +2707,9 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d2b0146dd9661bf67bb107c0bb2a55064d556eeb3fc314151b957f313bcd4e" +checksum = "1b3492ea85308705c3a5cc24fb9b9cf77273d30590349070db42991202b214c4" dependencies = [ "bitflags 2.13.0", "fallible-iterator", diff --git a/Cargo.toml b/Cargo.toml index 123889e..b41d868 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ exclude = [ [workspace.package] version = "1.2.0" edition = "2024" -rust-version = "1.88" +rust-version = "1.95" license = "Apache-2.0" repository = "https://github.com/kafkade/ldgr" homepage = "https://github.com/kafkade/ldgr" @@ -34,7 +34,7 @@ zeroize = { version = "1", features = ["derive"] } # Data rust_decimal = { version = "1", features = ["serde-with-str"] } -rusqlite = { version = "0.39", features = ["bundled"] } +rusqlite = { version = "0.40", features = ["bundled"] } serde = { version = "1", features = ["derive"] } serde_json = "1" uuid = { version = "1", features = ["v7", "serde"] } diff --git a/crates/ldgr-cli/src/commands/portfolio.rs b/crates/ldgr-cli/src/commands/portfolio.rs index 7126ccd..4cfb172 100644 --- a/crates/ldgr-cli/src/commands/portfolio.rs +++ b/crates/ldgr-cli/src/commands/portfolio.rs @@ -176,7 +176,7 @@ async fn run_portfolio_async(holdings: Vec) -> Result<()> { let backend = CrosstermBackend::new(io::stdout()); let mut terminal = Terminal::new(backend).context("failed to create terminal")?; - let tick_rate = Duration::from_secs(60); // Refresh every 60s for portfolio + let tick_rate = Duration::from_mins(1); // Refresh every 60s for portfolio let event_handler = EventHandler::new(tick_rate); let symbols: Vec = holdings.iter().map(|h| h.symbol.clone()).collect(); diff --git a/crates/ldgr-core/src/market/cache.rs b/crates/ldgr-core/src/market/cache.rs index 1e46770..f05cc43 100644 --- a/crates/ldgr-core/src/market/cache.rs +++ b/crates/ldgr-core/src/market/cache.rs @@ -9,9 +9,9 @@ use std::time::Duration; use serde::{Deserialize, Serialize}; /// Default TTLs for different data types (per ADR-007). -pub const QUOTE_TTL: Duration = Duration::from_secs(15 * 60); // 15 minutes -pub const HISTORICAL_TTL: Duration = Duration::from_secs(24 * 60 * 60); // 24 hours -pub const FOREX_TTL: Duration = Duration::from_secs(24 * 60 * 60); // 24 hours +pub const QUOTE_TTL: Duration = Duration::from_mins(15); // 15 minutes +pub const HISTORICAL_TTL: Duration = Duration::from_hours(24); // 24 hours +pub const FOREX_TTL: Duration = Duration::from_hours(24); // 24 hours /// A cached market data entry with expiration. #[derive(Debug, Clone, Serialize, Deserialize)] @@ -184,7 +184,7 @@ mod tests { #[test] fn rate_limiter_allows_within_limit() { - let mut rl = RateLimiter::new(3, Duration::from_secs(60)); + let mut rl = RateLimiter::new(3, Duration::from_mins(1)); assert!(rl.try_request(100)); assert!(rl.try_request(110)); assert!(rl.try_request(120)); @@ -193,7 +193,7 @@ mod tests { #[test] fn rate_limiter_window_slides() { - let mut rl = RateLimiter::new(2, Duration::from_secs(60)); + let mut rl = RateLimiter::new(2, Duration::from_mins(1)); assert!(rl.try_request(100)); assert!(rl.try_request(110)); assert!(!rl.try_request(120)); // denied diff --git a/crates/ldgr-server/Dockerfile b/crates/ldgr-server/Dockerfile index 2f1abd6..736741b 100644 --- a/crates/ldgr-server/Dockerfile +++ b/crates/ldgr-server/Dockerfile @@ -1,5 +1,5 @@ # ── Builder ──────────────────────────────────────────────────────────────────── -FROM rust:1.88-bookworm AS builder +FROM rust:1.95-bookworm AS builder WORKDIR /usr/src/ldgr COPY . . diff --git a/crates/ldgr-server/src/auth/srp.rs b/crates/ldgr-server/src/auth/srp.rs index f3ce6c8..6897035 100644 --- a/crates/ldgr-server/src/auth/srp.rs +++ b/crates/ldgr-server/src/auth/srp.rs @@ -293,7 +293,7 @@ mod tests { #[test] fn reject_zero_client_public() { - let store = SrpHandshakeStore::new(Duration::from_secs(60)); + let store = SrpHandshakeStore::new(Duration::from_mins(1)); let n = get_n(); // A = N, which is ≡ 0 mod N let result = store.initiate( @@ -311,7 +311,7 @@ mod tests { fn handshake_store_caps_pending() { let store = SrpHandshakeStore { handshakes: Mutex::new(HashMap::new()), - ttl: Duration::from_secs(60), + ttl: Duration::from_mins(1), max_pending: 2, }; let v = BigUint::from(42u32); diff --git a/docs/ldgr-architecture.md b/docs/ldgr-architecture.md index 749af36..d28e0b7 100644 --- a/docs/ldgr-architecture.md +++ b/docs/ldgr-architecture.md @@ -813,7 +813,7 @@ async runtime. Six tables: `users`, `sessions`, `vaults`, `blobs`, `devices`, - Relay offers are ephemeral with configurable TTL (default 10 minutes) - Body size limits: 64 KB for JSON endpoints, configurable for blob endpoints (default 50 MB) -**Deployment**: Docker multi-stage build (`rust:1.88-bookworm` → `debian:bookworm-slim`) +**Deployment**: Docker multi-stage build (`rust:1.95-bookworm` → `debian:bookworm-slim`) with non-root user and `/data` volume for the SQLite database. ---