Commit Graph

345 Commits

Author SHA1 Message Date
Fusion ea9f2e3c98 fix: use configurable router prefix for traefik services
Replace hardcoded 'hq-api' and '' router names with
configurable hq-api and -web. This ensures
unique identifiers per deployment and avoids conflicts with other
services sharing the same Traefik instance.
2026-05-18 10:41:40 +02:00
Fusion 86245671e7 fix: make traefik certresolver configurable via env var
Replace hardcoded 'letsencrypt' certresolver with configurable
letsencrypt in both api and web services.
2026-05-18 10:39:00 +02:00
Fusion fff3ea0c2f fix: resolve nginx pid permission error in web container
- Create /run directory explicitly for nginx.pid
- Set proper ownership and permissions for non-root user
- Fixes 'open() /run/nginx.pid failed (13: Permission denied)' error
2026-05-18 10:36:06 +02:00
Fusion b85ec38ff8 fix: revert service network refs to compose key name
Services should reference networks by their compose key name ('traefik'),
not by the env var. The actual Docker network name is already configurable
via TRAEFIK_NETWORK in the network definition at the bottom.
2026-05-18 10:01:47 +02:00
Fusion c722cab86c chore: archive completed user-profile change
Archive user-profile change to openspec/changes/archive/
All tasks complete, specs already synced to main specs directory.
2026-05-18 09:45:36 +02:00
Fusion 8bae77e42c fix: make traefik network configurable in docker-compose.traefik.yml
- Replace hardcoded 'traefik' network references with configurable
  traefik in both api and web services
- Network definition at bottom already supported configuration,
  but service references were still hardcoded
2026-05-18 09:38:33 +02:00
Fusion 236130b0a7 fix: use npm install in web Dockerfile to resolve esbuild platform deps
The package-lock.json was missing some esbuild optional dependencies
for other platforms. Using npm install instead of npm ci allows the
docker build to proceed without requiring all platform-specific packages
in the lock file.
2026-05-18 04:30:37 +02:00
Fusion 9b04760423 docs: sync oauth-traefik-integration specs to main specs
- Update auth-oauth spec: configurable endpoints via environment variables
- Update docker-infrastructure spec: add traefik deployment mode
- Add traefik-deployment spec: new capability for reverse proxy deployment
2026-05-17 23:28:43 +02:00
Fusion 75657bbcb0 docs: add git workflow and auto-commit rules to AGENTS.md
Add section documenting:
- Auto-commit on OpenSpec completion
- Conventional commit format requirements
- Commit scope rules
- Integration with definition of done
2026-05-17 23:18:10 +02:00
Fusion 577b052c05 feat: implement user profile management and oauth/traefik integration
User Profile (US-004):
- Add authenticated profile endpoints (GET/PUT /users/me)
- Add avatar upload with file validation (PNG/JPEG, max 2MB)
- Create frontend profile page with edit form and avatar upload
- Update app shell to link to profile page

OAuth/Traefik Integration:
- Externalize all Authentik URLs to environment variables
- Add domain configuration (API_DOMAIN, WEB_DOMAIN, AUTHENTIK_DOMAIN)
- Create docker-compose.traefik.yml for reverse proxy deployment
- Update OAuth redirect/callback URLs to use configured domains
- Add VITE_APP_URL for frontend public URL configuration

Quality gates: pytest (50 passed), ruff, mypy, npm test (12 passed), typecheck, lint, build
2026-05-17 23:17:10 +02:00
alex 56f440db1b chore: archive project-management and scaffold user-profile change 2026-05-17 20:26:30 +00:00
alex 71d9fe6406 feat: implement auth, projects, and frontend foundation 2026-05-17 20:21:55 +00:00
alex e7819bfc82 feat: implement docker infrastructure (US-001)
- Add docker-compose.yml with postgres, redis, api, and web services
- Add multi-stage Dockerfile for API (Python 3.11)
- Add multi-stage Dockerfile for web (Node.js 20 + nginx)
- Add Makefile with common development commands
- Add .env.example with all required environment variables
- Add placeholder pyproject.toml and package.json for builds
- Configure health checks for all services
- Setup persistent volumes for postgres, redis, and repos
- Run services as non-root users
2026-05-16 17:44:39 +00:00
alex 212d072417 bd init: initialize beads issue tracking 2026-05-16 17:11:01 +00:00
alex 082e8d03ff auth fixes 2026-05-16 14:57:55 +00:00
alex 84038c25ec fix: use correct Authentik authorization and token endpoints
The OIDC issuer URL was being used to construct authorize/token URLs,
but Authentik's endpoints are at different paths than the issuer base.

