Skip to content

Self-hosted Gitea deploy, Opus 4.8, server-hosting fixes, per-project Skills#1

Merged
holoduke merged 6 commits into
mainfrom
feature/selfhost-gitea-skills
Jun 25, 2026
Merged

Self-hosted Gitea deploy, Opus 4.8, server-hosting fixes, per-project Skills#1
holoduke merged 6 commits into
mainfrom
feature/selfhost-gitea-skills

Conversation

@holoduke

Copy link
Copy Markdown
Owner

Summary

Adapts Claudable to run fully self-hosted on New Story infra (Gitea + Gitea Actions + Traefik), adds Claude Opus 4.8, fixes several bugs that broke chat/preview when hosted on a server, and adds per-project Agent Skills.

What's included

Self-hosting / Gitea

  • lib/services/git-provider.ts — env-driven git provider config (github | gitea).
  • lib/services/github.ts — provider-aware repo create/connect/push; creates under an org via /orgs/{org}/repos; token from GIT_TOKEN env or DB.
  • lib/services/scaffold-deploy.ts — injects Dockerfile + docker-compose.yml + .gitea/workflows/deploy.yml into each generated site so push→main auto-deploys at <site>.<domain>.
  • Root Dockerfile / docker-compose.yml / .gitea/workflows/deploy.yml — containerize Claudable itself with the claude CLI for headless claude -p.

Model

  • Claude Opus 4.8 added to the model picker (lib/constants/claudeModels.ts); generic opus aliases resolve to it.

Bug fixes (server hosting)

  • Run container as non-root node — Claude Code refuses --dangerously-skip-permissions as root, which killed the agent.
  • claude.ts: pass cwd — the SDK uses cwd (it ignored workingDirectory), so the agent was editing Claudable's own files instead of the project.
  • preview.ts: force NODE_ENV=development for the spawned next dev — otherwise the dev CSS loader breaks (globals.css "Module parse failed" → preview 500).
  • preview.ts: public proxy-routed preview URLs (PREVIEW_URL_TEMPLATE) + bind 0.0.0.0 (PREVIEW_BIND_HOST) — localhost previews aren't reachable when hosted remotely.
  • Deploy workflows use cached docker compose build (dropped --no-cache).

Per-project Agent Skills

  • claude.ts: settingSources: ['project','user'] so the agent loads .claude/skills/.
  • lib/services/skills.ts + API (/api/projects/[id]/skills GET/POST, /[name] GET/DELETE) to manage SKILL.md files.
  • SkillsSettings panel + a new Skills tab in ProjectSettings.

Notes

  • Built/validated against a live self-hosted deployment; type-checks clean.
  • Some env vars are new: GIT_PROVIDER, GIT_API_BASE_URL, GIT_HTTP_BASE, GIT_ORG, GIT_TOKEN, GIT_DEPLOY_DOMAIN, PREVIEW_URL_TEMPLATE, PREVIEW_BIND_HOST, DEPLOY_PORT_BASE/SPAN, CLAUDE_CODE_OAUTH_TOKEN.

holoduke added 6 commits June 24, 2026 15:54
- git-provider.ts: env-driven provider config (github|gitea)
- github.ts: provider-aware repo create/connect/push (Gitea /api/v1, org repos)
- scaffold-deploy.ts: inject Dockerfile + compose + .gitea workflow per site
- Dockerfile/compose/.gitea: containerize Claudable with claude CLI (claude -p)
- claude-opus-4-8 as the top/flagship Opus option
- generic 'opus' aliases now resolve to 4.8; 4.6 kept as previous-gen
- preview.ts: PREVIEW_URL_TEMPLATE for proxy-routed preview URLs, PREVIEW_BIND_HOST to bind 0.0.0.0
- compose: preview band 3710-3719, preview.newstory.tf template, bind 0.0.0.0
- Dockerfile: run as node user (Claude Code refuses skip-permissions as root)
- claude.ts: pass cwd so agent edits the project, not Claudable's own /app
- preview.ts: force NODE_ENV=development so next dev compiles CSS (was 500)
- claude.ts: settingSources ['project','user'] so the agent loads .claude/skills/
- lib/services/skills.ts: read/write/delete SKILL.md under <project>/.claude/skills/<name>/
- API: GET/POST /api/projects/[id]/skills, GET/DELETE /api/projects/[id]/skills/[name]
- UI: SkillsSettings panel + new Skills tab in ProjectSettings
@holoduke holoduke merged commit 94d59e9 into main Jun 25, 2026
@holoduke holoduke deleted the feature/selfhost-gitea-skills branch June 25, 2026 10:49
holoduke added a commit that referenced this pull request Jun 29, 2026
…uard

Perf (opactorai#4): stop killing a project's dev server on navigation/unmount. The
PreviewManager already reaps idle previews + LRU-evicts on a full port pool, so
leaving them running keeps multiple projects warm — switching back is instant
instead of a 15-30s cold recompile.

Projects (#1): show access-filtered project tiles below the new-project prompt.

Agent isolation (#0, lightweight — no OS sandbox): a PreToolUse hook (fires even
under bypassPermissions) denies tool calls that escape the current project —
sibling projects, Claudable's source/secrets, sensitive system paths — while the
agent keeps full tool/skill/file/shell power within its own project + tmp.
holoduke added a commit that referenced this pull request Jun 29, 2026
Headless Chromium (added to the image) screenshots a project's running preview
on localhost:<port> via the CLI --screenshot flag (no extra npm dep). The chat
page captures once the preview is up (best-effort, delayed to let it render);
thumbnails are stored under data/thumbnails and served by
GET /api/projects/:id/thumbnail. Tiles show the thumbnail with a gradient
fallback until one exists.
holoduke added a commit that referenced this pull request Jul 5, 2026
…nded tiles

Wave 2 of the Lovable/Bolt-benchmark polish pass:
- COLORED DIFFS (the #1 competitive gap): edit/write tool cards now render a real
  unified diff (added=green/+, removed=red/-, context muted) from the toolInput
  metadata already persisted (Edit old/new_string, MultiEdit edits[], Write content,
  codex apply_patch). New dependency-free components/chat/DiffView.tsx (LCS line diff,
  capped at 400 lines, file-path header + Copy). Non-edit tools keep the raw pre.
- TOPBAR DECLUTTER: build-screen top bar went from ~19 icon buttons to a focused set
  (Preview/Code, route, refresh, open-tab, device, theme, Settings, Share, and Publish
  as a LABELED brand CTA) + a '⋯' overflow menu (edit/comments/architecture/skills/
  import/stop) with labels, Escape/outside-click close, role=menu. All conditionals +
  onClicks preserved.
- NO MORE alert(): all 10 blocking alert()s → toasts; a new ConfirmDialog replaces the
  clear-comments confirm; ToastProvider api memoized.
- Home: branded tile placeholder (brand-gradient + project initial) instead of flat
  grey when a preview has no thumbnail; hero tagline 'Describe it • Watch it build •
  Ship it' (was 'Connect CLI Agent…').
Verified: tsc, build, 74/74.
holoduke added a commit that referenced this pull request Jul 7, 2026
…e tokens, preview perf + chat fixes' (#1) from feat/homepage-mcp-tokens-perf into main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant