Skip to content

Commit 82ca428

Browse files
committed
Added clauder user and backward compatibility
1 parent 8077b23 commit 82ca428

3 files changed

Lines changed: 76 additions & 208 deletions

File tree

Dockerfile

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,48 +36,47 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
3636

3737
# ============================================================================
3838
# PERSISTENCE CONFIGURATION
39+
# BACKWARD COMPATIBLE: Defaults to /home/coder for existing volumes
3940
# ============================================================================
4041

41-
ENV HOME=/home/clauder
42-
ENV USER=clauder
42+
ENV HOME=/home/coder
43+
ENV USER=coder
4344

4445
# XDG Base Directory Specification
45-
ENV XDG_DATA_HOME=/home/clauder/.local/share
46-
ENV XDG_CONFIG_HOME=/home/clauder/.config
47-
ENV XDG_CACHE_HOME=/home/clauder/.cache
48-
ENV XDG_STATE_HOME=/home/clauder/.local/state
46+
ENV XDG_DATA_HOME=/home/coder/.local/share
47+
ENV XDG_CONFIG_HOME=/home/coder/.config
48+
ENV XDG_CACHE_HOME=/home/coder/.cache
49+
ENV XDG_STATE_HOME=/home/coder/.local/state
4950

5051
# PATH: Volume paths FIRST (user installs), image paths LAST (fallbacks)
51-
ENV PATH="/home/clauder/.local/bin:/home/clauder/.local/node/bin:/home/clauder/.claude/local:/home/clauder/node_modules/.bin:/usr/local/bin:/usr/bin:/usr/lib/code-server/lib/vscode/bin/remote-cli:${PATH}"
52+
ENV PATH="/home/coder/.local/bin:/home/coder/.local/node/bin:/home/coder/.claude/local:/home/coder/node_modules/.bin:/usr/local/bin:/usr/bin:/usr/lib/code-server/lib/vscode/bin/remote-cli:${PATH}"
5253

5354
# Custom startup scripts directory
54-
ENV ENTRYPOINTD=/home/clauder/entrypoint.d
55+
ENV ENTRYPOINTD=/home/coder/entrypoint.d
5556

5657
# ============================================================================
5758
# USER SETUP
58-
# Create clauder user with same UID as coder for compatibility
59+
# The base image already has coder user with UID 1000
5960
# ============================================================================
6061

61-
RUN groupadd -g 1000 clauder 2>/dev/null || true \
62-
&& useradd -m -s /bin/bash -u 1000 -g 1000 clauder 2>/dev/null || true \
63-
&& usermod -l clauder coder 2>/dev/null || true \
64-
&& groupmod -n clauder coder 2>/dev/null || true
62+
# Ensure coder user exists with correct UID/GID
63+
RUN id -u coder &>/dev/null || useradd -m -s /bin/bash -u 1000 -g 1000 coder 2>/dev/null || true
6564

6665
# ============================================================================
6766
# DIRECTORY SETUP
6867
# ============================================================================
6968

7069
RUN mkdir -p \
71-
/home/clauder/.local/share \
72-
/home/clauder/.config \
73-
/home/clauder/.cache \
74-
/home/clauder/.local/state \
75-
/home/clauder/.local/bin \
76-
/home/clauder/.local/node \
77-
/home/clauder/.claude \
78-
/home/clauder/entrypoint.d \
79-
/home/clauder/workspace \
80-
&& chown -R 1000:1000 /home/clauder
70+
/home/coder/.local/share \
71+
/home/coder/.config \
72+
/home/coder/.cache \
73+
/home/coder/.local/state \
74+
/home/coder/.local/bin \
75+
/home/coder/.local/node \
76+
/home/coder/.claude \
77+
/home/coder/entrypoint.d \
78+
/home/coder/workspace \
79+
&& chown -R 1000:1000 /home/coder
8180

8281
# Copy our custom entrypoint (replaces base image's entrypoint)
8382
COPY railway-entrypoint.sh /usr/bin/railway-entrypoint.sh
@@ -101,8 +100,9 @@ RUN curl -fsSL https://claude.ai/install.sh | bash \
101100
# Stay as root - entrypoint handles user switching based on RUN_AS_USER
102101
# ============================================================================
103102

104-
WORKDIR /home/clauder/workspace
103+
WORKDIR /home/coder/workspace
105104
EXPOSE 8080
106105

107106
# Use our entrypoint which calls code-server directly
108107
ENTRYPOINT ["/usr/bin/railway-entrypoint.sh"]
108+

README.md

Lines changed: 40 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,75 @@
1-
# Claude Code Server
1+
# VSCode Cloud IDE
22

3-
**Browser-based VS Code with Claude Code & AI Coding Assistants**
3+
**Browser-based VSCode with Claude Code & Node.js**
44

5-
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/claude-code-server)
5+
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/template/TEMPLATE_ID)
66

7-
Cloud IDE with persistent extensions, settings, and tools. Pre-installed Claude Code CLI.
7+
Cloud IDE with persistent extensions, settings, and tools. Runs as non-root user.
8+
9+
---
10+
11+
## Features
12+
13+
- **Claude Code** & **Node.js 20** pre-installed
14+
- **Non-root execution** - runs as `clauder` user (UID 1000)
15+
- Extensions persist across redeployments
16+
- Volume permissions auto-fixed on startup
817

918
---
1019

1120
## Quick Start
1221

