From d4a2e9cb70856e53d69debc147167466b01c5337 Mon Sep 17 00:00:00 2001
From: Julien Malka <julien@malka.sh>
Date: Wed, 26 Jul 2023 19:34:55 +0200
Subject: [PATCH] updated module to add epyc builders

---
 modules/buildbot/default.nix | 7 ++++---
 modules/buildbot/master.py   | 4 ++--
 secrets/buildbot-nix-workers | 6 +++---
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/modules/buildbot/default.nix b/modules/buildbot/default.nix
index f6a7b27..197b43f 100644
--- a/modules/buildbot/default.nix
+++ b/modules/buildbot/default.nix
@@ -88,15 +88,16 @@ in
         extraConfig = ''
           ssl_session_timeout 1440m;         
           ssl_session_cache shared:SSL:10m;
+          proxy_set_header    Upgrade     $http_upgrade;
         '';
-        locations."/".proxyPass = "http://127.0.0.1:1810/";
+        locations."/".proxyPass = "http://[::]:1810/";
         locations."/sse" = {
-          proxyPass = "http://127.0.0.1:1810/sse/";
+          proxyPass = "http://[::]:1810/sse/";
           # proxy buffering will prevent sse to work
           extraConfig = "proxy_buffering off;";
         };
         locations."/ws" = {
-          proxyPass = "http://127.0.0.1:1810/ws";
+          proxyPass = "http://[::]:1810/ws";
           proxyWebsockets = true;
           # raise the proxy timeout for the websocket
           extraConfig = "proxy_read_timeout 6000s;";
diff --git a/modules/buildbot/master.py b/modules/buildbot/master.py
index ec389a1..e2f6b57 100644
--- a/modules/buildbot/master.py
+++ b/modules/buildbot/master.py
@@ -225,7 +225,7 @@ def build_config() -> dict[str, Any]:
 
     c["www"] = {
         "avatar_methods": [util.AvatarGitHub()],
-        "port": int(os.environ.get("PORT", "1810")),
+        'port': "tcp:1810:interface=\\:\\:",
         "auth": util.GitHubAuth("bba3e144501aa5b8a5dd", str(read_secret_file("github-oauth-secret")).strip()),        
         "authz": util.Authz(
             roleMatchers=[
@@ -269,7 +269,7 @@ def build_config() -> dict[str, Any]:
 
     c["db"] = {"db_url": os.environ.get("DB_URL", "sqlite:///state.sqlite")}
 
-    c["protocols"] = {"pb": {"port": "tcp:9989:interface=127.0.0.1"}}
+    c['protocols'] = {'pb': {'port': "tcp:interface=\\:\\::port=9989"}}
     c["buildbotURL"] = BUILDBOT_URL
     c["collapseRequests"] = False
 
diff --git a/secrets/buildbot-nix-workers b/secrets/buildbot-nix-workers
index a72320f..7b0fb1c 100644
--- a/secrets/buildbot-nix-workers
+++ b/secrets/buildbot-nix-workers
@@ -1,5 +1,5 @@
 {
-	"data": "ENC[AES256_GCM,data:3n9AjM3MOsFzeJ26cFz1bzL4FjjTTl4uYmVpOAi3Uoo8Tgf09jtLksocRFQE46sBkCNBjfpluihNjD74UdEjBN6ieWPmOY6Gx7YUe89Z,iv:wifzTCW9sB2mutxmnKwfo37M2134a3zhGxZ16h9Gm/E=,tag:8Rdszajm8IhDgItMJ5DkKQ==,type:str]",
+	"data": "ENC[AES256_GCM,data:90e6wXshmzNQvceRcwomw3q/Se2NHOdTUGM384gKVVoiuFqAdix6I9uIIjf7g+krT3Q5K9I8LgZ/lv529Wvf87VON6otJinKqdksZ0PxESM/Egi4aVeNZk66+xf2u0t6odDMA+lRLPe0C83rjonoMXsDFK0VjJVIjDqXDFUW7LKgWuC1AjGBn+0de3IvOMCRpADRr03V+bz+,iv:Bj+YQtp+P0vwhm+PnGc7U1rzXlGaEd9iK2hhEsryL1A=,tag:V/Ky25e0Bdpr8k1uHUZp9A==,type:str]",
 	"sops": {
 		"kms": null,
 		"gcp_kms": null,
@@ -11,8 +11,8 @@
 				"enc": "-----BEGIN AGE ENCRYPTED FILE-----\nYWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBReGpFbFhHelhYLzRYSGlh\nZ3ZiL1FjNUdhUFJmVTB5R1pPYVNtMzNYdFhzCmpRakVzNWJWTFBsUlFtMDVrUisr\nbW01YkhkS2ZUcUZDWktRWVBCSTRmN3MKLS0tIE4rdGd4cStQdU5TVENQMFRmaits\nUndjTnN2NFFObUxiWXdXTHBtUGhKMU0KNe7I99AOUMyubXmOsq9vVVAlYa+AbUi8\nCdw6AZ6kJjTlXh4MpfpuJ8OZGVt4hsLWhiFNqyFkpRAjkj4Tsc6RaQ==\n-----END AGE ENCRYPTED FILE-----\n"
 			}
 		],
-		"lastmodified": "2023-06-15T21:20:32Z",
-		"mac": "ENC[AES256_GCM,data:xGKW6jssMomt53NHYyleYgNHj6nwuwk4P8fyX8d2/nrLn2yqkDCt5YS1xB2PHckT+YJS/CAFFETAmMVmqeYaKcvzLgY6SAU6haQT8obhRjok7PGfypFvGrf5/zfSU0xnzfdnLEjfZ6bjXkdV2w2j++br7K4yg4QUF6n+sD4M4hU=,iv:+WaJcZ7x+e38eqVUJqjSO3StAPJurzAnOGhoaAocHQM=,tag:EjgjiBjngyTh2QbOpWse8w==,type:str]",
+		"lastmodified": "2023-07-22T20:58:59Z",
+		"mac": "ENC[AES256_GCM,data:28AA7ZY0K4WGNv4W9MGt1Hf9GknM84nXJUXtnMh9eups6WelBwOgtMCMARGH9onYqBTcR4SsRL5OrQtEpOWvFCRZASDV/R7DGAf+0XZYmYAKg+Z+zHLNHVPnmdOmnXZsvcz3fXW7tzAaIQIitB51EiXTIAYJpuymbN9zLfZBmEM=,iv:exYJ6CJoiieYB/tAB+1c7BQIOlTBbNG6TLpjrfawGN0=,tag:d2Mm3QYPYU2ImysuFJyz4w==,type:str]",
 		"pgp": null,
 		"unencrypted_suffix": "_unencrypted",
 		"version": "3.7.3"