Skip to content
Rowsafe
Docs

Change what Rowsafe may do on a server

Root decides what Rowsafe may do on each server; Rowsafe does it only when someone clicks and confirms.

Some actions need root (restarts, updates, reboots, a pooler, the firewall). Rowsafe does them only when someone clicks and confirms, and only if root allowed them on that server.

  • Touches only the database: allowed unless root says no. Restarts, database updates (a Mark first), clusters for forks, the pooler, settings files, closing SQLite files to other users, restoring files to folders you protect.
  • Touches the server: waits for root's yes. Security updates, reboots, the firewall, and a pooler on public addresses.

Root changes them on the server. In the dashboard, owners and admins turn one off in one click; turning one on needs a passkey. Examples use a server named db-1.

When you install

The installer asks once, then shows what's allowed. On a PostgreSQL server:

==> What may Rowsafe do on this server?
    Rowsafe only does these when someone clicks them in your dashboard and
    confirms. You can change them any time with `sudo rowsafe-allow`.
Restart or stop PostgreSQL, when someone clicks Restart or Rewind? [Y/n]
Create a new PostgreSQL cluster here (ports 5440-5499), when someone forks a database to this server? [Y/n]
Install PostgreSQL updates and upgrades, when someone clicks Update? A Mark is saved first. [Y/n]
Install this server's security updates, when someone clicks Install? [y/N] y
Reboot this server, when someone clicks Reboot? A Mark is saved first. [y/N]
Install and manage PgBouncer (connection pooling), when someone turns pooling on? Nothing is installed now. [Y/n]
Limit who can reach PostgreSQL (port 5432) with the firewall, when someone picks the addresses? SSH and other ports are never touched. [y/N]

==> What Rowsafe may do on db-1, only when someone clicks it and confirms
    allowed      restart           restart or stop PostgreSQL (Restart, Rewind)
    allowed      create-cluster    create a PostgreSQL cluster for a fork
    allowed      updates           install PostgreSQL updates and upgrades
    allowed      security-updates  install this server's security updates
    allowed      pooler            install and manage PgBouncer (pooling)
    not allowed  reboot            reboot this server (after an update)
    not allowed  pooler-public     let PgBouncer listen on public addresses
    not allowed  firewall          limit who can reach PostgreSQL (firewall)
    Allow one:          sudo rowsafe-allow reboot
    Stop allowing one:  sudo rowsafe-allow --remove restart

It asks only what applies (by database) and, when re-run, only what's new. Without a terminal (cloud-init, CI) it takes the suggested answers; override with --allow-NAME or --no-allow-NAME (options).

See and change it later

On the server, as root:

sudo rowsafe-allow                            # what Rowsafe may do here
sudo rowsafe-allow restart security-updates   # allow these
sudo rowsafe-allow --remove reboot            # stop allowing this

It prints the new state; the dashboard shows it within a minute. Nothing else changes.

NameRowsafe mayNeedsBy default
restartrestart, stop and start the database: Restart, and Rewind the whole database in placeallowed
create-clustercreate a new PostgreSQL cluster (ports 5440-5499) when you fork a database to this serverrestartallowed
updatesinstall the database's minor updates and upgrade it to a new major (Updates)restartallowed
security-updatesinstall the server's security updatesrestartasks
rebootreboot the server, for example after a kernel updatesecurity-updatesasks
poolerinstall and manage the connection pooler: PgBouncer, ProxySQL or chproxy (connection pooling)allowed
pooler-publiclet the pooler listen on public addresses, when someone chooses thatpoolerasks
firewalllimit who can reach the database's port (any engine) with the firewall (Security), never SSH or other portsasks
tuningMongoDB, ClickHouse, Redis and Valkey: write the settings you change under Tuning into Rowsafe's own settings fileallowed
sqlite-modesSQLite: close the database files you listed to the server's other users, when someone clicks Apply fix under Securityallowed

"Allowed" means yes is suggested (and taken without a terminal); "asks" means no is.

  • Allow dependencies together: sudo rowsafe-allow security-updates reboot. Alone, reboot would change nothing and say so.
  • Turning one off turns off what needs it. sudo rowsafe-allow --remove restart also stops updates, security updates, reboots and new clusters.
  • unavailable comes with the reason, like the firewall without nftables (apt install nftables first) or clusters without Debian's pg_createcluster.
  • Upload folders, one by one: sudo rowsafe-allow --files /var/www/uploads backs the folder up and lets Rowsafe restore files there; --remove files stops it. See Files.

In the dashboard

Under What Rowsafe may do on this server, owners and admins can:

  • Turn one off in one click, no passkey (except the firewall and the public pooler). Nothing running stops; Rowsafe just can't do it anymore.
  • Turn one on with a passkey paired at the server. The server checks it, so no one can allow more than root did. See one-click permissions.

Older servers need the install command once more (curl -fsSL https://rowsafe.sh | sudo sh); the dashboard says so.

By database

Same names for every engine; the installer asks only what applies.

NamePostgreSQLMySQL, MariaDBMongoDBClickHouseRedis, Valkey
restartRestart, rewind in placeRestart, rewind in placeRestartRestartRestart
create-clusternew clusters for forks
updates, security-updates, rebootyesyesyesyesyes (updates: minor updates only)
pooler, pooler-publicPgBouncerProxySQL(drivers pool)chproxynot yet
firewallyesyesyesyesnot yet
tuning(not needed)(not needed)mongod.confconfig.d, users.dnot yet

MongoDB, ClickHouse, Redis and Valkey rewind without stopping, so don't need restart for it. PostgreSQL and MySQL tune through SQL, so don't need tuning.

Some rights belong to the database's own account and are asked separately: standbys for MySQL and MariaDB (--mysql-standby) and MongoDB (--mongodb-standby), and clone targets for MongoDB (--mongodb-clones) and ClickHouse (--clickhouse-clones). See MySQL and MariaDB, MongoDB, ClickHouse.

Install options

Answer with options:

curl -fsSL https://rowsafe.sh | sudo sh -s -- --allow-restart --allow-updates --no-allow-firewall

Each name has --allow-NAME and --no-allow-NAME. See the installer reference.

For configuration management, permissions-only mode (no terminal, no network):

sudo /usr/local/lib/rowsafe/install.sh --permissions --no-prompt --allow-restart --no-allow-reboot

Exit codes: 0 done, 2 refused and changed nothing, 1 failed while changing. The last lines show the state and any reason.

Limits

  • Root decides. Rowsafe's API and AI agents can't change permissions. The dashboard turns them on only with root's paired passkey.
  • Servers installed before rowsafe-allow need curl -fsSL https://rowsafe.sh | sudo sh once (self-updates don't add it). Until then, use the options.
  • Docker: set them where the containers are defined. See Docker.

Files on the server

Path
/usr/local/sbin/rowsafe-allowThe command (root 0755).
/usr/local/lib/rowsafe/install.shRoot's copy of the installer, which rowsafe-allow runs. Kept on every install and update, only after checking it against the signed release manifest.
/etc/rowsafe/*-allowedWhat root allowed (root 0644): restart-allowed, create-cluster-allowed, updates-allowed, pooler-allowed, firewall-allowed, files-allowed. The agent only reads them.
Edit on GitHub