b69cd80cae
Implements a complete serverless development container platform:
## Architecture
- Authentik forward auth for authentication/authorization
- NGINX routing proxy extracts GitHub repo from URL path
- Knative Service auto-scales dev container instances from 0
- Dynamic GitHub repo routing via /github/{owner}/{repo}
## Components
- routing-proxy: NGINX-based service for repo extraction and forwarding
- deployment.yaml: Complete K8s manifests (proxy, Knative, ingress, secrets)
- authentik-config.yaml: Authentik application and provider configs
- serverless scripts: Dynamic repo initialization and startup handling
- Comprehensive documentation and Makefile for ops
## Key Features
- Scale to zero when not in use (cost-effective)
- Per-request isolation (each repo gets own container)
- Built-in file manager for upload/download
- Support for private repos via GitHub tokens
- User attribution via Authentik headers
- WebSocket support for VNC connections
Example usage: https://devcontainer.farh.net/github/microsoft/vscode
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
50 lines
1.5 KiB
Bash
50 lines
1.5 KiB
Bash
#!/bin/bash
|
|
# Start application script for baseimage-gui
|
|
set -e
|
|
|
|
echo "=== Starting Dev Container ==="
|
|
|
|
# Check if we're in serverless mode
|
|
if [[ "$SERVERLESS_MODE" == "true" ]]; then
|
|
echo "Serverless mode detected, using serverless startup script..."
|
|
exec /usr/local/bin/serverless-startapp
|
|
fi
|
|
|
|
# Traditional mode - initialize repository
|
|
/usr/local/bin/init-repo
|
|
|
|
# Get workspace directory
|
|
if [ -f /tmp/workspace-dir ]; then
|
|
WORKSPACE_DIR=$(cat /tmp/workspace-dir)
|
|
else
|
|
WORKSPACE_DIR="/workspace/default"
|
|
fi
|
|
|
|
IDE="${IDE:-vscode}"
|
|
echo "IDE mode: $IDE"
|
|
echo "Workspace: $WORKSPACE_DIR"
|
|
|
|
case "$IDE" in
|
|
antigravity)
|
|
echo "Opening Google Antigravity in: $WORKSPACE_DIR"
|
|
# --no-sandbox is required for Electron apps in Docker (no kernel sandbox available).
|
|
# Explicit --user-data-dir and --extensions-dir pin config to the home PVC so
|
|
# settings and the setup wizard state survive pod restarts.
|
|
exec antigravity --no-sandbox \
|
|
--user-data-dir "$HOME/.config/antigravity" \
|
|
--extensions-dir "$HOME/.antigravity/extensions" \
|
|
--new-window --wait "$WORKSPACE_DIR"
|
|
;;
|
|
none)
|
|
echo "IDE=none: no IDE launched, keeping container alive."
|
|
exec sleep infinity
|
|
;;
|
|
*)
|
|
if [ "$IDE" != "vscode" ]; then
|
|
echo "WARNING: Unknown IDE value '$IDE', defaulting to VSCode"
|
|
fi
|
|
echo "Opening VSCode in: $WORKSPACE_DIR"
|
|
exec code --new-window --wait "$WORKSPACE_DIR"
|
|
;;
|
|
esac
|