refactor: users single-point
This commit is contained in:
35 files changed
+1009
-381
No files matched your search
@@ -15,15 +15,16 @@ in
|
||||
inbounds = {
|
||||
enable = true;
|
||||
routing.via = "proxy";
|
||||
# Fixed addresses, so firewall rules and DNS can name each device.
|
||||
# Keys are generated on first start.
|
||||
users = {
|
||||
laptop.address = "10.77.77.2";
|
||||
phone.address = "10.77.77.3";
|
||||
};
|
||||
listeners.vpn = {
|
||||
type = "amneziawg";
|
||||
port = 51820;
|
||||
# Fixed addresses, so firewall rules and DNS can name each device.
|
||||
# Keys are generated on first start.
|
||||
users = [
|
||||
{ name = "laptop"; address = "10.77.77.2"; }
|
||||
{ name = "phone"; address = "10.77.77.3"; }
|
||||
];
|
||||
users = [ "laptop" "phone" ];
|
||||
amneziaWg = {
|
||||
# Devices also reach this host, its LAN and each other, directly.
|
||||
mode = "lan";
|
||||
|
||||
@@ -3,7 +3,7 @@ let
|
||||
domain = "vpn.example.com";
|
||||
certDir = config.security.acme.certs.${domain}.directory;
|
||||
|
||||
users = map (name: { inherit name; uuidFile = "/run/secrets/proxy-uuid-${name}"; }) [
|
||||
users = [
|
||||
"alice"
|
||||
"bob"
|
||||
"carol"
|
||||
@@ -54,6 +54,7 @@ in
|
||||
};
|
||||
|
||||
inbounds = {
|
||||
users = lib.genAttrs users (name: { uuidFile = "/run/secrets/proxy-uuid-${name}"; });
|
||||
enable = true;
|
||||
serverAddress = domain;
|
||||
routing.via = "proxy";
|
||||
|
||||
@@ -6,15 +6,17 @@
|
||||
enable = true;
|
||||
serverAddress = "vpn.example.com"; # null: this host's public IPv4
|
||||
routing.via = "direct"; # clients exit straight from this host
|
||||
# Each user once; listeners name the ones they accept, and take the secret they need.
|
||||
users = {
|
||||
phone.uuidFile = "/run/secrets/uuid-phone";
|
||||
laptop.uuidFile = "/run/secrets/uuid-laptop";
|
||||
};
|
||||
listeners = {
|
||||
vless-reality = {
|
||||
type = "vless";
|
||||
port = 443;
|
||||
flow = "xtls-rprx-vision";
|
||||
users = [
|
||||
{ name = "phone"; uuidFile = "/run/secrets/uuid-phone"; }
|
||||
{ name = "laptop"; uuidFile = "/run/secrets/uuid-laptop"; }
|
||||
];
|
||||
users = [ "phone" "laptop" ];
|
||||
reality = {
|
||||
enable = true;
|
||||
serverNames = [ "www.microsoft.com" ];
|
||||
@@ -27,7 +29,7 @@
|
||||
awg = {
|
||||
type = "amneziawg";
|
||||
port = 51820;
|
||||
users = [ { name = "phone"; } ];
|
||||
users = [ "phone" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -26,15 +26,16 @@ in
|
||||
inbounds = {
|
||||
enable = true;
|
||||
routing.via = "proxy";
|
||||
# Fixed addresses, so firewall rules and DNS can name each device.
|
||||
# Keys are generated on first start.
|
||||
users = {
|
||||
laptop.address = "10.77.77.2";
|
||||
phone.address = "10.77.77.3";
|
||||
};
|
||||
listeners.vpn = {
|
||||
type = "amneziawg";
|
||||
port = 51820;
|
||||
# Fixed addresses, so firewall rules and DNS can name each device.
|
||||
# Keys are generated on first start.
|
||||
users = [
|
||||
{ name = "laptop"; address = "10.77.77.2"; }
|
||||
{ name = "phone"; address = "10.77.77.3"; }
|
||||
];
|
||||
users = [ "laptop" "phone" ];
|
||||
amneziaWg = {
|
||||
# Devices also reach this host, its LAN and each other, directly.
|
||||
mode = "lan";
|
||||
|
||||
@@ -23,7 +23,7 @@ let
|
||||
domain = "vpn.example.com";
|
||||
certDir = config.security.acme.certs.${domain}.directory;
|
||||
|
||||
users = map (name: { inherit name; uuidFile = "/run/secrets/proxy-uuid-${name}"; }) [
|
||||
users = [
|
||||
"alice"
|
||||
"bob"
|
||||
"carol"
|
||||
@@ -74,6 +74,7 @@ in
|
||||
};
|
||||
|
||||
inbounds = {
|
||||
users = lib.genAttrs users (name: { uuidFile = "/run/secrets/proxy-uuid-${name}"; });
|
||||
enable = true;
|
||||
serverAddress = domain;
|
||||
routing.via = "proxy";
|
||||
|
||||
@@ -40,15 +40,17 @@ services.proxy-suite = {
|
||||
enable = true;
|
||||
serverAddress = "vpn.example.com"; # null: this host's public IPv4
|
||||
routing.via = "direct"; # clients exit straight from this host
|
||||
# Each user once; listeners name the ones they accept, and take the secret they need.
|
||||
users = {
|
||||
phone.uuidFile = "/run/secrets/uuid-phone";
|
||||
laptop.uuidFile = "/run/secrets/uuid-laptop";
|
||||
};
|
||||
listeners = {
|
||||
vless-reality = {
|
||||
type = "vless";
|
||||
port = 443;
|
||||
flow = "xtls-rprx-vision";
|
||||
users = [
|
||||
{ name = "phone"; uuidFile = "/run/secrets/uuid-phone"; }
|
||||
{ name = "laptop"; uuidFile = "/run/secrets/uuid-laptop"; }
|
||||
];
|
||||
users = [ "phone" "laptop" ];
|
||||
reality = {
|
||||
enable = true;
|
||||
serverNames = [ "www.microsoft.com" ];
|
||||
@@ -61,7 +63,7 @@ services.proxy-suite = {
|
||||
awg = {
|
||||
type = "amneziawg";
|
||||
port = 51820;
|
||||
users = [ { name = "phone"; } ];
|
||||
users = [ "phone" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user