Config history
Every server config file the panel changes keeps its earlier versions — compare them, export one or put one back.
Whenever HF Panel writes a server config file, it keeps the version it replaces and the new one, with the time, who asked for the change and which server command made it. Config history lists those files, shows the difference between any two versions and puts an earlier version back when a change went wrong.
Where: Server Admin › System › Config history
What is kept
The files the panel manages for the server's services:
| Service | Files |
|---|---|
| Nginx | websites, separate panel addresses, firewall and speed rules, the panel's own server blocks |
| Apache | websites (virtual hosts) |
| PHP | PHP-FPM pools and each version's php.ini |
| Postfix and Dovecot | main.cf and the other settings files, the domain, mailbox and alias maps |
| DNS | zone files and the zone list included in BIND's settings |
| Cron jobs | the files in /etc/cron.d |
| Services | the system units the panel creates |
| HF Panel | the panel's own settings files in /etc/hostfog |
Not kept, on purpose:
- customers' own files — a website's
.htaccess, an account's ownphp.iniand a website's own Nginx directives (open them from that website's screens instead); - keys, certificates and password files, the panel's main settings file (it holds secrets), binary files and files over 1 MB.
The first copy of every file is made when HF Panel is installed or updated; after that every change adds a version.
Note: the history is kept in a folder only the server's administrator account (root) can read, outside the panel's own data folder. The newest 50 versions of each file are kept, versions older than 90 days are removed (the newest one always stays) and the whole history is kept under 200 MB — the oldest versions go first.
Find a change
The list shows the files with more than one version, newest change first: the service, the path, how many versions are kept, when it last changed and who changed it. Show every kept file also lists files that never changed.
Click History to open a file. Each version shows:
| Column | What it means |
|---|---|
| When | the time the version was kept (UTC); Current marks the content the file has now |
| Kind | Before a change (the content found just before the panel wrote the file), Changed (what a command wrote), First copy or Restored |
| By | who asked: the signed-in user, admin (as sarahbakes) for "Log in as", or system for scheduled jobs and updates |
| Command | the server command that changed the file and its arguments |
Compare two versions
- Click Compare next to a version. The difference from that version to the current file opens below.
- Pick another version under Compare with to compare two older versions.
- Switch between Unified and Side by side.
The comparison is made on the server; file content is always shown as plain text. Download diff saves it as a
.diff file.
Restore a version
- Click Restore this version next to the version you want and confirm.
- The current content is kept in the history first, then the version is written back and checked by the service
itself —
nginx -t,apache2ctl configtest,php-fpm -t,postfix check,doveconf -nornamed-checkconf. - If the check passes, the service is reloaded. If the check or the reload fails, the previous content is put back at once and the error is shown — nothing changes.
Warning: the panel writes many of these files again when you change a website, mailbox or zone. A restored website or mail file stays until the next change on its own screen; to keep a setting for good, change it there.
Each restore is written to the Activity log (config.restore) and raises the
config.restored event for webhooks and script hooks.
Export a version
Click Export next to a version to save its content as a file.
Read the history with the API
Administrator tokens can read the history (read only): GET /v1/config-history, GET /v1/config-history/versions?file=…
and GET /v1/config-history/diff?file=…&from=…&to=… (format=html answers a page with every character escaped). See
the server API.