Program to set up an auto peering service for DN42 on OpenBSD.
pip install dn42-autopeer
$ env GIT_SSH_COMMAND="ssh -i /home/user/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o IdentitiesOnly=yes" \
autopeer -f /etc/autopeer.conf
Anyone can request to peer with your ASN by sending a POST request to the appropriate endpoint. The request must be signed with their GPG key, the autopeer server will verify the signature and add the peer to the list. The signature is verified by fetching the GPG key for the email registered by the user in the DN42 registry.
$ cat request.json | gpg --sign --detach-sig - | base64 -w 0 > request.sig
$ curl -w '\n' -X POST -d @request.json \
-H "Content-Type: application/json" \
-H "X-DN42-Signature: $(cat request.sig)" \
-H "X-DN42-ASN: 4242420000" \
https://dn42-nue.bsd.ac/autopeer
What it does: - Fetches and keeps the DN42 registry updated in a local folder. - Manages wireguard configurations for a peer on request. - Manages BGP configurations for a peer on request.
User authentication works by verifying the GPG signature of the request. GPG keys are fetched from the DN42 registry.