dolomite: add an instance at sg

This commit is contained in:
xinyangli 2023-12-06 22:54:22 +08:00
parent 9986100945
commit 9fb8bcd621
7 changed files with 132 additions and 80 deletions

View file

@ -12,6 +12,10 @@ let
sg_server = {
_secret = config.sops.secrets.singbox_sg_server.path;
};
jp_server = {
_secret = config.sops.secrets.singbox_jp_server.path;
};
# TODO: diffrent password
sg_password = {
_secret = config.sops.secrets.singbox_sg_password.path;
};
@ -50,6 +54,10 @@ in
domain_suffix = sg_server;
server = "_dns_doh_mainland";
}
{
domain_suffix = jp_server;
server = "_dns_doh_mainland";
}
];
servers = [
{
@ -123,8 +131,9 @@ in
];
};
outbounds = [
{ tag = "selfhost"; type = "urltest"; outbounds = lib.forEach (lib.range 0 4) (id: "sg" + toString id); tolerance = 800; url = "http://www.gstatic.com/generate_204"; interval = "1m0s"; }
{ tag = "selfhost"; type = "urltest"; outbounds = lib.forEach (lib.range 0 4) (id: "jp" + toString id) ++ lib.forEach (lib.range 0 4) (id: "sg" + toString id); tolerance = 50; url = "http://www.gstatic.com/generate_204"; }
{ tag = "sg0"; type = "trojan"; server = sg_server; server_port = 8080; password = sg_password; tls = { enabled = true; server_name = sg_server; utls = { enabled = true; fingerprint = "firefox"; }; }; }
{ tag = "jp0"; type = "trojan"; server = jp_server; server_port = 8080; password = sg_password; tls = { enabled = true; server_name = jp_server; utls = { enabled = true; fingerprint = "firefox"; }; }; }
{ default = "auto"; outbounds = [ "auto" "selfhost" "direct" "block"]; tag = "_proxy_select"; type = "selector"; }
{ interval = "1m0s"; outbounds = [ "SS-01" "SS-02" "SS-03" "SS-04" "SS-01" "SS-02" "SS-03" "SS-01" "SS-02" "SS-03" "SS-01" "SS-02" "SS-03" "SS-04" "1" "2" "3" "4" "5" "6" "7" "8" "1" "2" "3" "4" "1" "2" "3" "4" "5" "6" "7" "8" "1" "2" "1" "2" "3" "4" "5" "6" "1" "2" ]; tag = "auto"; tolerance = 300; type = "urltest"; url = "http://www.gstatic.com/generate_204"; }
@ -184,6 +193,15 @@ in
uuid = sg_uuid;
password = sg_password;
tls = { enabled = true; server_name = sg_server; };
}) ++ lib.forEach (lib.range 6311 6314) (port: {
tag = "jp" + toString (port - 6310);
type = "tuic";
congestion_control = "bbr";
server = jp_server;
server_port = port;
uuid = sg_uuid;
password = sg_password;
tls = { enabled = true; server_name = jp_server; };
});
};
};