From 1f97b7bf2997139ea30cb34f3f0b3e2703d78282 Mon Sep 17 00:00:00 2001 From: Yann Stepienik Date: Mon, 8 May 2023 14:30:39 +0100 Subject: [PATCH] [release] v0.4.0-unstable9 --- client/src/pages/servapps/actionBar.jsx | 2 ++ client/src/pages/servapps/containers/overview.jsx | 2 +- client/src/pages/servapps/containers/volumes.jsx | 4 ++-- client/src/pages/servapps/servapps.jsx | 2 +- package.json | 2 +- src/docker/api_managecont.go | 6 +++--- src/docker/api_secureContainer.go | 4 ++-- src/docker/api_updateContainer.go | 4 ++-- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/client/src/pages/servapps/actionBar.jsx b/client/src/pages/servapps/actionBar.jsx index c372f1e..8b67083 100644 --- a/client/src/pages/servapps/actionBar.jsx +++ b/client/src/pages/servapps/actionBar.jsx @@ -17,6 +17,8 @@ const GetActions = ({ setIsUpdatingId(Id, true); API.docker.manageContainer(Id, action).then((res) => { refreshServeApps(); + }).catch((err) => { + refreshServeApps(); }); }; diff --git a/client/src/pages/servapps/containers/overview.jsx b/client/src/pages/servapps/containers/overview.jsx index 70650be..ba4d3bb 100644 --- a/client/src/pages/servapps/containers/overview.jsx +++ b/client/src/pages/servapps/containers/overview.jsx @@ -89,7 +89,7 @@ const ContainerOverview = ({ containerInfo, config, refresh }) => { { refreshAll() diff --git a/client/src/pages/servapps/containers/volumes.jsx b/client/src/pages/servapps/containers/volumes.jsx index 908454b..4914ca3 100644 --- a/client/src/pages/servapps/containers/volumes.jsx +++ b/client/src/pages/servapps/containers/volumes.jsx @@ -59,11 +59,11 @@ const VolumeContainerSetup = ({ config, containerInfo, refresh }) => { const errors = {}; // check unique const volumes = values.volumes.map((volume) => { - return `${volume.Destination}`; + return `${volume.Target}`; }); const unique = [...new Set(volumes)]; if (unique.length !== volumes.length) { - errors.submit = 'Mounts must have unique destinations'; + errors.submit = 'Mounts must have unique targets'; } return errors; }} diff --git a/client/src/pages/servapps/servapps.jsx b/client/src/pages/servapps/servapps.jsx index a903951..28be947 100644 --- a/client/src/pages/servapps/servapps.jsx +++ b/client/src/pages/servapps/servapps.jsx @@ -190,7 +190,7 @@ const ServeApps = () => { {/* */} - + diff --git a/package.json b/package.json index 7f51055..2895058 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.4.0-unstable8", + "version": "0.4.0-unstable9", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/docker/api_managecont.go b/src/docker/api_managecont.go index d963a74..c2b3a21 100644 --- a/src/docker/api_managecont.go +++ b/src/docker/api_managecont.go @@ -32,9 +32,9 @@ func ManageContainerRoute(w http.ResponseWriter, req *http.Request) { // stop, start, restart, kill, remove, pause, unpause, recreate action := utils.Sanitize(vars["action"]) - if os.Getenv("HOSTNAME") != "" && (action == "recreate" || action == "update") && containerName == os.Getenv("HOSTNAME") { - utils.Error("ManageContainer - cannot recreate/update self", nil) - utils.HTTPError(w, "Cannot recreate/update self", http.StatusBadRequest, "DS003") + if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") { + utils.Error("ManageContainer - Container cannot update itself", nil) + utils.HTTPError(w, "Container cannot update itself", http.StatusBadRequest, "DS003") return } diff --git a/src/docker/api_secureContainer.go b/src/docker/api_secureContainer.go index b654bd8..f8b1ec5 100644 --- a/src/docker/api_secureContainer.go +++ b/src/docker/api_secureContainer.go @@ -20,8 +20,8 @@ func SecureContainerRoute(w http.ResponseWriter, req *http.Request) { status := utils.Sanitize(vars["status"]) if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") { - utils.Error("SecureContainerRoute - Cannot force secure self", nil) - utils.HTTPError(w, "Cannot force secure self", http.StatusBadRequest, "DS003") + utils.Error("SecureContainerRoute - Container cannot update itself", nil) + utils.HTTPError(w, "Container cannot update itself", http.StatusBadRequest, "DS003") return } diff --git a/src/docker/api_updateContainer.go b/src/docker/api_updateContainer.go index 3056146..f7ec9fa 100644 --- a/src/docker/api_updateContainer.go +++ b/src/docker/api_updateContainer.go @@ -40,8 +40,8 @@ func UpdateContainerRoute(w http.ResponseWriter, req *http.Request) { containerName := utils.Sanitize(vars["containerId"]) if os.Getenv("HOSTNAME") != "" && containerName == os.Getenv("HOSTNAME") { - utils.Error("SecureContainerRoute - Cannot update self", nil) - utils.HTTPError(w, "Cannot update self", http.StatusBadRequest, "DS003") + utils.Error("SecureContainerRoute - Container cannot update itself", nil) + utils.HTTPError(w, "Container cannot update itself", http.StatusBadRequest, "DS003") return }