78 lines
1.2 KiB
Markdown
78 lines
1.2 KiB
Markdown
# vppn: Virtual Pretty Private Network
|
|
|
|
## TODO
|
|
|
|
* Add `-force-init` argument to `node` main?
|
|
|
|
## Hub Server Configuration
|
|
|
|
```
|
|
# Create user.
|
|
adduser user
|
|
|
|
# Enable ssh.
|
|
cp -r ~/.ssh /home/user/
|
|
chown -R user:user /home/user/.ssh
|
|
|
|
```
|
|
|
|
Upload `hub` executable:
|
|
|
|
```
|
|
scp hub user@<remote>:~/
|
|
```
|
|
|
|
Create systemd file in `/etc/systemd/system/hub.service
|
|
|
|
```
|
|
[Service]
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
Type=simple
|
|
User=user
|
|
WorkingDirectory=/home/user/
|
|
ExecStart=/home/user/hub -listen <addr>:https -secure=true -root-dir=/home/user
|
|
Restart=always
|
|
RestartSec=8
|
|
TimeoutStopSec=24
|
|
|
|
[Install]
|
|
WantedBy=default.target
|
|
```
|
|
|
|
Add and start the hub server:
|
|
|
|
```
|
|
systemctl daemon-reload
|
|
systemctl start hub
|
|
```
|
|
|
|
Get initial password from logs:
|
|
|
|
```
|
|
journalctl -f -u hub -n 100
|
|
```
|
|
|
|
Sign-in and configure.
|
|
|
|
## Peer Configuration
|
|
|
|
Install the binary somewhere, for example `~/bin/vppn`.
|
|
|
|
Create systemd file in `/etc/systemd/system/vppn.service`.
|
|
|
|
|
|
```
|
|
[Service]
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
|
|
Type=simple
|
|
User=user
|
|
WorkingDirectory=/home/user/
|
|
ExecStart=/home/user/vppn -name vppn -hub-address https://my.hub -api-key 1234567890
|
|
Restart=always
|
|
RestartSec=8
|
|
TimeoutStopSec=24
|
|
|
|
[Install]
|
|
WantedBy=default.target
|
|
```
|