Actions
63 actions, callable from the panel, the command palette and the API as
POST /api/v1/a/<id>. Internal actions used between modules are not listed.
| Action | What it does | Risk | Preview |
|---|---|---|---|
databases.engine.install | Install a database engine | critical | |
databases.engine.tune | Size a database engine for this server | high | |
databases.valkey.tune | Size the panel's Valkey | high | |
databases.engine.list | List installed engines (read) | low | No dry run |
databases.engine.offered | Engines this account's server runs (read) | low | No dry run |
databases.slowlog.list | List slow queries (read) | low | No dry run |
databases.query.run | Run a statement | medium | |
databases.maint.run | Database maintenance | medium | |
databases.db.create | Create a database | medium | |
databases.db.list | List databases (read) | low | No dry run |
databases.db.get | Get a database (read) | low | No dry run |
databases.db.stats | Refresh database sizes | low | No dry run |
databases.db.delete | Delete a database | high | |
databases.db.export | Export a database | low | |
databases.db.import | Import a dump | medium | |
databases.user.create | Create a database user | medium | |
databases.user.list | List database users (read) | low | No dry run |
databases.user.delete | Delete a database user | medium | |
databases.user.password.set | Reset a user's password | medium | |
databases.user.password.reveal | Reveal a vaulted password (read) | high | No dry run |
databases.grant.set | Set a user's access to a database | medium | |
databases.remote.set | Allow remote connections | high | |
databases.valkey.create | Create a Valkey instance | medium | |
databases.valkey.list | List Valkey instances (read) | low | No dry run |
databases.valkey.update | Change a Valkey instance | medium | |
databases.valkey.reset | Reset a Valkey password | medium | |
databases.valkey.stats | Valkey usage (read) | low | No dry run |
databases.valkey.delete | Delete a Valkey instance | high | |
databases.extension.list | List PostgreSQL extensions (read) | low | No dry run |
databases.extension.set | Turn a PostgreSQL extension on or off | medium | |
databases.engine.timezone.get | Show the MySQL time zone (read) | low | No dry run |
databases.engine.timezone.set | Set the MySQL time zone | medium | |
databases.valkey.adopt | Take over a Valkey container made by hand | high | |
databases.valkey.import | Import data into a Valkey instance | high | |
databases.valkey.old.list | Show the old containers left after a take-over (read) | low | No dry run |
databases.valkey.old.remove | Remove an old container left after a take-over | medium | |
databases.server.create | Register an external database server | medium | |
databases.server.list | List external database servers (read) | low | No dry run |
databases.server.get | Get an external database server (read) | low | No dry run |
databases.server.update | Change an external database server | medium | |
databases.server.test | Test an external database server | low | No dry run |
databases.server.delete | Remove an external database server | high | |
databases.db.snippets | Connection snippets (read) | low | No dry run |
databases.connection.for_node | Connection for a web server (read) | low | No dry run |
databases.admin.open | Open the database tool | medium | |
databases.admin.session.list | Open database tool sessions (read) | low | No dry run |
databases.admin.close | Close a database tool session | low | |
databases.reconcile | Re-apply all databases | medium | |
databases.config.reset_all | Reset the whole service to defaults | high | |
databases.config.snapshot.list | Snapshots before resets (read) | low | No dry run |
databases.config.snapshot.restore | Undo a reset (restore a snapshot) | high | |
databases.config.history.list | Earlier versions of a file (read) | low | No dry run |
databases.config.history.diff | Compare an earlier version (read) | low | No dry run |
databases.config.history.restore | Restore an earlier version of a file | high | |
databases.unmanaged.scan | Scan now for objects made outside the panel | low | No dry run |
databases.unmanaged.list | Objects made outside the panel (read) | low | No dry run |
databases.unmanaged.ignore | Ignore or un-ignore an unmanaged object | low | |
databases.unmanaged.adopt | Adopt an object made outside the panel | medium | |
databases.unmanaged.remove | Remove an object made outside the panel | high | |
databases.config.status | Hand-edited database server files (read) | low | No dry run |
databases.config.adopt | Keep a hand edit of a database server file | medium | |
databases.config.reapply | Render a database server file again | high | |
databases.config.unmanage | Hand a database server file off to the administrator | high |
Permissions and limits
Permissions
databases.db.viewView databases, users and instancesdatabases.db.manageCreate and delete databasesdatabases.user.manageManage database users and passwordsdatabases.grant.manageChange database grantsdatabases.remote.manageAllow remote connectionsdatabases.export.runExport (dump) databasesdatabases.import.runImport (restore) databasesdatabases.query.runRun statements in the query consoledatabases.valkey.manageManage Valkey instancesdatabases.engine.manageInstall database engines on serversdatabases.reconcileRe-apply every database to its serverdatabases.server.viewView external database serversdatabases.server.manageRegister and change external database serversdatabases.admin.openOpen the database tool
Plan limits
databases.countDatabasesdatabases.usersDatabase usersdatabases.size_mbTotal database sizedatabases.connectionsConnections per database userdatabases.statement_timeout_sLongest database statement (0 = no limit)databases.remote_hostsRemote host rulesdatabases.valkey_instancesValkey instancesdatabases.valkey_mbValkey memory (all instances)databases.servers_sqlExternal MySQL/MariaDB/PostgreSQL servers (0 = not allowed)databases.servers_clickhouseExternal ClickHouse servers (0 = not allowed)databases.servers_redisExternal Redis/Valkey servers (0 = not allowed)databases.servers_mongodbExternal MongoDB servers (0 = not allowed)
Engineering notes
Generated from modules/databases/docs.md at build 38156245. These are the notes the engineers keep
next to the code: precise, technical, and honest about what is not done yet.
Customer database servers are installed on the node by the driver (internal/agent/databases*.go); the panel's own
Postgres is unrelated. Listeners are loopback-only until some user has remote hosts.
Model
- Names are
<account>_<name>(account-becomes_); database <= 48, user <= 32 characters. - Privileges (
readonly/readwrite/admin) replace each other ondatabases.grant.set. MariaDB: SELECT / DML / ALL on`acct\_db`.*(underscore escaped; no GRANT OPTION). PostgreSQL: per database three NOLOGIN group roles<db>_own(owner; admin users are members and log in withSET ROLE, so what they create is owned by the group),<db>_rw,<db>_ro, plus default privileges for new tables. - Passwords are generated (24 chars), returned once by create/reset, never stored, never in list/get. With
store_in_vaultthe vault keeps it anddatabases.user.password.revealreturns it (audited). Supplied passwords: 12-128 chars, letters+digits, no quotes/backslash/space/backtick. Top-levelpasswordkeys are redacted by the host audit. - Remote access (
databases.remote.set): IPv4/IPv6 addresses or IPv4 CIDR;%//0and ranges wider than /16 admin-only. MariaDB: extra'user'@'host'entries (CIDR becomes addr/netmask) +REQUIRE SSL; PostgreSQL:hostssl/hostlines inrc-hba.d/<user>.conf(included from pg_hba.conf, PG 16+). The engine listens on 0.0.0.0 only while some user has remote hosts (restart on change). TLS uses a self-signed cert generated by the agent (ssl module cert later). The firewall rule belongs to thesecuritymodule (not built): the plan warns about it. - Limits:
databases.count/users/valkey_instances/valkey_mb/remote_hostsReserve/Release;databases.connectionsbecomesMAX_USER_CONNECTIONS/ role CONNECTION LIMIT (read from the plan by probing Reserve, see follow-ups);databases.size_mbis enforced bydatabases.db.stats(reserves growth; when refused the database's grants are forced read-only, restored when it fits again; statusquota_exceeded). - Dump/restore:
databases.db.exportwrites.sql/.sql.gzinto the account's home,databases.db.importreads it. All file access runs as the account viarunuser(no symlink escape by a root agent). Import runs as an ephemeral user with rights on that database only (cannot CREATE USER / touch other DBs; verified). - Valkey:
rc-valkey@<account>_<name>from a template unit,User=<account>,Slice=rc-acct-<account>.slice, loopback port from a sequence + unix socket in~/valkey/<name>/,user default off, ACL user with a sha256 hash (no clear password on disk), dangerous commands denied,maxmemoryfrom the request (counted againstdatabases.valkey_mb),MemoryMax = 2x+64M. Anrc-agentACL user (token only in /etc/rc-valkey) feeds stats. - Desired state first, then apply (idempotent);
databases.reconcilere-applies everything keeping passwords;accounts.deletedsubscription removes everything of the account (durable, idempotent).
Verified in the lab (2026-10-09, Ubuntu 24.04: MariaDB 10.11, PostgreSQL 16, Valkey 7.2)
- Create db+user on both engines; connect from a second container over TLS with the generated password; wrong password
refused; before remote.set the port is closed; with
require_tlsa non-TLS client is refused (both engines). databases.countlimit 2: third create ->limit_exceeded; valkey instance limit likewise; connection limit 3: fourth concurrent session ->max_user_connectionserror.- readonly user cannot INSERT; readwrite can, cannot CREATE; password reset invalidates the old one; vault reveal.
- Export -> drop table -> import restores rows on both engines (gz and plain), ephemeral roles gone; a dump with
CREATE USERis refused;../paths refused. - Size quota flips a PostgreSQL database read-only (an empty PG database is ~7 MB).
- Reconcile recreated a database and user dropped behind the panel's back; remote off closes the listener again;
Valkey runs as the account in its slice,
CONFIGis denied; account deletion removed DBs/users/roles via the event.
External (bring-your-own) servers — w6-04
databases.server.createregisters a MySQL/MariaDB, PostgreSQL, MongoDB, Redis/Valkey or ClickHouse server: host, port,tls(off|on= encrypted, certificate not checked |verify= checked, optionally against a pasted CA) and the admin login. It is TESTED ON SAVE through the account's node (databases.server.testagent op: version, encryption, latency); a failing test saves nothing. The admin password goes to the vault (server/<id>) and is never returned, logged, audited or put in an event; it reaches the client only in its environment (MYSQL_PWD,PGPASSWORD, an HTTP header, RESPAUTH), never argv or SQL (unit-tested).- Plans: limits
databases.servers_sql/_clickhouse/_redis/_mongodb(count; 0 = that kind is not allowed). - Every existing action takes
server_id(db.create,user.create, lists); the engine is the server's kind. Names keep the<account>_prefix. Users on an external MySQL/MariaDB get host%unlessremote.setrestricts them. Per kind: MySQL/MariaDB (flavour auto-detected: MySQL 8 copies hashes asIDENTIFIED WITH plugin AS 0x..) and PostgreSQL (same<db>_own/_rw/_romodel; a newer server brings the matching PGDGpg_dump) support everything incl. export/import/size; ClickHouse (HTTP interface: databases, SQL users, GRANT ondb.*, sizes) has no export/import; Redis/Valkey: a "database" is the key namespace<name>:*, users are ACL users, readonly =%R~; MongoDB: register + connectivity test only (management is a follow-up). The agent refuses loopback / link-local / metadata hosts and names resolving to them (use the built-in engine for this node). - Deleting a server is refused while databases/users are registered on it; deleting an account forgets its servers (the servers themselves are never touched).
databases.db.snippets: PHP, Node, Python, Go, Ruby, Java and .NET for every family, with aPASSWORDplaceholder.
Built-in engines on demand (databases.engine.install)
mysql (Oracle 8.4 LTS apt repo; refused while MariaDB owns :3306), postgresql + version 14-18 (PGDG), clickhouse
(vendor repo; loopback; the passwordless default user is removed, rc_admin credentials in /etc/rc-clickhouse/admin.json
0600), qdrant (pinned release + SHA-256, loopback, API key in /etc/rc-qdrant/env), ferretdb (v1.24 pinned, over the
node's PostgreSQL: a FerretDB "database" is a PostgreSQL database + user, clients use the PostgreSQL login with
authMechanism=PLAIN). Repos and download URLs are fixed in databases_engines.go; keys are fetched over https.
Database tool (Adminer) - w11-61, proven and ON by default in w11-85
databases.admin.open (one database + one of its users) -> a single-use ticket -> the editor gateway's isolated origin -> Adminer 6.1.1
(pinned in the version catalogue, sha256-checked) running as the ACCOUNT's own user in its slice with no network, behind a
root-owned socket. PHP is the node's own php-cli (the web server install brings it; the first open adds the PostgreSQL driver
through apt once). The login is ephemeral, has the chosen user's privilege only and is never shown, stored or audited. Sessions are
listed on the database's "Database tool" tab with Close; a session ends with the panel session, after 30 minutes without use, at
the end of its life (admin_tool_session_hours, 4) or when its link was never opened. Built-in MariaDB, MySQL and PostgreSQL
databases only; opens in its own tab (not framed), not made for a phone. Setting admin_tool_enabled (default on) switches it off
for the whole server and closes every open session at the next sweep. Proof, limits and the bugs the real sign-in found:
docs/security/database-tool.md; the lab walk is lab/tests/database-tool.sh.
Follow-ups closed
import takes clean (drops everything first: MariaDB/MySQL drop+create keeping charset, PostgreSQL recreates public);
size enforcement runs from the schedule databases.stats.run (15 min, one unreachable server does not stop the rest).
Next
UI (w6-08); panel reverse proxy for the admin tool; MongoDB management on external servers; Qdrant collections/keys per
account; ClickHouse/Redis dump; pin repo key fingerprints; grace period for deletes (AC-18), clone/rename, maintenance
ops, slow-query log; firewall rule via security.
Several web servers (w11-177)
A database lives on one server. A pooled PHP site on other web servers must write to it there: 127.0.0.1 on those
servers is their own (read-only replica or empty) engine. With replication set up, the cluster module publishes
db-primary.rc.internal (the first pair's primary) and db-primary-<engine>.rc.internal (each engine's primary) in
/etc/hosts on every node and moves them on a promotion. databases.connection.for_node and the snippets answer
(multi_node_host) say which name to use; customer-uploaded PHP sites should put that name in their config.
When a pool's servers change, databases.pool.grant opens the account's built-in database users to every web server
of the pool. The firewall rule for the database port is still the security module's.
Moving real databases onto a server (w12 card B)
- Import (
databases.db.import, a job with progress; a log file is kept in the account's home underbackups/databases/import-<db>-<time>.log).- PostgreSQL reads the kind from the file: custom (
pg_dump -Fc) and directory (-Fd) dumps go throughpg_restore(jobsloads tables in parallel), plain.sqland.sql.gzthroughpsql. Both run as the account, logged in as an ephemeral role that runs as the database's own role<db>_own, so everything the dump creates belongs to it and not to postgres (that role is also what the app's login runs as; see Model).no_owner(default true) drops owners and privileges of the dump (pg_restore--no-owner --no-acl; for plain dumps single-lineALTER ... OWNER TO,GRANTandREVOKElines outside COPY data are skipped).cleandrops every schema first.exclude_tablesleaves tables out with their indexes, keys, defaults, triggers, sequences and the foreign keys others have to them (custom/directory dumps only);data_only/schema_onlylikewise. - Extensions the dump needs are created first as the server's administrator (the restoring role is no superuser), after installing the OS package if the server lacks it.
- The client's output is sorted:
report.errorsare things that did not load (the action then fails with them listed, and the data that did load stays);report.notesare PostgreSQL's harmless "must be owner of extension" and "schema public already exists".report.log_fileis the whole output. - MySQL and MariaDB:
.sqlor.sql.gz, as before. The MySQL 9 client has no--skip-ssl: external servers now get--ssl-mode=for it.
- PostgreSQL reads the kind from the file: custom (
- Extensions (
databases.extension.list/.set, PostgreSQL built-in only): vector (pgvector), pg_trgm, btree_gist, pg_stat_statements, citext, unaccent, uuid-ossp, postgis (when the package exists).setinstalls the package from the agent's allow-list (postgresql-<major>-pgvector,postgresql-<major>-postgis-3; RHEL:pgvector_<major>), creates or drops the extension, and for pg_stat_statements writesshared_preload_librariesintoconf.d/97-respirecloud-preload.conf, restarts PostgreSQL once and creates it inpostgrestoo (where the slow-statement list reads it). The preview lists those steps. - Exact names (
exact: trueondb.create,user.create,valkey.create; administrators only):nerix_dbisnerix_db, not<account>_nerix_db. An exact name is outside every account's name space; customers keep the prefix rule. - Given passwords for moves:
passwordorpassword_hashas before, orpassword_file: a file in the account's home with the password on one line, read by the agent as the account. Through the CLI that is the way to keep a password off the command line (and-f -takes the whole JSON, password included, from stdin). - MySQL time zone (
databases.engine.timezone.get/.set):default_time_zoneas an offset (+04:30),UTC,SYSTEMor a name (Asia/Kabul; the zone tables are loaded when needed). A managed file98-respirecloud-timezone.cnfkeeps it across restarts,SET GLOBALapplies it to new connections at once. TIMESTAMP values are stored in UTC and shown in the zone; DATETIME values are never converted. Charset and collation are per database at creation (db.create --charset --collation, e.g.utf8mb4/utf8mb4_0900_ai_ci). - Valkey as a container (
runtime: containeronvalkey.create; ADR 0033):docker runby the agent with every capability dropped, user 999:999, no-new-privileges, read-only root, a pids and memory limit, published on127.0.0.1:<port>(port chosen or the next free one). The password is the password of the default user (asrequirepass, kept as a sha256 ACL hash in/etc/rc-valkey/<name>.conf, owned by the container's user, mode 0400); dangerous commands are denied.maxmemory, eviction policy andnone/rdb/aofpersistence as before. Data lives in the Docker volumerc-valkey-<name>. The default image is pinned by digest ininternal/agent/databases_valkey_ctr.go.databases.valkey.adopttakes over a container made by hand (nerix-valkey): same port, same volume (no copy), the password you give; the old container is stopped and kept as<name>-replaced, and started again if the managed one does not come up.databases.valkey.importreplaces an instance's data with an.rdb,.rdb.gz,.taror.tar.gzof a data folder. An RDB loaded into an instance that keeps an AOF is converted first (a server that finds only an RDB withappendonly yesstarts empty; verified).- Process instances (systemd, in the account's slice) are unchanged and still the default.
- Batch fix (walk data, 2026-10-27):
extension.setneeds noid: left out, it works in any PostgreSQL database of the built-in server (the slow-statements "Turn it on").- A plain
pg_dumpimport also skipsALTER DEFAULT PRIVILEGES; a MySQL or MariaDB import dropsSQL_LOG_BINandGTID_PURGEDlines (a stockmysqldumpfrom a GTID server needs SUPER for them and they change no data). databases.db.deletepreviews without the typed name, andwith_usersalso removes the login users that belong to that database only (the screen offers it, on). Without it the result names the users it kept.- A password the caller gave (
password,password_file) is never printed back. - Previews of create and adopt check the plan limits the real call will meet. Create and import read the size at once.
databases.valkey.old.list/.remove: the stopped...-replacedcontainer an adopt keeps, with a "Remove the old container" button.- The new-Valkey dialog has port, password, "Runs as" and "Take over a container that already runs"; Engines does not offer to install the Valkey package on a node that runs container instances.
- Engine install makes
/run/mysqldexist at every start (MariaDB 13 on Ubuntu 26.04 did not start without it). - The CLI's
--fileis the JSON-input option only for actions that have nofileparameter (-falways is).
- Screens: Engines lists MariaDB, MySQL (not beside MariaDB, said in words), PostgreSQL and Valkey, with the MySQL time zone under an installed MySQL or MariaDB; a PostgreSQL database has an Extensions tab; Import has "Show details" for the options above; a container Valkey has "Import data".
- Previews: every change in this module has
dry_run(import, export, password set, Valkey reset, extension, time zone, adopt and the Valkey import included).
Other servers, found on the server, extension schema
- Databases > "Other servers": register, check and remove external database servers (the admin password goes to the vault).
- Databases > "Found on the server" (administrators): databases and logins made by hand; pick the account, then Adopt, Hide or Remove (a copy is saved first).
- A password given with no user name is refused ("no user would be created"). A password file whose content has spaces, quotes or backslashes is refused before the database is made. Nothing reports success while skipping the user.
databases.extension.settakesschema: the extension is created there (the schema is made if missing); one already installed is moved.
Valkey without the Valkey package, and password files (w14)
databases.valkey.createwith noruntimeruns the instance as a container when this server has no Valkey package; asking forruntime: processthere still refuses, and the message names the container runtime as the other way.password_filemay be a path relative to the account's home or an absolute path inside/home/<account>/. Any other path is refused in the preview with the reason, so a preview that passes also applies.
Screens in the 1.0.15 round
- Connect tab: shows the full login user (matched from
databases.user.liston the database's first access), copy buttons for host, port, database and user, and "Make a new password" (databases.user.password.set); the new password shows once. The button needsdatabases.user.manage. The code snippets still use a$PASSWORDplaceholder. - Cache naming: Valkey is called "Cache (Valkey)" in the engine filter, the create text and the list.
- One container form (Stacks, in the containers module): the default source; image, port, name (from the image), optional data folder (a named volume, never a host folder), variables, address step, Compose preview behind "Show details".
- Open row: one level of navigation. Opening a database shows how to connect, then collapsed sections (Users and access, Backups, Import and export, Extensions for PostgreSQL, Query, Database tool, Maintenance); each remembers whether it was left open.