$ pip install pynacl
import base64import nacl.publicdef wgkeys(): """Generate a WireGuard keypair.""" private = nacl.public.PrivateKey.generate() privkey = base64.b64encode(bytes(private)).decode() pubkey = base64.b64encode(bytes(private.public_key)).decode() return privkey, pubkey
... I will push to Github and you can take a look.
There is a new feature in OPNsense that allows the importer to find CDs, and this fits perfectly.
For WireGuard, because it is a plugin, there needs to be a triggering event for the packages for the plugin to be installed.
% coverage report -mName Stmts Miss Branch BrPart Cover Missing------------------------------------------------------------------src/oscg/__init__.py 0 0 0 0 100%src/oscg/cli.py 105 0 36 0 100%src/oscg/core.py 171 0 32 0 100%src/oscg/example.py 11 0 0 0 100%src/oscg/utils.py 14 0 2 0 100%------------------------------------------------------------------TOTAL 301 0 70 0 100%
pip install opnsense-confgen