- Use the actual authorization_endpoint from .well-known config
- Use the actual token_endpoint from .well-known config
- Fixes Authentik 'not found' error on login redirect
2026-05-16 13:46:09 +00:00
alex d23582eb82 fix: normalize OIDC issuer URL to avoid double slashes
CI / API CI (push) Failing after 9s
CI / Web CI (push) Failing after 10s
The OIDC issuer URL in .env ends with a trailing slash, which caused
the authorize endpoint to have a double slash (//authorize).

- Normalize issuer URL by removing trailing slash before appending path
- Applied to both LoginPage.tsx and CallbackPage.tsx
- Fixes Authentik 'not found' error on login redirect
2026-05-16 13:36:50 +00:00
alex ab400d7ad9 Merge branch 'main' of ssh://git.commumedia.org:2222/alex/headquarter
CI / Web CI (push) Failing after 9s
CI / API CI (push) Failing after 10s
2026-05-16 13:16:24 +00:00
alex 44e2ae60ef fix: add VITE_OIDC_REDIRECT_URI and build args for frontend
- Add VITE_OIDC_REDIRECT_URI to .env.example and docker-compose files
- Pass OIDC variables as build args in Dockerfile (build-time only)
- Update both docker-compose.prod.yml and docker-compose.traefik.yml
- Fixes undefined OIDC variables causing 404 on login redirect
2026-05-16 13:14:09 +00:00
alex be2cb09dad fix: remove non-existent sec-headers middleware causing 404
The sec-headers@file middleware was referenced but not defined,
causing Traefik to return 404 for all routes.

- Changed sec-headers@file to default-security-headers@file in both
  docker-compose.prod.yml and docker-compose.traefik.yml
- This assumes the external Traefik has default-security-headers defined
  in its file provider configuration (e.g., in dynamic/middlewares.yml)

If you don't have this middleware defined, either:
1. Define it in your Traefik dynamic configuration, or
2. Remove the middleware label entirely
2026-05-16 13:08:46 +00:00
alex 8d91a1d1e0 Update docker-compose.prod.yml
CI / Web CI (push) Failing after 9s
CI / API CI (push) Failing after 10s
2026-05-16 15:07:32 +02:00
alex 09920c1ca1 removed secs middleware from docker compose
CI / Web CI (push) Failing after 9s
CI / API CI (push) Failing after 11s
2026-05-16 15:07:04 +02:00
alex 75108afe29 Merge branch 'main' of ssh://git.commumedia.org:2222/alex/headquarter
CI / Web CI (push) Failing after 10s
CI / API CI (push) Failing after 10s
2026-05-16 12:42:07 +00:00
alex f92f9c33e6 fix: traefik compose contains app services only (no traefik service)
- docker-compose.traefik.yml now contains api, web, db services only
- Assumes external Traefik proxy is already deployed
- Uses external traefik network for discovery
- docker-compose.prod.yml remains the full stack with embedded Traefik
2026-05-16 12:41:37 +00:00
alex 984f9e5b9b docs: fix broken links to removed deploy directory
CI / Web CI (push) Failing after 8s
CI / API CI (push) Failing after 9s
2026-05-16 14:39:56 +02:00
alex 2655a29886 feat: restore traefik to prod compose and add standalone traefik compose
CI / Web CI (push) Failing after 10s
CI / API CI (push) Failing after 11s
- Add Traefik v3.2 service back to docker-compose.prod.yml with:
  - Dashboard with basic auth middleware
  - Let's Encrypt TLS challenge
  - HTTP→HTTPS redirect
  - Health checks and structured logging
- Create docker-compose.traefik.yml for standalone Traefik deployment:
  - Mirrors production Traefik configuration
  - Isolated network for external proxy usage
  - Persistent certificate storage
- Add TRAEFIK_ACME_EMAIL to .env.example
- All compose files validated with docker compose config
2026-05-16 12:37:03 +00:00
alex 8136eae8f4 Merge branch 'main' of ssh://git.commumedia.org:2222/alex/headquarter
CI / Web CI (push) Failing after 9s
CI / API CI (push) Failing after 10s
2026-05-16 12:32:08 +00:00
alex 9fcc73b874 refactor(docker): remove dashboard subdomain, prefix traefik router names
- Remove TRAEFIK_DASHBOARD_SUBDOMAIN from .env.example (no longer used)
- Rename traefik routers from 'api'/'web' to 'headquarter-api'/'headquarter-web'
- Rename traefik services from 'api'/'web' to 'headquarter-api'/'headquarter-web'

This prevents router/service name collisions with other projects
sharing the same Traefik instance.
2026-05-16 12:25:14 +00:00
alex 533d50dd01 chore: clean up root configuration files
CI / Web CI (push) Failing after 9s
CI / API CI (push) Failing after 10s
- Remove redundant .npmrc (ignore-build-scripts=false is default)
- Remove Makefile (scripts available in package.json)
- Simplify root package.json:
  - Remove duplicate pnpm keys
  - Remove frontend-specific esbuild config (already in apps/web/package.json)
  - Remove version/description (not needed for private workspace root)
  - Remove compose scripts (use docker compose directly)
- Clean pnpm-workspace.yaml:
  - Remove placeholder allowBuilds comment
  - Remove onlyBuiltDependencies (handled per-workspace)
2026-05-16 14:14:41 +02:00
alex aef6cbb2b1 Merge branch 'main' of ssh://git.commumedia.org:2222/alex/headquarter
CI / Web CI (push) Failing after 9s
CI / API CI (push) Failing after 10s
2026-05-16 12:14:29 +00:00
alex ae4fe95c40 refactor(docker): remove traefik compose, cleanup deploy folder
- Delete docker-compose.traefik.yml (redundant overlay)
- Remove Traefik service from docker-compose.prod.yml
- Add traefik external network and labels to api/web services in prod compose
- Add TRAEFIK_ENTRYPOINT env var to all Traefik router labels
- Remove deploy/ folder (portainer-stack.yml, .env examples, README)

Production compose now assumes external Traefik proxy on Docker network.
All environment variables come from host environment only.
2026-05-16 12:13:38 +00:00
alex 1f2017b7a9 refactor(docker): remove all .env file references and add configurable Traefik vars
- Remove env_file from deploy/portainer-stack.yml (api and web services)
- Add TRAEFIK_CERT_RESOLVER env var to all Traefik router labels
- Add TRAEFIK_DASHBOARD_SUBDOMAIN for configurable dashboard hostname
- Add TRAEFIK_ENTRYPOINT env var to Traefik dashboard router
- Update .env.example with TRAEFIK_DASHBOARD_SUBDOMAIN and TRAEFIK_LOG_LEVEL
- Update deploy/.env.example with new Traefik variables

All environment variables now come from host environment only.
2026-05-16 12:05:43 +00:00
alex e78339a7b1 Delete directory '.fusion'
CI / Web CI (push) Failing after 8s
CI / API CI (push) Failing after 9s
2026-05-16 14:05:40 +02:00
alex a2a0b2602c Delete directory '.worktrees'
CI / Web CI (push) Failing after 11s
CI / API CI (push) Failing after 12s
2026-05-16 14:05:18 +02:00
alex dab37a88e8 refactor(docker): replace env_file with explicit environment variables
CI / Web CI (push) Failing after 9s
CI / API CI (push) Failing after 10s
- Remove env_file references from docker-compose.yml and docker-compose.prod.yml
- Add explicit environment variable forwarding for all services
- Use TRAEFIK_NETWORK env var in docker-compose.traefik.yml instead of hardcoded name
- Add VITE_* frontend variables to .env.example and deploy/.env.example
- Add missing production variables (TRAEFIK_ENTRYPOINT, TRAEFIK_CERT_RESOLVER) to deploy/.env.example

This makes environment configuration more explicit and easier to manage
across different deployment scenarios (local dev, CI/CD, Portainer).
2026-05-16 11:50:39 +00:00
alex a443127779 chore(openspec): archive completed OpenSpec changes
CI / API CI (push) Failing after 10s
CI / Web CI (push) Failing after 11s
- Archive config-secrets (FN-009) change
- Archive deployment-config (FN-006) change
- Archive runfusion-poc (FN-008) change
2026-05-16 13:44:40 +02:00
alex 024278a3d2 docs(openspec): add FN-007 Git Connection Model change
- Add proposal, design, specs, and tasks for git connection model
- Include provider adapter, credential storage, SSH key lifecycle specs
- Add repository connection API and git operations specifications
2026-05-16 13:43:49 +02:00
alex e071e3418d docs(FN-007): add repository connection documentation
- Update development.md with Repository Connections section
- Document SSH key generation and provider adapter usage
2026-05-16 13:43:00 +02:00
alex ed642dcc66 feat(FN-007): add repository connection frontend UI
- Create RepositoryListPage with connection status display
- Create RepositoryDetailPage with SSH key management
- Add repository API methods to client
- Update router with repository routes
- Add Repository types to frontend
2026-05-16 13:42:08 +02:00
alex 3728c245d3 feat(FN-007): implement repository connection API and git operations
- Add GitHubAdapter and GitLabAdapter with URL parsing
- Create provider factory in apps/api/app/git/providers/
- Implement clone, fetch, push in LocalGitOperations
- Add repository_connections router with CRUD and SSH key endpoints
- Create RepositoryConnection schema with validation
- Update models and routers __init__.py for new components
- Add comprehensive tests for git operations
2026-05-16 13:41:37 +02:00
alex 25db3f81b0 feat(FN-007): implement credential storage with Fernet encryption
- Add DatabaseCredentialStorage with async CRUD operations
- Create Credential SQLAlchemy model with encrypted values
- Update GitCredential and AccessTokenCredential to support async
- Fix SSH key encryption to use Fernet instead of base64 placeholder
2026-05-16 13:41:07 +02:00
alex 8b4784f5ed chore(openspec): archive completed changes
CI / Web CI (push) Failing after 10s
CI / API CI (push) Failing after 11s
- Archive config-secrets (FN-009) - 31 tasks complete
- Archive runfusion-poc (FN-008) - 25 tasks complete
- Archive deployment-config (FN-006) - 27 tasks complete
- All changes moved to openspec/changes/archive/
2026-05-16 11:33:37 +02:00
alex 5a7b026cbc docs(openspec): mark all tasks complete for config-secrets, runfusion-poc, deployment-config
- Mark all 31 config-secrets tasks as complete
- Mark all 25 runfusion-poc tasks as complete
- Mark all 27 deployment-config tasks as complete
- All implementations verified and committed
2026-05-16 11:33:02 +02:00
alex e0f753803c docs(opencode): add OpenCode tool documentation to development guide
- Document manifest configuration and web terminal access
- Add environment variables and workspace mount details
- Include usage instructions and differences from code-server
- Add local testing commands for OpenCode container
2026-05-16 11:28:48 +02:00
alex 51d93d9dc6 feat(FN-009): implement config and secrets management with runtime injection
- Add RuntimeInjectionService for scope-based config/secret resolution
- Mount configs as JSON files at /app/config/ with 0400 permissions
- Inject secrets as environment variables with uppercase keys
- Implement scope hierarchy: instance > project > user > global
- Create ConfigListPage and SecretListPage frontend components
- Mask secret values in API responses (never expose decrypted)
- Validate secrets exist before spawning containers
- Add comprehensive tests for runtime injection service
- Update documentation with config/secrets workflow
2026-05-15 16:44:26 +02:00
alex 78aaddb2b5 docs(openspec): add OpenSpec changes for FN-005, FN-006, FN-008, FN-009, FN-010
CI / Web CI (push) Failing after 12s
CI / API CI (push) Failing after 1m1s
- Add frontend-foundation change (FN-005) with 46 tasks
- Add deployment-config change (FN-006) with 27 tasks
- Add runfusion-poc/opencode-poc change (FN-008) with 25 tasks
- Add config-secrets change (FN-009) with 31 tasks
- Add codeserver-spawn change (FN-010) with 38 tasks
- Include project specsheet and configuration
- Archive completed deployment-config change
2026-05-14 17:35:20 +02:00
alex 1539a67883 docs: update README with OpenCode references and deployment guide
- Replace RunFusion with OpenCode in description
- Add frontend environment variables section
- Add deployment quick start guide
- Update scope boundaries with current task status
2026-05-14 17:32:02 +02:00
alex 85ae390263 chore: add frontend dependencies and update test fixtures
- Add react-router-dom, @tanstack/react-query, zustand, @headlessui/react
- Update pnpm workspace configuration
- Update test fixtures to reference OpenCode instead of RunFusion
- Add frontend environment variable examples
- Update .gitignore for .opencode and .sisyphus directories
2026-05-14 17:30:41 +02:00
alex 62640daf36 docs: update all documentation for OpenCode and deployment
- Update architecture.md with spawn service and auth proxy sections
- Update deployment.md with production stack details
- Update development.md with spawn workflow documentation
- Update mvp-scope.md, project-brief.md, tool-manifest-spec.md
- Update conversation-handoff.md with current status
- Replace all RunFusion references with OpenCode
2026-05-14 17:30:03 +02:00
alex 139654d5c0 feat(FN-006): add production deployment configuration
- Create docker-compose.prod.yml with Traefik, API, web, and DB services
- Add Portainer stack deployment files
- Configure Let's Encrypt TLS and health checks
- Add deployment environment variable examples
- Update portainer.env.example with additional config vars
2026-05-14 17:28:56 +02:00