fix: zulip to use domain and webhooks api properly
This commit is contained in:
parent
3a0d464234
commit
e2f2b96919
1 changed files with 51 additions and 47 deletions
|
|
@ -10,8 +10,9 @@ in
|
|||
enable = lib.mkEnableOption "noisebell Zulip bridge";
|
||||
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Domain for the Caddy virtual host.";
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = "Optional domain for the Caddy virtual host.";
|
||||
};
|
||||
|
||||
port = lib.mkOption {
|
||||
|
|
@ -57,17 +58,14 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable (
|
||||
{
|
||||
users.users.noisebell-zulip = {
|
||||
isSystemUser = true;
|
||||
group = "noisebell-zulip";
|
||||
};
|
||||
users.groups.noisebell-zulip = { };
|
||||
|
||||
services.caddy.virtualHosts.${cfg.domain}.extraConfig = ''
|
||||
reverse_proxy localhost:${toString cfg.port}
|
||||
'';
|
||||
|
||||
systemd.services.noisebell-zulip = {
|
||||
description = "Noisebell Zulip bridge";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
|
@ -103,5 +101,11 @@ in
|
|||
RestrictSUIDSGID = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
// lib.mkIf (cfg.domain != null) {
|
||||
services.caddy.virtualHosts.${cfg.domain}.extraConfig = ''
|
||||
reverse_proxy localhost:${toString cfg.port}
|
||||
'';
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue