Skip to content

Commit 1eefb21

Browse files
committed
fix(server/proxy): enforce explicit domain on IO primary host
1 parent 3f39ab2 commit 1eefb21

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

modules/nixos/server/proxy/options.nix

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
isThisIOPrimaryHost,
23
getIOPrimaryHostAttr,
34
...
45
}:
@@ -25,15 +26,18 @@ let
2526
functionTo
2627
deferredModule
2728
;
28-
2929
in
3030
{
3131
options.server.proxy = {
3232
domain = mkOption {
3333
type = str;
34-
default = getIOPrimaryHostAttr "server.proxy.domain";
35-
defaultText = literalExpression "getIOPrimaryHostAttr \"server.proxy.domain\"";
36-
description = "The base domain for all virtual hosts.";
34+
default = if isThisIOPrimaryHost then null else getIOPrimaryHostAttr "server.proxy.domain";
35+
defaultText = literalExpression "if isThisIOPrimaryHost then null else getIOPrimaryHostAttr \"server.proxy.domain\"";
36+
description = ''
37+
The base domain for all virtual hosts.
38+
Must be set explicitly on the IO primary host (`server.ioPrimaryHost`);
39+
other hosts read it from the primary host's configuration.
40+
'';
3741
};
3842

3943
extensions = mkOption {

0 commit comments

Comments
 (0)