supabase-selfhost-ops AGENTS.md

Project instructions for an Ansible-based deployment system for running Supabase on your own server. Supabase is a backend platform that provides services such as databases and authentication.

In plain words
What is it for?
Use them when configuring, reviewing, or extending self-hosted Supabase deployments managed with Ansible, including Caddy, monitoring, backups, UFW, or disk encryption.
Why use it?
They explain which configuration file users should edit and how scripts generate the deployment files. They also document optional security, monitoring, backup, and access-control components.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ankaboot-source/supabase-selfhost-ops/agents-md
Clone the repo
git clone --depth 1 https://github.com/ankaboot-source/supabase-selfhost-ops

Made for: Codex, OpenCode.

Per session 11,786 This file is loaded in full into every session.
When invoked 11,786 The same file — it is already loaded in full.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.11786 $0.11786
Opus 5 $0.05893 $0.05893
Sonnet 5 $0.02357 $0.02357
Haiku 4.5 $0.01179 $0.01179

Measured 2d ago against content hash 6e2863d821de, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

supabase-selfhost-ops AGENTS.md scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **A stale repo must be RESET via MinIO recreation, never wiped under the running container.** When `stanza-create` fails with `028`/`103` after a data reset (fresh PGDATA on a repo bound to the old system-id), the role

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

3. Verify: `curl https://<domain>/functions/v1/<name>` (Kong routes `/functions/v1/*` to the edge-runtime).
AGENTS.md · 328 lines

How it starts

The opening of the file, as written. The whole thing — 328 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ansible-Supabase — AI Context

Purpose

Deterministic, configuration-based Ansible deployer for self-hosted Supabase with optional components (Caddy SSO, monitoring, fail2ban, backups, UFW, LUKS).

Workflow

config.yml  ──>  setup.sh  ──>  env/supabase.yml  ──>  ansible-playbook
                                        │
                              playbook-supabase.yml
                              (regenerated from component toggles)

The user edits only config.yml (copy of config.example.yml). setup.sh validates, renders env vars into env/supabase.yml, regenerates playbook-supabase.yml, then runs install.sh (which bootstraps Ansible and executes the playbook).

Key Files

File Purpose
config.example.yml User-facing template — add new config fields here
config.yml Actual config (gitignored) — single source of truth
setup.sh Orchestrator: validates, renders secrets, writes env vars
env/supabase.yml Ansible vars file — rendered by setup.sh, consumed by playbook
playbook-supabase.yml Generated playbook — roles enabled/disabled by component toggles
install.sh Ansible runner (pip install + ansible-playbook)

Roles (roles/)

Each role follows Ansible convention:

  • tasks/main.yml — idempotent deployment logic
  • defaults/main.yml — default variables
  • templates/ — Jinja2 templates

Role: docker

Installs Docker Engine (official APT repo), docker-compose-plugin, and adds deploy_user to the docker group. Always runs first as a prerequisite.

Role: supabase

Clones the official Supabase repo, renders the Docker Compose stack, configures Kong (API gateway), sets up SSL certs (from Caddy or self-signed), and starts all Supabase services (Postgres, GoTrue, PostgREST, Realtime, Storage, Edge Functions, Studio, etc.). Six templates: docker-compose-supabase.yml.j2, docker-compose-logs.yml.j2 (Logflare + Vector log-drain override, see below), vector-logs.yml.j2 (<supabase_path>/volumes/logs/vector.yml — Vector pipeline that routes container logs to Logflare, container names templated with the deploy_env suffix), kong-supabase.yml.j2, env-supabase.j2, start-supabase.sh.j2.

Read the full file on GitHub · 328 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 328 lines · 11,786 tokens per session scan C 6e2863d821de

Subscribe to this mod's changes

supabase-selfhost-ops AGENTS.md is an instructions file published in the GitHub repository ankaboot-source/supabase-selfhost-ops (22 stars, last pushed 13d ago), licensed MIT. It adds 11,786 tokens to every session, about $0.0589 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories