-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User keys master #79
User keys master #79
Conversation
Thanks @xxxserxxx -- seems like a worthwhile change. I will put it through soon. @botto please take a look, too. Sorry for the late reply, I've been swamped! |
Rebased from origin/master for a clean merge. |
Note if you try to merge both of my PRs, there'll be conflicts. If you merge one, I'll rebase and update the other to make it merge cleanly. |
Thanks @xxxserxxx . Sorry it took so long to merge (years!) I kind of got burnt out on dsnet. |
No problem. I frequently suffer from the same issue. It's especially hard when you maintain several different projects. dsnet has been a big help, though. It's not as if configuring Wireguard subnets is difficult, but dsnet has nevertheless been a big help to me. I change the subnet infrequently enough that I have to re-learn how to do it every time, but often enough that it's a PITA; dsnet relieves this. |
Glad to hear it helps! :-) |
Replaces #77. This PR is based on the head of master and should merge cleanly without any extra changes. It also handles the CLI parameters in a more viper-ish way. In the bargain, it implements your todo code comment about allowing users to provide a public key.
This PR adds the ability to accept user-supplied private and public keys. The use case for public keys is obvious, but there's also a use case for private keys.
The WireGuard Android client does not allow two WireGuard configurations to be active at the same time. The wg-quick config format also only allows declaring one public key. Therefore, if a user wants to have two subnets active (on a mobile phone), then they have to re-use a private key.
The patch adds two (optional) parameters to
Add
----private-key
and--public-key
.AAAAA...AAAAA=
, which the user will have to replace with their private key before using.I can't think of a reason why a user would provide both keys, but rather than disallow it, I have the code test the keys.
Example:
This feature is backwards compatible; if neither argument is provided, dsnet generates the keys itself.