feat/wip/fix: add inbounds support, fix ssh-proxy
This commit is contained in:
39 files changed
+5093
-48
No files matched your search
@@ -24,6 +24,41 @@ let
|
||||
;
|
||||
};
|
||||
|
||||
inboundRules = import ./rules/proxy-inbounds.nix {
|
||||
inherit lib;
|
||||
inherit (derived) proxyInboundsCfg proxyInbounds;
|
||||
inherit (rules) zapretDirectRules;
|
||||
};
|
||||
|
||||
proxyInboundsTemplate = import ./config-templates/proxy-inbounds.nix {
|
||||
inherit lib derived inboundRules;
|
||||
inherit (xrayTemplates) mkDnsServer;
|
||||
};
|
||||
|
||||
# Listener specification handed to build-inbound.py at service start. Secrets
|
||||
# appear here only as paths; the script reads them at runtime.
|
||||
proxyInboundsSpec = {
|
||||
serverAddress = derived.proxyInboundsCfg.serverAddress;
|
||||
shareLinks = derived.proxyInboundsCfg.shareLinks;
|
||||
listeners = map (ib: {
|
||||
inherit (ib) tag;
|
||||
inherit (ib.listener)
|
||||
type
|
||||
port
|
||||
sharePort
|
||||
users
|
||||
flow
|
||||
method
|
||||
transport
|
||||
tls
|
||||
reality
|
||||
xrayJson
|
||||
jsonFile
|
||||
;
|
||||
listen = ib.listener.listenAddress;
|
||||
}) derived.proxyInbounds;
|
||||
};
|
||||
|
||||
selectedTemplates = if derived.pureXrayEnabled then xrayTemplates else singBoxTemplates;
|
||||
routeModeRules =
|
||||
if derived.pureXrayEnabled then rules.xrayRouteModeRules else rules.singBoxRouteModeRules;
|
||||
@@ -40,6 +75,12 @@ let
|
||||
routeModeRulesFile = pkgs.writeText "proxy-suite-route-mode-rules.json" (
|
||||
builtins.toJSON routeModeRules
|
||||
);
|
||||
proxyInboundsFile = pkgs.writeText "proxy-suite-inbounds-template.json" (
|
||||
builtins.toJSON proxyInboundsTemplate
|
||||
);
|
||||
proxyInboundsSpecFile = pkgs.writeText "proxy-suite-inbounds-spec.json" (
|
||||
builtins.toJSON proxyInboundsSpec
|
||||
);
|
||||
in
|
||||
{
|
||||
inherit
|
||||
@@ -47,5 +88,7 @@ in
|
||||
tunFile
|
||||
perAppTunFile
|
||||
routeModeRulesFile
|
||||
proxyInboundsFile
|
||||
proxyInboundsSpecFile
|
||||
;
|
||||
}
|
||||
Reference in new issue
Block a user