amangs commited on
Commit
ee6be2a
Β·
1 Parent(s): 05667d9

Install DeepSeek Harness & OpenCode agent, use persistent /data/Caddyfile with Caddyfile.example fallback

Browse files
Dockerfile CHANGED
@@ -189,7 +189,7 @@ RUN curl -fsSL "https://github.com/oven-sh/bun/releases/latest/download/bun-linu
189
  # ------------------------------------------
190
  COPY security/stub-playwright-index.js /tmp/stub-pw.js
191
  COPY security/stub-playwright-index.mjs /tmp/stub-pw.mjs
192
- RUN npm install -g rea-agents@latest supergateway@latest @anthropic-ai/claude-code aicodeman@latest pnpm yarn typescript && \
193
  cp /tmp/stub-pw.js /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.js 2>/dev/null || true && \
194
  cp /tmp/stub-pw.mjs /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.mjs 2>/dev/null || true && \
195
  rm -f /tmp/stub-pw.* && \
@@ -208,7 +208,7 @@ RUN git clone https://github.com/RichardAtCT/claude-code-telegram.git /opt/claud
208
  /opt/claude-code-telegram/venv/bin/pip install --no-cache-dir poetry && \
209
  /opt/claude-code-telegram/venv/bin/pip install --no-cache-dir /opt/claude-code-telegram && \
210
  rm -f /tmp/patch-claude-telegram.py && \
211
- /usr/local/bin/rea setup --client claude_code --yes || true
212
 
213
  # ------------------------------------------
214
  # 14. Application Setup & Runtime Runner
 
189
  # ------------------------------------------
190
  COPY security/stub-playwright-index.js /tmp/stub-pw.js
191
  COPY security/stub-playwright-index.mjs /tmp/stub-pw.mjs
192
+ RUN npm install -g rea-agents@latest supergateway@latest @anthropic-ai/claude-code aicodeman@latest opencode-ai @deepseek-ai/dsh pnpm yarn typescript && \
193
  cp /tmp/stub-pw.js /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.js 2>/dev/null || true && \
194
  cp /tmp/stub-pw.mjs /usr/local/lib/node_modules/rea-agents/node_modules/playwright-core/index.mjs 2>/dev/null || true && \
195
  rm -f /tmp/stub-pw.* && \
 
208
  /opt/claude-code-telegram/venv/bin/pip install --no-cache-dir poetry && \
209
  /opt/claude-code-telegram/venv/bin/pip install --no-cache-dir /opt/claude-code-telegram && \
210
  rm -f /tmp/patch-claude-telegram.py && \
211
+ /usr/local/bin/rea setup --client claude_code --client opencode --yes || true
212
 
213
  # ------------------------------------------
214
  # 14. Application Setup & Runtime Runner
config/{Caddyfile β†’ Caddyfile.example} RENAMED
@@ -40,7 +40,13 @@
40
  reverse_proxy 127.0.0.1:8787
41
  }
42
 
43
- # 5. REA Doctor status JSON
 
 
 
 
 
 
44
  handle /rea-status.json {
45
  root * /tmp/logs
46
  file_server
 
40
  reverse_proxy 127.0.0.1:8787
41
  }
42
 
