[release] v0.21.0-unstable96

This commit is contained in:
Yann Stepienik
2026-02-24 23:30:02 +00:00
parent 93baa01142
commit 8483f290a9
3 changed files with 17 additions and 11 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.21.0-unstable95",
"version": "0.21.0-unstable96",
"description": "",
"main": "test-server.js",
"bugs": {
-7
View File
@@ -16,13 +16,6 @@ type DeviceEditRequestJSON struct {
}
func DeviceEdit_API(w http.ResponseWriter, req *http.Request) {
if utils.FBL.AgentMode {
utils.Error("Constellation: Agents cannot manage devices. Use a manager server", nil)
utils.HTTPError(w, "Constellation Error: Agents cannot manage devices. Use a manager server",
http.StatusInternalServerError, "UC001")
return
}
if req.Method != "POST" {
utils.Error("DeviceEdit: Method not allowed "+req.Method, nil)
utils.HTTPError(w, "Method not allowed", http.StatusMethodNotAllowed, "HTTP001")
+16 -3
View File
@@ -940,9 +940,22 @@ func populateIPTableMasquerade() {
if err != nil {
utils.Error("Constellation: Failed to check existing iptables rules", err)
// Continue anyway
} else if strings.Contains(string(output), "COSMOS-CLOUD-EXIT-NODE") {
utils.Log("Constellation: IPTables rules already exist, skipping")
return
}
// Remove rules with our comment marker from nat table (IP range might have changed)
cmd = exec.Command("sh", "-c", "iptables-save -t nat | grep 'COSMOS-CLOUD-EXIT-NODE' | grep '^-A' | sed 's/-A/-D/' | xargs -r -L1 iptables -t nat")
if err := cmd.Run(); err != nil {
utils.Error("Constellation: Error removing NAT rules", err)
} else {
utils.Log("Constellation: NAT rules removed")
}
// Remove rules with our comment marker from filter table
cmd = exec.Command("sh", "-c", "iptables-save | grep 'COSMOS-CLOUD-EXIT-NODE' | grep '^-A' | sed 's/-A/-D/' | xargs -r -L1 iptables")
if err := cmd.Run(); err != nil {
utils.Error("Constellation: Error removing FORWARD rules", err)
} else {
utils.Log("Constellation: FORWARD rules removed")
}
// Add iptables rules with comment markers