mirror of
https://github.com/bitwarden/browser
synced 2026-02-25 00:53:22 +00:00
Restructure devcontainers with browser-gui, native-gui variants and shared config
This commit is contained in:
30
.devcontainer/native-gui/devcontainer.json
Normal file
30
.devcontainer/native-gui/devcontainer.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "Bitwarden Clients (Windows / Linux)",
|
||||
"dockerComposeFile": ["../common/docker-compose.yml", "docker-compose.override.yml"],
|
||||
"service": "bitwarden_clients",
|
||||
"workspaceFolder": "/workspace",
|
||||
"initializeCommand": "bash .devcontainer/native-gui/setup-x11.sh",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/rust:1": {}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"angular.ng-template",
|
||||
"orta.vscode-jest",
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"nrwl.angular-console",
|
||||
"bradlc.vscode-tailwindcss"
|
||||
]
|
||||
}
|
||||
},
|
||||
"postCreateCommand": "bash .devcontainer/common/postCreateCommand.sh",
|
||||
"forwardPorts": [8080, 8081, 6006],
|
||||
"portsAttributes": {
|
||||
"default": { "onAutoForward": "ignore" },
|
||||
"8080": { "label": "Web Vault", "onAutoForward": "notify" },
|
||||
"8081": { "label": "Web Vault (Self-hosted)", "onAutoForward": "notify" },
|
||||
"6006": { "label": "Storybook", "onAutoForward": "notify" }
|
||||
}
|
||||
}
|
||||
32
.devcontainer/native-gui/setup-x11.sh
Executable file
32
.devcontainer/native-gui/setup-x11.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# Generates docker-compose.override.yml for X11 forwarding
|
||||
# Detects Windows (WSL2) vs native Linux
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
OVERRIDE_FILE="$SCRIPT_DIR/docker-compose.override.yml"
|
||||
|
||||
if grep -qi microsoft /proc/version 2>/dev/null; then
|
||||
echo "Detected Windows (WSL2) - configuring WSLg..."
|
||||
cat > "$OVERRIDE_FILE" << 'EOF'
|
||||
services:
|
||||
bitwarden_clients:
|
||||
volumes:
|
||||
- /tmp/.X11-unix:/tmp/.X11-unix
|
||||
- /mnt/wslg:/mnt/wslg
|
||||
environment:
|
||||
- DISPLAY=${DISPLAY:-:0}
|
||||
- WAYLAND_DISPLAY=${WAYLAND_DISPLAY:-wayland-0}
|
||||
- XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/mnt/wslg/runtime-dir}
|
||||
- PULSE_SERVER=${PULSE_SERVER:-/mnt/wslg/PulseServer}
|
||||
EOF
|
||||
else
|
||||
echo "Detected Linux - configuring X11..."
|
||||
cat > "$OVERRIDE_FILE" << 'EOF'
|
||||
services:
|
||||
bitwarden_clients:
|
||||
volumes:
|
||||
- /tmp/.X11-unix:/tmp/.X11-unix
|
||||
environment:
|
||||
- DISPLAY=${DISPLAY:-:0}
|
||||
EOF
|
||||
fi
|
||||
Reference in New Issue
Block a user