Skip to content

Running-app artifacts (systemd + port + reverse_proxy)#54

Open
obaid wants to merge 1 commit into
feature/artifact-static-publishfrom
feature/artifact-apps
Open

Running-app artifacts (systemd + port + reverse_proxy)#54
obaid wants to merge 1 commit into
feature/artifact-static-publishfrom
feature/artifact-apps

Conversation

@obaid

@obaid obaid commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Feature 1, PR 3 of ~5. Stacked on #53. Adds the app artifact type — a long-running process the agent runs, reverse-proxied by Caddy.

Piece Detail
ArtifactAppService Allocates a per-server port (base 7000, clear of the VNC/CDP/websockify ranges), writes a systemd unit (Restart=always) that runs the artifact's start_command from its workspace dir on $PORT, and starts/stops it over the CommandExecutor.
PublishArtifactService For app artifacts: allocate port + deploy the unit before syncing Caddy; unpublish stops + removes the unit.
ArtifactController Accepts type=app with a required start_command.
Caddy Already reverse_proxys app artifacts to their port (added in #53's handleBlock).

Tests

Port allocation (base + increment per server), unit generation (workdir/port/command/restart), deploy + remove over a mocked executor, and the app publish/unpublish orchestration + API (incl. start_command required). Full suite green (761).

Note

The agent's start_command runs as root on the agent's own server — consistent with the existing model where an agent already has full control of its box. Next: 4) gated access · 5) agent publish tool + cleanup.

Extends artifact publishing to type=app — a long-running process the agent
runs, reverse-proxied by Caddy.

- ArtifactAppService: allocates a per-server port (base 7000), writes a
  systemd unit (Restart=always) running the artifact's start_command from its
  workspace dir on $PORT, and starts/stops it over the CommandExecutor.
- PublishArtifactService: for app artifacts, allocates the port + deploys the
  unit before syncing Caddy; unpublish stops + removes the unit.
- ArtifactController: accepts type=app with a required start_command.

Caddy already reverse_proxies app artifacts to their port (from the static PR).
Tests cover port allocation, unit generation, deploy/remove, and the app
publish/unpublish paths. Full suite green (761).
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