TermFDocs

DocsFeatures

Servers, databases and logs

The Ops view gives you, and one approval at a time the agents, access to the project's servers, databases and logs, with secrets masked in everything that comes back.

Connections and recipes

You declare connections (SSH, Postgres, MySQL, Redis, Kubernetes, CloudWatch, Google Cloud Logging, Loki, Datadog) and run recipes on them: tail the logs, list the pods, run a read-only command. An agent can ask to run a recipe too, and every request shows you the exact command, the target and the environment before it runs.

Ops: the project's connections, a production SSH server with its checks, and the recipes that run on it
A connection, tested, with its recipes. Sample data.

Add a connection

  1. In Ops, add a connection: its kind, its environment (dev, staging, prod) and its secrets, by name, from the vault.
  2. Test it: the tool, the secrets, the tunnel. A database warns you when its user can write.
  3. Run a recipe with its form. The exact command shows as you type, and the result comes back masked.
  4. When an agent asks, an approval card shows the command, the target and the environment, with a countdown. A prod target asks your master password.

The connections, by machine

Connections is a tree built from the links you already set: a database or a Redis sits under the SSH server it goes through, and a server under its bastion. Machines come first. Above the tree, pick an environment (All, dev, staging, prod): a machine of another environment that a connection goes through stays in grey, to keep the path.

The tabs of Ops are Connections, SQL, Redis, Forge, History and Recipes.

Defaults

  • A connection is invisible to agents until you allow it, masked or in full.
  • Your system's own clients run it (ssh, psql, mysql, kubectl…). Keys are never read and secrets never go on the command line.
  • Databases open read-only when the recipe reads. The output is masked (vault values, tokens, emails, phone numbers) and each run is logged.
  • After a prod recipe, the session needs your OK to reach the web or other tools.

Settings

  • Connections live in the project's file, as [[ops.connections]].
  • The project's own recipes sit next to the shipped ones: logs, Kubernetes pods and logs, a read-only SSH command, a service restart, a server's health, Nginx, Laravel and Redis.
# connections
termf ops connections | test

# recipes, from a terminal
termf ops recipes | run <recipe>

Servers, Redis and Forge

An SSH connection also shows panels that read the server for you, and a few changes that wait for your confirmation:

  • Server health: CPU, memory, disks, services, ports and SSL certificates;
  • Nginx: whether it runs, nginx -t, its sites, its logs live, a safe reload;
  • Laravel: php artisan about, the scheduler, Horizon, failed jobs, laravel.log live.

The Redis tab browses a Redis like a database, read-only until you allow changes. The Forge tab imports a Laravel Forge account's servers and sites, and redeploys them.

From ⌘I, the DevOps engineer can add, change, test or delete a connection and do these changes too, each through its card. See Agents that act for you.

The database studio

The SQL tab of Ops is a database studio for the project's Postgres, MySQL, MariaDB, SQLite and ClickHouse databases, always read-only: the schema and its diagram, an editor that completes names, charts of a result, the DBA, saved queries and exports. See Database studio.

Live logs and the production .env

The logs-follow recipe follows a log as it is written, masked line by line. The env-fetch recipe reads a server's .env and shows its keys, values hidden, so you can find the variable that differs between production and your machine.

Follow a log

  1. In Ops › Recipes, open logs-follow, pick the connection and its settings, then Follow. Following a log file from a server's panel opens it too.
  2. Filter by text or by level, pause, clear, stop.

Logs come from journalctl or a file over SSH, Kubernetes, CloudWatch and Loki. The last 5,000 lines stay on screen, and the stream keeps going from one tab to another.

Compare a server's .env

  1. In Ops › Recipes, run env-fetch on an SSH connection: you get the keys of the server's .env, values masked.
  2. Compare it with a repository of the project: which keys differ, which are only local.
  3. Reveal a value for 30 seconds, copy it, or write it into the .env of a run's worktree.

A value written into a worktree goes to a file git ignores; it is refused if git tracks it. Every reveal, copy and write is logged. Agents never follow a log, and never get a value of the .env: only its keys.

Your own recipes can do the same with follow = true or env = true.

# the keys of a server's .env, from a terminal
termf ops run env-fetch --connection <name> --path <file>

Edit this page on GitHub

Esc