First Time Setup for ZFM
A host can run a ZFM system for multiple facilities. This page deals with all the setup that is independent of any one facility. Per-facility set-up will come in the following pages.
The set-up described here only needs to be done once after ZFM is installed for the first time.
Install the database certificate
When you set up your database service earlier, you downloaded the certificate authority the connection is verified against, from the db service's admin page. You now need to copy that certificate to the production host.
# on the machine where the download landed, copy the certificate to the production host
scp <full path to your certificate file> <production-host>:/tmp/db-ca.crt
# on the production host copy the certificate to the zfm directory
sudo install -o root -g root -m 644 /tmp/db-ca.crt /etc/zfm/db-ca.crt
In the next section you will tell zfm where to find that certificate with:
DB_SSL_CA=/etc/zfm/db-ca.crt
Edit the host's settings
The install put /etc/zfm/zfm.conf in place, copied from the release's own template. It arrives
holding that template's values rather than blanks, and some of those values are real addresses
belonging to the system the release was packaged on — so read down the whole file and make every
value this host's, using what you collected earlier in this guide. The comments beside each key say
what the key is for.
The one value no template can carry is the mail account's password, which the template names as a placeholder.
The file remains in place release over release. Every facility shares the settings in it.
# edit the system-wide settings
sudo -e /etc/zfm/zfm.conf
# or if you are over 65 and crusty:
sudo vi /etc/zfm/zfm.conf
These are the keys that you need to fill in
| the database server | DB_HOST and DB_PORT, and DB_SSL_CA for a managed one |
| the mail account | MAIL_FROM, MAIL_HOST, MAIL_USER, MAIL_PASSWORD |
| the platform owner | SUPER_USERNAME, SUPER_NAME, SUPER_INITIALS, SUPER_EMAIL |
Am I ready to move on?
There is a script you can use to report syntactic errors: a missing, misspelled or extraneous key, or a value that is not the kind of value it should be.
The script is buried deep in the release that you installed.
# look at the installed releases (there should be only one the first time you install).
sudo ls /srv/zfm/releases
# choose the one you want:
export RELEASE=/srv/zfm/releases/<the release>
#run the validation script for the system-wide settings.
sudo node $RELEASE/zf-server/dist/scripts/check-config-syntax.js --system
It does not report semantic errors, such as a mail server password that is wrong.