Cleanup
This commit is contained in:
12
README.md
12
README.md
@@ -1,11 +1,5 @@
|
|||||||
# vppn: Virtual Potentially Private Network
|
# vppn: Virtual Potentially Private Network
|
||||||
|
|
||||||
## TO DO
|
|
||||||
|
|
||||||
* peer - write status to file instead of using sockets
|
|
||||||
* peer - improve relay selection
|
|
||||||
* Double buffering in IFReader and ConnReader ?
|
|
||||||
|
|
||||||
## Hub Server Configuration
|
## Hub Server Configuration
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -59,15 +53,17 @@ Sign-in and configure.
|
|||||||
|
|
||||||
Install the binary somewhere, for example `~/bin/vppn`.
|
Install the binary somewhere, for example `~/bin/vppn`.
|
||||||
|
|
||||||
|
Add the API key for your network name in `~/.vppn/<netname>/apikey`.
|
||||||
|
|
||||||
Create systemd file in `/etc/systemd/system/vppn.service`.
|
Create systemd file in `/etc/systemd/system/vppn.service`.
|
||||||
|
|
||||||
```
|
```
|
||||||
[Service]
|
[Service]
|
||||||
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
|
AmbientCapabilities=AP_NET_ADMIN CAP_DAC_OVERRIDE CAP_CHOWN
|
||||||
Type=simple
|
Type=simple
|
||||||
User=user
|
User=user
|
||||||
WorkingDirectory=/home/user/
|
WorkingDirectory=/home/user/
|
||||||
ExecStart=/home/user/vppn run my_net_name https://my.hub my_api_key
|
ExecStart=/home/user/bin/vppn -name my_net_name -hub https://my.hub
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=8
|
RestartSec=8
|
||||||
TimeoutStopSec=24
|
TimeoutStopSec=24
|
||||||
|
|||||||
@@ -57,7 +57,12 @@ func (a *App) devSetRelay(p *Peer, endpoint netip.AddrPort) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) devPromote(p *Peer) {
|
func (a *App) devPromote(p *Peer) {
|
||||||
log.Printf("PROMOTED: %s - %s @ %s", p.Name, p.VPNIP.String(), p.WGEndpoint().String())
|
ep := p.WGEndpoint()
|
||||||
|
if ep.IsValid() {
|
||||||
|
log.Printf("PROMOTED: %s - %s @ %s", p.Name, p.VPNIP.String(), p.WGEndpoint().String())
|
||||||
|
} else {
|
||||||
|
log.Printf("PROMOTED: %s - %s (no IP)", p.Name, p.VPNIP.String())
|
||||||
|
}
|
||||||
devRetry(p.VPNIP, "Promote", func() error { return a.dev.Promote(p.PubKey(), p.VPNIP) })
|
devRetry(p.VPNIP, "Promote", func() error { return a.dev.Promote(p.PubKey(), p.VPNIP) })
|
||||||
p.State = StateDirect
|
p.State = StateDirect
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user