Operations
Backups, import and export
Move rules and configuration between servers, and back up the database.
- Rules as JSON or Rules as CSV: every role that can read rules.
- Whole config: settings, both network allow lists and rules. It never includes users, tokens, keys or secrets.
- Import rules: pick or paste a file, choose
mergeorreplace(replace only wipes the types in the file), and use Try it first before Import. - Import a whole config: choose whether settings and the allow list come across too. Settings go through the same checks as the Settings page.
rules.csv
pattern,kind,version_range,note,priority,enabled
express,allow,^4.21.0,web framework,0,1
event-stream,deny,,compromised in 2018,1000,1
@acme/*,allow,,our own packages,0,1
Database backups
on the server
docker exec npm-repo mariadb-dump --socket=/run/mysqld/mysqld.sock --single-transaction --routines --triggers npmrepo > backup-$(date +%F).sql
Careful
A config export is not a backup of users, tokens or the traffic history. Back up the database and the data directory.