No description
  • Rust 82%
  • TypeScript 7.3%
  • Astro 7%
  • CSS 1.3%
  • JavaScript 1.1%
  • Other 1.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Laurent Evrard c6453f28f0
Some checks failed
CI / mutation gate (diff) (push) Has been skipped
CI / mutation gate (full, shard 0/) (push) Has been skipped
CI / mutation gate (full, shard 1/) (push) Has been skipped
CI / mutation gate (full, shard 2/) (push) Has been skipped
CI / mutation gate (full, shard 3/) (push) Has been skipped
CI / mutation gate (full, shard 4/) (push) Has been skipped
CI / mutation gate (full, shard 5/) (push) Has been skipped
CI / mutation gate (full, shard 6/) (push) Has been skipped
CI / mutation gate (full, shard 7/) (push) Has been skipped
CI / format, lint, test, dependencies (push) Failing after 9m5s
Release / build and publish (push) Failing after 17m6s
chore(release): v0.8.1
2026-12-03 08:39:46 +01:00
.cargo feat: manage Docker containers over the daemon socket 2026-11-10 13:52:06 +01:00
.github/workflows build(client): cross-compile the macOS client from Linux 2026-11-13 14:44:15 +01:00
crates feat(packagekit): allow upgrading a single package by name 2026-12-03 08:39:21 +01:00
docs docs: document reboot and reload signalling 2026-11-18 16:04:54 +01:00
fuzz chore(release): v0.8.1 2026-12-03 08:39:46 +01:00
packaging feat: add host metrics and path metadata tools 2026-11-14 14:09:14 +01:00
scripts build(client): cross-compile the macOS client from Linux 2026-11-13 14:44:15 +01:00
website feat(packagekit): allow upgrading a single package by name 2026-12-03 08:39:21 +01:00
.gitignore docs: document the package surface, dependencies and release; bump to 0.3.0 2026-11-09 07:30:35 +01:00
.tool-versions feat: gilfoyle MCP server skeleton with get_uptime 2026-10-27 09:10:37 +01:00
AGENTS.md feat(client): reach nodes through a jump host 2026-11-18 09:26:36 +01:00
Cargo.lock chore(release): v0.8.1 2026-12-03 08:39:46 +01:00
Cargo.toml chore(release): v0.8.1 2026-12-03 08:39:46 +01:00
clippy.toml feat: gilfoyle MCP server skeleton with get_uptime 2026-10-27 09:10:37 +01:00
deny.toml fix(ci): ignore the chrono unmaintained advisory 2026-11-18 10:07:14 +01:00
GLOSSARY.md docs: document reboot and reload signalling 2026-11-18 16:04:54 +01:00
Makefile feat: report pending reboot and per-unit daemon reload 2026-11-18 16:04:54 +01:00
README.md feat(packagekit): allow upgrading a single package by name 2026-12-03 08:39:21 +01:00

Gilfoyle

CI

A secure MCP server, written in Rust, that exposes Linux administration tools to an AI agent over SSH: reads are open when they are bounded, named and non-disclosing (a read over an unbounded namespace, a path, is allowlisted), and the only mutations are starting and stopping allowlisted systemd units and Docker containers, and refreshing or upgrading allowlisted packages.

Gilfoyle is built so that it cannot execute anything. There is no shell, no command passthrough and no scripting: every tool is a compiled function with fixed behaviour, and the only host interaction in the whole codebase is reading a few fixed files under /proc (uptime, loadavg, meminfo, mounts), the mount table, /etc/os-release and the reboot-required markers under /run, one read-only statvfs syscall over the configured mounts, and the metadata of the paths the operator declared (never their contents).

SSH is used purely as a protocol: the server serves an MCP subsystem and refuses every shell, exec, pty and forwarding request. A connection can never obtain a shell.

Status: early. Tools so far: get_uptime, get_load_and_memory, get_disk_usage, get_reboot_status, path_status; systemd units (list_units, unit_status, start_unit, stop_unit); Docker containers (list_containers, container_status, start_container, stop_container, restart_container); packages (list_packages, list_updates, preview_upgrade, refresh_package_cache, upgrade_packages).

