feat: add a keyserver

This commit is contained in:
silver 2024-05-07 01:37:19 +01:00
parent cb6f9c2b8e
commit 6ae584c895
3 changed files with 66 additions and 0 deletions

View file

@ -10,3 +10,8 @@ The goal is to back these up in multiple locations.
| UL | skynet | https://gitlab.skynet.ie/compsoc1/compsoc/open-goverance | | | UL | skynet | https://gitlab.skynet.ie/compsoc1/compsoc/open-goverance | |
| | | | | | | | | |
## Keys
We host our own keyserver: https://keyserver.skynet.ie
Use it in commands like so:
``gpg --keyserver hkp://keyserver.skynet.ie:80 --send-key KEY_ID``

View file

@ -0,0 +1,59 @@
/*
This file is for hosting teh open governance for other societies
*/
{
lib,
config,
pkgs,
...
}:
with lib; let
name = "keyserver";
cfg = config.services.skynet."${name}";
port = 11371;
in {
imports = [
../acme.nix
../dns.nix
];
options.services.skynet."${name}" = {
host = {
ip = mkOption {
type = types.str;
};
name = mkOption {
type = types.str;
};
};
};
config = {
skynet_acme.domains = [
"${name}.skynet.ie"
];
skynet_dns.records = [
{
record = "${name}";
r_type = "CNAME";
value = cfg.host.name;
}
];
services.sks = {
enable = true;
hkpPort = port;
};
services.nginx.virtualHosts = {
"${name}.skynet.ie" = {
forceSSL = true;
useACMEHost = "skynet";
locations."/" = {
proxyPass = "http://localhost:${toString port}";
};
};
};
};
}

View file

@ -12,6 +12,7 @@ in {
./acme.nix ./acme.nix
./dns.nix ./dns.nix
./open_governance/open_governance.nix ./open_governance/open_governance.nix
./open_governance/keyserver.nix
]; ];
options.services.skynet = { options.services.skynet = {
@ -64,6 +65,7 @@ in {
]; ];
services.skynet.open-governance.host = cfg.host; services.skynet.open-governance.host = cfg.host;
services.skynet.keyserver.host = cfg.host;
networking.firewall.allowedTCPPorts = [80 443]; networking.firewall.allowedTCPPorts = [80 443];
services.nginx = { services.nginx = {