diff --git a/modules/sneedstr.nix b/modules/sneedstr.nix index 9e02bf4..f881b5b 100644 --- a/modules/sneedstr.nix +++ b/modules/sneedstr.nix @@ -95,6 +95,8 @@ in { addSSL = mkIf cfg.sslEnable true; enableACME = mkIf cfg.sslEnable true; + http3 = true; + locations."/" = { proxyPass = "http://${cfg.localAddress}:8080"; proxyWebsockets = true; # needed if you need to use WebSocket diff --git a/src/relay/handler.rs b/src/relay/handler.rs index d264ca8..4295254 100644 --- a/src/relay/handler.rs +++ b/src/relay/handler.rs @@ -16,9 +16,11 @@ pub async fn relay_config(header: String) -> Result { Err(warp::reject::not_found()) } else { let res = serde_json::json!({ - "name": "Zhitno.st", + "contact": "klink@zhitno.st", + "name": "zhitno.st", "description": "Very *special* nostr relay", - "software": "sneedstr", + "supported_nips": [ 1, 9, 11, 12, 15, 16, 20, 22, 28, 33 ], + "software": "git+https://git.zhitno.st/Klink/sneedstr.git", "version": "0.1.0" }); Ok(warp::reply::json(&res)) diff --git a/src/relay/routes.rs b/src/relay/routes.rs index 2c6282c..d30cfae 100644 --- a/src/relay/routes.rs +++ b/src/relay/routes.rs @@ -13,14 +13,17 @@ fn index(context: Context) -> impl Filter("X-Real-IP"); let real_client_ip = warp::addr::remote(); let accept_application_json_header = warp::header::header("Accept"); + let cors = warp::cors().allow_any_origin(); warp::path::end().and( accept_application_json_header .and_then(handler::relay_config) + .with(&cors) .or(warp::ws() .and(with_context(context)) .and(real_client_ip) - .and_then(handler::ws_handler)), + .and_then(handler::ws_handler) + .with(&cors)), ) }