Two roles

  • Node — the Gilfoyle process on one host. It serves that host over SSH and exposes the compiled tools.
  • Client — an aggregator that connects to several nodes and presents one MCP surface (over stdio) to the AI agent. Every tool takes a node argument; all fans a read out to every node. The client adds a list_nodes tool.
AI agent ──MCP(stdio)──▶ gilfoyle client ──SSH──▶ gilfoyle node @ host A
                        (aggregator)     ──SSH──▶ gilfoyle node @ host B

Why it is safe by construction

  • The domain core performs no I/O and has no access to the network, the filesystem or the process table.
  • SSH is a protocol, not a shell: the server accepts only the gilfoyle-mcp subsystem and refuses shell, exec, pty and every forwarding request, in code.
  • unsafe is forbidden workspace-wide in our crates, and clippy::disallowed_methods makes any reference to std::process::Command a compile error.
  • systemd and PackageKit are reached over in-process D-Bus, never by spawning systemctl or apt; Docker is reached over its UNIX socket, never by spawning docker; disk usage is read with the read-only statvfs syscall, and reboot state from fixed markers under /run.
  • Reads are open when they are bounded, named and non-disclosing, and allowlisted otherwise: a path is an unbounded namespace, so path_status acts only on paths listed in [paths] allow (empty by default) and returns metadata, never contents (see docs/adr/0012).
  • Authentication is public key only (none, password and keyboard-interactive are refused). Each key may carry a tool grant; a read-only key cannot reach a mutation.
  • Mutations are default-deny: start_unit and stop_unit act only on units listed in [systemd] manage_units, start_container/stop_container/restart_container act only on containers listed in [docker] manage_containers, refresh_package_cache and upgrade_packages act only on the operations listed in [packagekit] allow, and polkit is the authority behind systemd and PackageKit.
  • No install, no remove, by construction: the package operation vocabulary is a closed enum with no install/remove variant, and an upgrade that would install or remove a package is refused. Docker has no create or remove operation for the same reason.
  • Configuration is fail-closed: no bind, no key or no host key means no start.
  • The client pins each node's host-key fingerprint; a mismatch fails the connection.

Architecture

Hexagonal (ports and adapters). Dependencies point inward, enforced by the Cargo dependency graph.

Crate Role I/O
gilfoyle-core domain types, ports, use cases none
gilfoyle-system driven adapter (host uptime) read-only
gilfoyle-host driven adapter (load, memory, disk usage, reboot) read-only
gilfoyle-path driven adapter (path metadata) read-only
gilfoyle-systemd driven adapter (systemd over D-Bus) system bus
gilfoyle-packagekit driven adapter (PackageKit over D-Bus) system bus
gilfoyle-docker driven adapter (Docker over its UNIX socket) socket
gilfoyle-ssh driving adapter: embedded SSH server (russh) + auth/channel policy network
gilfoyle-client driving adapter: multi-node aggregator network
gilfoyle-server MCP handler, config, wiring + the gilfoyle binary network

Requirements

Build.

  • Rust 1.89 or newer (the pinned toolchain in .tool-versions is a recent nightly).
  • A C toolchain: the SSH crypto backend is ring, so the build is not pure Rust and releases are dynamically linked (the old static-musl artifact is gone).

Run (node).

  • A Linux host with systemd and an accessible system D-Bus (needed by the unit tools).
  • /proc/uptime, /proc/loadavg, /proc/meminfo and /proc/mounts for the host tools.
  • /etc/os-release and the /run/reboot-required markers for get_reboot_status.
  • polkit (polkitd) — only to authorise start_unit/stop_unit. Reads need none.
  • PackageKit and a backend (APT on Debian/Ubuntu, DNF on Rocky) — only for the package tools. It is not installed by default on a minimal host; when absent the package tools report a clear error. A backend package such as packagekit (plus apt/dnf) must be present and packagekitd reachable on the system bus.
  • Docker — only for the container tools. When absent, or when the socket is not reachable, the container tools report a clear error; the server still starts. Access to /var/run/docker.sock is equivalent to root, so grant it narrowly (see Authorising Docker access).
  • The system bus, polkit, PackageKit and the Docker socket are reached over AF_UNIX; the hardened unit already allows it.

Run (client).

  • Nothing beyond the gilfoyle binary: the client speaks SSH with its own pinned host-key fingerprints. A C crypto backend (ring) is linked in.
  • The client runs on macOS (Apple Silicon and Intel) as well as Linux; the node is Linux-only. Releases ship the macOS client cross-compiled from Linux — no Apple SDK is needed — see Releases and docs/INSTALL.md.

