Move ntfy to its own file
This commit is contained in:
parent
d1e1fe6c5b
commit
f696b221bd
3 changed files with 35 additions and 30 deletions
|
@ -80,8 +80,6 @@ in
|
||||||
reverse_proxy :${toString config.services.lastfm-status.port}
|
reverse_proxy :${toString config.services.lastfm-status.port}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"http://syncthing.internal".extraConfig = ''
|
"http://syncthing.internal".extraConfig = ''
|
||||||
@local remote_ip private_ranges 100.64.0.0/10
|
@local remote_ip private_ranges 100.64.0.0/10
|
||||||
reverse_proxy @local http://${config.services.syncthing.guiAddress}
|
reverse_proxy @local http://${config.services.syncthing.guiAddress}
|
||||||
|
@ -186,24 +184,6 @@ in
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
"ntfy.catnip.ee".extraConfig = ''
|
|
||||||
tls {
|
|
||||||
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
|
|
||||||
resolvers 1.1.1.1
|
|
||||||
}
|
|
||||||
|
|
||||||
reverse_proxy ${config.services.ntfy-sh.settings.listen-http}
|
|
||||||
|
|
||||||
# Redirect HTTP to HTTPS, but only for GET topic addresses, since we want
|
|
||||||
# it to work with curl without the annoying https:// prefix.
|
|
||||||
@httpget {
|
|
||||||
protocol http
|
|
||||||
method GET
|
|
||||||
path_regexp ^/([-_a-z0-9]{0,64}$|docs/|static/)
|
|
||||||
}
|
|
||||||
redir @httpget https://{host}{uri}
|
|
||||||
'';
|
|
||||||
|
|
||||||
"cloud.catnip.ee".extraConfig = ''
|
"cloud.catnip.ee".extraConfig = ''
|
||||||
tls {
|
tls {
|
||||||
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
|
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
./services/blocky.nix
|
./services/blocky.nix
|
||||||
./services/coturn.nix
|
./services/coturn.nix
|
||||||
./services/feishin.nix
|
./services/feishin.nix
|
||||||
|
./services/ntfy.nix
|
||||||
inputs.lastfm-status.nixosModules.default
|
inputs.lastfm-status.nixosModules.default
|
||||||
inputs.confess.nixosModules.default
|
inputs.confess.nixosModules.default
|
||||||
inputs.common-modules.nixosModules.nixos-upgrade
|
inputs.common-modules.nixosModules.nixos-upgrade
|
||||||
|
@ -209,7 +210,6 @@
|
||||||
"/var/lib/mysql"
|
"/var/lib/mysql"
|
||||||
"/var/lib/postgresql"
|
"/var/lib/postgresql"
|
||||||
"/var/lib/nextcloud"
|
"/var/lib/nextcloud"
|
||||||
"/var/lib/private/ntfy-sh"
|
|
||||||
"/var/lib/private/drasl"
|
"/var/lib/private/drasl"
|
||||||
"/var/lib/acme"
|
"/var/lib/acme"
|
||||||
"/var/lib/tailscale"
|
"/var/lib/tailscale"
|
||||||
|
@ -531,15 +531,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# /var/lib/ntfy-sh
|
|
||||||
ntfy-sh = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
listen-http = ":4006";
|
|
||||||
base-url = "https://ntfy.catnip.ee";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
cloudflare-dyndns = {
|
cloudflare-dyndns = {
|
||||||
enable = true;
|
enable = true;
|
||||||
apiTokenFile = "/etc/secrets/cloudflare-dyndns.env";
|
apiTokenFile = "/etc/secrets/cloudflare-dyndns.env";
|
||||||
|
|
34
services/ntfy.nix
Normal file
34
services/ntfy.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{ config, ... }: {
|
||||||
|
services = {
|
||||||
|
# /var/lib/ntfy-sh
|
||||||
|
ntfy-sh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
listen-http = ":4006";
|
||||||
|
base-url = "https://ntfy.catnip.ee";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
caddy.virtualHosts."ntfy.catnip.ee".extraConfig = ''
|
||||||
|
tls {
|
||||||
|
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
|
||||||
|
resolvers 1.1.1.1
|
||||||
|
}
|
||||||
|
|
||||||
|
reverse_proxy ${config.services.ntfy-sh.settings.listen-http}
|
||||||
|
|
||||||
|
# Redirect HTTP to HTTPS, but only for GET topic addresses, since we want
|
||||||
|
# it to work with curl without the annoying https:// prefix.
|
||||||
|
@httpget {
|
||||||
|
protocol http
|
||||||
|
method GET
|
||||||
|
path_regexp ^/([-_a-z0-9]{0,64}$|docs/|static/)
|
||||||
|
}
|
||||||
|
redir @httpget https://{host}{uri}
|
||||||
|
'';
|
||||||
|
|
||||||
|
borgbackup.jobs."borgbase".paths = [
|
||||||
|
"/var/lib/ntfy-sh"
|
||||||
|
"/var/lib/private/ntfy-sh"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue