diff --git a/kindexr.dev.yaml b/kindexr.dev.yaml index 56f2079..ceaa506 100644 --- a/kindexr.dev.yaml +++ b/kindexr.dev.yaml @@ -14,14 +14,21 @@ relays: - "wss://nos.lol" - "wss://freelay.sovbit.dev" - "wss://freelay.sovbit.host" + - "wss://relay.primal.net" + - "wss://relay.snort.social" + - "wss://nostr.mom" + - "wss://relay.nostr.band" + - "wss://nostr.wine" + - "wss://relay.nos.social" + - "wss://wot.nostr.net" -backfill_days: 7 +backfill_days: 365 negentropy_bootstrap: false curation: wot_only: false follow_depth: 2 - operator_pubkey: "" + operator_pubkey: "npub1gnwpctdec0aa00hfy4lvadftu08ccs9677mr73h9ddv2zvw8fu9smmerrq" allowlist: [] blocklist: [] curation_sets: [] @@ -44,15 +51,23 @@ network: url: "" publisher: - enabled: false - outbox: [] - publish_delay_secs: 1800 + enabled: true + outbox: + - "wss://freelay.sovbit.dev" + - "wss://freelay.sovbit.host" + publish_delay_secs: 0 identity: - nsec: "" + nsec: "nsec1uszemvvqhv4agy8alggnrmw4h4qmhdgr4ahrv4tqz08c8hsusfrqrmnmva" bunker_url: "" qbittorrent: - url: "http://127.0.0.1:8080" - username: "admin" + url: "" + username: "" password: "" - poll_interval_secs: 60 + poll_interval_secs: 0 categories: [] + deluge: + enabled: true + url: "http://127.0.0.1:8112" + password: "q1w2e3r4t5" + poll_interval_secs: 60 + labels: [] diff --git a/src/publisher/deluge.rs b/src/publisher/deluge.rs index 85befc7..2ece58b 100644 --- a/src/publisher/deluge.rs +++ b/src/publisher/deluge.rs @@ -2,7 +2,6 @@ use anyhow::{bail, Context}; use reqwest::Client; use serde::Deserialize; use serde_json::{json, Value}; -use std::collections::HashMap; use tracing::debug; pub struct DelugeClient { @@ -36,10 +35,17 @@ struct RpcResponse { impl DelugeClient { pub fn new(url: &str, password: &str) -> Self { + // Disable connection pooling — Deluge's Twisted HTTP server closes + // keep-alive connections aggressively, causing "connection closed before + // message completed" errors when reqwest tries to reuse a stale connection. + let http = Client::builder() + .pool_max_idle_per_host(0) + .build() + .unwrap_or_default(); DelugeClient { url: url.trim_end_matches('/').to_owned(), password: password.to_owned(), - http: Client::new(), + http, } } diff --git a/src/publisher/watcher.rs b/src/publisher/watcher.rs index ca79b47..482638b 100644 --- a/src/publisher/watcher.rs +++ b/src/publisher/watcher.rs @@ -94,7 +94,7 @@ impl Watcher { } } } - Err(e) => warn!("deluge poll failed: {e}"), + Err(e) => warn!("deluge poll failed: {e:#}"), } tokio::time::sleep(interval).await; } diff --git a/src/ui/settings.rs b/src/ui/settings.rs index feb285b..88c9234 100644 --- a/src/ui/settings.rs +++ b/src/ui/settings.rs @@ -27,18 +27,8 @@ pub async fn handler( async fn render(state: &AppState, params: &PageParams) -> anyhow::Result> { let cfg = &state.cfg; - let has_overrides = db::settings_count(&state.pool).await > 0; let api_keys = db::list_api_keys(&state.pool).await.unwrap_or_default(); - let restart_banner = if has_overrides { - r#"
"# - } else { - "" - }; - let flash = if let Some(key) = ¶ms.newkey { let label = params.keylabel.as_deref().unwrap_or("new key"); format!( @@ -377,7 +367,6 @@ function copyKey() { let body = format!( r#"