Quickstart (node)

make build                                  # debug build of the workspace

# Installing on a host, generating the host key and authorising clients is documented
# step by step in docs/INSTALL.md. In short, after install:
#   sudo gilfoyle ssh keygen --path /etc/gilfoyle/ssh_host_ed25519_key
# prints the SHA256 fingerprint that clients pin; client public keys go in [[keys]].

Node configuration (/etc/gilfoyle/config.toml)

Configuration is a TOML file (default /etc/gilfoyle/config.toml, override with --config). Environment variables override file values.

bind = "10.0.0.5:2222"                    # mandatory, address AND port
host_key = "/etc/gilfoyle/ssh_host_ed25519_key"
max_connections = 32
max_channels_per_connection = 8
log_level = "info"                        # tracing filter, JSON logs on stderr

[tools]
enabled = [
  "get_uptime",
  "get_load_and_memory", "get_disk_usage", "get_reboot_status", "path_status",
  "list_units", "unit_status", "start_unit", "stop_unit",
  "list_packages", "list_updates", "preview_upgrade",
  "refresh_package_cache", "upgrade_packages",
  "list_containers", "container_status", "start_container", "stop_container", "restart_container",
]

[systemd]
# Units that may be started or stopped. Empty (the default) means none may.
manage_units = ["nginx.service", "myapp.service"]

[host]
# Mount points whose disk usage is reported (default ["/"]). Only a UNIX
# filesystem reached by the read-only statvfs syscall is probed; a path that is
# not currently mounted is reported as not mounted, never as the parent's usage.
disks = ["/", "/var"]

[paths]
# Paths whose metadata may be read. Empty (the default) means none may. An entry
# is an absolute path (exact match) or a `re:` regular expression anchored to the
# whole path. Only metadata is returned, never the contents. The shipped unit
# sets ProtectHome=yes, so a path under /home or /root cannot be read.
allow = ["/var/lib/myapp/last-run", "re:^/var/backups/[^/]+\\.dump$"]

[packagekit]
# Mutating package operations that may be performed. Empty (the default) means
# none may. There is deliberately no "install" or "remove": gilfoyle never
# installs or removes a package.
allow = ["refresh", "upgrade"]
# An upgrade is refused when its plan would install, remove, obsolete or
# downgrade a package. Set this to true to permit such transitive changes.
allow_transitive_changes = false
# Timeout for a whole package transaction, in seconds (default 600).
poll_timeout_seconds = 600
# Maximum number of package entries returned in a report (default 200).
default_limit = 200

[docker]
# Path to the Docker daemon socket (default /var/run/docker.sock). Only a UNIX
# socket path is accepted; a TCP endpoint is refused.
endpoint = "/var/run/docker.sock"
# Containers that may be started, stopped or restarted. Empty (the default)
# means none may. An entry is an exact name, or a `re:` regular expression
# anchored to the whole name.
manage_containers = ["web", "re:^worker-[0-9]+$"]
# Timeout for a single API call, in seconds (default 10).
call_timeout_seconds = 10
# Timeout passed to Docker for a stop, in seconds (default 30).
stop_timeout_seconds = 30
# Maximum number of containers returned by a listing (default 100).
default_limit = 100

[[keys]]
id = "nestor"
public_key = "ssh-ed25519 AAAA..."
# tools omitted → inherits [tools] enabled; present → narrows it (intersection)

Authentication and tool grants

Each [[keys]] entry is a client public key. The key's id is the principal used in logs. The accepted algorithms are ed25519, ecdsa-sha2 and rsa-sha2; ssh-rsa (SHA-1) is refused. A key with a tools list may call only the intersection of that list and [tools] enabled; an unknown tool name fails the configuration. A key without tools inherits the global set. Rotating or revoking a key requires a restart.

Environment overrides

Variable Effect
GILFOYLE_BIND overrides bind
GILFOYLE_HOST_KEY overrides host_key
GILFOYLE_LOG overrides log_level

Client configuration

A suggested path is ~/.config/gilfoyle/client.toml; pass it to the client with gilfoyle client --config <path> (or GILFOYLE_CLIENT_CONFIG).

