diff --git a/VERSION b/VERSION index b66183a..591bdbc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.17 +1.2.18 diff --git a/internal/handlers/ipaddresses.go b/internal/handlers/ipaddresses.go index 06a60b7..e9e4dd1 100644 --- a/internal/handlers/ipaddresses.go +++ b/internal/handlers/ipaddresses.go @@ -30,9 +30,9 @@ func NewIPAddressesHandler(repo *ipaddresses.Repo, a *audit.Repo, nodeID string) } } -func (h *IPAddressesHandler) applyAsync(ctx context.Context) { +func (h *IPAddressesHandler) applyAsync() { go func() { - if err := h.Generator.Render(ctx); err != nil { + if err := h.Generator.Render(context.Background()); err != nil { slog.Warn("ip-addresses: apply failed", "error", err) } }() @@ -86,7 +86,7 @@ func (h *IPAddressesHandler) Create(c *gin.Context) { } _ = h.Audit.Log(c.Request.Context(), actorOf(c), "ip_address.create", req.Address, out, h.NodeID) - h.applyAsync(c.Request.Context()) + h.applyAsync() response.Created(c, out) } @@ -111,7 +111,7 @@ func (h *IPAddressesHandler) Update(c *gin.Context) { } _ = h.Audit.Log(c.Request.Context(), actorOf(c), "ip_address.update", out.Address, out, h.NodeID) - h.applyAsync(c.Request.Context()) + h.applyAsync() response.OK(c, out) } @@ -130,6 +130,6 @@ func (h *IPAddressesHandler) Delete(c *gin.Context) { } _ = h.Audit.Log(c.Request.Context(), actorOf(c), "ip_address.delete", strconv.FormatInt(id, 10), gin.H{"id": id}, h.NodeID) - h.applyAsync(c.Request.Context()) + h.applyAsync() response.NoContent(c) } diff --git a/internal/handlers/networks.go b/internal/handlers/networks.go index 4d63379..f727b71 100644 --- a/internal/handlers/networks.go +++ b/internal/handlers/networks.go @@ -39,9 +39,9 @@ func NewNetworksHandler( } } -func (h *NetworksHandler) applyAsync(ctx context.Context) { +func (h *NetworksHandler) applyAsync() { go func() { - if err := h.Generator.Render(ctx); err != nil { + if err := h.Generator.Render(context.Background()); err != nil { slog.Warn("network-interfaces: apply failed", "error", err) } }() @@ -106,7 +106,7 @@ func (h *NetworksHandler) Create(c *gin.Context) { return } _ = h.Audit.Log(c.Request.Context(), actorOf(c), "network_interface.create", req.Name, out, h.NodeID) - h.applyAsync(c.Request.Context()) + h.applyAsync() response.Created(c, out) } @@ -141,7 +141,7 @@ func (h *NetworksHandler) Update(c *gin.Context) { return } _ = h.Audit.Log(c.Request.Context(), actorOf(c), "network_interface.update", out.Name, out, h.NodeID) - h.applyAsync(c.Request.Context()) + h.applyAsync() response.OK(c, out) } @@ -160,7 +160,7 @@ func (h *NetworksHandler) Delete(c *gin.Context) { } _ = h.Audit.Log(c.Request.Context(), actorOf(c), "network_interface.delete", strconv.FormatInt(id, 10), gin.H{"id": id}, h.NodeID) - h.applyAsync(c.Request.Context()) + h.applyAsync() response.NoContent(c) } diff --git a/packaging/debian/edgeguard-api/DEBIAN/postinst b/packaging/debian/edgeguard-api/DEBIAN/postinst index 3610cf7..2961c10 100755 --- a/packaging/debian/edgeguard-api/DEBIAN/postinst +++ b/packaging/debian/edgeguard-api/DEBIAN/postinst @@ -484,6 +484,7 @@ APPLYIFACES Description=EdgeGuard managed network interfaces apply After=network-online.target Wants=network-online.target +StartLimitIntervalSec=0 [Service] Type=oneshot @@ -549,6 +550,7 @@ APPLYIP Description=EdgeGuard managed IP addresses apply After=network-online.target edgeguard-interfaces.service Wants=network-online.target +StartLimitIntervalSec=0 [Service] Type=oneshot