happyDomain respects the methodology 12 factor and allows to act on the application configuration in several ways.
It is possible to configure happyDomain in three different ways: configuration file, environment, command line. All options are available for each of these mechanisms.
The precedence, when an option is defined by several mechanisms simultaneously, is that an option present in a configuration file will be overwritten by the environment, which will be overwritten by an option passed on the command line
When the application is launched, the first configuration file from the following list will be used:
./happydomain.conf
$XDG_CONFIG_HOME/happydomain/happydomain.conf
/etc/happydomain.conf
Only the first existing file is taken into account. It is not possible to have part of its options in /etc/happydomain.conf
and part in ./happydomain.conf
, only the latter configuration file will be taken into account.
It is possible to specify a custom path by adding it as an additional parameter to the command line. Thus, to use the configuration file located at /etc/happydomain/config
, we would use :
./happydomain /etc/happydomain/config
Comments line has to begin with #
, it is not possible to have comments at the end of a line, by appending #
followed by a comment.
Place on each line the name of the config option and the expected value, separated by =
. For example:
storage-engine=leveldb
leveldb-path=/var/lib/happydomain/db/
When happyDomain is started, all variables beginning with HAPPYDOMAIN_
are scanned for valid configuration options.
You can do the same thing as in the previous example, with the following environment variables:
HAPPYDOMAIN_STORAGE_ENGINE=leveldb
HAPPYDOMAIN_LEVELDB_PATH=/var/lib/happydomain/db/
You just have to replace dash by underscore.
Finally, the command line can be used to pass options, according to the usual UNIX format.
To continue the previous example, we can perform the same configuration with the following command line:
./happydomain -storage-engine leveldb -leveldb-path /var/lib/happydomain/db/
or by using the =
sign to clearly assign the value.
./happydomain -storage-engine=leveldb -leveldb-path=/var/lib/happydomain/db/
The complete list of configurable items can be listed by calling happyDomain
with the -h
or --help
option.
Here is a list of the main options:
bind
admin-bind
default-ns
dev
externalurl
custom-head-html
custom-body-html
storage-engine
storage-engine=leveldb
)leveldb-path
We use go-mail
as a library to send mails.
mail-from
Note that without the mail-smtp-*
options, happyDomain will use the sendmail
binary to send mail. This can be coupled with the msmtp
or ssmtp
packages, for example, to set the parameters for the whole system.
mail-smtp-host
mail-smtp-port
mail-smtp-username
mail-smtp-password
no-auth
external-auth
jwt-secret-key
Some registrars require third-party applications to identify themselves in addition to the user.
Please refer to this documentation in order to generate application credentials: https://docs.ovh.com/gb/en/api/api-rights-delegation/#application-registration.
ovh-application-key
ovh-application-secret