mirror of
https://github.com/fosrl/gerbil.git
synced 2026-03-02 08:46:43 +00:00
Clean up mod
This commit is contained in:
3
go.mod
3
go.mod
@@ -1,7 +1,8 @@
|
|||||||
module github.com/fosrl/gerbil
|
module github.com/fosrl/gerbil
|
||||||
|
|
||||||
go 1.21.5
|
go 1.23.1
|
||||||
|
|
||||||
|
toolchain go1.23.2
|
||||||
require (
|
require (
|
||||||
github.com/vishvananda/netlink v1.3.0
|
github.com/vishvananda/netlink v1.3.0
|
||||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6
|
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6
|
||||||
|
|||||||
6
main.go
6
main.go
@@ -21,7 +21,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
interfaceName = "wg0"
|
interfaceName = "wg0"
|
||||||
listenAddr = ":3002"
|
listenAddr = ":3003"
|
||||||
lastReadings = make(map[string]PeerReading)
|
lastReadings = make(map[string]PeerReading)
|
||||||
mu sync.Mutex
|
mu sync.Mutex
|
||||||
)
|
)
|
||||||
@@ -79,7 +79,7 @@ func main() {
|
|||||||
interfaceNameArg := flag.String("interface", "wg0", "Name of the WireGuard interface")
|
interfaceNameArg := flag.String("interface", "wg0", "Name of the WireGuard interface")
|
||||||
configFile := flag.String("config", "", "Path to local configuration file")
|
configFile := flag.String("config", "", "Path to local configuration file")
|
||||||
remoteConfigURL := flag.String("remoteConfig", "", "URL to fetch remote configuration")
|
remoteConfigURL := flag.String("remoteConfig", "", "URL to fetch remote configuration")
|
||||||
listenAddrArg := flag.String("listen", ":3002", "Address to listen on")
|
listenAddrArg := flag.String("listen", ":3003", "Address to listen on")
|
||||||
reportBandwidthTo := flag.String("reportBandwidthTo", "", "Address to listen on")
|
reportBandwidthTo := flag.String("reportBandwidthTo", "", "Address to listen on")
|
||||||
generateAndSaveKeyTo := flag.String("generateAndSaveKeyTo", "", "Path to save generated private key")
|
generateAndSaveKeyTo := flag.String("generateAndSaveKeyTo", "", "Path to save generated private key")
|
||||||
reachableAt := flag.String("reachableAt", "", "Endpoint of the http server to tell remote config about")
|
reachableAt := flag.String("reachableAt", "", "Endpoint of the http server to tell remote config about")
|
||||||
@@ -579,7 +579,7 @@ func reportPeerBandwidth(apiURL string) error {
|
|||||||
return fmt.Errorf("failed to marshal bandwidth data: %v", err)
|
return fmt.Errorf("failed to marshal bandwidth data: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Info("Reporting bandwidth data: %s", string(jsonData))
|
logger.Debug("Reporting bandwidth data: %s", string(jsonData))
|
||||||
|
|
||||||
resp, err := http.Post(apiURL, "application/json", bytes.NewBuffer(jsonData))
|
resp, err := http.Post(apiURL, "application/json", bytes.NewBuffer(jsonData))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user