Compare commits
2 Commits
1cd9f1e52d
...
cb12fb64cb
Author | SHA1 | Date | |
---|---|---|---|
cb12fb64cb | |||
d068fea2ce |
8
bin/update-ssh-host-keys.sh
Executable file
8
bin/update-ssh-host-keys.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
cd $(git rev-parse --show-toplevel)
|
||||||
|
|
||||||
|
for host in $(nix eval --apply 'attrs: builtins.concatStringsSep "\n" (builtins.filter (name: (builtins.substring 0 1 name) != "_") (builtins.attrNames attrs))' --raw .#clerie.hosts); do
|
||||||
|
echo $host
|
||||||
|
ssh-keyscan -t ed25519 ${host}.net.clerie.de 2>/dev/null | sed -E 's/(\S+) (.+)/\2/g' > hosts/${host}/ssh.pub
|
||||||
|
done
|
1
hosts/carbon/ssh.pub
Normal file
1
hosts/carbon/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGdyTanEqCieqt81Ri8xHnw1dyK3i8srDi1F+xIb3Js3
|
1
hosts/dn42-il-gw1/ssh.pub
Normal file
1
hosts/dn42-il-gw1/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINbpzEFngWD8gZpGKvOdo5CVMPlaDCylNKorf/ZN93rT
|
1
hosts/dn42-il-gw5/ssh.pub
Normal file
1
hosts/dn42-il-gw5/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHCgFELN24kkb40/Pv2aOwhfqoqbCEdQPBTND7nTw1hd
|
1
hosts/dn42-il-gw6/ssh.pub
Normal file
1
hosts/dn42-il-gw6/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGI7h8xpVDM0BsY+XGwp8kX1XKn82Cg0lhd1M4Eldsp5
|
1
hosts/dn42-ildix-clerie/ssh.pub
Normal file
1
hosts/dn42-ildix-clerie/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIANa33GhY8tK+rGFKjrEbaw289bMqh1Aazyo04B//27t
|
1
hosts/dn42-ildix-service/ssh.pub
Normal file
1
hosts/dn42-ildix-service/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKbqGg6BF4MLSgDIe0Q0EsaogXPlYKHCNKWvfIXkNq7L
|
1
hosts/gatekeeper/ssh.pub
Normal file
1
hosts/gatekeeper/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKhHoM0m6PZnCCzWOugKnN/BqhadwYzEE8xbABQxEhgo
|
1
hosts/hydra-1/ssh.pub
Normal file
1
hosts/hydra-1/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE2xQBCsFBCwL9n4OP/bPngtNO1fy9kPw13Z/NDoba16
|
1
hosts/hydra-2/ssh.pub
Normal file
1
hosts/hydra-2/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDZED9QM+qe7sB6R6atvP6WNaI2sC2nh7TTsD6kgRpnr
|
1
hosts/minecraft-2/ssh.pub
Normal file
1
hosts/minecraft-2/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIYGtzxrVeuA7ShtNLmf2iBQDT/4h6aQHQHsuJ2WbSN/
|
1
hosts/monitoring-3/ssh.pub
Normal file
1
hosts/monitoring-3/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLx2HIlnJdOn4JafIdQsUvdjcrAHX9XtP5S//eN5sxW
|
1
hosts/nonat/ssh.pub
Normal file
1
hosts/nonat/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJNYD4kXavTWu8ftw/8pYkyUjIUFS4zxkHjJZSTgkm3Z
|
1
hosts/osmium/ssh.pub
Normal file
1
hosts/osmium/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIICt1KsCZpvwltp5UMyamLI5YIBj3imlGwWr24efQM7i
|
1
hosts/palladium/ssh.pub
Normal file
1
hosts/palladium/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBc/YTf80MjyVeApOecOlxORIlwCaWtJNWtfggc0B374
|
1
hosts/porter/ssh.pub
Normal file
1
hosts/porter/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN2AeM/t66I8+9K+IYGdb/K531ujaqSqNpevIZqs4CdY
|
1
hosts/schule/ssh.pub
Normal file
1
hosts/schule/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAIuAyY1FtMWoBdLzOkDsCro6vQjGYQduGzU9HLcSvfj
|
1
hosts/storage-2/ssh.pub
Normal file
1
hosts/storage-2/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIXlKMje2VbEtAuqn7ui9A4A7gqfv4c412iKvKk76D8p
|
@ -18,6 +18,9 @@
|
|||||||
rev = "d3f220899ecb98e87026ee0a7600bb8898ae3c42";
|
rev = "d3f220899ecb98e87026ee0a7600bb8898ae3c42";
|
||||||
sha256 = "sha256-3o2/+m5OGSfc5RTrS4/j/aVibDasQISL7vY+J3yxbB8=";
|
sha256 = "sha256-3o2/+m5OGSfc5RTrS4/j/aVibDasQISL7vY+J3yxbB8=";
|
||||||
};
|
};
|
||||||
|
locations."= /ssh/known_hosts" = {
|
||||||
|
alias = pkgs.writeText "known_hosts" (import ../../lib/ssh-known-hosts.nix);
|
||||||
|
};
|
||||||
locations."~ ^/.well-known/openpgpkey/hu/[a-z0-9]+/?$" = {
|
locations."~ ^/.well-known/openpgpkey/hu/[a-z0-9]+/?$" = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
1
hosts/web-2/ssh.pub
Normal file
1
hosts/web-2/ssh.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIHQDwfRlw6L+pkLjXDgW2BUWlY1zNEDtVhNEsClgqaL
|
13
lib/ssh-known-hosts.nix
Normal file
13
lib/ssh-known-hosts.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
let
|
||||||
|
stripR = str: if (builtins.substring ((builtins.stringLength str) - 1) (builtins.stringLength str) str) == "\n" then stripR (builtins.substring 0 ((builtins.stringLength str) - 1) str) else str;
|
||||||
|
hostsWithSshPubkey = builtins.filter (hostname: (builtins.substring 0 1 hostname) != "_" && builtins.pathExists (../hosts + "/${hostname}/ssh.pub")) (builtins.attrNames (builtins.readDir ../hosts));
|
||||||
|
sshkeyList = map (hostname: {
|
||||||
|
name = hostname;
|
||||||
|
sshPubkey = stripR (builtins.readFile (../hosts + "/${hostname}/ssh.pub"));
|
||||||
|
}) hostsWithSshPubkey;
|
||||||
|
knownHosts = builtins.concatStringsSep "" (builtins.map ({name, sshPubkey}: ''
|
||||||
|
${name} ${sshPubkey}
|
||||||
|
${name}.net.clerie.de ${sshPubkey}
|
||||||
|
'') sshkeyList);
|
||||||
|
in
|
||||||
|
knownHosts
|
Loading…
Reference in New Issue
Block a user