feat: add Cloudflare tunnel hosting
This commit is contained in:
parent
e6c1b82679
commit
23e087ae4b
15 changed files with 839 additions and 30 deletions
|
|
@ -4,6 +4,7 @@ pkg:
|
|||
let
|
||||
cfg = config.services.noisebell-rss;
|
||||
bin = "${pkg}/bin/noisebell-rss";
|
||||
caddyHost = if cfg.httpOnly then "http://${cfg.domain}" else cfg.domain;
|
||||
in
|
||||
{
|
||||
options.services.noisebell-rss = {
|
||||
|
|
@ -14,6 +15,12 @@ in
|
|||
description = "Domain for the Caddy virtual host.";
|
||||
};
|
||||
|
||||
httpOnly = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Use an explicit HTTP-only Caddy virtual host, for example behind Cloudflare Tunnel.";
|
||||
};
|
||||
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 3002;
|
||||
|
|
@ -37,7 +44,7 @@ in
|
|||
};
|
||||
users.groups.noisebell-rss = { };
|
||||
|
||||
services.caddy.virtualHosts.${cfg.domain}.extraConfig = ''
|
||||
services.caddy.virtualHosts.${caddyHost}.extraConfig = ''
|
||||
reverse_proxy localhost:${toString cfg.port}
|
||||
'';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue