agent

module
v0.0.0-...-903b831 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: Apache-2.0

Directories

Path Synopsis
cmd
falak command
Command falak is the Falak CLI: it talks to the control-plane public REST API with a Sanctum token.
Command falak is the Falak CLI: it talks to the control-plane public REST API with a Sanctum token.
falak-agent command
Command falak-agent is the Falak server daemon.
Command falak-agent is the Falak server daemon.
falak-builder command
Command falak-builder is the Falak build worker (control-plane host or a `builder` server).
Command falak-builder is the Falak build worker (control-plane host or a `builder` server).
falak-db command
Command falak-db is the helper inside every Falak database image (images/db): the container's entrypoint and healthcheck, and what the agent runs with `docker exec` for backups, restores and WAL/binlog spooling.
Command falak-db is the helper inside every Falak database image (images/db): the container's entrypoint and healthcheck, and what the agent runs with `docker exec` for backups, restores and WAL/binlog spooling.
falak-relay command
Command falak-relay is the terminal relay (docs/plans/CONSOLE.md): it pipes terminal sessions' bytes between the agents running them and the browsers or CLIs attached to them, over WebSockets.
Command falak-relay is the terminal relay (docs/plans/CONSOLE.md): it pipes terminal sessions' bytes between the agents running them and the browsers or CLIs attached to them, over WebSockets.
falak-restore command
Command falak-restore decrypts a Falak backup (FKB1, docs/BACKUPS.md) without the control plane: with the backup's data key (exported by an admin, "Export backup key") or, for customer-held keys, the age identity file.
Command falak-restore decrypts a Falak backup (FKB1, docs/BACKUPS.md) without the control plane: with the backup's data key (exported by an admin, "Export backup key") or, for customer-held keys, the age identity file.
internal
agent
Package agent wires every subsystem of falak-agent together: enrollment, transport loops, the command registry with all executors, the supervisor, cron, terminals and the telemetry relay.
Package agent wires every subsystem of falak-agent together: enrollment, transport loops, the command registry with all executors, the supervisor, cron, terminals and the telemetry relay.
backupcrypt
Package backupcrypt is Falak's backup file format, FKB1: the data is compressed with zstd, then encrypted with AES-256-GCM in 64 KiB segments (the STREAM construction), so a backup of any size streams through in constant memory and any change, truncation or reordering is detected.
Package backupcrypt is Falak's backup file format, FKB1: the data is compressed with zstd, then encrypted with AES-256-GCM in 64 KiB segments (the STREAM construction), so a backup of any size streams through in constant memory and any change, truncation or reordering is detected.
builder
Package builder implements falak-builder: clone a repository, build it natively (release tarball) or as an OCI image (BuildKit), and stream progress as agent-protocol events (event.schema.json).
Package builder implements falak-builder: clone a repository, build it natively (release tarball) or as an OCI image (BuildKit), and stream progress as agent-protocol events (event.schema.json).
cgroup
Package cgroup gives services on the host (classic sites, PHP-FPM, workers, daemons) their resource limits: one systemd slice per service, falak-<key>.slice under falak.slice (cgroup v2), with MemoryMax / MemoryHigh / MemoryLow / CPUQuota / TasksMax.
Package cgroup gives services on the host (classic sites, PHP-FPM, workers, daemons) their resource limits: one systemd slice per service, falak-<key>.slice under falak.slice (cgroup v2), with MemoryMax / MemoryHigh / MemoryLow / CPUQuota / TasksMax.
cli
Package cli implements the `falak` command-line client for the control-plane public API.
Package cli implements the `falak` command-line client for the control-plane public API.
cli/api
Package api is the typed client for the Falak control-plane public REST API.
Package api is the typed client for the Falak control-plane public REST API.
commands
Package commands contains the command registry, the Executor interface and the dispatcher that runs envelopes received from the control plane and turns them into protocol events.
Package commands contains the command registry, the Executor interface and the dispatcher that runs envelopes received from the control plane and turns them into protocol events.
config
Package config holds agent configuration from flags and FALAK_* environment variables.
Package config holds agent configuration from flags and FALAK_* environment variables.
configspec
Package configspec is the falak.yaml v1 contract on the Go side: the JSON Schema (an embedded copy of contracts/config/v1.schema.json), the YAML/JSON reading rules the control plane shares, and the environment merge with its reference checks (docs/plans/CONFIG_AS_CODE.md, "Phase 0 contract (fixed)").
Package configspec is the falak.yaml v1 contract on the Go side: the JSON Schema (an embedded copy of contracts/config/v1.schema.json), the YAML/JSON reading rules the control plane shares, and the environment merge with its reference checks (docs/plans/CONFIG_AS_CODE.md, "Phase 0 contract (fixed)").
cron
Package cron is falak-agent's built-in scheduler (replaces crontab juggling).
Package cron is falak-agent's built-in scheduler (replaces crontab juggling).
db
Package db implements the db.* commands.
Package db implements the db.* commands.
dbhelper
Package dbhelper is falak-db, the helper inside every Falak database image (images/db).
Package dbhelper is falak-db, the helper inside every Falak database image (images/db).
deploy
Package deploy implements the native release lifecycle:
Package deploy implements the native release lifecycle:
docker
Package docker talks to the Docker Engine API over its unix socket with plain net/http (no SDK) and implements the docker.* commands plus deploy.container.swap (blue/green behind Caddy).
Package docker talks to the Docker Engine API over its unix socket with plain net/http (no SDK) and implements the docker.* commands plus deploy.container.swap (blue/green behind Caddy).
ebpfobs
Package ebpfobs is the eBPF collector (docs/plans/network/ebpf.md): an opt-in, in-kernel probe counting TCP health (retransmits, resets, connect latency, RTT), DNS queries and run-queue delay into bounded maps, read once per telemetry interval, attributed to workloads like the phase 1 and 4 collectors, and shipped as OTLP metrics.
Package ebpfobs is the eBPF collector (docs/plans/network/ebpf.md): an opt-in, in-kernel probe counting TCP health (retransmits, resets, connect latency, RTT), DNS queries and run-queue delay into bounded maps, read once per telemetry interval, attributed to workloads like the phase 1 and 4 collectors, and shipped as OTLP metrics.
edge
Package edge renders the Falak edge model into Caddy JSON and applies it atomically through the Caddy (or FrankenPHP) admin API.
Package edge renders the Falak edge model into Caddy JSON and applies it atomically through the Caddy (or FrankenPHP) admin API.
enroll
Package enroll implements agent enrollment (one-time token + CSR) and certificate renewal, and persists credentials under the Falak etc dir with 0600 permissions.
Package enroll implements agent enrollment (one-time token + CSR) and certificate renewal, and persists credentials under the Falak etc dir with 0600 permissions.
envlinks
Package envlinks remembers the symlinks that point at secret files on the tmpfs (a site's shared/.env, a compose release's .env), so that after a reboot the agent can tell which sites lost their secrets wherever they live (custom sites roots, compose release directories).
Package envlinks remembers the symlinks that point at secret files on the tmpfs (a site's shared/.env, a compose release's .env), so that after a reboot the agent can tell which sites lost their secrets wherever they live (custom sites roots, compose release directories).
facts
Package facts collects host facts (contracts/agent-protocol/facts.schema.json).
Package facts collects host facts (contracts/agent-protocol/facts.schema.json).
fngateway
Package fngateway is the per-server function gateway (`falak-agent fn-gateway`, falak-fn-gateway.service).
Package fngateway is the per-server function gateway (`falak-agent fn-gateway`, falak-fn-gateway.service).
functions
Package functions implements the fn.* commands: it writes a function release (the code files the control plane sends), installs its dependencies with the runtime image's falak-fn-install in a one-shot container, keeps falak-fn-gateway.service running and registers the release with it (see package fngateway).
Package functions implements the fn.* commands: it writes a function release (the code files the control plane sends), installs its dependencies with the runtime image's falak-fn-install in a one-shot container, keeps falak-fn-gateway.service running and registers the release with it (see package fngateway).
hostfs
Package hostfs gives executors a re-rootable view of the host filesystem so that code writing to /etc, /srv, /opt ...
Package hostfs gives executors a re-rootable view of the host filesystem so that code writing to /etc, /srv, /opt ...
httpstats
Package httpstats aggregates the edge's access records into per-site HTTP metrics (falak.net.http.*, docs/plans/network/http.md): what the HTTP tab charts continuously.
Package httpstats aggregates the edge's access records into per-site HTTP metrics (falak.net.http.*, docs/plans/network/http.md): what the HTTP tab charts continuously.
insights
Package insights implements the Insights tee: it inspects spans relayed by the agent and forwards compact summaries to the control plane (POST /agent/v1/insights, NDJSON) per the telemetry contract: one `exception` line per exception span event and per-minute `aggregate` lines per (site_id, event_type, name).
Package insights implements the Insights tee: it inspects spans relayed by the agent and forwards compact summaries to the control plane (POST /agent/v1/insights, NDJSON) per the telemetry contract: one `exception` line per exception span event and per-minute `aggregate` lines per (site_id, event_type, name).
localedge
Package localedge reads /etc/falak/local-edge.env, which falak-ctl writes on the control-plane machine when it is also a Falak server: the control plane's edge owns ports 80/443 there and passes every host that is not the panel's to this server's edge on a bridge address (TLS untouched, PROXY protocol v2).
Package localedge reads /etc/falak/local-edge.env, which falak-ctl writes on the control-plane machine when it is also a Falak server: the control plane's edge owns ports 80/443 there and passes every host that is not the panel's to this server's edge on a bridge address (TLS untouched, PROXY protocol v2).
logs
Package logs ships log files and Docker container logs into the OTLP relay (replacing promtail/alloy).
Package logs ships log files and Docker container logs into the OTLP relay (replacing promtail/alloy).
metrics
Package metrics reads host metrics from /proc (replacing node_exporter) and converts them to OTLP metrics.
Package metrics reads host metrics from /proc (replacing node_exporter) and converts them to OTLP metrics.
netcfg
Package netcfg implements net.firewall.apply (nftables table inet falak) and net.wireguard.apply.
Package netcfg implements net.firewall.apply (nftables table inet falak) and net.wireguard.apply.
netobs
Package netobs is the agent's network collector (docs/plans/network/connections.md): TCP connections by state and direction, listening sockets with their owner, "talks to" peers with counts and (with conntrack accounting) bytes, long-lived connections, conntrack usage, latency probes and WireGuard peer health, per network namespace (the host and every site / database container), as falak.net.* metrics and a per-minute net.observed report.
Package netobs is the agent's network collector (docs/plans/network/connections.md): TCP connections by state and direction, listening sockets with their owner, "talks to" peers with counts and (with conntrack accounting) bytes, long-lived connections, conntrack usage, latency probes and WireGuard peer health, per network namespace (the host and every site / database container), as falak.net.* metrics and a per-minute net.observed report.
nettool
Package nettool implements net.tool (docs/plans/network/tools.md): ping, traceroute, DNS lookups, an HTTP check and a TCP connection test, run from the host or inside a container's network namespace.
Package nettool implements net.tool (docs/plans/network/tools.md): ping, traceroute, DNS lookups, an HTTP check and a TCP connection test, run from the host or inside a container's network namespace.
obs
Package obs is the tiny internal telemetry interface used by subsystems (supervisor, cron, logs) to emit log records and spans into the OTLP relay without depending on it.
Package obs is the tiny internal telemetry interface used by subsystems (supervisor, cron, logs) to emit log records and spans into the OTLP relay without depending on it.
otlp
Package otlp implements the agent's OTLP relay: an OTLP/HTTP receiver (unix socket + TCP), resource enrichment per the telemetry contract, trace sampling, batching, export over OTLP/HTTP protobuf with retries, and a bounded on-disk buffer used while the exporter is unavailable.
Package otlp implements the agent's OTLP relay: an OTLP/HTTP receiver (unix socket + TCP), resource enrichment per the telemetry contract, trace sampling, batching, export over OTLP/HTTP protobuf with retries, and a bounded on-disk buffer used while the exporter is unavailable.
protect
Package protect implements net.protection.apply (blocked addresses in nftables sets with timeouts, docs/plans/ network/protection.md) and the protection observer: SSH brute-force detection from the auth log with the optional auto-ban, and the firewall's rule and block-set counters.
Package protect implements net.protection.apply (blocked addresses in nftables sets with timeouts, docs/plans/ network/protection.md) and the protection observer: SSH brute-force detection from the auth log with the optional auto-ban, and the firewall's rule and block-set counters.
provision
Package provision implements provision.apply: a declarative host plan converged step by step.
Package provision implements provision.apply: a declarative host plan converged step by step.
provision/inspect
Package inspect implements provision.inspect: a read-only report of the software already on a machine (packages and where they came from, Docker, databases, listening ports, SSH, firewall, swap, runtimes), so the control plane can decide per component whether to install, adopt, complete or block before provision.apply runs.
Package inspect implements provision.inspect: a read-only report of the software already on a machine (packages and where they came from, Docker, databases, listening ports, SSH, firewall, swap, runtimes), so the control plane can decide per component whether to install, adopt, complete or block before provision.apply runs.
pty
Package pty implements web-terminal sessions (terminal.*): a shell in a PTY whose output is streamed as `output` events (data = base64 of raw PTY bytes) on the long-running terminal.open command.
Package pty implements web-terminal sessions (terminal.*): a shell in a PTY whose output is streamed as `output` events (data = base64 of raw PTY bytes) on the long-running terminal.open command.
redact
Package redact masks secret values in everything the agent ships back to the control plane: command output, errors and results, deployment lifecycle events, process logs and build logs.
Package redact masks secret values in everything the agent ships back to the control plane: command output, errors and results, deployment lifecycle events, process logs and build logs.
relay
Package relay is falak-relay: a WebSocket relay that pipes a terminal session's bytes between the agent running it and the browsers or CLIs watching it (docs/plans/CONSOLE.md).
Package relay is falak-relay: a WebSocket relay that pipes a terminal session's bytes between the agent running it and the browsers or CLIs watching it (docs/plans/CONSOLE.md).
resources
Package resources queues what the agent saw happen to services' resources — OOM kills and restarts — until a heartbeat delivers them (heartbeat `service_events`).
Package resources queues what the agent saw happen to services' resources — OOM kills and restarts — until a heartbeat delivers them (heartbeat `service_events`).
runner
Package runner isolates every call to an OS tool (apt-get, systemctl, nft, mysql, ...) behind a small interface so executors are unit-testable with a fake (see runnertest).
Package runner isolates every call to an OS tool (apt-get, systemctl, nft, mysql, ...) behind a small interface so executors are unit-testable with a fake (see runnertest).
runner/runnertest
Package runnertest provides a scriptable fake Runner.
Package runnertest provides a scriptable fake Runner.
runtime
Package runtime implements runtime.* commands: PHP (ondrej PPA, or the distribution's archive where the PPA does not publish the release), php.ini overrides, Node.js from official tarballs, the static FrankenPHP binary (+ falak-edge.service) and PHP-FPM pools.
Package runtime implements runtime.* commands: PHP (ondrej PPA, or the distribution's archive where the PPA does not publish the release), php.ini overrides, Node.js from official tarballs, the static FrankenPHP binary (+ falak-edge.service) and PHP-FPM pools.
sandbox
Package sandbox implements the sandbox.* commands (docs/plans/SANDBOXES.md): disposable machines for untrusted code under gVisor.
Package sandbox implements the sandbox.* commands (docs/plans/SANDBOXES.md): disposable machines for untrusted code under gVisor.
security
Package security implements the server baseline report: security.audit (read-only checks of SSH, updates, the firewall, fail2ban, Docker, files, kernel settings, accounts and time sync; bounded in time, no network) and security.fix / security.undo (an allowlist of hardening fixes compiled into the agent: the control plane only names a fix, it never sends commands).
Package security implements the server baseline report: security.audit (read-only checks of SSH, updates, the firewall, fail2ban, Docker, files, kernel settings, accounts and time sync; bounded in time, no network) and security.fix / security.undo (an allowlist of hardening fixes compiled into the agent: the control plane only names a fix, it never sends commands).
sqlnorm
Package sqlnorm turns SQL text into its shape: literals become `?`, so a slow query or a top statement can be stored and shown without the values it ran with (docs/plans/OBSERVABILITY.md phase 3, "Privacy").
Package sqlnorm turns SQL text into its shape: literals become `?`, so a slow query or a top statement can be stored and shown without the values it ran with (docs/plans/OBSERVABILITY.md phase 3, "Privacy").
supervisor
Package supervisor is falak-agent's built-in process supervisor (replaces supervisord).
Package supervisor is falak-agent's built-in process supervisor (replaces supervisord).
system
Package system implements the system.* commands and exports host helpers (apt, users, downloads) reused by runtime/ and provision/.
Package system implements the system.* commands and exports host helpers (apt, users, downloads) reused by runtime/ and provision/.
telemetry
Package telemetry wires the OTLP relay, Insights tee, host metrics and log shipping together and implements the telemetry.configure command.
Package telemetry wires the OTLP relay, Insights tee, host metrics and log shipping together and implements the telemetry.configure command.
transport
Package transport implements the agent side of the control-plane protocol: mTLS HTTP client, command long-poll, batched NDJSON event posting, heartbeats and insights.
Package transport implements the agent side of the control-plane protocol: mTLS HTTP client, command long-poll, batched NDJSON event posting, heartbeats and insights.
version
Package version holds the build version, injected via -ldflags.
Package version holds the build version, injected via -ldflags.
volumes
Package volumes implements the volume.* commands: Docker named volumes, sized volumes (an ext4 image file loop-mounted by a systemd mount unit, which gives a hard size limit that grows online), bind paths from an allowlist and classic sites' shared paths.
Package volumes implements the volume.* commands: Docker named volumes, sized volumes (an ext4 image file loop-mounted by a systemd mount unit, which gives a hard size limit that grows online), bind paths from an allowlist and classic sites' shared paths.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL