From 2ba1167d6922aa7a14dabf856764dc47d2914864 Mon Sep 17 00:00:00 2001 From: FUFSoB Date: Mon, 13 Apr 2026 17:03:51 +0500 Subject: [PATCH] make default tg-ws-proxy host local-only --- docs/options.md | 24 ++++++++---------------- modules/proxy-suite/options.nix | 17 ++++++----------- nix/checks.nix | 8 ++++++++ 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/docs/options.md b/docs/options.md index e12cbd4..e29423e 100644 --- a/docs/options.md +++ b/docs/options.md @@ -65,12 +65,9 @@ services.proxy-suite = { }; }; tgWsProxy = { - dcIps = { - "2" = "149.154.167.220"; - "4" = "149.154.167.220"; - }; + dcIps = { }; enable = false; - host = "0.0.0.0"; + host = "127.0.0.1"; port = 1076; secret = null; secretFile = null; @@ -2119,10 +2116,7 @@ attribute set of string *Default:* ```nix -{ - "2" = "149.154.167.220"; - "4" = "149.154.167.220"; -} +{ } ``` @@ -2131,11 +2125,9 @@ attribute set of string ```nix { - "1" = "149.154.175.50"; - "2" = "149.154.167.51"; - "3" = "149.154.175.100"; - "4" = "149.154.167.91"; - "5" = "91.108.56.130"; + "2" = "149.154.167.220"; + "203" = "149.154.167.220"; + "4" = "149.154.167.220"; } ``` @@ -2161,7 +2153,7 @@ string *Default:* ```nix -"0.0.0.0" +"127.0.0.1" ``` @@ -2169,7 +2161,7 @@ string *Example:* ```nix -"0.0.0.0" +"127.0.0.1" ``` *Declared by:* diff --git a/modules/proxy-suite/options.nix b/modules/proxy-suite/options.nix index 133a140..d633869 100644 --- a/modules/proxy-suite/options.nix +++ b/modules/proxy-suite/options.nix @@ -902,12 +902,12 @@ in host = mkOption { type = types.str; - default = "0.0.0.0"; + default = "127.0.0.1"; description = '' Address to bind tg-ws-proxy to. Only relevant when tgWsProxy.enable = true. ''; - example = "0.0.0.0"; + example = "127.0.0.1"; }; secret = mkOption { @@ -937,20 +937,15 @@ in dcIps = mkOption { type = types.attrsOf types.str; - default = { - "2" = "149.154.167.220"; - "4" = "149.154.167.220"; - }; + default = { }; description = '' Map of Telegram DC ID to IP address for relay. Only relevant when tgWsProxy.enable = true. ''; example = { - "1" = "149.154.175.50"; - "2" = "149.154.167.51"; - "3" = "149.154.175.100"; - "4" = "149.154.167.91"; - "5" = "91.108.56.130"; + "2" = "149.154.167.220"; + "4" = "149.154.167.220"; + "203" = "149.154.167.220"; }; }; }; diff --git a/nix/checks.nix b/nix/checks.nix index 95b2c18..5a45a4b 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -698,6 +698,14 @@ let assert tgSecretFile.config.services.proxy-suite.tgWsProxy.host == "127.0.0.1"; true ) + ( + assert minimal.config.services.proxy-suite.tgWsProxy.host == "127.0.0.1"; + true + ) + ( + assert minimal.config.services.proxy-suite.tgWsProxy.dcIps == { }; + true + ) ( assert tgSecretFile.config.systemd.services."proxy-suite-tg-ws-proxy".serviceConfig.LoadCredential