feat: warp endpoint; fix: hardening

This commit is contained in:
FUFSoB committed 2026-09-23 11:50:22 +05:00
1 parent 8f65fa9c25
commit 5f29f30790
32 files changed
+266 -381

No files matched your search

+9
View File
@@ -18,6 +18,15 @@ in
default = null;
inherit description example;
};
# A WireGuard peer's host:port, IPv6 in brackets.
endpoint =
description:
mkOption {
type = types.nullOr (types.strMatching "(\\[[0-9A-Fa-f:.]+]|[^]:[]+):[0-9]+");
default = null;
example = "162.159.192.1:500";
inherit description;
};
bool =
default: description:
mkOption {
+14 -4
View File
@@ -13,11 +13,21 @@ in
options.services.proxy-suite.proxy.dns = {
local = mkOption {
type = t.dnsUpstreamType;
default = cloudflare;
description = "Resolver for direct traffic and the default domain resolver. Goes through the proxy in global TUN mode.";
example = {
# TCP: DPI boxes answer plain UDP queries to well-known resolvers themselves, with
# NXDOMAIN or a stub address for blocked names, so direct traffic (zapret's
# included) dials nothing. Not tls, which pure XRay lacks.
default = cloudflare // {
type = "tcp";
address = "9.9.9.9";
};
description = ''
Resolver for direct traffic and the default domain resolver. Goes through the proxy in
global TUN mode. TCP by default: plain UDP queries to well-known resolvers are often
answered by the ISP's DPI instead, which breaks blocked names routed direct to zapret.
'';
example = {
type = "tls";
address = "1.1.1.1";
port = 853;
};
};
@@ -3,6 +3,7 @@
let
inherit (lib) mkOption types;
inherit (import ../lib.nix { inherit lib; }) endpoint;
optionalString = types.nullOr types.str;
optionalUnsigned = types.nullOr types.ints.unsigned;
rangeValue = types.oneOf [
@@ -206,6 +207,7 @@ let
Either way the tunnel itself reaches the peer over the uplink, past TUN and TProxy.
'';
};
endpoint = endpoint "host:port (IPv6 in brackets) that replaces the first peer's Endpoint when the profile is prepared.";
allowConfigHooks = mkOption {
type = types.bool;
default = false;
+8
View File
@@ -2,6 +2,7 @@
let
inherit (lib) mkEnableOption mkOption types;
inherit (import ./lib.nix { inherit lib; }) endpoint;
in
{
options.services.proxy-suite.warp = {
@@ -35,6 +36,13 @@ in
example = "https://valokda-amnezia.vercel.app/api/warp?mode=awg2";
};
endpoint = endpoint ''
host:port that replaces the profile's Endpoint (IPv6 in brackets), for when the default
engage.cloudflareclient.com:2408 is blocked: another Cloudflare address, another port WARP
answers on (500, 1701, 4500, ...), or a relay. Applied in every mode when the tunnel or
AmneziaWG profile starts; the profile file itself is left as is.
'';
asOutbound = mkOption {
type = types.nullOr (
types.enum [