-
-
Notifications
You must be signed in to change notification settings - Fork 573
chore: initialize devcontainer setup for better DX #4285
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| PORT=5055 | ||
| HOST=0.0.0.0 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,31 @@ | ||||||||||||||||
| FROM mcr.microsoft.com/devcontainers/typescript-node:18 | ||||||||||||||||
|
|
||||||||||||||||
| RUN echo "INSTALL OVERSEER DEVCONTAINER IMAGE" && \ | ||||||||||||||||
| # Configure Bash | ||||||||||||||||
| # --> Disable Bash's bracket paste mode | ||||||||||||||||
| echo "bind 'set enable-bracket-paste off'" >> ~/.bashrc && \ | ||||||||||||||||
| # --> Always show hidden files in ls and colorize the output | ||||||||||||||||
| echo "alias ls='ls -a --color=auto'" >> ~/.bashrc && \ | ||||||||||||||||
| # Configure Git | ||||||||||||||||
| # --> Ensure that git treats /workspace as a safe directory to avoid permission-related issues. | ||||||||||||||||
| git config --global --add safe.directory /workspace && \ | ||||||||||||||||
| # Install common dependencies | ||||||||||||||||
| apt-get update && \ | ||||||||||||||||
| (type -p curl >/dev/null || (apt-get install curl -y)) && \ | ||||||||||||||||
| (type -p ca-certificates >/dev/null || (apt-get install ca-certificates -y)) && \ | ||||||||||||||||
| (type -p gnupg >/dev/null || (apt-get install gnupg -y)) && \ | ||||||||||||||||
| (type -p wget >/dev/null || (apt-get install wget -y)) && \ | ||||||||||||||||
| (type -p unzip >/dev/null || (apt-get install unzip -y)) && \ | ||||||||||||||||
| (type -p lsb-release >/dev/null || (apt-get install lsb-release -y)) && \ | ||||||||||||||||
|
Comment on lines
+14
to
+19
|
||||||||||||||||
| (type -p curl >/dev/null || (apt-get install curl -y)) && \ | |
| (type -p ca-certificates >/dev/null || (apt-get install ca-certificates -y)) && \ | |
| (type -p gnupg >/dev/null || (apt-get install gnupg -y)) && \ | |
| (type -p wget >/dev/null || (apt-get install wget -y)) && \ | |
| (type -p unzip >/dev/null || (apt-get install unzip -y)) && \ | |
| (type -p lsb-release >/dev/null || (apt-get install lsb-release -y)) && \ | |
| apt-get install -y curl ca-certificates gnupg wget unzip lsb-release && \ |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||||||||||||||||||||||||||||
| services: | ||||||||||||||||||||||||||||||||
| devcontainer: | ||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||
| context: . | ||||||||||||||||||||||||||||||||
| dockerfile: Dockerfile | ||||||||||||||||||||||||||||||||
| environment: | ||||||||||||||||||||||||||||||||
| GH_TOKEN: ${GH_TOKEN} | ||||||||||||||||||||||||||||||||
| env_file: | ||||||||||||||||||||||||||||||||
| - path: ./.env | ||||||||||||||||||||||||||||||||
| required: true | ||||||||||||||||||||||||||||||||
| volumes: | ||||||||||||||||||||||||||||||||
| - ../:/workspace | ||||||||||||||||||||||||||||||||
| # Mount the SSH keys from the host to the container for git access | ||||||||||||||||||||||||||||||||
| - ~/.ssh:/root/local-ssh | ||||||||||||||||||||||||||||||||
|
Comment on lines
+8
to
+14
|
||||||||||||||||||||||||||||||||
| env_file: | |
| - path: ./.env | |
| required: true | |
| volumes: | |
| - ../:/workspace | |
| # Mount the SSH keys from the host to the container for git access | |
| - ~/.ssh:/root/local-ssh | |
| SSH_AUTH_SOCK: /ssh-agent | |
| env_file: | |
| - path: ./.env | |
| required: true | |
| volumes: | |
| - ../:/workspace | |
| # Forward the SSH agent socket for git access | |
| - $SSH_AUTH_SOCK:/ssh-agent |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| { | ||
| "name": "Overseer Dev Container", | ||
| "dockerComposeFile": "./compose.yml", | ||
| "service": "devcontainer", | ||
| "shutdownAction": "none", | ||
|
|
||
| "remoteUser": "root", | ||
| "workspaceFolder": "/workspace", | ||
|
|
||
| "postCreateCommand": "bash /root/setup.sh", | ||
|
|
||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "EditorConfig.editorconfig", | ||
| "dbaeumer.vscode-eslint", | ||
| "esbenp.prettier-vscode", | ||
| "Orta.vscode-jest", | ||
| "stylelint.vscode-stylelint", | ||
| "bradlc.vscode-tailwindcss", | ||
| "mskelton.npm-outdated", | ||
| "eamodio.gitlens", | ||
| "wix.vscode-import-cost", | ||
| "gruntfuggly.todo-tree", | ||
| "aaron-bond.better-comments", | ||
| "usernamehw.errorlens" | ||
| ], | ||
| "settings": { | ||
| "editor.formatOnSave": true, | ||
| "editor.defaultFormatter": "esbenp.prettier-vscode", | ||
| "prettier.configPath": "/workspace/.prettierrc", | ||
| "prettier.ignorePath": "/workspace/.prettierignore", | ||
| "eslint.enable": true, | ||
| "eslint.validate": [ | ||
| "javascript", | ||
| "javascriptreact", | ||
| "typescript", | ||
| "typescriptreact" | ||
| ], | ||
| "typescript.tsdk": "node_modules/typescript/lib", | ||
| "typescript.preferences.importModuleSpecifier": "non-relative", | ||
| "sqltools.connections": [ | ||
| { | ||
| "previewLimit": 50, | ||
| "driver": "SQLite", | ||
| "name": "Local SQLite", | ||
| "database": "./config/db/db.sqlite3" | ||
| } | ||
| ], | ||
| "files.associations": { | ||
| "globals.css": "tailwindcss" | ||
| }, | ||
| "i18n-ally.localesPaths": ["src/i18n/locale"] | ||
| } | ||
| } | ||
| }, | ||
|
|
||
| "forwardPorts": [5055], | ||
| "portsAttributes": { | ||
| "5055": { | ||
| "label": "Overseer", | ||
| "onAutoForward": "notify" | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||||||||||
| #!/bin/bash | ||||||||||||||
| set -e | ||||||||||||||
|
|
||||||||||||||
| echo "🚀 Setting up development environment..." | ||||||||||||||
|
|
||||||||||||||
| # Copy SSH keys | ||||||||||||||
| echo "🔑 Configuring SSH keys..." | ||||||||||||||
| mkdir -p /root/.ssh | ||||||||||||||
| cp -p /root/local-ssh/* /root/.ssh/ | ||||||||||||||
|
||||||||||||||
| cp -p /root/local-ssh/* /root/.ssh/ | |
| cp -p /root/local-ssh/* /root/.ssh/ 2>/dev/null || true |
Copilot
AI
Nov 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script sets permissions for all files in /root/.ssh, but SSH requires stricter permissions. The known_hosts file should be 644, authorized_keys should be 600, and private keys should be 600. However, files like config should be 600, not 644. The current logic incorrectly assumes only .pub files should be readable. Consider being more explicit: set 600 for everything by default, then specifically set 644 only for .pub files.
| find /root/.ssh -type f -exec sh -c 'case "$1" in *.pub) chmod 644 "$1";; *) chmod 600 "$1";; esac' _ {} \; | |
| # Set 600 for all files by default | |
| find /root/.ssh -type f -exec chmod 600 {} \; | |
| # Set 644 for public keys and known_hosts | |
| find /root/.ssh -type f -name "*.pub" -exec chmod 644 {} \; | |
| if [ -f /root/.ssh/known_hosts ]; then chmod 644 /root/.ssh/known_hosts; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The base image tag
:18is not pinned to a specific version, which means builds may produce different results over time as the underlying image updates. Consider using a specific version tag like:18-bullseyeor a digest to ensure reproducible builds.