Skip to content

Commit 21804eb

Browse files
Erethonmergify[bot]
authored andcommitted
master: Add config to force https for the endpoint
1 parent 4de786e commit 21804eb

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

examples/master.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,8 @@
6969
# forceSSL = true;
7070
# enableACME = true;
7171
#};
72+
73+
# Optional: If buildbot is setup to run behind another proxy that does TLS
74+
# termination set this to true to have buildbot use https:// for its endpoint
75+
#useHTTPS = true;
7276
}

nix/master.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ in
187187
example = "https://buildbot-webhooks.numtide.com/";
188188
default = config.services.buildbot-master.buildbotUrl;
189189
};
190+
useHTTPS = lib.mkOption {
191+
type = lib.types.nullOr lib.types.bool;
192+
default = false;
193+
description = ''
194+
If buildbot is setup behind a reverse proxy other than the configured nginx set this to true
195+
to force the endpoint to use https:// instead of http://.
196+
'';
197+
};
190198

191199
outputsPath = lib.mkOption {
192200
type = lib.types.nullOr lib.types.path;
@@ -292,7 +300,7 @@ in
292300
buildbotUrl =
293301
let
294302
host = config.services.nginx.virtualHosts.${cfg.domain};
295-
hasSSL = host.forceSSL || host.addSSL;
303+
hasSSL = host.forceSSL || host.addSSL || cfg.useHTTPS;
296304
in
297305
"${if hasSSL then "https" else "http"}://${cfg.domain}/";
298306
dbUrl = config.services.buildbot-nix.master.dbUrl;

0 commit comments

Comments
 (0)