#!/bin/bash set -euo pipefail HOME_DIR=/home/developer HOST_KEY_DIR="${HOME_DIR}/.ssh-host" AUTH_KEYS_SRC=/etc/ssh-authorized-keys/authorized_keys mkdir -p "${HOME_DIR}/.ssh" "${HOME_DIR}/workspace" "${HOST_KEY_DIR}" # Persist host keys on the PVC so SSH fingerprints stay stable across restarts. if [ ! -f "${HOST_KEY_DIR}/ssh_host_ed25519_key" ]; then ssh-keygen -t ed25519 -f "${HOST_KEY_DIR}/ssh_host_ed25519_key" -N "" -q fi if [ ! -f "${HOST_KEY_DIR}/ssh_host_rsa_key" ]; then ssh-keygen -t rsa -b 4096 -f "${HOST_KEY_DIR}/ssh_host_rsa_key" -N "" -q fi cat > /etc/ssh/sshd_config.d/98-hostkeys.conf <> /etc/environment if [ ! -f "${HOME_DIR}/.profile" ] || ! grep -q 'DOCKER_HOST' "${HOME_DIR}/.profile" 2>/dev/null; then printf '\nexport DOCKER_HOST=tcp://127.0.0.1:2375\n' >> "${HOME_DIR}/.profile" chown developer:developer "${HOME_DIR}/.profile" fi # Tiny HTTP for TrinityIngress / health (Traefik terminates TLS). python3 -m http.server 8080 --bind 0.0.0.0 --directory /usr/share/devbox-http >/tmp/http-8080.log 2>&1 & exec /usr/sbin/sshd -D -e