maatma: automatically sync wg config after public key reception
This commit is contained in:
parent
8c881b0e3a
commit
748939c3b4
@ -110,6 +110,8 @@ func getWgTunnelInfo(w http.ResponseWriter, r *http.Request, ps httprouter.Param
|
||||
return
|
||||
}
|
||||
|
||||
syncWgConf()
|
||||
|
||||
tinfo := getTunnelInfo(token.IdStudent)
|
||||
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
@ -264,6 +266,13 @@ AllowedIPs = %s/%d
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
func syncWgConf() (err error) {
|
||||
_, err = exec.Command("sh", "/root/wg-sync.sh").Output()
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
type WGDump struct {
|
||||
PubKey string
|
||||
PSK string
|
||||
|
Reference in New Issue
Block a user