wg-federation
A WireGuard federation server and client.
Optional dependencies
systemd-python
: enable logging into systemd journal
Development
Python virtualenv
must be installed on your system.
python -m venv venv
source ./venv/bin/activate
pip install -e ".[dev]"
pip install -e ".[build]"
wg-federation
deactivate
Run Unit Tests
pytest -v --spec
pytest -v --cov
Run Functional Tests
behave tests/features
behave tests/features -w
Run SAST Tests
bandit -c pyproject.toml -r -q .
Setup IDE and Debugger
To avoid having to install the dependencies on your operating system, setup your IDE to use a python virtual environment “SDK”.
E.g. the venv
directory you may have created above.
Intellij/PyCharm provides this feature.
This will allow the IDE to find the libraries in the virtual environment, run and debug the application.
To debug the application, run src/wg_federation/__init__.py
Deploy Manually
Build
python -m build
Publish to Test PyPI
Use __token__
as a username to publish using a token
twine upload --repository testpypi dist/*
Publish in Production (PyPI)
Use __token__
as a username to publish using a token
twine upload dist/*VERSION_HERE
Generate the Documentation
sphinx-apidoc -o doc/ src/wg_federation
pyreverse -o png -d doc/img --colorized --ignore container.py,federation.py,wireguard_interface.py,hq_state.py,controller_events.py,hq_event.py,wireguard_peer.py,constants.py,main.py,status.py,raw_options.py,log_level.py,is_argument_data_class.py,is_data_class.py,interface_status.py,configuration_saver_interface.py,configuration_loader_interface.py,can_save_configuration_interface.py,can_load_configuration_interface.py,user_input.py,command_line_argument.py,configuration_backend.py,argparse_action.py,command_line_option.py src/wg_federation
make -C doc html