Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
48 changes: 48 additions & 0 deletions .devcontainer/devcontainer.go.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "Go Dev Environment",
"build": {
"dockerfile": "../containers/go/Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"GitHub.copilot"
],
"settings": {
"go.toolsManagement.autoUpdate": true,
"go.useLanguageServer": true,
"go.lintTool": "golangci-lint",
"go.lintOnSave": "workspace",
"editor.formatOnSave": true,
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
}
},
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"
],
"workspaceFolder": "/workspace",
"forwardPorts": [8080, 2345],
"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "notify"
},
"2345": {
"label": "Debug (delve)",
"onAutoForward": "silent"
}
},
"postCreateCommand": "echo 'Go environment ready!'",
"remoteUser": "root",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Running the dev container as the root user is not a security best practice and can lead to file permission issues on the host system when using bind mounts. Consider creating a non-root user (e.g., vscode or dev) in the base Dockerfiles and setting that user here. For example:

In your Dockerfile:

RUN useradd -m -s /bin/bash vscode
USER vscode

Then in devcontainer.json:

"remoteUser": "vscode"

This comment applies to all devcontainer.*.json files in this PR.

"features": {
"ghcr.io/devcontainers/features/git:1": {}
}
}
47 changes: 47 additions & 0 deletions .devcontainer/devcontainer.python.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "Python Dev Environment",
"build": {
"dockerfile": "../containers/python/Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"ms-python.debugpy"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python3",
"python.linting.enabled": true,
"python.linting.ruffEnabled": true,
"python.formatting.provider": "ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
}
}
},
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"
],
"workspaceFolder": "/workspace",
"forwardPorts": [8000, 5678],
"portsAttributes": {
"8000": {
"label": "Application",
"onAutoForward": "notify"
},
"5678": {
"label": "Debug",
"onAutoForward": "silent"
}
},
"postCreateCommand": "echo 'Python environment ready!'",
"remoteUser": "root",
"features": {
"ghcr.io/devcontainers/features/git:1": {}
}
}
44 changes: 44 additions & 0 deletions .devcontainer/devcontainer.rust.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "Rust Dev Environment",
"build": {
"dockerfile": "../containers/rust/Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"rust-lang.rust-analyzer",
"vadimcn.vscode-lldb",
"serayuzgur.crates"
],
"settings": {
"rust-analyzer.checkOnSave.command": "clippy",
"rust-analyzer.cargo.allFeatures": true,
"editor.formatOnSave": true,
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
}
}
}
},
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"
],
"workspaceFolder": "/workspace",
"forwardPorts": [8080, 5000],
"portsAttributes": {
"8080": {
"label": "Application",
"onAutoForward": "notify"
},
"5000": {
"label": "Debug",
"onAutoForward": "silent"
}
},
"postCreateCommand": "echo 'Rust environment ready!'",
"remoteUser": "root",
"features": {
"ghcr.io/devcontainers/features/git:1": {}
}
}
57 changes: 57 additions & 0 deletions .devcontainer/devcontainer.web.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "Web Dev Environment",
"build": {
"dockerfile": "../containers/web/Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"Vue.volar",
"ms-vscode.vscode-typescript-next"
],
"settings": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue"
],
"typescript.tsdk": "node_modules/typescript/lib"
}
}
},
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached"
],
"workspaceFolder": "/workspace",
"forwardPorts": [3000, 5173, 9229],
"portsAttributes": {
"3000": {
"label": "Next.js/React",
"onAutoForward": "notify"
},
"5173": {
"label": "Vite",
"onAutoForward": "notify"
},
"9229": {
"label": "Debug",
"onAutoForward": "silent"
}
},
"postCreateCommand": "echo 'Web environment ready!'",
"remoteUser": "root",
"features": {
"ghcr.io/devcontainers/features/git:1": {}
}
}
154 changes: 154 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: CI

on:
push:
branches: [main, test]
pull_request:
branches: [main]

jobs:
# Lint and test Go code
go-checks:
name: Go Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24.x'

- name: Go mod download
run: go mod download

- name: Run gofmt
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "Go code is not formatted:"
gofmt -d .
exit 1
fi

- name: Run go vet
run: go vet ./...

- name: Run go test
run: go test -v ./...

- name: Build CLI
run: go build -o bin/dev ./cmd/dev

# Lint shell scripts
shell-checks:
name: Shell Script Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install shellcheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck

- name: Install shfmt
run: |
wget -O /tmp/shfmt https://github.com/mvdan/sh/releases/download/v3.8.0/shfmt_v3.8.0_linux_amd64
chmod +x /tmp/shfmt
sudo mv /tmp/shfmt /usr/local/bin/

- name: Run shellcheck on scripts
run: |
find . -name "*.sh" -o -path "./runs/*" -type f -executable | while read -r file; do
if file "$file" | grep -q "shell script"; then
echo "Checking $file"
shellcheck "$file" || true
fi
done

- name: Run shfmt on scripts
run: |
find . -name "*.sh" -o -path "./runs/*" -type f -executable | while read -r file; do
if file "$file" | grep -q "shell script"; then
echo "Checking format: $file"
shfmt -d "$file" || true
fi
done

# Validate manifests
manifest-checks:
name: Manifest Validation
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Validate YAML syntax
run: |
for file in manifests/*.yaml manifests/presets/*.yaml; do
if [ -f "$file" ]; then
echo "Validating $file"
python3 -c "import yaml; yaml.safe_load(open('$file'))" || exit 1
fi
done

# Build preset containers
build-containers:
name: Build ${{ matrix.preset }} container
runs-on: ubuntu-latest
strategy:
matrix:
preset: [python, go, rust, web]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build ${{ matrix.preset }} image
run: |
docker build \
-t dev-env-${{ matrix.preset }}:ci \
-f containers/${{ matrix.preset }}/Dockerfile \
containers/${{ matrix.preset }}/

- name: Run smoke test
run: |
case "${{ matrix.preset }}" in
python)
docker run --rm dev-env-${{ matrix.preset }}:ci python3 --version
;;
go)
docker run --rm dev-env-${{ matrix.preset }}:ci go version
;;
rust)
docker run --rm dev-env-${{ matrix.preset }}:ci rustc --version
;;
web)
docker run --rm dev-env-${{ matrix.preset }}:ci node --version
;;
esac

# Validate K8s manifests
k8s-checks:
name: Validate K8s for ${{ matrix.preset }}
runs-on: ubuntu-latest
strategy:
matrix:
preset: [python, go, rust, web]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup kubectl
uses: azure/setup-kubectl@v4

- name: Validate K8s manifests
run: |
if [ -d "deploy/${{ matrix.preset }}" ]; then
kubectl kustomize deploy/${{ matrix.preset }}/ > /dev/null
echo "✓ K8s manifests valid for ${{ matrix.preset }}"
fi
32 changes: 30 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
# Build artifacts
/bin/
/test/
main
/Emojicode-1.0-beta.2-Linux-x86_64/
*.exe
*.exe~
*.dll
*.so
*.dylib

# Go files
*.test
*.out
vendor/

# OS files
.DS_Store
Thumbs.db

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# Backup files
*.backup-*
*.bak

# Temporary files
*.tmp
*.log
Loading
Loading