mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-14 08:32:39 +02:00
feat: monitor dnsmasq + v2ray
This commit is contained in:
@@ -107,7 +107,7 @@ ruby:
|
|||||||
kana:
|
kana:
|
||||||
colmena apply --on '@kana'
|
colmena apply --on '@kana'
|
||||||
|
|
||||||
tailscale_gw:
|
tsgw:
|
||||||
colmena apply --on '@tailscale_gw'
|
colmena apply --on '@tailscale_gw'
|
||||||
|
|
||||||
pve-image:
|
pve-image:
|
||||||
|
|||||||
@@ -1,10 +1,34 @@
|
|||||||
{
|
{
|
||||||
# dae(running on aquamarine) do not provides http/socks5 proxy server, so we use v2ray here.
|
# dae(running on aquamarine) do not provides http/socks5 proxy server; so we use v2ray here.
|
||||||
# https://github.com/v2fly
|
# https=//github.com/v2fly
|
||||||
services.v2ray = {
|
services.v2ray = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
# for monitoring
|
||||||
|
"stats" = {};
|
||||||
|
"api" = {
|
||||||
|
"tag" = "api";
|
||||||
|
"services" = [
|
||||||
|
"StatsService"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"policy" = {
|
||||||
|
"levels" = {
|
||||||
|
"0" = {
|
||||||
|
"statsUserUplink" = true;
|
||||||
|
"statsUserDownlink" = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
"system" = {
|
||||||
|
"statsInboundUplink" = true;
|
||||||
|
"statsInboundDownlink" = true;
|
||||||
|
"statsOutboundUplink" = true;
|
||||||
|
"statsOutboundDownlink" = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
inbounds = [
|
inbounds = [
|
||||||
|
# core inbound
|
||||||
{
|
{
|
||||||
listen = "0.0.0.0";
|
listen = "0.0.0.0";
|
||||||
port = 7890;
|
port = 7890;
|
||||||
@@ -19,6 +43,17 @@
|
|||||||
udp = true;
|
udp = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# for monitoring
|
||||||
|
{
|
||||||
|
"tag" = "api";
|
||||||
|
"listen" = "127.0.0.1";
|
||||||
|
"port" = 54321;
|
||||||
|
"protocol" = "dokodemo-door";
|
||||||
|
"settings" = {
|
||||||
|
"address" = "127.0.0.1";
|
||||||
|
};
|
||||||
|
}
|
||||||
];
|
];
|
||||||
outbounds = [
|
outbounds = [
|
||||||
# forward traffic directly via system's default network(to dae proxy running on aquamarine)
|
# forward traffic directly via system's default network(to dae proxy running on aquamarine)
|
||||||
@@ -27,6 +62,28 @@
|
|||||||
tag = "freedom";
|
tag = "freedom";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# for monitoring
|
||||||
|
"routing" = {
|
||||||
|
"rules" = [
|
||||||
|
{
|
||||||
|
"inboundTag" = [
|
||||||
|
"api"
|
||||||
|
];
|
||||||
|
"outboundTag" = "api";
|
||||||
|
"type" = "field";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# https://github.com/wi1dcard/v2ray-exporter
|
||||||
|
services.prometheus.exporters.v2ray = {
|
||||||
|
enable = true;
|
||||||
|
listenAddress = "0.0.0.0";
|
||||||
|
port = 9153;
|
||||||
|
openFirewall = false;
|
||||||
|
v2rayEndpoint = "127.0.0.1:54321";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,6 +165,14 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# monitoring with prometheus
|
||||||
|
services.prometheus.exporters.dnsmasq = {
|
||||||
|
enable = true;
|
||||||
|
listenAddress = "0.0.0.0";
|
||||||
|
port = 9153;
|
||||||
|
openFirewall = false;
|
||||||
|
};
|
||||||
|
|
||||||
# The service irqbalance is useful as it assigns certain IRQ calls to specific CPUs instead of
|
# The service irqbalance is useful as it assigns certain IRQ calls to specific CPUs instead of
|
||||||
# letting the first CPU core to handle everything.
|
# letting the first CPU core to handle everything.
|
||||||
# This is supposed to increase performance by hitting CPU cache more often.
|
# This is supposed to increase performance by hitting CPU cache more often.
|
||||||
|
|||||||
Reference in New Issue
Block a user