1322
```bash
14-
# Claude Code with auto-accept
23+
# Claude Code with auto-accept (for automation)
1524
claude --dangerously-skip-permissions
1625

17-
# Or use the alias
18-
claude-auto
19-
2026
# Interactive mode
2127
claude
28+
29+
# Node.js ready
30+
node --version
31+
npm --version
2232
```
2333

2434
---
2535

26-
## ⚠️ Claude Code Authentication
36+
## Environment Variables
2737

28-
When running `claude` for the first time:
29-
30-
1. The CLI will display an authentication URL
31-
2. **Copy the URL to a different browser** (not this code-server browser)
32-
3. Complete the login in that browser
33-
4. Copy the code displayed after login
34-
5. Paste the code back into the CLI
35-
36-
Your credentials persist in `~/.claude/` across redeployments.
38+
| Variable | Required | Default | Description |
39+
|----------|----------|---------|-------------|
40+
| `PASSWORD` | Yes | - | Login password |
41+
| `CLAUDER_HOME` | **Yes** | `/home/clauder` | Volume mount path (REQUIRED) |
42+
| `CLAUDER_UID` | No | `1000` | User ID |
43+
| `CLAUDER_GID` | No | `1000` | Group ID |
3744

3845
---
3946

40-
## 📍 Railway Deployment
41-
42-
> **Region**: Set your Railway region to **US West** for the fastest performance.
43-
44-
### Required Variables
45-
46-
| Variable | Description |
47-
|----------|-------------|
48-
| `PASSWORD` | Login password for code-server |
49-
50-
### User Configuration
51-
52-
| Variable | Default | Description |
53-
|----------|---------|-------------|
54-
| `CLAUDER_HOME` | `/home/clauder` | Volume mount path |
55-
| `CLAUDER_UID` | `1000` | User ID for clauder |
56-
| `CLAUDER_GID` | `1000` | Group ID for clauder |
57-
| `RUN_AS_USER` | `root` | Set to `clauder` for non-root execution |
58-
59-
### Pre-Install AI CLIs
60-
61-
Set to `1` to install on startup (default: `0`):
62-
63-
| Variable | CLI | Description |
64-
|----------|-----|-------------|
65-
| `INSTALL_OPENCODE` | OpenCode | Google's agentic AI IDE |
66-
| `INSTALL_GEMINI` | Gemini CLI | Google Gemini assistant |
67-
| `INSTALL_KILOCODE` | KiloCode | VS Code AI coding |
68-
| `INSTALL_CONTINUE` | Continue | Open-source AI code assistant |
69-
| `INSTALL_CODEX` | Codex | OpenAI Codex CLI |
70-
71-
> **Note**: Claude Code is **always installed** and cannot be disabled.
47+
## How It Works
7248

73-
### Pre-Install Development Frameworks
49+
1. **Starts as root** - fixes volume permissions
50+
2. **Switches to clauder** - uses `gosu` for clean handoff
51+
3. **Runs code-server** - as non-root user
7452

75-
| Variable | Framework | Description |
76-
|----------|-----------|-------------|
77-
| `INSTALL_BMAD` | BMAD Method | Spec-driven development workflow |
78-
| `INSTALL_OPENSPEC` | OpenSpec | AI-powered spec generation |
79-
| `INSTALL_SPECKIT` | Spec-Kit | GitHub's specification toolkit |
53+
This means:
54+
- ✅ No root permission warnings in code-server
55+
- ✅ Existing volumes with root-owned files work fine
56+
- ✅ Claude `--dangerously-skip-permissions` works
8057

8158
---
8259

83-
## How It Works
60+
## Claude Code Authentication
8461

85-
1. **Starts as root** – fixes volume permissions
86-
2. **Installs optional CLIs** – based on environment variables
87-
3. **Switches to clauder** – uses `gosu` for clean handoff
88-
4. **Runs code-server** – as non-root user
62+
After running `claude` for the first time:
8963

90-
This means:
91-
- ✅ No root permission warnings
92-
- ✅ Existing volumes work fine
93-
- ✅ Claude `--dangerously-skip-permissions` works
64+
1. Follow the authentication prompts
65+
2. Your credentials are stored in `~/.claude/`
66+
3. They persist across redeployments (on volume)
9467

9568
---
9669

9770
## Custom Startup Scripts
9871

99-
Add scripts to `$CLAUDER_HOME/entrypoint.d/`:
72+
Add to `$CLAUDER_HOME/entrypoint.d/`:
10073

10174
```bash
10275
#!/bin/bash
@@ -111,7 +84,7 @@ Make executable: `chmod +x script.sh`
11184

11285
| Component | Behavior |
11386
|-----------|----------|
114-
| **Volume tools** | You control install to `~/.local/bin/` |
87+
| **Volume tools** | You control - install to `~/.local/node/` or `~/.claude/local/` |
11588
| **Image tools** | Auto-update on redeploy (fallback) |
11689
| **Extensions** | Persist on volume |
11790
| **Claude auth** | Persists on volume |
@@ -127,7 +100,6 @@ Logs show `[volume]` or `[image]` next to each tool.
127100
| Permission denied | Check `CLAUDER_UID` matches your volume owner |
128101
| Claude not found | Run `which claude` to check PATH |
129102
| Extensions missing | Verify volume mounted at `CLAUDER_HOME` |
130-
| Auth URL won't open | Copy URL to a different browser |
131103

132104
---
133105

0 commit comments

Comments
 (0)