Skip to main content

Configuration drop-ins

Your own configuration for a daemon goes in a drop-in directory under /etc/elpan/<svc>/, which no package and no transformer writes. Most transformers check your drop-ins with the configuration they render, so a broken one stops the panel's changes from reaching the daemon, not the daemon itself (Server configuration).

PackageDrop-insChecked by the transformerAfter a change
elpan-nginx/etc/elpan/nginx/conf.d/*.conf, /etc/elpan/nginx/ratelimit-exempt.d/Yes, with the whole configuration (nginx -t).Reload it: systemctl reload elpan-nginx.
elpan-haproxy/etc/elpan/haproxy/conf.d/*.cfgYes, with the whole configuration (haproxy -c).Reload it: systemctl reload elpan-haproxy.
elpan-httpd/etc/elpan/httpd/default.conf.d/, <group UUID>.conf.d/, <hostname>.conf.d/ (*.conf)Yes, each shared IP address group on its own (httpd -t).Reload the group's server: systemctl reload elpan-httpd@<group UUID>.
elpan-mail-in/etc/elpan/mail-in/main.cf.d/, master.cf.d/Yes (postconf -n of the assembled main.cf).The transformer reloads elpan-mail-in.
elpan-mail-out/etc/elpan/mail-out/main.cf.d/, master.cf.d/No.The transformer reloads elpan-mail-out.
elpan-resolver/etc/elpan/resolver/conf.d/No: they are the resolver's, not the transformer's.Reload it: systemctl reload elpan-resolver.

The daemons' man pages (elpan-httpd(8), elpan-nginx(8), ...) say what goes in each and give examples.

A broken drop-in​

A transformer that checks drop-ins notices a change to one and checks again within a minute. A broken one fails the check:

  • nginx, HAProxy, mail-in: the run fails and installs nothing. The daemon keeps its last good configuration, the panel's changes wait, and the Configuration screen shows the transformer Failed with the validator's message.
  • Apache: the groups the drop-in breaks are left as they are installed, the other groups go ahead, and the run fails, naming them. A virtual host whose new configuration breaks its group, such as a new website with a broken <hostname>.conf.d/, is refused instead and keeps its last good configuration (none, for a new one).

Fixing the drop-in is picked up on the next tick: the run passes, installs what waited, and reloads.

The check protects a reload, not a restart

The transformer does not stop the daemon from reading a broken drop-in. nginx's, HAProxy's and Apache's reloads test the configuration first and keep the old one, but a restart, and a reboot, read the drop-in as it is. After editing one, look at the Configuration screen before anything restarts the daemon.

The transformers' commands​

As root, each transformer has its own commands. It is not on PATH:

/usr/lib/elpan/nginx/elpan-nginx-confgen diff
/usr/lib/elpan/nginx/elpan-nginx-confgen run --force
CommandWhat it does
runWhat the units run.
run --forceA run even when nothing it reads changed: everything is rendered, checked and installed again, and the daemon reloaded for what that changed.
diffWhat a run would change, without changing anything: each file missing, extra, or differing in content (the lines, never a secret's) or mode, and the objects a run would refuse. Exits 0 when nothing would change, 1 when something would, 2 when it cannot render (waiting for the panel included).
checkRenders every object and prints the refused ones and a summary. Exits 0 when nothing is refused, 1 otherwise.
render <kind> <key>What one object renders to, secrets left out.
pathsThe directories it writes, its state directory, the files it reads besides the intent, and the drop-ins its validator reads.

diff and check run no validator: a broken drop-in is no difference, and diff exiting 0 says that what is installed is what the panel wrote, not that the daemon accepts it.

run --force is rarely needed: a transformer runs on every change of what it reads, puts back what was edited by hand, and retries a failure every minute (What retries by itself).

The man pages​

Every transformer has its manual page, elpan-<svc>-confgen(8), such as man elpan-nginx-confgen: the kinds it reads, the files it writes and their modes, its validator, how it acts on the daemon, its units, its report and its retries. A daemon's own page, such as elpan-nginx(8), says what the panel configures in it under CONFIGURATION FROM THE PANEL.