feat: rebranded from vpn-router to linux-manager.
This commit is contained in:
1 parent
8efe21bfa6
commit
85a1ffa21f
238 files changed
+5010
-3761
No files matched your search
@@ -0,0 +1,14 @@
|
||||
"""Give user alice one WireGuard peer: wireguard_peer.py PUBLIC-KEY TUNNEL-ADDRESS.
|
||||
|
||||
Runs on the server; the peer's allowed address is TUNNEL-ADDRESS/32.
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, '/usr/lib/linux-manager')
|
||||
|
||||
import linuxmanager_users as users # noqa: E402
|
||||
|
||||
public_key, address = sys.argv[1:3]
|
||||
with users.session() as connection:
|
||||
users.update(connection, 'alice', {'wireguard_peers': [{'public_key': public_key, 'ips': [f'{address}/32']}]})
|
||||
Reference in new issue
Block a user