This commit is contained in:
jdl
2026-06-12 18:22:25 +02:00
parent 9a3cb2d1c2
commit 926e111c3f
2 changed files with 10 additions and 9 deletions

View File

@@ -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

View File

@@ -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) {
ep := p.WGEndpoint()
if ep.IsValid() {
log.Printf("PROMOTED: %s - %s @ %s", p.Name, p.VPNIP.String(), p.WGEndpoint().String()) 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
} }