📦 ipfs: adding my own gateway

This commit is contained in:
2021-10-30 23:33:26 -04:00
parent f744273d7c
commit 004d0f038e
6 changed files with 78 additions and 17 deletions

21
modules/ipfs/cluster.nix Normal file
View File

@ -0,0 +1,21 @@
{ config, lib, pkgs, ... }:
{
imports = [ ./default.nix ];
services = {
ipfs = {
enable = true;
extraConfig = {
Swarm = {
AddrFilters = null;
ConnMgr = {
Type = "basic";
LowWater = 25;
HighWater = 50;
GracePeriod = "1m0s";
};
};
};
};
};
}

View File

@ -20,16 +20,6 @@
API = { HTTPHeaders = { Access-Control-Allow-Origin = [ "*" ]; }; };
Discovery = { MDNS = { Enabled = true; }; };
Routing = { Type = "dht"; };
Peering = { Peers = [ ]; };
Swarm = {
AddrFilters = null;
ConnMgr = {
Type = "basic";
LowWater = 25;
HighWater = 50;
GracePeriod = "1m0s";
};
};
};
};
};

48
modules/ipfs/gateway.nix Normal file
View File

@ -0,0 +1,48 @@
{ config, lib, pkgs, ... }:
let
peers = [
{
ID = "12D3KooWMQSgdfa4tUrDhkFx4zP3ZpgT1ryj9KH5RGUae62Vsc7y";
Addrs = [ "/ip4/100.95.167.126/tcp/4001" ];
}
{
ID = "12D3KooWMqSiDukubKNKrK7J4PaF3mfNnZFVAd3Lh7qj3Y3e5bcN";
Addrs = [ "/ip4/100.87.220.71/tcp/4001" ];
}
{
ID = "12D3KooWGmNRyqP969QbyP8NLVRZNK2i6yCcP6N6N2r2DCG4H34v";
Addrs = [ "/ip4/100.126.255.109/tcp/4001" ];
}
{
ID = "12D3KooWFkR8nsG5pzffoAfMzmwBcSakXxnogVa6inRxUbpfN5ua";
Addrs = [ "/ip4/100.74.59.80/tcp/4001" ];
}
];
in {
imports = [ ./default.nix ];
networking.firewall = {
allowedTCPPorts = [ 4001 ];
allowedUDPPorts = [ 4001 ];
};
services = {
ipfs = {
enable = true;
extraConfig = {
Peering = { Peers = peers; };
Swarm = { AddrFilters = null; };
};
};
nginx = {
virtualHosts."walkah.cloud" = {
forceSSL = true;
enableACME = true;
locations."/" = { proxyPass = "http://127.0.0.1:8080"; };
};
};
};
}