Go 1.27 (#755)
Docker / Build and Push (push) Canceled after 0s
github-pages / deploy (push) Canceled after 0s
Test / make test (push) Canceled after 0s
Docker / release (push) Canceled after 0s

* update to go 1.27

* go fix changes
This commit is contained in:
h44z
2026-09-12 17:52:01 +02:00
committed by GitHub
parent 34ee98a51e
commit 38c372e239
46 changed files with 418 additions and 505 deletions
+10 -20
View File
@@ -263,11 +263,9 @@ func (c *MikrotikController) convertWireGuardInterface(
error,
) {
pi := domain.PhysicalInterface{
Identifier: domain.InterfaceIdentifier(wg.GetString("name")),
KeyPair: domain.KeyPair{
PrivateKey: wg.GetString("private-key"),
PublicKey: wg.GetString("public-key"),
},
Identifier: domain.InterfaceIdentifier(wg.GetString("name")),
PrivateKey: wg.GetString("private-key"),
PublicKey: wg.GetString("public-key"),
ListenPort: wg.GetInt("listen-port"),
Addresses: addresses,
Mtu: wg.GetInt("mtu"),
@@ -354,13 +352,11 @@ func (c *MikrotikController) convertWireGuardPeer(peer lowlevel.GenericJsonObjec
}
peerModel := domain.PhysicalPeer{
Identifier: domain.PeerIdentifier(peer.GetString("public-key")),
Endpoint: currentEndpoint,
AllowedIPs: allowedAddresses,
KeyPair: domain.KeyPair{
PublicKey: peer.GetString("public-key"),
PrivateKey: peer.GetString("private-key"),
},
Identifier: domain.PeerIdentifier(peer.GetString("public-key")),
Endpoint: currentEndpoint,
AllowedIPs: allowedAddresses,
PublicKey: peer.GetString("public-key"),
PrivateKey: peer.GetString("private-key"),
PresharedKey: domain.PreSharedKey(peer.GetString("preshared-key")),
PersistentKeepalive: keepAliveSeconds,
LastHandshake: lastHandshakeTime,
@@ -792,7 +788,7 @@ func (c *MikrotikController) ExecuteInterfaceHook(
}
scriptName := fmt.Sprintf("wg-portal-hook-%s-%d", id, time.Now().UnixNano())
// Replace %i with the interface ID to mimic wg-quick behavior
scriptSource := strings.ReplaceAll(hookCmd, "%i", string(id))
// Inject the interface ID as a local variable for convenience in RouterOS scripts
@@ -1076,13 +1072,7 @@ func (c *MikrotikController) setRoutesForFamily(
continue
}
valid := false
for _, cidr := range cidrs {
if existingRoute.EqualPrefix(cidr) {
valid = true
break
}
}
valid := slices.ContainsFunc(cidrs, existingRoute.EqualPrefix)
if valid {
continue // route is still valid, nothing to do
}