Commit Graph

14 Commits

Author SHA1 Message Date
Matt 7b2674debf fix: remove GHA cache (not supported by Gitea Actions)
Build and Push Docker Image / build (push) Successful in 1m3s Details
2025-12-08 12:16:06 +01:00
Matt 9b7ac40ad7 fix: rename secret to REGISTRY_TOKEN
Build and Push Docker Image / build (push) Failing after 30s Details
2025-12-08 12:14:30 +01:00
Matt 9a34834fe4 refactor: use Gitea container registry instead of Docker Hub
Build and Push Docker Image / build (push) Failing after 34s Details
Image will be pushed to: code.letsbe.solutions/letsbe/sysadmin-agent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 12:12:58 +01:00
Matt d17722e362 chore: trigger CI build
Build and Push Docker Image / build (push) Failing after 32s Details
2025-12-08 12:10:15 +01:00
Matt 1df0b7a101 feat: add Gitea Actions workflow for Docker image builds
Automatically builds and pushes to Docker Hub on:
- Push to main/master branch
- Version tags (v*)

Image: letsbesolutions/sysadmin-agent

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 12:08:19 +01:00
Matt 51b3050b5c feat: add secure registration with credential persistence
- Add REGISTRATION_TOKEN config for new secure registration flow
- Add agent_secret and credentials_path config options
- Update HTTP client to use X-Agent-Id/X-Agent-Secret headers
- Add credential persistence to ~/.letsbe-agent/credentials.json
- Load persisted credentials on startup to survive restarts
- Verify credentials via heartbeat before skipping registration
- Maintain backward compatibility with legacy Bearer token auth

The agent now:
1. First tries to load persisted credentials
2. Validates them via heartbeat
3. Falls back to registration if invalid/missing
4. Persists new credentials after successful registration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 11:11:59 +01:00
Matt cea54183cc feat: add tenant_id support to agent registration
- Add tenant_id field to Settings (via TENANT_ID env var)
- Include tenant_id in registration payload when configured
- Add TENANT_ID to docker-compose.yml with documentation
- Add ROADMAP.md tracking project progress

Agents can now be associated with a specific tenant at startup.
Required in production, optional in development.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 20:10:43 +01:00
Matt 47b3422829 Add NEXTCLOUD_SET_DOMAIN executor for domain configuration
Implements a Nextcloud-specific executor that accepts a high-level
public_url payload and runs the appropriate occ config:system:set
commands via docker compose exec. The Orchestrator remains unaware
of container names, occ paths, and docker-compose syntax.

Features:
- Task type: NEXTCLOUD_SET_DOMAIN
- Payload: { "public_url": "https://cloud.example.com" }
- Parses URL into scheme and host, defaults to https if not provided
- Strips trailing slashes from URLs
- Runs three occ commands: overwritehost, overwriteprotocol, overwrite.cli.url
- Returns partial results with failed_args for debugging on failure
- Configurable constants for stack dir, service name, occ path, and user

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 14:01:41 +01:00
Matt e8eae5a8e0 Add ENV_INSPECT and FILE_INSPECT executors with tests
- Add EnvInspectExecutor to read ENV files and return key-value pairs
- Add FileInspectExecutor to read portions of text files (up to 1MB)
- Add FileExecutor tests including /opt/letsbe/config path verification
- Register new executors in EXECUTOR_REGISTRY

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 00:47:08 +01:00
Matt ae78376dfb Download Docker Compose plugin directly from GitHub
docker-compose-plugin isn't in Debian repos, need to download
the binary directly from Docker's GitHub releases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:35:51 +01:00
Matt a16a585f86 Add docker-compose-plugin to Dockerfile
docker-cli alone doesn't include 'docker compose' subcommand.
Need docker-compose-plugin for 'docker compose -f' to work.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:31:47 +01:00
Matt db616aece5 Fix Dockerfile: use docker-cli instead of docker.io
docker.io on Debian Trixie only installs the daemon (dockerd), not the CLI.
The docker CLI is in the separate docker-cli package.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 16:02:50 +01:00
Matt 9385ab09e4 Fix docker volume mounts for host directory access
- Replace named volume (agent_data) with bind mounts for /opt/letsbe/{env,stacks,nginx}
- Update ALLOWED_FILE_ROOT default from /opt/agent_data to /opt/letsbe
- Add startup validation that warns (but doesn't block) if host dirs missing

This fixes ENV_UPDATE writes going to container filesystem instead of host,
and DOCKER_RELOAD failing with "File does not exist" errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 15:20:07 +01:00
Matt b351217509 Initial commit: SysAdmin Agent with executors
- Core agent architecture with task manager and orchestrator client
- Executors: ECHO, SHELL, FILE_WRITE, ENV_UPDATE, DOCKER_RELOAD, COMPOSITE, PLAYWRIGHT
- EnvUpdateExecutor: Secure .env file management with key validation
- DockerExecutor: Docker Compose operations with path security
- CompositeExecutor: Sequential task execution with fail-fast behavior
- Comprehensive unit tests (84 tests)
- Docker deployment configuration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 11:05:54 +01:00