Skip to content

Commit 985d6bf

Browse files
feat: add code-server (VS Code in Browser)
- Add code-server service with LinuxServer.io image - Password authentication (no Caddy basic auth) - Shared folder integration with other services - AI coding extensions support (Claude Code, OpenCode, Continue) - Full documentation with troubleshooting guide - Vaultwarden credential export support New environment variables: - CODESERVER_HOSTNAME - CODESERVER_PASSWORD - CODESERVER_SUDO_PASSWORD
1 parent f427f6b commit 985d6bf

File tree

9 files changed

+400
-0
lines changed

9 files changed

+400
-0
lines changed

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ OUTLINE_S3_HOSTNAME=outline-s3.yourdomain.com
219219
OUTLINE_S3_ADMIN_HOSTNAME=outline-s3-admin.yourdomain.com
220220
GITEA_HOSTNAME=git.yourdomain.com
221221
DOCUSEAL_HOSTNAME=sign.yourdomain.com
222+
CODESERVER_HOSTNAME=code.yourdomain.com
222223
LETSENCRYPT_EMAIL=
223224

224225
# Everything below this point is optional.
@@ -1120,3 +1121,10 @@ GITEA_SSH_PORT=2222
11201121
DOCUSEAL_DB_PASSWORD=
11211122

11221123
# Note: Admin account created during first access via setup wizard
1124+
1125+
############
1126+
# Code-Server - VS Code in the Browser
1127+
# Uses built-in password authentication (no Caddy basic auth needed)
1128+
############
1129+
CODESERVER_PASSWORD=
1130+
CODESERVER_SUDO_PASSWORD=

Caddyfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,4 +769,9 @@ https://{$NEO4J_HOSTNAME}:7687 {
769769
reverse_proxy docuseal:3000
770770
}
771771

