Skip to content

Modern Docker Management, Designed for Everyone

fix: default not able to be overidden

Kyle Mendell2d65952525b5
diff --git a/examples/compose.basic.yaml b/examples/compose.basic.yaml
index 1d605c2a9..a6070fd95 100644
--- a/examples/compose.basic.yaml
+++ b/examples/compose.basic.yaml
@@ -3,7 +3,7 @@ services:
image: ghcr.io/ofkm/arcane:latest
container_name: arcane
ports:
- - '3552:3552'
+ - "3552:3552"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- arcane-data:/app/data
@@ -14,7 +14,11 @@ services:
- ENCRYPTION_KEY=xxxxxxxxxxxxxxxxxxxxxx
- JWT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxx
healthcheck:
- test: ['CMD-SHELL', 'curl -fsS http://localhost:3552/api/health >/dev/null || exit 1']
+ test:
+ [
+ "CMD-SHELL",
+ "curl -fsS http://localhost:3552/api/health >/dev/null || exit 1",
+ ]
interval: 10s
timeout: 3s
retries: 5
diff --git a/frontend/src/lib/components/terminal/terminal-controls.svelte b/frontend/src/lib/components/terminal/terminal-controls.svelte
index 2934736ef..b6e8a0705 100644
--- a/frontend/src/lib/components/terminal/terminal-controls.svelte
+++ b/frontend/src/lib/components/terminal/terminal-controls.svelte
@@ -52,6 +52,29 @@
onShellChange?.(customShell);
}
}
+
+ $effect(() => {
+ if (!selectedShell) {
+ return;
+ }
+
+ const isKnownShell = selectedShell in shellLabels;
+ if (!isKnownShell && selectedShell !== 'custom') {
+ useCustomShell = true;
+ customShell = selectedShell;
+ return;
+ }
+
+ if (selectedShell === 'custom') {
+ useCustomShell = true;
+ return;
+ }
+
+ if (isKnownShell) {
+ useCustomShell = false;
+ customShell = '';
+ }
+ });
</script>
<div class="flex items-center gap-2">
diff --git a/frontend/src/routes/containers/components/ContainerShell.svelte b/frontend/src/routes/containers/components/ContainerShell.svelte
index e6b85a505..f58387198 100644
--- a/frontend/src/routes/containers/components/ContainerShell.svelte
+++ b/frontend/src/routes/containers/components/ContainerShell.svelte
@@ -18,41 +18,50 @@
let selectedShell = $state($settingsStore.defaultShell || '/bin/sh');
let reconnectKey = $state(0);
let lastContainerId = $state<string | undefined>(undefined);
- let lastShell = $state<string | undefined>(undefined);
+ let lastShellForUrl = $state<string | undefined>(undefined);
+ let hasShellOverride = $state(false);
+ let lastDefaultShell = $state<string | undefined>(undefined);
$effect(() => {
- // Only update if container or shell actually changed
- const currentContainer = containerId;
- const currentShell = $settingsStore.defaultShell || selectedShell;
-
- if (lastContainerId === currentContainer && lastShell === currentShell) {
- return; // No change, skip update
+ const defaultShell = $settingsStore.defaultShell;
+ if (defaultShell !== lastDefaultShell) {
+ lastDefaultShell = defaultShell;
+ hasShellOverride = false;
+ const fallbackShell = defaultShell || '/bin/sh';
+ if (selectedShell !== fallbackShell) {
+ selectedShell = fallbackShell;
+ }
+ } else if (!selectedShell) {
+ selectedShell = defaultShell || '/bin/sh';
}
- lastContainerId = currentContainer;
- lastShell = currentShell;
-
- if ($settingsStore.defaultShell) {
- selectedShell = $settingsStore.defaultShell;
+ const currentContainer = containerId;
+ if (!containerId || !selectedShell) {
+ return;
}
- if (containerId && selectedShell) {
- updateWebSocketUrl();
+ if (lastContainerId === currentContainer && lastShellForUrl === selectedShell) {
+ return;
}
+
+ lastContainerId = currentContainer;
+ lastShellForUrl = selectedShell;
+ updateWebSocketUrl(selectedShell);
});
- function updateWebSocketUrl() {
+ function updateWebSocketUrl(shell: string) {
(async () => {
const envId = await environmentStore.getCurrentEnvironmentId();
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = window.location.host;
- websocketUrl = `${protocol}//${host}/api/environments/${envId}/containers/${containerId}/exec/ws?shell=${encodeURIComponent(selectedShell)}`;
+ websocketUrl = `${protocol}//${host}/api/environments/${envId}/containers/${containerId}/exec/ws?shell=${encodeURIComponent(shell)}`;
})();
}
function handleShellChange(shell: string) {
+ const defaultShell = $settingsStore.defaultShell || '/bin/sh';
+ hasShellOverride = shell !== defaultShell;
selectedShell = shell;
- updateWebSocketUrl();
}
function handleConnected() {