pool_size = 4

[[jumps]]
name = "bastion"                          # optional: reach nodes through a jump host
host = "bastion.example.com"
port = 22
user = "laurent"
key = "~/.ssh/gilfoyle_bastion"           # unencrypted private key, mode 0600
host_key_fingerprint = "SHA256:..."       # from the jump host

[[nodes]]
label = "web1"
host = "10.0.0.5"                         # reached from the jump host, when one is set
port = 2222
key = "~/.ssh/gilfoyle_web1"              # unencrypted private key, mode 0600
host_key_fingerprint = "SHA256:..."       # from `gilfoyle ssh keygen`
jump = "bastion"                          # optional; omit for a direct connection

A node that is not directly reachable can be reached through a jump host: the client connects to it, opens an SSH direct-tcpip channel to the node, and runs the node's session over it (ADR 0013). The jump host must be an OpenSSH sshd with AllowTcpForwarding; a gilfoyle node is not a jump host, because it refuses every forwarding request. The jump host only relays bytes — the session to the node stays end-to-end encrypted and its fingerprint is still pinned.

Run the client with gilfoyle client --config <path> (or GILFOYLE_CLIENT_CONFIG). It serves MCP on stdio, holds pool_size sessions per node, marks unreachable nodes, and retries reads (never mutations) across reconnections. A node that is down at startup stays visible in list_nodes and errors on call.

Tools

get_uptime

Returns the uptime of the host machine (from /proc/uptime, i.e. since kernel boot). Takes no arguments.

{ "uptime_seconds": 1048545.67, "uptime_human": "12d 3h 15m 45s" }

get_load_and_memory

Reads the load average (/proc/loadavg) and memory usage (/proc/meminfo). Takes no arguments. Read-only and open.

{
  "load": { "one": 0.42, "five": 0.35, "fifteen": 0.30, "runnable": 1, "total": 312 },
  "memory": { "total_kib": 8174832, "available_kib": 4120000, "used_kib": 4054832,
              "swap_total_kib": 0, "swap_free_kib": 0, "used_percent": 49.6 }
}

get_disk_usage

Reports the usage of the mount points in [host] disks (default ["/"]), read with the read-only statvfs syscall. Takes no arguments. Read-only and open.