43
+ # 5. Diagnostic logs & REA status
44
+ handle /logs/* {
45
+ uri strip_prefix /logs
46
+ root * /tmp/logs
47
+ file_server browse
48
+ }
49
+
50
  handle /rea-status.json {
51
  root * /tmp/logs
52
  file_server
entrypoint.sh CHANGED
@@ -1,12 +1,12 @@
1
  #!/bin/bash
2
  set -e
3
 
4
- echo "πŸš€ Starting REA + Codeman Mission Control..."
5
- echo "==========================================="
6
 
7
- # 1. Directory Structure:
8
- # - /data (S3 bucket): ONLY persistent files (workspace, services, code-server config)
9
- # - /tmp (ephemeral local disk): ALL logs, caches, databases, and scratch files
10
  mkdir -p /data/{workspace,code-server,services}
11
  mkdir -p /tmp/{logs,.cache,code-server-cache}
12
  chmod -R 755 /data/services
@@ -26,14 +26,21 @@ for f in /app/services/*.sh; do
26
  chmod +x "$target"
27
  done
28
 
29
- # 2. Enforce Browser Lockdown
 
 
 
 
 
 
 
30
  rm -rf /root/.cache/ms-playwright /root/.cache/puppeteer /tmp/.cache/ms-playwright 2>/dev/null || true
31
  mkdir -p /root/.cache
32
  ln -sfn /dev/null /root/.cache/ms-playwright 2>/dev/null || true
33
  ln -sfn /dev/null /root/.cache/puppeteer 2>/dev/null || true
34
  echo "Browser lockdown verified: zero browser packages permitted." > /tmp/logs/browser-block.log
35
 
36
- # 3. Launch Persistent Background Services
37
  shopt -s nullglob
38
  scripts=(/data/services/*.sh)
39
  echo "🧩 Launching ${#scripts[@]} background service(s)..." > /tmp/logs/services.log
@@ -45,6 +52,6 @@ for s in "${scripts[@]}"; do
45
  disown 2>/dev/null || true
46
  done
47
 
48
- # 4. Run Caddy in Foreground on Port 7860
49
- echo "🌐 Starting Caddy edge proxy on :7860..."
50
- exec caddy run --config /app/config/Caddyfile --adapter caddyfile
 
1
  #!/bin/bash
2
  set -e
3
 
4
+ echo "πŸš€ Starting REA + Codeman Mission Control Space..."
5
+ echo "================================================="
6
 
7
+ # 1. Directories:
8
+ # - /data (S3 bucket): ONLY persistent files (workspace, services, config, code-server)
9
+ # - /tmp (ephemeral local disk): logs, caches, databases, scratch files
10
  mkdir -p /data/{workspace,code-server,services}
11
  mkdir -p /tmp/{logs,.cache,code-server-cache}
12
  chmod -R 755 /data/services
 
26
  chmod +x "$target"
27
  done
28
 
29
+ # 2. Persistent Caddyfile on /data (user-editable):
30
+ # If /data/Caddyfile does NOT exist, seed it from /app/config/Caddyfile.example
31
+ if [ ! -f /data/Caddyfile ]; then
32
+ echo "πŸ“‹ Seeding persistent /data/Caddyfile from /app/config/Caddyfile.example..."
33
+ cp /app/config/Caddyfile.example /data/Caddyfile
34
+ fi
35
+
36
+ # 3. Enforce Browser Lockdown
37
  rm -rf /root/.cache/ms-playwright /root/.cache/puppeteer /tmp/.cache/ms-playwright 2>/dev/null || true
38
  mkdir -p /root/.cache
39
  ln -sfn /dev/null /root/.cache/ms-playwright 2>/dev/null || true
40
  ln -sfn /dev/null /root/.cache/puppeteer 2>/dev/null || true
41
  echo "Browser lockdown verified: zero browser packages permitted." > /tmp/logs/browser-block.log
42
 
43
+ # 4. Launch Persistent Background Services
44
  shopt -s nullglob
45
  scripts=(/data/services/*.sh)
46
  echo "🧩 Launching ${#scripts[@]} background service(s)..." > /tmp/logs/services.log
 
52
  disown 2>/dev/null || true
53
  done
54
 
55
+ # 5. Run Caddy in Foreground using persistent /data/Caddyfile
56
+ echo "🌐 Starting Caddy edge proxy on :7860 using /data/Caddyfile..."
57
+ exec caddy run --config /data/Caddyfile --adapter caddyfile
services/25-codeman.sh CHANGED
@@ -9,6 +9,7 @@ if [ -f /data/.env ]; then
9
  set +a
10
  fi
11
 
 
12
  export CODEMAN_PORT=3000
13
  export CODEMAN_HOST="127.0.0.1"
14
  export CODEMAN_PASSWORD="${AUTH_TOKEN:-}"
@@ -30,4 +31,4 @@ if pgrep -f "codeman.*web" >/dev/null 2>&1; then
30
  fi
31
 
32
  cd /data/workspace || exit 1
33
- exec /usr/local/bin/codeman web --host 127.0.0.1 --port 3000 >> "$LOG" 2>&1
 
9
  set +a
10
  fi
11
 
12
+ export PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
13
  export CODEMAN_PORT=3000
14
  export CODEMAN_HOST="127.0.0.1"
15
  export CODEMAN_PASSWORD="${AUTH_TOKEN:-}"
 
31
  fi
32
 
33
  cd /data/workspace || exit 1
34
+ exec codeman web --host 127.0.0.1 --port 3000 >> "$LOG" 2>&1