depot/cluster/services/ipfs/default.nix

92 lines
2.3 KiB
Nix
Raw Normal View History

2023-08-31 01:55:45 +03:00
{ config, depot, lib, ... }:
{
2023-08-31 01:55:45 +03:00
hostLinks = lib.genAttrs config.services.ipfs.nodes.node (name: depot.lib.summon name ({ depot, ... }: let
2023-03-07 02:26:07 +02:00
host = depot.reflection;
intf = host.interfaces.primary;
self = config.hostLinks.${name}.ipfs;
in {
ipfs = {
ipv4 = if intf ? addrPublic then intf.addrPublic else intf.addr;
port = 4001;
extra = {
peerId = {
VEGAS = "Qmd7QHZU8UjfYdwmjmq1SBh9pvER9AwHpfwQvnvNo3HBBo";
prophet = "12D3KooWQWsHPUUeFhe4b6pyCaD1hBoj8j6Z7S7kTznRTh1p1eVt";
}.${name};
multiaddrs = [
"/ip4/${self.ipv4}/udp/${self.portStr}/quic-v1"
"/ip4/${self.ipv4}/tcp/${self.portStr}"
];
};
};
2023-08-31 01:55:45 +03:00
}));
services.ipfs = {
nodes = {
node = [ "VEGAS" "prophet" ];
clusterPeer = [ "VEGAS" "prophet" ];
gateway = [ "VEGAS" "prophet" ];
2023-06-02 18:51:00 +03:00
io-tweaks = [ "VEGAS" ];
remote-api = [ "VEGAS" ];
};
2024-07-04 19:30:38 +03:00
meshLinks.gateway = {
name = "ipfsGateway";
link.protocol = "http";
};
nixos = {
node = [
./node.nix
];
gateway = [
./gateway.nix
./monitoring.nix
];
clusterPeer = [
./cluster.nix
];
2023-06-02 18:51:00 +03:00
io-tweaks = ./io-tweaks.nix;
remote-api = ./remote-api.nix;
};
};
monitoring.blackbox.targets.ipfs-gateway = {
2023-08-31 01:55:45 +03:00
address = "https://bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354.ipfs.${depot.lib.meta.domain}/";
module = "https2xx";
};
2023-11-03 00:43:58 +02:00
dns.records = {
"ipfs.admin".target = map
(node: depot.hours.${node}.interfaces.primary.addrPublic)
config.services.ipfs.nodes.remote-api;
2024-07-04 19:30:38 +03:00
pin.consulService = "ipfs-gateway";
};
ways = {
p2p = {
consulService = "ipfs-gateway";
extras.locations."/" = {
2024-07-04 19:30:38 +03:00
extraConfig = ''
add_header X-Content-Type-Options "";
add_header Access-Control-Allow-Origin *;
'';
};
};
ipfs = {
consulService = "ipfs-gateway";
2024-07-04 19:30:38 +03:00
wildcard = true;
extras.extraConfig = ''
add_header X-Content-Type-Options "";
add_header Access-Control-Allow-Origin *;
'';
};
2024-07-04 19:30:38 +03:00
ipns = {
consulService = "ipfs-gateway";
2024-07-04 19:30:38 +03:00
wildcard = true;
extras.extraConfig = ''
add_header X-Content-Type-Options "";
add_header Access-Control-Allow-Origin *;
'';
};
2023-11-03 00:43:58 +02:00
};
}