rewrite script for configuring VPN peers in container - #138
This MR is part of #138 (closed). Script configure_peer.py
enables easier configuration of wireguard VPN peers for Fed-BioMed.
The complete rewrite of configure_peer.py
includes:
- add privilege drop from root to a non-privileged user for all write operations on file (so that files written outside on container, on the host machine filesystem) belong to this user
- extends script functions:
-
remove
: remove a peer declared in the active wireguard interface -
removeconf
: same asremove
plus remove the configuration file for this peer -
list
: list all peers declared in configuration files and/or in the active wireguard interface
-
- refactor the script (coding style, tests, messages) to make it more robust and maintenable.
Note: it can be tested without running the other containers. Any public key string with the correct length is ok for add
ing a peer.