internal/

directory
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
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.
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.
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).
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.
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.
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.
Package config holds agent configuration from flags and FALAK_* environment variables.
Package config holds agent configuration from flags and FALAK_* environment variables.
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)").
Package cron is falak-agent's built-in scheduler (replaces crontab juggling).
Package cron is falak-agent's built-in scheduler (replaces crontab juggling).
Package db implements the db.* commands.
Package db implements the db.* commands.
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).
Package deploy implements the native release lifecycle:
Package deploy implements the native release lifecycle:
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).
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.
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.
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.
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).
Package facts collects host facts (contracts/agent-protocol/facts.schema.json).
Package facts collects host facts (contracts/agent-protocol/facts.schema.json).
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).
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).
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 ...
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.
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).
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).
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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`).
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).
runnertest
Package runnertest provides a scriptable fake Runner.
Package runnertest provides a scriptable fake Runner.
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.
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.
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).
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").
Package supervisor is falak-agent's built-in process supervisor (replaces supervisord).
Package supervisor is falak-agent's built-in process supervisor (replaces supervisord).
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/.
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.
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.
Package version holds the build version, injected via -ldflags.
Package version holds the build version, injected via -ldflags.
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