ExecuteR MVP: agent, control plane, WebUI, grouping, deployment #1
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Brings the complete ExecuteR MVP from the design specification into
main: a Windows management agent that enrolls over ordinary HTTPS, establishes scoped NATS messaging over WebSocket through one reverse-proxy edge, publishes live state, accepts durable work, runs PowerShell in-process, and provides a secured interactive terminal — with a browser that updates in real time over NATS, no SignalR/SSE/polling.31 commits, 245 files.
Verification
svelte-checkclean, production build cleanWhat is included
Agent (single self-contained Windows x64 exe / service, .NET 10)
sc.exeBackend (ASP.NET Core, EF Core)
nats-authCLI that generates real Ed25519 operator/account keysWebUI (SvelteKit)
Beyond the original MVP
deploy.sh, Gitea CI publishing to the built-in container registryReviewer notes
mainis currently the initial commit, so this is effectively the whole codebase; reviewing by commit is likely easier than by diff.gitignorecovers.env,secrets/*,*.seed,*.credsdata(variables takevalue), and secret names may not start withGITEA_/GITHUB_maintriggers the release workflow: agent zip, MSI and checksums attached to a Gitea release, and images tagged<version>pluslatestAgent: - ConPTY interop (CreatePseudoConsole + CreateProcess with pseudoconsole attribute); no WinPTY fallback - ConPtySession: pipes, output pump, process watch, resize, clean disposal - ShellManager: single active session per device, base64 output over Core NATS with monotonic sequence, idle (15m) and absolute (60m) timeouts, prefers pwsh 7 then Windows PowerShell - ShellCommandListener: Core NATS subscription gated by AllowRemoteShell policy Backend: - ShellBridge: browser publishes only to browser.<sid>.shell.<shellId>.input; backend validates ownership and republishes to privileged agent command subjects; agent output/state relayed to the owning session only - POST /api/devices/{clientId}/shell: authorize, bind to live browser session, persist metadata only (no transcript), publish open command WebUI: - xterm.js terminal page with fit/resize forwarding, live status, explicit Disconnect, session-scoped input publishing Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>- STACK_NAME/STACKNAME identity; EXTERNAL + INTERNAL bridge networks - Container naming EXECUTER-{NATS,API,WEB}-00001; service-name networking - Uncommon host-published ports (webui 13080, backend 19080, nats-ws 19222); internal NATS TCP stays off the host (loopback only in the dev override) - NATS image pinned to the linux multi-arch index digest (2.12-alpine) - Bind-mount data under ${STACK_BINDMOUNTROOT}/${STACK_NAME}/{Tier}/Data; timezone/localtime mounts; local logging; stop grace; watchtower labels; healthchecks with start_period - .env.example rewritten to spec (header, identity, pinned images, ports, trust, admin, OIDC, NATS seeds, S3 block, watchtower); vite dev proxy defaults updated to new ports Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>- Backend S3PresignService (AWSSDK.S3; AWS S3 / MinIO / path-style) issues short-lived presigned GET URLs; S3 credentials never leave the backend - POST /api/devices/{clientId}/files (Operator): presign object key, record a job, dispatch a durable file-download command; progress/result flow through the normal live job pipeline - Durable command subject agent.*.command.file added to the COMMANDS stream - Agent FileDownloadHandler: streams the presigned URL to the destination path (atomic temp+move), emits byte progress, optional SHA-256 verification, publishes Running/Succeeded/Failed; idempotent by job id - WebUI: device Actions "Send file (S3)" form -> jumps to the live job - S3 config surfaced in .env.example / compose (already added) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>- proxy-headers and websocket snippet contents inlined at server level; the map and limit_req_zone directives moved to the top of the same file with a note that they belong at http{} level - Removed the snippets/ directory and the per-location Upgrade/Connection duplicates now covered by the server-level block - README updated: copy one file, no snippet install step Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>Compose: - Backend and webui now reference ${REGISTRY}/<image>:<tag> (Gitea container registry) with pull_policy: missing, keeping the build section as the fallback path - docker-compose.proxy.yml adds an OPT-IN in-stack nginx (EXECUTER-PROXY-00001) on uncommon host ports with bind-mounted config, certs, logs and ACME webroot scripts/deploy.sh: - Bootstrappable straight from a URL (curl ... | bash) or run from a checkout; fetches only the files it needs when there is no clone - Pulls published images first and builds from source only if the pull fails (--build / --no-pull to force either way) - Creates .env with a generated initial admin password, prepares the bind-mount tree, and generates real NATS operator/account keys by running the backend image's own nats-auth CLI (no dotnet SDK needed on the host) - --with-proxy is opt-in and rewrites the nginx site to reach services by compose service name; --host supplies the public hostname - Waits for backend health and prints the resulting endpoints .env.example: REGISTRY/IMAGE/VERSION/pull-policy, proxy settings, and DEVICE_ORPHAN_AFTER_DAYS. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>- CI now tags images as <gitea-host>/<owner-lowercased>/executer-{backend,webui} so they match exactly what docker-compose.yml pulls; pushes <version> plus latest on main or dev/<version>-dev on dev, and warns (instead of silently skipping) when the registry secret is unset - scripts/Initialize-GiteaSecrets.ps1 creates/updates the Actions secrets and variables over the Gitea REST API: registry host/user/password, GITEA_TOKEN, the NATS account signing seed, initial admin password, OIDC and S3 secrets, plus a REGISTRY variable. Derives owner/repo/URL from the git remote, reads values from .env and secrets/nats, is idempotent, and never prints a secret value Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>Gitea secrets: - The secrets endpoint takes {"data": ...} while variables take {"value": ...}; sending the wrong field returned HTTP 422 for every secret - Gitea also reserves the GITEA_ prefix for Actions secret names (HTTP 400), so the registry credentials are now REGISTRY_HOST / REGISTRY_USERNAME / REGISTRY_PASSWORD, and the instance URL moved to a SERVER_URL variable - No GITEA_TOKEN secret is created: Actions injects one per run. release.yml now uses that built-in token and falls back to github.server_url - Secrets and variables verified seeded on gsadmin/ExecuteR Central configuration: - ProtocolDefaults.DefaultOrphanAfterDays = 30 is the single source of truth; DEVICE_ORPHAN_AFTER_DAYS overrides it and 0 disables orphaning. Previously an unset value silently meant "disabled" - LogDefaults gives each role its own rolling policy: agent rolls at 5 MB keeping 3 files, backend at 10 MB keeping 7. LOG_RETAIN_FILES replaces the misnamed LOG_RETAIN_DAYS (it was always a file count, not days) - Compose and .env.example updated to the new names and defaults Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>