A path that is not currently in /proc/mounts is reported as mounted: false with an error, and never measured (a statvfs on an unmounted mount point would return the parent filesystem's numbers). Network filesystems are reported as unsupported rather than probed, because a statvfs on a stale network mount can block.

{ "filesystems": [ { "mount": "/", "device": "/dev/vda1", "fstype": "ext4",
                     "mounted": true, "total_bytes": 42000000000,
                     "used_bytes": 31000000000, "free_bytes": 11000000000,
                     "used_percent": 73.8, "inodes_total": 2621440,
                     "inodes_free": 900000, "inodes_used_percent": 65.7, "error": null } ] }

get_reboot_status

Reports whether the host needs a reboot. On Debian/Ubuntu hosts the verdict comes from the /run/reboot-required marker and the packages that asked for it are listed. Takes no arguments. Read-only and open.

{ "required": true, "packages": ["linux-image-amd64", "libc6"], "origin": "debian" }
{ "required": null, "packages": [], "origin": "unsupported" }

On a Debian-family host without the marker, required is false and packages is empty. On any other distribution gilfoyle has no in-process mechanism, so required is null and origin is "unsupported" — unknown is never reported as false (see docs/adr/0014).

path_status

Returns the metadata of one path (never the contents) — for example to check that a job wrote its marker file. The path must be listed in [paths] allow (empty by default): a path is an unbounded namespace, so unlike the other reads this one is allowlisted. The final path component is not followed (lstat), and the tool never lists a directory.

{ "path": "/var/lib/myapp/last-run", "exists": true, "kind": "file",
  "size_bytes": 42, "age_seconds": 3120, "modified": "2026-11-14T02:00:00Z",
  "accessed": "2026-11-14T02:00:00Z", "changed": "2026-11-14T02:00:00Z",
  "mode": "0644", "uid": 998, "gid": 998, "symlink_target": null }

systemd tools

systemd is reached over in-process D-Bus (org.freedesktop.systemd1); gilfoyle never spawns systemctl.

Tool Arguments Effect
list_units active_state?, name_contains?, unit_type?, limit? list units (read-only)
unit_status name detailed status of one unit (read-only)
start_unit name start a managed unit
stop_unit name stop a managed unit

Unit names may be given short (nginx) or fully qualified (nginx.service). start_unit and stop_unit wait for the systemd job to finish and report its result. unit_status also reports need_daemon_reload: whether the unit's on-disk definition changed since systemd last loaded it, so a reload would pick up the new configuration.

Mutations are default-deny: they act only on units listed in [systemd] manage_units, and polkit is the authority behind them. Reads may target any unit.

Package tools

Packages are managed through PackageKit over the system D-Bus (org.freedesktop.PackageKit), in-process and without spawning anything. That makes the same frontend work on APT (Debian) and DNF (Rocky). Gilfoyle never installs or removes a package: the operation vocabulary is closed in code, and apt upgrade is expressed as an update of existing packages only.

Tool Arguments Effect
list_packages name_contains?, limit? list installed packages and versions (read-only)
list_updates min_severity?, limit? list available updates (read-only)
preview_upgrade package? simulate an upgrade and report what it would do (read-only)
refresh_package_cache force? (default true) refresh the metadata cache, i.e. apt update
upgrade_packages package? apply available upgrades, i.e. apt upgrade

Reads (list_packages, list_updates, preview_upgrade) are open. The two mutations are default-deny: they act only when [packagekit] allow names them, and polkit is the authority behind them.

preview_upgrade and upgrade_packages take an optional package: an exact package name restricts the upgrade to that one package, and a name with no available update changes nothing. preview_upgrade and the gate inside upgrade_packages use PackageKit's SIMULATE flag, which PackageKit authorises without polkit and which never changes anything. If the plan would install, remove, obsolete or downgrade a package, upgrade_packages refuses unless allow_transitive_changes = true. Untrusted packages (missing signature, required signing key, EULA) are always refused: gilfoyle never answers InstallSignature or AcceptEula.

Docker tools

Docker is reached over its UNIX socket with an in-process HTTP client; gilfoyle never spawns docker. The API version is negotiated via GET /version and pinned. There is deliberately no create and no remove: the operation set is list, inspect, start, stop and restart.

Tool Arguments Effect
list_containers state?, name_contains?, limit? list containers (read-only)
container_status container detailed status of one container (read-only)
start_container container start a managed container
stop_container container stop a managed container
restart_container container restart a managed container

container is a container name or id. Reads are open. The three mutations are default-deny: they act only on containers whose name matches [docker] manage_containers, and the action is performed on the resolved container id (so a rename between the check and the action cannot target another container).

Through the client

The client adds a required node argument to every tool (a label, or all for the read tools get_uptime, get_load_and_memory, get_disk_usage, get_reboot_status, path_status, list_units, unit_status, list_packages, list_updates, preview_upgrade, list_containers and container_status). all returns a per-node map, with a per-node error for any node that failed. A list_nodes tool reports each node's label, reachability and exposed tools.

Authorising unit control (polkit)

start_unit and stop_unit require the org.freedesktop.systemd1.manage-units authorisation. Gilfoyle runs unprivileged and never escalates, so polkit must be installed and running for these two tools to work — without it systemd refuses the call.

# Debian/Ubuntu; on other distributions use the equivalent polkit daemon package.
sudo apt-get install -y polkitd

# Install the rule generated from your configuration.
gilfoyle systemd polkit-rule | sudo tee /etc/polkit-1/rules.d/49-gilfoyle-units.rules > /dev/null

The rule grants the gilfoyle user the right to start and stop only the units in [systemd] manage_units. Re-run the command whenever that list changes; gilfoyle warns at startup when the installed rule is missing or out of sync.

Authorising package operations (polkit)

refresh_package_cache needs org.freedesktop.packagekit.system-sources-refresh and upgrade_packages needs org.freedesktop.packagekit.system-update. PackageKit asks polkit for these, but the stock defaults require an interactive administrative authentication, which a headless system service cannot satisfy, so the operator installs a generated rule:

gilfoyle packagekit polkit-rule | sudo tee /etc/polkit-1/rules.d/49-gilfoyle-packagekit.rules > /dev/null

The rule grants the gilfoyle user only the actions named in [packagekit] allow, and explicitly refuses installing, reinstalling, downgrading, removing packages, trusting signing keys and upgrading the whole distribution. Gilfoyle warns at startup when the installed rule is missing or out of sync. PackageKit only exists on hosts that ship it (and its backend); on a minimal host the package tools report a clear "PackageKit is unavailable" error.

Authorising Docker access

Docker has no polkit. Access to /var/run/docker.sock is equivalent to root — a --privileged container can mount the host — so how the socket is granted is a security decision. Gilfoyle narrows the tool surface ([docker] manage_containers is default-deny), but the socket is the real boundary.

The recommended deployment puts a socket proxy in front of the daemon, exposing only the endpoints gilfoyle uses (containers/json, containers/{id}/json, containers/{id}/start|stop|restart), and points [docker] endpoint at the proxy's socket. The simple alternative — adding the gilfoyle user to the docker group — hands gilfoyle full control of the daemon; prefer the proxy, and keep [docker] manage_containers as narrow as possible in either case.

The systemd unit already reaches AF_UNIX, and ProtectSystem=strict does not impede connecting to an existing socket (the system bus is reached the same way), so no extra hardening directive is needed.

Threat model (summary)

In scope. An attacker who reaches the SSH port, or who compromises the gilfoyle process, must not gain code execution or host privileges.

  • No code execution. Tools are compiled functions; nothing accepts a command, a script or a path to run. The SSH handler refuses shell/exec/pty and all forwarding. systemd and PackageKit are reached over in-process D-Bus, Docker over its UNIX socket, and disk usage through the read-only statvfs syscall, never by spawning systemctl, apt or docker.
  • No unbounded read. A read that names an arbitrary path would be a metadata oracle over the whole filesystem. path_status therefore acts only on paths listed in [paths] allow, returns metadata and never contents, does not follow the final path component, and reports a real error (not "absent") on anything but ENOENT. The other reads are open because they touch a fixed, well-known set of files — /proc, /etc/os-release and the reboot markers under /run — and return no file contents.
  • No install, no remove, by construction. The package operation vocabulary is a closed enum with no install/remove variant; upgrades carry ONLY_TRUSTED, and a plan that would install or remove a package is refused. Docker has no create or remove operation at all.
  • Least privilege. Run as an unprivileged dedicated user (see the systemd unit); systemd and package mutations are enforced twice (the tool's allowlist and the polkit rule). Docker has no polkit: its socket is root-equivalent, so grant it narrowly (a socket proxy) and keep [docker] manage_containers tight.
  • Auth. Public keys only, mapped to a principal; per-key tool grants limit what a key can reach. The client pins host-key fingerprints, so SSH is not open to MITM.
  • Jump hosts relay, they do not terminate. A node reached through a [[jumps]] entry is reached over an SSH direct-tcpip channel the client opens on the jump host, whose fingerprint the client also pins. The session to the node stays end-to-end encrypted and its per-key grants still apply; a compromised jump host can refuse service, not read or forge the session (ADR 0013).
  • Fail-closed. No bind, no key or no host key means no start; no allowed package operation means no refresh or upgrade.

Out of scope for now. Rate limiting is left to the firewall and systemd; key rotation requires a restart; OpenSSH certificates are not supported. The SSH transport adds a pre-authentication parser surface and a C crypto backend (ring) — a deliberate trade. path_status discloses metadata (existence, size, owner, times) for the declared paths, a deliberate trade that keeps [paths] allow empty by default; keep it narrow. get_reboot_status discloses the distribution identity and the reboot state of the host, which is the point of the tool; on non-Debian hosts it reports null rather than guessing.

Quality

make fmt-check   # formatting
make lint        # clippy -D warnings
make test        # unit + integration tests
make mutants     # cargo-mutants; the score must be 100%
make fuzz        # cargo-fuzz targets on nightly with ASan
make check       # all of the above except fuzzing
make install-hooks

The mutation score is held at 100%. Excluded: the composition root (main.rs) and the thin russh/rmcp/hyper transport glue (gilfoyle-ssh's adapter and hostkey, gilfoyle-client's session wiring, the server's serve.rs, gilfoyle-docker's transport.rs); their decisions live in pure, fully-tested modules. The systemd and PackageKit adapters are tested against in-process mock buses (peer-to-peer socket pairs) and the Docker adapter against an in-process mock HTTP server on a UNIX socket, so no daemon or package manager is needed.

make check runs the whole-workspace mutation gate, serial and in place. It is slow, and CI runs it in full only on a weekly schedule, so run make check locally before pushing — a test gap elsewhere in the workspace will not be caught by the faster per-PR gate (see Continuous integration).

Installing on a host

The full procedure — a fresh install, the migration from the old HTTP build, and a copy-paste prompt for an agent — lives in docs/INSTALL.md. The short version:

cargo build --release -p gilfoyle-server --bin gilfoyle

sudo useradd --system --user-group --no-create-home --shell /usr/sbin/nologin gilfoyle
sudo install -o root -g root -m 0755 target/release/gilfoyle /usr/local/bin/gilfoyle
sudo install -d -o root -g gilfoyle -m 0750 /etc/gilfoyle
sudo /usr/local/bin/gilfoyle ssh keygen --path /etc/gilfoyle/ssh_host_ed25519_key
sudo chown gilfoyle:gilfoyle /etc/gilfoyle/ssh_host_ed25519_key   # the service reads it
# write /etc/gilfoyle/config.toml (0640 root:gilfoyle) — see Node configuration above
sudo install -o root -g root -m 0644 packaging/gilfoyle.service /etc/systemd/system/gilfoyle.service
sudo systemctl daemon-reload && sudo systemctl enable --now gilfoyle
gilfoyle systemd polkit-rule | sudo tee /etc/polkit-1/rules.d/49-gilfoyle-units.rules > /dev/null
# optional: packages, if [packagekit] allow is set and packagekit is installed
gilfoyle packagekit polkit-rule | sudo tee /etc/polkit-1/rules.d/49-gilfoyle-packagekit.rules > /dev/null
# optional: containers, if [docker] manage_containers is set; grant socket access narrowly
# (a socket proxy, not the docker group) — see "Authorising Docker access"

packaging/gilfoyle.service is a hardened unit (dedicated gilfoyle user, NoNewPrivileges, ProtectSystem=strict, empty capability set, SystemCallFilter). The system bus is reached over AF_UNIX, which the unit already allows.

Releases

Tagged releases ship a dynamically linked GNU binary, a checksum and the deployment files:

https://github.com/lauevrar77/gilfoyle/releases

Build a release artifact with:

make package-release            # writes dist/gilfoyle-<version>-x86_64-unknown-linux-gnu.tar.gz

The tarball holds the gilfoyle binary, gilfoyle.service, the example polkit rules (units and packages), README.md, INSTALL.md, and the compiled website under website/. The release script builds the site (npm ci && npm run build in website/) and fails if it cannot — a release always ships the site. Pushing a tag (git tag vX.Y.Z && git push origin vX.Y.Z) runs the release workflow, which builds the binary and the site, checks that the tag matches the Cargo.toml version, and publishes the .tar.gz and its .sha256 as release assets. The client uses the same binary (gilfoyle client).

Releases also ship the client for macOS, cross-compiled on the Linux runner with zig (one tarball per architecture, no Apple SDK needed):

make client-macos-setup         # once: zig, cargo-zigbuild, the Rust Apple targets
make package-client-macos       # dist/gilfoyle-<version>-{aarch64,x86_64}-apple-darwin.tar.gz

Continuous integration

GitHub Actions (.github/workflows/):

  • ci.yml — on every push and pull request, the check job runs cargo fmt --check, clippy -D warnings, cargo test --workspace, cargo deny check and cargo audit. The mutation gate is split out:

    • on a pull request, an incremental gate mutates only the lines the PR changes (cargo mutants --in-diff), which is fast and covers what the author just wrote;
    • on a weekly schedule (and on manual workflow_dispatch), the full gate runs the entire workspace, fanned out over 8 shards (cargo mutants --shard k/8) so it finishes within a job.

    Both gates still require a 100% score. Because the full gate is not run on every push, run make check — which runs the full gate locally — before pushing.

  • release.yml — on a v* tag: builds and packages the release (binary, deployment files and the compiled website) and publishes it with the .sha256 checksum.

Fuzzing is deliberately not in CI (it needs nightly and ASan); run it locally with make fuzz.

License

Licensed under either of Apache-2.0 or MIT, at your option.