1
0
Files
nixfiles/profiles/dn42-router/documentation.nix

89 lines
2.6 KiB
Nix

{ config, lib, ... }:
with lib;
let
cfg = config.profiles.clerie.dn42-router;
in {
profiles.clerie.dn42-router.htmlDocumentation = ''
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<h1>${config.networking.fqdn}</h1>
<p>This is a router in the <a href="https://wiki.dn42.us/">experimental decentralized network dn42</a>.</p>
<p>If you like to peer, please drop me an email to <a href="mailto:dn42@clerie.de">dn42@clerie.de</a>.</p>
<p>Happy peering!</p>
<h2>Router Information</h2>
<ul>
<li>ASN: <code>AS4242422574</code></li>
<li>Loopback IP: <code>${cfg.loopbackIp}</code></li>
<li>Router ID: <code>${cfg.routerId}</code></li>
</ul>
<h2>Wireguard Peers</h2>
<table>
${concatMapStringsSep "\n" (peer: ''
<tr>
<td>${peer.peerName}</td>
<td><a href="https://explorer.burble.com/#/aut-num/AS${peer.remoteAsn}">AS${peer.remoteAsn}</a></td>
<td>
<details>
<summary>Peering config</summary>
<ul>
<li>Local Endpoint: <code>${config.networking.fqdn}:???</code></li>
<li>Local Address: <code>${peer.localAddress}</code></li>
<li>Local ASN: <code>AS4242422574</code></li>
</ul>
<ul>
<li>Remote Endpoint: <code>???</code></li>
<li>Remote Address: <code>${peer.remoteAddress}</code></li>
<li>Remote ASN: <code>AS${peer.remoteAsn}</code></li>
</ul>
</details>
</td>
<td><a href="https://map.iedon.net/#${peer.remoteAsn}">[Map]</a></td>
</tr>
'') cfg.wireguardPeers}
</table>
<h2>BGP Peers</h2>
<table>
${concatMapStringsSep "\n" (peer: ''
<tr>
<td>${peer.peerName}</td>
<td>AS${peer.remoteAsn}</td>
<td>
<details>
<summary>Peering config</summary>
<ul>
<li>Local Address: <code>${peer.localAddress}</code></li>
<li>Local ASN: <code>AS4242422574</code></li>
</ul>
<ul>
<li>Remote Address: <code>${peer.remoteAddress}</code></li>
<li>Remote ASN: <code>AS${peer.remoteAsn}</code></li>
</ul>
</details>
</td>
<td><a href="https://map.iedon.net/#${peer.remoteAsn}">[Map]</a></td>
</tr>
'') cfg.bgpPeers}
</table>
</body>
</html>
'';
}