Browse Source

contains/public-access-proxy: add to nixops and fixed proxy warnings

Markus Schmidl 1 month ago
parent
commit
4aa3d1a291

+ 3
- 21
hosts/containers/public-access-proxy/configuration.nix View File

@@ -6,31 +6,13 @@
6 6
 
7 7
 {
8 8
   imports =
9
-    [ <nixpkgs/nixos/modules/profiles/minimal.nix>
9
+    [ ../../../lib/lxc-container.nix
10
+      ../../../lib/shared.nix
11
+      ../../../lib/admins.nix
10 12
       ./proxy.nix
11 13
     ];
12
-  nix.useSandbox = false;
13
-  nix.maxJobs = lib.mkDefault 2;
14
-  nix.buildCores = lib.mkDefault 16;
15
-
16
-  boot.isContainer = true;
17
-  # /sbin/init
18
-  boot.loader.initScript.enable = true;
19
-  boot.loader.grub.enable = false;
20
-
21
-  fileSystems."/" = { fsType = "rootfs"; device = "rootfs"; };
22 14
 
23 15
   networking.hostName = "public-access-proxy";
24
-  networking.defaultGateway = { address = "172.22.99.4"; interface = "eth0"; };
25
-
26
-  # Set your time zone.
27
-  time.timeZone = "Europe/Berlin";
28
-
29
-  services.openssh = {
30
-    enable = true;
31
-    permitRootLogin = "yes";
32
-    ports = [ 1122 ];
33
-  };
34 16
 
35 17
   my.services.proxy = {
36 18
     enable = true;

+ 2
- 2
hosts/containers/public-access-proxy/proxy.nix View File

@@ -82,12 +82,12 @@ in {
82 82
 
83 83
         frontend http-in
84 84
           bind :::80 v4v6
85
+          timeout client 30000
85 86
           default_backend proxy-backend-http
86 87
   
87 88
         backend proxy-backend-http
88 89
           timeout connect 5000
89 90
           timeout check 5000
90
-          timeout client 30000
91 91
           timeout server 30000
92 92
           ${concatMapStringsSep "\n" (proxyHost:
93 93
             optionalString (proxyHost.hostNames != [] && proxyHost.proxyTo.host != null) (
@@ -102,12 +102,12 @@ in {
102 102
 
103 103
         frontend https-in
104 104
           bind :::443 v4v6
105
+          timeout client 30000
105 106
           default_backend proxy-backend-https
106 107
 
107 108
         backend proxy-backend-https
108 109
           timeout connect 5000
109 110
           timeout check 5000
110
-          timeout client 30000
111 111
           timeout server 30000
112 112
           ${concatMapStringsSep "\n" (proxyHost:
113 113
             optionalString (proxyHost.hostNames != [] && proxyHost.proxyTo.host != null) (

+ 13
- 0
hq.nixops View File

@@ -48,4 +48,17 @@
48 48
 				storeKeysOnMachine = true;
49 49
 			};
50 50
 		};
51
+
52
+	"public-access-proxy" =
53
+		{ ... }:
54
+		{
55
+			imports = [
56
+				hosts/containers/public-access-proxy/configuration.nix
57
+			];
58
+			deployment = {
59
+				targetHost = "2a02:8106:208:5201:1024:5fff:febd:9be7";
60
+				storeKeysOnMachine = true;
61
+			};
62
+		};
63
+
51 64
 }