Here's another one. This adds the ability to accept user-supplied private keys. Why? Because I have a dream that I'll be able to connect my mobile phone to two WireGuard subnets at the same time, but to do that, you have to use the same private key for both peers (because you can only supply one in the WireGuard Android client). Here's how it works:
The user copies the base64 private key
The user runs the dsnet add function, and includes the -k switch
dsnet will ask the user to enter their private key
dsnet uses the key instead of generating a new one
Example:
phaethusa ~ % sudo ./dsnet add -k mynode
private key: RGlkIHlvdSB0aGluayBJIHdvdWxkIHBvc3QgYSBrZXk=
owner: Me
Description: My Phone
Do you want to add the above configuration? [y/n] y
[Interface]
Address=10.79.56.6/22
PrivateKey=RGlkIHlvdSB0aGluayBJIHdvdWxkIHBvc3QgYSBrZXk=
[Peer]
PublicKey=U3RvcCB0cnlpbmchIFRoaXMgaXMgY2Vuc29yZWRlZGQ=
PresharedKey=VGhpcyBpcyBhIHNpbGx5IGJpdCBvZiB0ZXh0LiAwMTI=
Endpoint=my.server.net:51820
PersistentKeepalive=0
AllowedIPs=10.79.56.0/22
This feature is backwards compatible; dsnet acts the same as it did before if the -k flag isn't provided.
Here's another one. This adds the ability to accept user-supplied private keys. Why? Because I have a dream that I'll be able to connect my mobile phone to two WireGuard subnets at the same time, but to do that, you have to use the same private key for both peers (because you can only supply one in the WireGuard Android client). Here's how it works:
-k
switchExample:
This feature is backwards compatible; dsnet acts the same as it did before if the
-k
flag isn't provided.This PR depends on the
error_cascade
PR. Sorry.