cluster/services/ipfs: make gateway consul service public

This commit is contained in:
Max Headroom 2023-06-02 23:23:07 +02:00
parent 56d0d07d26
commit 3e0684ffb5

View file

@ -1,4 +1,4 @@
{ config, lib, tools, ... }: { config, depot, lib, tools, ... }:
with tools.nginx; with tools.nginx;
let let
inherit (tools.meta) domain; inherit (tools.meta) domain;
@ -60,15 +60,27 @@ in
consul.services.ipfs-gateway = { consul.services.ipfs-gateway = {
mode = "external"; mode = "external";
unit = "ipfs"; unit = "ipfs";
definition = { definition = rec {
name = "ipfs-gateway"; name = "ipfs-gateway";
address = gw.ipv4; address = depot.reflection.interfaces.primary.addrPublic;
inherit (gw) port; port = 443;
checks = lib.singleton { checks = [
{
name = "Frontend";
id = "service:ipfs-gateway:frontend";
interval = "60s";
http = "https://${address}/";
tls_server_name = "bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354.ipfs.${domain}"; # empty directory
method = "HEAD";
}
{
name = "IPFS Node";
id = "service:ipfs-gateway:ipfs";
interval = "60s"; interval = "60s";
http = "${gw.url}/ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn/"; # empty directory http = "${gw.url}/ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn/"; # empty directory
method = "HEAD"; method = "HEAD";
}; }
];
}; };
}; };
} }