Files
openchamber/.github/workflows/opencode.yml
T
Ashik Ahmed 1937dbfcd2 feat: added github action for starting opencode/openchamber in actions infrastructure with persistence encryption (#194)
* fix(ui): make chat message action icons always visible

- Removes opacity-0 and pointer-events-none classes from UserMessageBody action buttons container.
- Ensures icons are visible by default instead of only on hover/focus.
- Addresses user feedback about empty space at the bottom of chat bubbles.

* fix(ui): make chat message action icons always visible

- Removes opacity-0 and pointer-events-none classes from UserMessageBody action buttons container.
- Ensures icons are visible by default instead of only on hover/focus.
- Addresses user feedback about empty space at the bottom of chat bubbles.

* fix(ui): prevent diff comment input from closing on click (#3)

Replaced global `document.querySelector('[data-comment-ui]')` with a local `useRef` to detect clicks inside the comment input area. This fixes an issue where clicking the input in one diff viewer would close it if another diff viewer (found first by querySelector) existed in the DOM.

- Added `commentContainerRef` in `PierreDiffViewer.tsx`.
- Updated `handleClickOutside` to check against the ref.
- Attached ref to comment UI containers in both 'fill' and 'inline' layouts.
- Preserved `data-comment-ui` attribute for backward compatibility.

* feat(ui): add visual connector lines to file explorer (#2)

- Replaced manual padding-based indentation with nested list structure
- Added vertical connector lines using border-l on nested ul
- Added horizontal connector lines using pseudo-elements on list items
- Added tail masking for the last item in a branch to create the 'L' shape
- Removed manual padding calculation from file/folder buttons

* Create openchamber.yml

* Create OPENCODE_FOR_ACTIONS.md

* feat: update OpenChamber for Actions workflow and docs (#6)

- Rename `docs/OPENCODE_FOR_ACTIONS.md` to `docs/OPENCHAMBER_FOR_ACTIONS.md`.
- Update `README.md` to include a section on OpenChamber for Actions.
- Update `.github/workflows/openchamber.yml` to allow users to select which service to expose (OpenChamber, OpenCode, or Both).
- Update documentation to reflect the new workflow options.

* feat: Add shimmer effect for generating messages (#7)

* Create test_unreleased.yml

* Update test_unreleased.yml

* Delete test_unreleased.yml

* 🧪 Labs: Enhanced File Explorer with Context Menus & UI Improvements (#13)

* feat: add file management capabilities (create, rename, delete) (#11)

Added backend endpoints for delete and rename operations.
Extended FilesAPI interface and implementation.
Updated FilesView with toolbar buttons for Create File/Folder.
Added context menu to file tree items for Rename, Delete, and Copy Path.
Implemented dialogs for all file operations.

* Refactor UI/UX: Modernize styles, components, and layout architecture (#10)

Refactored `packages/ui` CSS into modular files (design-system, typography, mobile).
Modernized `Header` with pill-style tabs and semantic Flexbox layout.
Enhanced `Chat` UI with threading visuals, improved typography, and better spacing.
Updated `Sidebar` to match the new design system aesthetic.
Verified with full workspace build.

* Add workflow

* Change to manual dispatch only

* Delete test.yml

* Update openchamber.yml

* Fix styling and workflow improvements (#17)

* Refactor OpenChamber workflow and update docs (#18)

- Refactor `.github/workflows/openchamber.yml` to use modular helper scripts.
- Add helper scripts in `scripts/`: `monitor.sh`, `persistence-restore.sh`, `persistence-save.sh`, `opencode-config.sh`.
- Update `docs/OPENCHAMBER_FOR_ACTIONS.md` to reflect new inputs and features.
- Implement robust monitoring with self-healing and proper URL logging.
- Improve persistence robustness for file copying.

* Expose Opencode Core, Web, and Chamber via Cloudflare tunnels (#19)

This commit updates the GitHub Actions workflow and monitoring script to:
1. Install `wetty` to expose the core Opencode TTY over the web (interpreted from user request for "WiTTY").
2. Start `opencode web` (8080), `openchamber` (9090), and `wetty` (3000) concurrently.
3. Configure Cloudflare to create three separate tunnels for these ports.
4. Update `monitor.sh` to accept and display URLs for all three services.

* Update opencode-config.sh

* Tighten actions persistence and UI polish

* Delete openchamber.yml

* Delete persistence-save.sh

* Delete persistence-restore.sh

* Delete opencode-config.sh

* Delete monitor.sh

* Delete install.sh

* Fix OpenChamber workflow and scripts for multi-service tunnels (#21)

* Create auto-opencode.yml

* Update opencode.yml

* feat: add password protection for OpenChamber in Actions (#22)

- Introduce `OPENCODE_SERVER_PASSWORD` secret support in `.github/workflows/opencode.yml`.
- Automatically set `OPENCHAMBER_UI_PASSWORD` and `OPENCODE_UI_PASSWORD` if the secret is provided.
- Configure `ttyd` to use basic auth (`-c user:password`) when password is set.
- Update `scripts/monitor.sh` to respect password settings during service restarts.
- Significantly update `docs/OPENCHAMBER_FOR_ACTIONS.md` with an overview, password configuration instructions, and improved layout (collapsible sections).

* use one password env variable

* Update OPENCHAMBER_FOR_ACTIONS.md

* feat: improve GITHUB_STEP_SUMMARY, fix TTY home logic and add encryption support in scripts

* feat: lazy load large diffs to prevent page freeze (#186)

When diff content exceeds 1500 lines or 150KB, show a placeholder with
"Load Diff" button instead of parsing immediately. This prevents the page
from freezing when viewing large diffs.

Co-authored-by: Jovines <jovines@qq.com>

* feat: add Web Push API support and PWA integration (#189)

* feat: add Web Push API support and PWA integration

Add web Push API with subscribe/unsubscribe and visibility endpoints
Introduce usePushVisibilityBeacon and useSessionDeepLink hooks
Integrate PWA with service worker, registerSW, and VAPID key persistence

* feat: add heartbeat visibility beacon for web runtime

Add a 10s heartbeat to ping visibility while visible
Subscribe to visibilitychange, focus, blur, pageshow, and pagehide events to report state
Clear heartbeat interval on unmount to avoid leaks

* feat(UI): Introduce new UI components for file attachments and related views (#191)

Add file management API and UI components
Implement directory listing, search and CRUD operations in desktop backend
Expose new Files API on frontend to list, search, and modify files

* feat: add workbox-window and improve event stream cleanup

Add workbox-window dependency to bun.lock and web package.json
Cancel and release the stream reader on disconnect to avoid leaks

* feat: provider config management (#193)

* feat: support scoped removal of provider config (auth, user, project, custom)

* feat: implement UI session token management with cookies for window visibility control

* feature: header layout changes (#195)

* fix(ui): remove fixed sessions button and mac titlebar coupling

Remove fixed sessions button from header on desktop Mac
Eliminate Mac titlebar spacer and drag-to-dock logic in sidebar
Update layout to rely on standard header/sidebar without mac-specific tweaks

* feat: improve mobile header with session toggle and back button

Add back button in mobile header to exit session switcher
Show Sessions label when session switcher is open in mobile header
Toggle between opening sessions and back navigation based on session state

* restore: add back scripts/install.sh from main branch

* docs: improve Tech Stack section with organized label badges

* Fix actions auth and remove shimmer
2026-01-22 18:24:11 +02:00

230 lines
9.7 KiB
YAML

name: OpenChamber for Actions
on:
workflow_dispatch:
inputs:
tunnel_provider:
description: 'Select Tunnel Provider'
required: true
default: 'cloudflare'
type: choice
options:
- ngrok
- cloudflare
timeout_minutes:
description: 'Auto-shutdown after (minutes)'
required: true
default: '300'
type: string
jobs:
serve:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
# ============================================================
# PERSISTENCE: Restore previous session (OAuth, chats, config)
# ============================================================
- name: Restore Session Data (Artifact)
if: ${{ secrets.OPENCODE_SERVER_PASSWORD != '' }}
uses: dawidd6/action-download-artifact@v6
continue-on-error: true
with:
name: opencode-session
path: /tmp/opencode-restore
workflow: opencode.yml
workflow_conclusion: success
if_no_artifact_found: ignore
repo: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Apply Restored Session Data
if: ${{ secrets.OPENCODE_SERVER_PASSWORD != '' }}
env:
OPENCODE_SERVER_PASSWORD: ${{ secrets.OPENCODE_SERVER_PASSWORD }}
run: |
chmod +x scripts/persistence-restore.sh
RESTORE_DIR=/tmp/opencode-restore ./scripts/persistence-restore.sh
# ============================================================
# CACHE: Speed up npm installations
# ============================================================
- name: Cache npm modules
uses: actions/cache@v4
with:
path: |
~/.npm
key: npm-cache-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-cache-${{ runner.os }}-
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Tools
run: |
npm install -g opencode-ai @openchamber/web
sudo apt update && sudo apt install jq lsof coreutils openssl -y
# Install ttyd for OpenCode TTY exposure
wget -q -O ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.x86_64
chmod +x ttyd
sudo mv ttyd /usr/local/bin/
# ============================================================
# CONFIGURATION: Setup OpenCode config (respects artifacts)
# ============================================================
- name: Configure OpenCode
run: |
chmod +x scripts/opencode-config.sh
RESTORE_DIR=/tmp/opencode-restore ./scripts/opencode-config.sh
# ============================================================
# STARTUP: Launch services and tunnel
# ============================================================
- name: Start Services
env:
OPENCODE_SERVER_PASSWORD: ${{ secrets.OPENCODE_SERVER_PASSWORD }}
run: |
# Setup Password Protection
TTYD_ARGS=""
if [[ -n "$OPENCODE_SERVER_PASSWORD" ]]; then
echo "Password protection enabled."
# Export for subsequent steps (Monitor script) and other services
echo "OPENCHAMBER_UI_PASSWORD=$OPENCODE_SERVER_PASSWORD" >> $GITHUB_ENV
echo "OPENCODE_UI_PASSWORD=$OPENCODE_SERVER_PASSWORD" >> $GITHUB_ENV
# Use for current step
export OPENCHAMBER_UI_PASSWORD="$OPENCODE_SERVER_PASSWORD"
export OPENCODE_UI_PASSWORD="$OPENCODE_SERVER_PASSWORD"
TTYD_ARGS="-c user:$OPENCODE_SERVER_PASSWORD"
else
echo "Password protection disabled (OPENCODE_SERVER_PASSWORD not set)."
fi
# Start OpenCode TTY (via ttyd)
echo "Starting OpenCode TTY..."
nohup stdbuf -oL ttyd $TTYD_ARGS -p 7681 opencode > opencode_tty.log 2>&1 &
# Start OpenChamber
echo "Starting OpenChamber..."
if [[ -n "$OPENCODE_SERVER_PASSWORD" ]]; then
nohup stdbuf -oL openchamber --port 9090 --ui-password "$OPENCODE_SERVER_PASSWORD" > openchamber.log 2>&1 &
else
nohup stdbuf -oL openchamber --port 9090 > openchamber.log 2>&1 &
fi
# Start OpenCode Web
echo "Starting OpenCode Web..."
if [[ -n "$OPENCODE_SERVER_PASSWORD" ]]; then
OPENCODE_SERVER_PASSWORD="$OPENCODE_SERVER_PASSWORD" nohup stdbuf -oL opencode web --port 8080 > opencode_web.log 2>&1 &
else
nohup stdbuf -oL opencode web --port 8080 > opencode_web.log 2>&1 &
fi
# Wait for services to initialize
sleep 20
echo "Services started. Checking status..."
lsof -i :7681 || echo "Warning: OpenCode TTY may not be running"
lsof -i :9090 || echo "Warning: OpenChamber may not be running"
lsof -i :8080 || echo "Warning: OpenCode Web may not be running"
- name: Setup Tunnel
run: |
if [[ "${{ github.event.inputs.tunnel_provider }}" == "ngrok" ]]; then
echo "Setting up ngrok tunnel..."
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null
echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list
sudo apt update && sudo apt install ngrok -y
ngrok config add-authtoken "${{ secrets.NGROK_AUTH_TOKEN }}"
# Note: Multiple ngrok tunnels on free plan might be limited or require config file
# Attempting to start tunnels blindly
nohup ngrok http 127.0.0.1:9090 --log=stdout > tunnel_chamber.log 2>&1 &
nohup ngrok http 127.0.0.1:8080 --log=stdout > tunnel_web.log 2>&1 &
nohup ngrok http 127.0.0.1:7681 --log=stdout > tunnel_tty.log 2>&1 &
sleep 10
# Extract URLs
URL_CHAMBER=$(curl -s http://localhost:4040/api/tunnels | jq -r '.tunnels[] | select(.config.addr | contains("9090")) | .public_url' || true)
URL_WEB=$(curl -s http://localhost:4040/api/tunnels | jq -r '.tunnels[] | select(.config.addr | contains("8080")) | .public_url' || true)
URL_TTY=$(curl -s http://localhost:4040/api/tunnels | jq -r '.tunnels[] | select(.config.addr | contains("7681")) | .public_url' || true)
echo "URL_CHAMBER=$URL_CHAMBER" >> $GITHUB_ENV
echo "URL_WEB=$URL_WEB" >> $GITHUB_ENV
echo "URL_TTY=$URL_TTY" >> $GITHUB_ENV
else
echo "Setting up Cloudflare tunnel..."
wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared-linux-amd64.deb
# Start 3 separate tunnels
nohup cloudflared tunnel --url http://127.0.0.1:7681 > tunnel_tty.log 2>&1 &
nohup cloudflared tunnel --url http://127.0.0.1:9090 > tunnel_chamber.log 2>&1 &
nohup cloudflared tunnel --url http://127.0.0.1:8080 > tunnel_web.log 2>&1 &
echo "Waiting for Cloudflare Tunnel URLs..."
# Loop to wait for URLs
for i in {1..30}; do
URL_TTY=$(grep -o 'https://[-a-z0-9.]*trycloudflare.com' tunnel_tty.log 2>/dev/null | tail -n 1 || true)
URL_CHAMBER=$(grep -o 'https://[-a-z0-9.]*trycloudflare.com' tunnel_chamber.log 2>/dev/null | tail -n 1 || true)
URL_WEB=$(grep -o 'https://[-a-z0-9.]*trycloudflare.com' tunnel_web.log 2>/dev/null | tail -n 1 || true)
if [[ -n "$URL_TTY" && -n "$URL_CHAMBER" && -n "$URL_WEB" ]]; then
echo "All tunnels established!"
break
fi
echo "Waiting for tunnels... ($i/30)"
sleep 2
done
if [[ -z "$URL_TTY" ]]; then echo "Warning: TTY Tunnel URL missing"; fi
if [[ -z "$URL_CHAMBER" ]]; then echo "Warning: Chamber Tunnel URL missing"; fi
if [[ -z "$URL_WEB" ]]; then echo "Warning: Web Tunnel URL missing"; fi
echo "URL_TTY=$URL_TTY" >> $GITHUB_ENV
echo "URL_CHAMBER=$URL_CHAMBER" >> $GITHUB_ENV
echo "URL_WEB=$URL_WEB" >> $GITHUB_ENV
fi
# ============================================================
# MONITOR: Self-healing loop with status updates
# ============================================================
- name: Monitor & Self-Heal
env:
OPENCHAMBER_UI_PASSWORD: ${{ secrets.OPENCODE_SERVER_PASSWORD }}
run: |
chmod +x scripts/monitor.sh
# Pass all 3 URLs to monitor script
./scripts/monitor.sh "${{ github.event.inputs.tunnel_provider }}" "${{ github.event.inputs.timeout_minutes }}" "${{ env.URL_TTY }}" "${{ env.URL_CHAMBER }}" "${{ env.URL_WEB }}"
# ============================================================
# PERSISTENCE: Save all session data (always runs)
# ============================================================
- name: Prepare Session Data for Save
if: ${{ always() && secrets.OPENCODE_SERVER_PASSWORD != '' }}
env:
OPENCODE_SERVER_PASSWORD: ${{ secrets.OPENCODE_SERVER_PASSWORD }}
run: |
chmod +x scripts/persistence-save.sh
SAVE_DIR=/tmp/opencode-save ./scripts/persistence-save.sh
- name: Upload Session Data (Artifact)
if: ${{ always() && secrets.OPENCODE_SERVER_PASSWORD != '' }}
uses: actions/upload-artifact@v4
with:
name: opencode-session
path: /tmp/opencode-save/
retention-days: 90
overwrite: true
if-no-files-found: warn