{{define "content"}} {{$s := .Data.S}}{{$db := .Data.DBStats}}{{$csrf := .CSRF}}{{$bs := .Data.BackupStatus}}

Settings

Server configuration, stored in the database.

{{template "settingsnav" .}} {{if .Data.PendingRestore}}
A database restore is staged
The next time this server starts, the live database will be replaced by the staged backup. The current database is preserved alongside it, so this remains reversible.
{{template "confirmform" dict "Action" "/settings/database/restore/cancel" "CSRF" $csrf "Label" "Cancel restore" "Icon" "bi-x-lg" "Class" "btn btn-sm btn-outline-dark" "Message" "Discard the staged restore and keep the current database?"}}
{{end}}
Database
Path
{{$db.Path}}
Size
{{bytes $db.SizeBytes}}
Write-ahead log
{{bytes $db.WALBytes}}
Schema version
{{$db.SchemaVer}}
Zones
{{num $db.Zones}}
Records
{{num $db.Records}}
List domains
{{num $db.Domains}}
Query log rows
{{num $db.QueryLogs}}
Audit rows
{{num $db.AuditLogs}}
Schema migrations
{{range .Data.Migrations}} {{end}}
{{.Version}}_{{.Name}} {{if .Drifted}}drift {{else if .Applied}}applied {{else}}pending{{end}}
Configuration transfer

A versioned JSON export of zones, records, networks, policies, list definitions and settings. Password hashes and API token secrets are deliberately excluded.

Objects that already exist are kept as they are and reported, never overwritten.
Automatic backups
h
files
Backups use SQLite's VACUUM INTO, which writes a transactionally consistent copy while the database is in use. Copying the file with cp instead would capture a torn snapshot whose committed data still lives in the write-ahead log.
Backups {{if $bs.Count}} — {{$bs.Count}} file{{if ne $bs.Count 1}}s{{end}}, {{bytes $bs.TotalBytes}} {{end}} {{template "postform" dict "Action" "/settings/database/backup" "CSRF" $csrf "Label" "Back up now" "Icon" "bi-play-fill" "Class" "btn btn-sm btn-primary"}}
{{if $bs.LastError}}
Last backup failed: {{$bs.LastError}}
{{end}} {{if .Data.Backups}}
{{range .Data.Backups}} {{end}}
FileSizeCreatedActions
{{.Name}} {{bytes .SizeBytes}} {{timeAgo .CreatedAt}}
{{template "confirmform" dict "Action" (printf "/settings/database/backup/%s/delete" .Name) "CSRF" $csrf "Icon" "bi-trash" "Title" "Delete this backup" "Message" (printf "Delete the backup file %s?" .Name)}}
{{else}}
{{template "empty" dict "Icon" "bi-archive" "Title" "No backups yet" "Message" "Run one now, or enable the schedule above. Backups are written to the directory configured here and are restricted to the owning user."}}
{{end}}
{{/* ---- Restore modal ---- */}} {{end}}