Add usage examples
This commit is contained in:
@@ -1,12 +1,43 @@
|
|||||||
# vpn-manager
|
# WireGuard config manager (WCM)
|
||||||
|
|
||||||
Manage WireGuard VPN peers (both server and clients)
|
Manage WireGuard VPN peers (both server and clients)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# networks
|
||||||
|
wcm network add test
|
||||||
|
wcm network add with-ip --address=10.0.0.2/24
|
||||||
|
wcm network delete with-ip
|
||||||
|
wcm network add no-preshared --no-preshared-key
|
||||||
|
wcm network show
|
||||||
|
|
||||||
|
# peers
|
||||||
|
wcm peer add temp
|
||||||
|
wcm peer add server to network test --pass-thru=0.0.0.0/0 --port=59
|
||||||
|
wcm peer add alice to network test --address=10.0.0.150
|
||||||
|
wcm peer add bob to network test --with-pk=wireguardprivatekey=
|
||||||
|
wcm peer remove alice from network test
|
||||||
|
wcm peer delete alice
|
||||||
|
wcm peer show
|
||||||
|
|
||||||
|
# config
|
||||||
|
wcm config make test
|
||||||
|
wcm config make all
|
||||||
|
wcm config make test --output-dir=~/vpn-configs
|
||||||
|
wcm config load ~/vpn-configs/old
|
||||||
|
|
||||||
|
# Delete database
|
||||||
|
wcm database delete
|
||||||
|
|
||||||
|
# development crud
|
||||||
|
```
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
To start developing:
|
To start developing:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
python -m venv .venv
|
python -m venv .venv
|
||||||
source .venv/Scripts/activate
|
source .venv/Scripts/activate
|
||||||
pip install -e .[test,lint]
|
pip install -e .[test,lint]
|
||||||
@@ -16,17 +47,17 @@ deactivate
|
|||||||
|
|
||||||
Tools:
|
Tools:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
pytest
|
pytest
|
||||||
flake8 vpn_manager
|
flake8 wcm
|
||||||
black vpn_manager
|
black wcm
|
||||||
```
|
```
|
||||||
|
|
||||||
Test runs:
|
Test runs:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
# package
|
# package
|
||||||
$ python -m vpn_manager
|
$ python -m wcm
|
||||||
run
|
run
|
||||||
# script declared in pyproject.toml
|
# script declared in pyproject.toml
|
||||||
$ example
|
$ example
|
||||||
|
|||||||
Reference in New Issue
Block a user