diff --git a/Dockerfile b/Dockerfile index 337f828..5a88405 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,16 @@ RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | gpg --dearm # Chrome wrapper: adds flags required for running inside a Docker container. # xdg-open (used by Claude Code on Linux) respects $BROWSER, so pointing it # here ensures the OAuth popup works without manual --no-sandbox invocations. -RUN printf '#!/bin/bash\nexec /usr/bin/google-chrome-stable \\\n --no-sandbox \\\n --disable-dev-shm-usage \\\n --disable-gpu \\\n "$@"\n' > /usr/local/bin/google-chrome && \ +# Also explicitly sets user-data-dir to persist Chrome settings across restarts. +RUN printf '#!/bin/bash\n\ +# Ensure Chrome data directory exists with proper permissions\n\ +mkdir -p "$HOME/.config/google-chrome"\n\ +exec /usr/bin/google-chrome-stable \\\n\ + --no-sandbox \\\n\ + --disable-dev-shm-usage \\\n\ + --disable-gpu \\\n\ + --user-data-dir="$HOME/.config/google-chrome" \\\n\ + "$@"\n' > /usr/local/bin/google-chrome && \ chmod +x /usr/local/bin/google-chrome # Install Node.js (LTS version for Happy Coder) @@ -87,6 +96,8 @@ COPY --chmod=755 scripts/startapp.sh /startapp.sh COPY --chmod=755 scripts/init-repo.sh /usr/local/bin/init-repo # Fix app user shell after baseimage-gui creates it at runtime COPY --chmod=755 scripts/cont-init-user.sh /etc/cont-init.d/20-fix-user-shell.sh +# Initialize persistent home directory structure +COPY --chmod=755 scripts/cont-init-home.sh /etc/cont-init.d/21-init-home.sh COPY --chmod=755 scripts/cont-init-sshd.sh /etc/cont-init.d/25-start-sshd.sh # Set working directory diff --git a/chart/Chart.yaml b/chart/Chart.yaml index aee1716..f362211 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: devcontainer description: Antigravity Dev Container with Happy Coder AI assistant type: application -version: 0.1.12 +version: 0.1.13 appVersion: "latest" diff --git a/scripts/cont-init-home.sh b/scripts/cont-init-home.sh new file mode 100644 index 0000000..1ca8cc8 --- /dev/null +++ b/scripts/cont-init-home.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Initialize persistent home directory structure for the app user +# This ensures Chrome settings and SSH keys persist across pod restarts + +echo "=== Initializing persistent home directory ===" + +# Ensure the user home directory exists with proper ownership +if [ ! -d "/home/user" ]; then + echo "Creating /home/user directory..." + mkdir -p /home/user + chown app:app /home/user +fi + +# Ensure critical directories exist for persistent data +echo "Ensuring persistent directories exist..." +mkdir -p /home/user/.config +mkdir -p /home/user/.ssh +mkdir -p /home/user/.cache + +# Set proper ownership for all directories +chown -R app:app /home/user + +# Ensure SSH directory has proper permissions +chmod 700 /home/user/.ssh + +echo "Home directory initialization complete" \ No newline at end of file