Skip to content

Modern Docker Management, Designed for Everyone

fix: do not stop arcanes container it self when using the quick action

Kyle Mendell016608442b05
diff --git a/backend/internal/services/system_service.go b/backend/internal/services/system_service.go
index 88fda4b77..ceb9a1f63 100644
--- a/backend/internal/services/system_service.go
+++ b/backend/internal/services/system_service.go
@@ -199,6 +199,10 @@ func (s *SystemService) StopAllContainers(ctx context.Context) (*dto.ContainerAc
}
for _, cont := range containers {
+ // Skip Arcane server container
+ if cont.Labels != nil && cont.Labels["com.ofkm.arcane.server"] == "true" {
+ continue
+ }
if err := s.containerService.StopContainer(ctx, cont.ID, systemUser); err != nil {
result.Failed = append(result.Failed, cont.ID)
result.Errors = append(result.Errors, fmt.Sprintf("Failed to stop container %s: %v", cont.ID, err))
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 1dfe2b057..bdc106434 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -72,6 +72,7 @@ LABEL org.opencontainers.image.title="Arcane"
LABEL org.opencontainers.image.description="Modern Docker Management, Made for Everyone"
LABEL com.ofkm.arcane.updater="false"
+LABEL com.ofkm.arcane.server="true"
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["./arcane"]
\ No newline at end of file
diff --git a/docker/Dockerfile-agent b/docker/Dockerfile-agent
index e58629d5a..5f7dbee67 100644
--- a/docker/Dockerfile-agent
+++ b/docker/Dockerfile-agent
@@ -47,6 +47,7 @@ ENV GIN_MODE=release \
ENVIRONMENT=production
LABEL com.ofkm.arcane.updater="false"
+LABEL com.ofkm.arcane.server="true"
EXPOSE 3553
VOLUME ["/app/data"]
diff --git a/docker/Dockerfile-agent-static b/docker/Dockerfile-agent-static
index 07fde6eb9..bdeb459f4 100644
--- a/docker/Dockerfile-agent-static
+++ b/docker/Dockerfile-agent-static
@@ -16,6 +16,7 @@ COPY ./backend/.bin/arcane-agent-linux-${TARGETARCH} ./arcane-agent
COPY --chmod=755 ../scripts/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
LABEL com.ofkm.arcane.updater="false"
+LABEL com.ofkm.arcane.server="true"
EXPOSE 3553
ENV ENVIRONMENT=production \
diff --git a/docker/Dockerfile-static b/docker/Dockerfile-static
index f51a728be..070634d08 100644
--- a/docker/Dockerfile-static
+++ b/docker/Dockerfile-static
@@ -16,6 +16,7 @@ COPY ./backend/.bin/arcane-linux-${TARGETARCH} ./arcane
COPY --chmod=755 ../scripts/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
LABEL com.ofkm.arcane.updater="false"
+LABEL com.ofkm.arcane.server="true"
EXPOSE 3552
ENV ENVIRONMENT=production
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index 523eec369..d52d16b7a 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -346,7 +346,7 @@
"dashboard_start_all_failed": "Failed to start all containers",
"dashboard_start_all_success": "All containers started successfully",
"dashboard_stop_all_title": "Stop All Containers",
- "dashboard_stop_all_confirm": "Are you sure you want to stop all running containers?",
+ "dashboard_stop_all_confirm": "Are you sure you want to stop all running containers? This will not stop arcane itself.",
"dashboard_stop_all_failed": "Failed to stop all running containers",
"dashboard_stop_all_success": "All containers stopped successfully",
"dashboard_prune_failed": "Failed to prune {types}",
diff --git a/scripts/docker/entrypoint.sh b/scripts/docker/entrypoint.sh
index 767eed7cc..a7385b865 100644
--- a/scripts/docker/entrypoint.sh
+++ b/scripts/docker/entrypoint.sh
@@ -105,6 +105,10 @@ if [ -d "$PROJECTS_DIR" ] && is_mountpoint "$PROJECTS_DIR"; then
SKIP_PROJECTS_CHOWN=true
fi
+# Always ensure /app/data itself is owned and writable does not touch projects folder
+chown "${PUID}:${PGID}" "$DATA_DIR" || true
+chmod 775 "$DATA_DIR" || true
+
# Chown everything under /app/data except projects if skipped
if [ "$SKIP_PROJECTS_CHOWN" = "true" ]; then
for entry in "$DATA_DIR"/*; do
@@ -119,8 +123,16 @@ fi
# Grant access to bind-mounted projects without changing host ownership:
# Map the container user into the host GID owning the projects dir.
if [ -d "$PROJECTS_DIR" ]; then
- PRJ_UID=$(stat -c '%u' "$PROJECTS_DIR" 2>/dev/null || echo "")
- PRJ_GID=$(stat -c '%g' "$PROJECTS_DIR" 2>/dev/null || echo "")
+ # Prefer a real entry inside the mount (some mounts mask dir metadata)
+ PRJ_PATH="$PROJECTS_DIR"
+ CANDIDATE="$(find "$PROJECTS_DIR" -mindepth 1 -maxdepth 1 -print -quit 2>/dev/null || true)"
+ if [ -n "$CANDIDATE" ]; then
+ PRJ_PATH="$CANDIDATE"
+ fi
+ PRJ_UID="$(stat -c '%u' "$PRJ_PATH" 2>/dev/null || echo "")"
+ PRJ_GID="$(stat -c '%g' "$PRJ_PATH" 2>/dev/null || echo "")"
+
+ echo "Entrypoint: Projects path used for GID detection: $PRJ_PATH (uid:$PRJ_UID gid:$PRJ_GID)"
if [ -n "$PRJ_GID" ]; then
if getent group "$PRJ_GID" >/dev/null 2>&1; then
HOST_GROUP=$(getent group "$PRJ_GID" | cut -d: -f1)
@@ -142,6 +154,12 @@ if [ -d "$PROJECTS_DIR" ]; then
fi
fi
+# Verify /app/data is writable before starting
+if ! su-exec "$APP_USER" sh -lc "test -w '$DATA_DIR' && touch '$DATA_DIR/.rwtest' && rm -f '$DATA_DIR/.rwtest'"; then
+ echo "ERROR: $DATA_DIR is not writable by ${APP_USER}. Check volume permissions."
+ exit 1
+fi
+
# Ensure app directory ownership
chown "${PUID}:${PGID}" /app