Compare commits

...

3 Commits

Author SHA1 Message Date
laoxong d7de8b8f8f Feat: Adjust the log level
Build and Push Docker Image / build_docker_image (push) Successful in 8m31s
2025-08-07 00:15:23 +08:00
laoxong fb7a633d14 Fix auth_required comparison 2025-08-04 03:18:48 +08:00
laoxong 8ba270156a Update README.md 2025-08-04 03:01:53 +08:00
3 changed files with 13 additions and 4 deletions
+6
View File
@@ -5,7 +5,13 @@ A Rust learning project with poor code quality.
# Usage
Run `cargo run` whit environment variable `DB_PATH` set to the path of the database file.
# Env
DB_PATH: String
AUTH_REQUIRED: Bool
# Features
- NIP-1
- NIP-2
- NIP-5
- NIP-42
- NIP-65
+4 -1
View File
@@ -31,5 +31,8 @@ pub static SERVER_INFO: Lazy<ServerInfo> = Lazy::new(|| ServerInfo {
software: "https://git.moe.gift/laoxong/nostr-relay",
supported_nips: vec![1, 2, 5, 42, 65],
version: env!("CARGO_PKG_VERSION"), // 从 Cargo.toml 获取版本
auth_required: env::var("AUTH_REQUIRED").unwrap_or_else(|_| "False".to_string()) == "True",
auth_required: env::var("AUTH_REQUIRED")
.unwrap_or_else(|_| "false".to_string())
.to_lowercase()
== "true",
});
+3 -3
View File
@@ -130,11 +130,11 @@ pub async fn handle_ws_connection(
});
}
Ok(Message::Close(_)) => {
info!("Client {} disconnected via CLOSE message", client_id);
debug!("Client {} disconnected via CLOSE message", client_id);
break;
}
Err(e) => {
error!("Client {} WebSocket error: {}", client_id, e);
debug!("Client {} WebSocket error: {}", client_id, e);
break;
}
_ => {}
@@ -332,7 +332,7 @@ pub async fn handle_message(
new_trust_accounts.into_iter().collect();
new_trust_accounts_set.insert(SERVER_INFO.pubkey.to_string()); // 确保服务器公钥始终在信任列表中
*ts = new_trust_accounts_set;
debug!("Trust list updated to {} accounts.", ts.len());
info!("Trust list updated to {} accounts.", ts.len());
}
}
Err(e) => {