772+
# Code-Server - VS Code in the Browser
773+
{$CODESERVER_HOSTNAME} {
774+
reverse_proxy code-server:8443
775+
}
776+
772777
import /etc/caddy/addons/*.conf

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ git clone https://github.com/freddy-schuetz/ai-launchkit && cd ai-launchkit && s
173173
|------|-------------|-----------|--------|
174174
| **[bolt.diy](https://github.com/stackblitz-labs/bolt.diy)** | Build full-stack apps with prompts | Rapid prototyping, MVP creation, learning to code | `bolt.yourdomain.com` |
175175
| **[OpenUI](https://github.com/wandb/openui)** 🧪 | AI-powered UI component generation | Design systems, component libraries, mockups | `openui.yourdomain.com` |
176+
| **[code-server](https://github.com/coder/code-server)** | VS Code in the browser with AI extensions | Remote development, Claude Code, AI-assisted coding | `code.yourdomain.com` |
176177

177178
### 🤖 AI Agents
178179

README_Services.md

Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15769,6 +15769,320 @@ See [bolt.diy section](#ai-powered-development) for full documentation.
1576915769

1577015770
</details>
1577115771

15772+
<details>
15773+
<summary><b>🖥️ code-server - VS Code in the Browser</b></summary>
15774+
15775+
### What is code-server?
15776+
15777+
code-server is a full VS Code experience running in your browser, allowing you to code from any device with a consistent development environment. Combined with AI extensions like Claude Code and OpenCode, it transforms into a powerful AI-assisted development platform that rivals cloud-based solutions while keeping your data self-hosted.
15778+
15779+
### Features
15780+
15781+
- **Full VS Code**: Complete VS Code experience with all features and keybindings
15782+
- **AI Extensions**: Support for Claude Code, OpenCode, Continue, and other AI coding assistants
15783+
- **Persistent Workspace**: Your files, settings, and extensions persist across sessions
15784+
- **Terminal Access**: Full terminal access with sudo capabilities
15785+
- **Extension Marketplace**: Access to Open VSX Registry for extensions
15786+
- **Shared Folder**: Direct access to AI LaunchKit's shared folder for integration with other services
15787+
- **Mobile Friendly**: Works on tablets and even phones in a pinch
15788+
15789+
### Initial Setup
15790+
15791+
**First Access to code-server:**
15792+
1. Navigate to `https://code.yourdomain.com`
15793+
2. Enter your password (from `.env`: `CODESERVER_PASSWORD`)
15794+
3. VS Code loads in your browser - ready to code!
15795+
15796+
**Recommended Extensions to Install:**
15797+
15798+
Open the Extensions panel (Ctrl+Shift+X) and install:
15799+
15800+
| Extension | Purpose | Installation |
15801+
|-----------|---------|--------------|
15802+
| **Claude Code** | AI coding assistant by Anthropic | Search "Claude" in extensions |
15803+
| **Continue** | Open-source AI autocomplete | Search "Continue" |
15804+
| **OpenCode** | Ollama integration for local AI | Search "OpenCode" |
15805+
| **GitLens** | Enhanced Git integration | Search "GitLens" |
15806+
| **Python** | Python language support | Search "Python" |
15807+
| **Prettier** | Code formatting | Search "Prettier" |
15808+
15809+
**Configure Claude Code Extension:**
15810+
1. Install Claude Code extension
15811+
2. Open Command Palette (Ctrl+Shift+P)
15812+
3. Search "Claude: Set API Key"
15813+
4. Enter your Anthropic API key
15814+
5. Start coding with AI assistance!
15815+
15816+
**Configure Continue (for Ollama):**
15817+
1. Install Continue extension
15818+
2. Click Continue icon in sidebar
15819+
3. Configure model:
15820+
```json
15821+
{
15822+
"models": [{
15823+
"title": "Ollama",
15824+
"provider": "ollama",
15825+
"model": "qwen2.5:7b-instruct-q4_K_M",
15826+
"apiBase": "http://ollama:11434"
15827+
}]
15828+
}
15829+
```
15830+
4. Use Ctrl+L to chat, Ctrl+I for inline edits
15831+
15832+
### n8n Integration Setup
15833+
15834+
**Workflow Pattern: Code Development Pipeline**
15835+
```javascript
15836+
// 1. Webhook Trigger
15837+
// Receive code review requests or file changes
15838+
15839+
// 2. Code Node: Prepare file for processing
15840+
const filePath = '/config/workspace/shared/' + $json.filename;
15841+
const fileContent = $json.content;
15842+
15843+
return {
15844+
path: filePath,
15845+
content: fileContent,
15846+
action: 'review'
15847+
};
15848+
15849+
// 3. HTTP Request to Ollama
15850+
// Send code for AI review
15851+
// URL: http://ollama:11434/api/generate
15852+
// Body: { "model": "qwen2.5:7b-instruct", "prompt": "Review this code:\n" + fileContent }
15853+
15854+
// 4. Write File Node
15855+
// Save review results to shared folder
15856+
15857+
// 5. Notification
15858+
// Send results via email/Slack/Discord
15859+
```
15860+
15861+
**Shared Folder Integration:**
15862+
- code-server workspace: `/config/workspace/shared`
15863+
- n8n access: `./shared` folder
15864+
- Both services can read/write to the same files!
15865+
15866+
**Internal URL:** `http://code-server:8443` (for internal service-to-service communication)
15867+
15868+
### Example Use Cases
15869+
15870+
#### Example 1: AI-Assisted Python Development
15871+
15872+
**Scenario**: Develop Python scripts for n8n automation
15873+
```bash
15874+
# In code-server terminal:
15875+
cd /config/workspace/shared
15876+
15877+
# Create a new Python script
15878+
touch data_processor.py
15879+
15880+
# Use Claude Code to help write it:
15881+
# 1. Open the file
15882+
# 2. Type a comment describing what you need:
15883+
# "# Script to process CSV files from n8n and extract email addresses"
15884+
# 3. Use Claude Code: Ctrl+Shift+P → "Claude: Generate Code"
15885+
# 4. Review and refine the generated code
15886+
15887+
# Test the script
15888+
python data_processor.py sample.csv
15889+
15890+
# The script is now available in n8n's shared folder!
15891+
```
15892+
15893+
#### Example 2: Editing n8n Workflow Files
15894+
15895+
**Scenario**: Bulk edit n8n workflow JSON files
15896+
```bash
15897+
# Access shared n8n exports
15898+
cd /config/workspace/shared/n8n-exports
15899+
15900+
# Use VS Code's multi-file search (Ctrl+Shift+F)
15901+
# Find all workflows using a specific node
15902+
# Search: "httpRequest"
15903+
15904+
# Use Claude Code to help refactor:
15905+
# "Update all HTTP Request nodes to use the new authentication method"
15906+
15907+
# Save changes - n8n can import the modified workflows
15908+
```
15909+
15910+
#### Example 3: Full-Stack Development with Gitea
15911+
15912+
**Scenario**: Develop and version control your projects
15913+
```bash
15914+
# Clone from your Gitea instance
15915+
git clone http://gitea:3000/username/my-project.git
15916+
15917+
# Open project in code-server
15918+
cd my-project
15919+
15920+
# Develop with AI assistance
15921+
# - Claude Code for complex logic
15922+
# - Continue for autocomplete
15923+
# - Terminal for testing
15924+
15925+
# Commit and push
15926+
git add .
15927+
git commit -m "feat: add new feature with AI assistance"
15928+
git push origin main
15929+
```
15930+
15931+
### Development Workflow
15932+
15933+
**Recommended Workspace Structure:**
15934+
```
15935+
/config/workspace/
15936+
├── shared/ # Shared with n8n, Ollama, etc.
15937+
│ ├── scripts/ # Python/Node scripts for automation
15938+
│ ├── data/ # Data files for processing
15939+
│ └── exports/ # Exported workflows/configs
15940+
├── projects/ # Your development projects
15941+
│ ├── webapp/ # Web applications
15942+
│ └── api/ # API projects
15943+
└── .vscode/ # VS Code settings (persistent)
15944+
└── settings.json
15945+
```
15946+
15947+
**Best Practices:**
15948+
- **Use Shared Folder**: Place files that need to be accessed by other services in `/config/workspace/shared`
15949+
- **Install Extensions Once**: Extensions persist across sessions
15950+
- **Configure Git**: Set up Git credentials for seamless version control
15951+
- **Use Terminal**: Full Linux terminal available with sudo access
15952+
- **Keyboard Shortcuts**: Same as desktop VS Code - muscle memory works!
15953+
15954+
### Troubleshooting
15955+
15956+
**Cannot Access code-server:**
15957+
```bash
15958+
# 1. Check if code-server is running
15959+
docker ps | grep code-server
15960+
15961+
# 2. Check logs for errors
15962+
docker logs code-server -f
15963+
15964+
# 3. Verify Caddy is routing correctly
15965+
docker logs caddy | grep code-server
15966+
15967+
# 4. Check CODESERVER_HOSTNAME in .env
15968+
grep CODESERVER_HOSTNAME .env
15969+
15970+
# 5. Restart the service
15971+
docker compose restart code-server
15972+
```
15973+
15974+
**Extensions Not Installing:**
15975+
```bash
15976+
# 1. Check network connectivity from container
15977+
docker exec code-server ping -c 3 open-vsx.org
15978+
15979+
# 2. Check disk space
15980+
docker exec code-server df -h /config
15981+
15982+
# 3. Try installing via terminal
15983+
docker exec code-server code-server --install-extension ms-python.python
15984+
15985+
# 4. Check extension logs
15986+
# In VS Code: Help → Toggle Developer Tools → Console
15987+
```
15988+
15989+
**AI Extensions Not Working:**
15990+
```bash
15991+
# 1. Verify API keys are configured
15992+
# In VS Code: Ctrl+Shift+P → "Claude: Set API Key"
15993+
15994+
# 2. Check Ollama connectivity (for local AI)
15995+
docker exec code-server curl -s http://ollama:11434/api/tags
15996+
15997+
# 3. Test Claude API directly
15998+
curl https://api.anthropic.com/v1/messages \
15999+
-H "x-api-key: $ANTHROPIC_API_KEY" \
16000+
-H "anthropic-version: 2023-06-01" \
16001+
-H "content-type: application/json" \
16002+
-d '{"model":"claude-sonnet-4-20250514","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'
16003+
16004+
# 4. Restart code-server
16005+
docker compose restart code-server
16006+
```
16007+
16008+
**Terminal or Sudo Not Working:**
16009+
```bash
16010+
# 1. Check if sudo password is set
16011+
grep CODESERVER_SUDO_PASSWORD .env
16012+
16013+
# 2. Test sudo access
16014+
docker exec -it code-server sudo ls /root
16015+
16016+
# 3. Check user permissions
16017+
docker exec code-server id
16018+
# Should show uid=1000 and groups
16019+
16020+
# 4. Reinstall if needed
16021+
docker compose down code-server
16022+
docker compose up -d code-server
16023+
```
16024+
16025+
**Slow Performance:**
16026+
```bash
16027+
# 1. Check container resources
16028+
docker stats code-server
16029+
16030+
# 2. Increase memory limit if needed (edit docker-compose.yml)
16031+
# deploy:
16032+
# resources:
16033+
# limits:
16034+
# memory: 2G
16035+
16036+
# 3. Disable unnecessary extensions
16037+
# Extensions can consume significant resources
16038+
16039+
# 4. Clear VS Code cache
16040+
docker exec code-server rm -rf /config/.local/share/code-server/Cache
16041+
docker compose restart code-server
16042+
```
16043+
16044+
### Integration with AI LaunchKit Services
16045+
16046+
**code-server + Ollama:**
16047+
- Use Continue extension with local Ollama models
16048+
- No API costs for AI assistance
16049+
- Full privacy for sensitive code
16050+
- Configure: `http://ollama:11434` as API base
16051+
16052+
**code-server + Gitea:**
16053+
- Clone repositories directly: `git clone http://gitea:3000/user/repo.git`
16054+
- Push/pull with seamless authentication
16055+
- Code review with AI assistance before committing
16056+
16057+
**code-server + n8n:**
16058+
- Edit scripts in `/config/workspace/shared`
16059+
- Scripts immediately available in n8n's shared folder
16060+
- Develop custom nodes and functions
16061+
16062+
**code-server + Paperless-ngx:**
16063+
- Develop OCR processing scripts
16064+
- Access documents via shared folder
16065+
- Build custom document workflows
16066+
16067+
### Resources
16068+
16069+
- **Official Documentation**: [coder.com/docs/code-server](https://coder.com/docs/code-server)
16070+
- **GitHub Repository**: [github.com/coder/code-server](https://github.com/coder/code-server)
16071+
- **LinuxServer.io Image**: [docs.linuxserver.io/images/docker-code-server](https://docs.linuxserver.io/images/docker-code-server)
16072+
- **VS Code Documentation**: [code.visualstudio.com/docs](https://code.visualstudio.com/docs)
16073+
- **Open VSX Registry**: [open-vsx.org](https://open-vsx.org) (Extension marketplace)
16074+
16075+
### Security Notes
16076+
16077+
- **Password Authentication**: code-server uses its own password authentication (set via `CODESERVER_PASSWORD`)
16078+
- **Sudo Access**: `CODESERVER_SUDO_PASSWORD` grants root access - use strong passwords!
16079+
- **HTTPS Only**: Always access via HTTPS to protect your code and credentials
16080+
- **API Keys**: Store API keys in VS Code's secure storage, not in files
16081+
- **Shared Folder**: Be aware that `/config/workspace/shared` is accessible by other services
16082+
- **No Public Exposure**: Consider using Cloudflare Tunnel for additional security
16083+
16084+
</details>
16085+
1577216086
### AI Agents
1577316087

1577416088
<details>

0 commit comments

Comments
 (0)