Commit Graph
11 Commits
Author SHA1 Message Date
Willie 13d9b82be7 fix: devcontainer token loading from .env and host env fallback
- Remove token vars from remoteEnv (localEnv overrides .env with empty)
- Pass host tokens via docker-compose environment as fallback
- Add profile.d script to source .devcontainer/.env in login shells
- Add sandbox token passthrough for GitLab/Bitbucket/generic tokens
- Add root .env to .gitignore
2026-02-22 15:13:10 +08:00
Willie 626f0f2240 feat(devcontainer): add Node.js 24, auto-start dev servers, and dev-servers manager
Enable full frontend development inside the devcontainer without
falling back to the host. Three dev servers (Go API :19420, Vite :5173,
Docusaurus :3000) start automatically via postStartCommand and can be
managed with the `dev-servers` CLI (start/stop/restart/status/logs).

Key changes:
- Add Node.js 24 + pnpm devcontainer feature
- Auto-install ui/ and website/ dependencies in setup.sh
- Add dev-servers.sh process manager with PID tracking
- Replace shell aliases with PATH scripts (ss, skillshare-ui, etc.)
- Set Vite server.host: true for container accessibility
- Make ui-dev Go server host configurable via SKILLSHARE_UI_HOST env var
- Forward ports 5173 and 3000 alongside 19420
- Harden setup.sh with environment guard and safe_cleanup helpers
- Update docker-sandbox.md with frontend development section
2026-02-20 04:12:34 +08:00
Willie 41e822d979 feat: remove go:embed, serve UI exclusively via runtime download
Replace the embedded SPA (go:embed + build tags) with runtime download
from GitHub Releases. The binary no longer bundles UI assets — they are
downloaded on first `skillshare ui` launch and cached at
~/.cache/skillshare/ui/<version>/.

- Delete embed.go / embed_dev.go; add spa_disk.go with placeholder handler
- Simplify ensureUIAvailable(): cache check before dev-mode fallback
- Pre-download UI assets in `skillshare upgrade` (best-effort)
- Remove Node stages from production and CI Dockerfiles
- Keep Node stage in sandbox for playground UI cache pre-population
- Remove ui-embed-check CI job and -tags dev build flag
- Update Makefile, mise.toml, GoReleaser, release workflow
2026-02-16 02:58:22 +08:00
Willie 5739e59ab6 docs: clarify dev workflow and fix sandbox/dev runtime issues
- Distinguish two dev workflows: make ui-dev (local Go) vs
  dev-docker-up + pnpm run dev (no Go required)
- Add auto-init to dev profile so container doesn't crash on first run
- Add --cap-add ALL to playground volume init (cap_drop blocks chmod)
- Document port 19420 conflict between playground and dev profile
- Add docker-build vs docker-build-multiarch explanation and GHCR pull examples
- Increase git command timeout to 180s for constrained Docker networks
- Increase online test timeout to 300s
- Align Makefile help text formatting
2026-02-13 15:52:53 +08:00
Willie c4a0c64911 feat(docker): add graceful shutdown, security hardening, production/CI images, and dev profile
Server improvements:
- Graceful shutdown with SIGTERM/SIGINT (10s grace period)
- HTTP timeouts (ReadHeader 5s, Read 15s, Write 30s, Idle 60s)
- Health endpoint now returns version and uptime

Compose security hardening:
- read_only filesystem, cap_drop ALL, no-new-privileges
- Resource limits (2 CPU / 2G memory), tmpfs for /tmp
- Playground healthcheck via /api/health

New Docker images:
- docker/production/ — lightweight debian-slim with tini, non-root user, healthcheck
- docker/ci/ — minimal image for skill validation in pipelines
- .github/workflows/docker-publish.yml — multi-arch GHCR publishing on tag push

Script improvements:
- DRY: test_docker.sh --online flag replaces duplicate test_docker_online.sh
- _sandbox_common.sh: Compose v2 version check with install suggestions
- .dockerignore: exclude website/, .github/, editor files

New targets:
- sandbox-status, dev-docker-up/down, docker-build, docker-build-multiarch

Docs updated: CLAUDE.md, README.md, website docker guide with use cases
2026-02-13 15:29:52 +08:00
Willie 18a4177973 test: add online integration tests for install, update, and search
Cover real GitHub operations that were previously untested:
- install clone (subdir skill)
- install --track (full repo)
- update tracked repo (freshly cloned → up to date)
- search with conditional GITHUB_TOKEN skip

Also pass GITHUB_TOKEN into sandbox-online container and remove
the -run filter so all online-tagged tests run automatically.
2026-02-11 03:40:54 +08:00
Willie 570195d1a2 feat: enhance skill template, improve search UX, and harden playground
- new: redesign SKILL.md template based on Anthropic's skill-building
  guide — description now includes WHAT+WHEN trigger format, step-based
  instructions (Gather/Execute/Validate), examples, and troubleshooting
- search: prompt for keyword when run without arguments instead of
  auto-browsing popular skills
- playground: default shell to $HOME (/sandbox-home) and mount source
  as read-only to prevent accidental host file modifications
2026-02-09 21:43:10 +08:00
Willie 0c49860d63 feat: add project mode labels, privacy-first messaging, and UI polish
- Add (project) labels to status, sync, collect, target, and uninstall
  headers for clear mode distinction (matching list/target list pattern)
- Add ui.WithModeLabel() helper for shared functions that run in both modes
- Update uninstall confirmation prompt: "from the project?" in project mode
- Add "Privacy-first" to README Why section and website homepage
- Replace "Unified Source" card with "Privacy-First" card on website
- Unify Quick Actions card heights with h-full in DashboardPage
- Add frontend rebuild note to Docker sandbox docs
2026-02-09 21:08:03 +08:00
Willie 503ee8af24 refactor: DRY up Docker sandbox scripts with shared entrypoint and boilerplate
- Add docker/sandbox/entrypoint.sh to auto-copy /ui-dist → internal/server/dist/
  when missing, fixing the gitignore regression for all Docker workflows
- Add scripts/_sandbox_common.sh with shared SCRIPT_DIR, PROJECT_ROOT,
  COMPOSE_FILE, and require_docker() function
- Refactor all 5 sandbox scripts to source _sandbox_common.sh
- Use YAML extension fields (x-sandbox-common) in docker-compose.sandbox.yml
  to eliminate duplicated service config
- Break sandbox_playground_up.sh one-liner into readable steps, add
  skillshare-ui alias and init hint
- Change test.sh to use `make build` for placeholder consistency
2026-02-08 16:32:28 +08:00
Willie 092fb14f8a feat: add web dashboard with embedded React SPA (skillshare ui)
Single-binary web UI for visual skill management — React 19 + Vite
frontend embedded via go:embed, Go net/http REST API backend (30+
endpoints). Includes dashboard, skills browser, targets, sync, collect,
search, install, config editor, backup/restore, and git sync pages.

Also adds Bitbucket/GitLab URL parsing for install, git operations
library, skill version checking, CI frontend build steps, Docker
sandbox support, and website docs for the ui command.
2026-02-08 05:08:30 +08:00
Willie 080e29e0ff feat: add docker sandbox test/playground workflows and docs 2026-02-07 21:55:20 +08:00