Add page about configuration
continuous-integration/drone/push Build is passing Details

This commit is contained in:
nemunaire 2023-02-11 12:00:00 +01:00
parent e88b17a5dc
commit 75e622f88b
4 changed files with 327 additions and 2 deletions

163
content/deploy/config.en.md Normal file
View File

@ -0,0 +1,163 @@
---
data: 2023-02-11T11:58:55+01:00
title: Configuration
weight: 20
---
happyDomain respects the methodology [*12 factor*](https://12factor.net/) and allows to act on the application configuration in several ways.
## How do I configure happyDomain?
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
### Configuration by file
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
```
#### Configuration file format
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/
```
### Configuration by the environment
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.
### Command line configuration
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/
```
## Configuration items
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:
### General parameters
`bind`
: Bind port/socket to use to expose happyDomain.
`admin-bind`
: Bind port/socket to use to expose the administration API.
`default-ns`
: Address and port of the name resolver server to be used by default when name resolution is required.
`dev`
: URL to which all requests related to the graphical interface will be returned.
`externalurl`
: URL of the service, as it should appear in emails and content to the public.
#### Page layout
`custom-head-html`
: String to be placed before the end of the HTML header.
`custom-body-html`
: String to be placed before the end of the HTML body.
### Data storage
`storage-engine`
: Allows you to choose the data storage mechanism among all supported mechanisms.
### LevelDB (`storage-engine=leveldb`)
`leveldb-path`
: Path to the folder containing the LevelDB database to use.
### E-Mail parameters
We use [`go-mail`](https://github.com/go-mail/mail) as a library to send mails.
`mail-from`
: Defines the name and address of the sender of emails sent by the service.
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`
: IP or host name of the SMTP server to use.
`mail-smtp-port`
: Port to use on the remote server.
`mail-smtp-username`
: When authentication is required on the remote server, username to use.
`mail-smtp-password`
: When authentication is required on the remote server, password to use.
### Authentication
`no-auth`
: Disables the notion of users and access control. A default account is used.
`external-auth`
: URL base of the authentication and registration service to be used instead of the embedded login system.
`jwt-secret-key`
: Secret key used to verify JWT tokens.
### Specific to registrars
Some registrars require third-party applications to identify themselves in addition to the user.
#### OVH
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`
: Application key for OVH API.
`ovh-application-secret`
: Secret key for OVH API.

162
content/deploy/config.fr.md Normal file
View File

@ -0,0 +1,162 @@
---
data: 2023-02-11T11:58:55+01:00
title: Configuration
weight: 20
---
happyDomain respecte la méthodologie [*12 factor*](https://12factor.net/) et permet notamment d'agir sur la configuration de l'application de plusieurs manières.
## Par quels moyens configurer happyDomain ?
Il est possible de configurer happyDomain de trois manières différentes : fichier de configuration, environnement, ligne de commande. Toutes les options sont disponibles pour chacun de ces méchanismes.
La précédence, lorsqu'une option est définie par plusieurs méchanismes simultanément, est qu'une option présente dans un fichier de configuration sera écrasée par l'environnement, qui sera écrasée par une option passée sur la ligne de commande.
### Configuration par fichier
Au lancement de l'application, le premier fichier de configuration parmi la liste suivante sera utilisé :
- `./happydomain.conf`
- `$XDG_CONFIG_HOME/happydomain/happydomain.conf`
- `/etc/happydomain.conf`
**Seulement le premier fichier existant est pris en compte.** Il n'est pas possible d'avoir une partie de ses options dans `/etc/happydomain.conf` et une autre dans `./happydomain.conf`, seul ce dernier fichier de configuration sera pris en compte.
Il est possible de préciser un chemin personnalisé en l'ajoutant comme paramètre supplémentaire à la ligne de commande. Ainsi, pour utiliser le fichier de configuration situé à `/etc/happydomain/config`, on utilisera :
```
./happydomain /etc/happydomain/config
```
#### Format du fichier de configuration
Une ligne de commentaires commence par `#`, il n'est pas possible d'avoir des commentaires à la fin d'une ligne, en ajoutant `#` suivi d'un commentaire.
Placez sur chaque ligne le nom de l'option de configuration et la valeur attendue, séparés par `=`. Par exemple :
```
storage-engine=leveldb
leveldb-path=/var/lib/happydomain/db/
```
### Configuration par l'environnement
Au lancement d'happyDomain, toutes les variables commençant par `HAPPYDOMAIN_` sont analysées à la recherche d'options de configuration valides.
Vous pouvez réaliser la même chose que dans l'exemple précédent, avec les variables d'environnement suivantes :
```
HAPPYDOMAIN_STORAGE_ENGINE=leveldb
HAPPYDOMAIN_LEVELDB_PATH=/var/lib/happydomain/db/
```
Notez que les `-` sont remplacés par des `_` dans les variables d'environnement.
### Configuration par la ligne de commande
Enfin, la ligne de commande peut être utilisée pour passer des options, selon le format UNIX usuel.
Pour continuer l'exemple précédent, nous pouvons réaliser la même configuration avec la ligne de commande suivante :
```
./happydomain -storage-engine leveldb -leveldb-path /var/lib/happydomain/db/
```
ou encore en utilisant le signe `=` pour assigner clairement la valeur.
```
./happydomain -storage-engine=leveldb -leveldb-path=/var/lib/happydomain/db/
```
## Éléments de configuration
La liste exhaustive des éléments configurables peuvent être listés en appelant `happyDomain` avec l'option `-h` ou `--help`.
Voici la liste des principales options :
### Paramètres généraux
`bind`
: Interface (ip, port) à utiliser pour exposer le service happyDomain.
`admin-bind`
: Interface (ip, port ou socket) à utiliser pour exposer l'API d'administration.
`default-ns`
: Adresse et port du serveur résolveur de noms à utiliser par défaut lorsqu'une résolution de nom est nécessaire.
`dev`
: URL vers laquelle toutes les requêtes liés à l'interface graphique seront renvoyées.
`externalurl`
: URL du service, tel qu'il doit apparaître dans les mails et contenus à destination du public.
#### Mise en page
`custom-head-html`
: Chaîne de caractères à placer avant la fin de l'en-tête HTML.
`custom-body-html`
: Chaîne de caractères à placer avant la fin du corps HTML.
### Stockage des données
`storage-engine`
: Permet de choisir le mécanisme de stockage des données parmi tous les mécanismes supportés.
### LevelDB (`storage-engine=leveldb`)
`leveldb-path`
: Chemin vers le dossier contenant la base LevelDB à utiliser.
### Paramètres e-mail
Nous employons [`go-mail`](https://github.com/go-mail/mail) comme bibliothèque pour envoyer les mails.
`mail-from`
: Défini le nom et l'adresse de l'expéditeur des mails envoyés par le service.
Notez que sans les options `mail-smtp-*`, happyDomain utilisera le binaire `sendmail` pour envoyer les mails. Cela peut être couplé aux paquets `msmtp` ou `ssmtp` par exemple, pour définir les paramètres pour tout le système.
`mail-smtp-host`
: IP ou nom d'hôte du serveur SMTP à utiliser.
`mail-smtp-port`
: Port à utiliser sur le serveur distant.
`mail-smtp-username`
: Lorsque de l'authentification est nécessaire sur le serveur distant, nom d'utilisateur à utiliser.
`mail-smtp-password`
: Lorsque de l'authentification est nécessaire sur le serveur distant, mot de passe à utiliser.
### Authentification
`no-auth`
: Désactive la notion d'utilisateurs et de contrôle d'accès. Un compte par défaut est utilisé.
`external-auth`
: Base de l'URL du service d'authentification et d'enregistrement à utiliser à la place du système de connexion embarqué.
`jwt-secret-key`
: Clef secrète utilisée pour vérifier les tokens JWT.
### Spécifique aux bureaux d'enregistrement
Certain bureau d'enregistrement nécessitent que les applications tierces s'identifient en plus d'identifier l'utilisateur.
#### OVH
Veuillez vous référer à cette documentation afin de générer les identifiants: <https://docs.ovh.com/gb/en/api/api-rights-delegation/#application-registration>.
`ovh-application-key`
: Application key pour l'API d'OVH
`ovh-application-secret`
: Clef secrète pour l'API d'OVH

View File

@ -1,7 +1,7 @@
---
data: 2023-02-09T09:12:25+01:00
title: Connect to a local knot
weight: 21
weight: 31
---
[Knot](https://knot-dns.cz) is an authoritative DNS server developed by the [cz.nic](https://nic.cz) association.

View File

@ -1,7 +1,7 @@
---
data: 2023-02-09T08:03:25+01:00
title: Connexion à un knot local
weight: 21
weight: 31
---
[Knot](https://knot-dns.cz) est un serveur DNS faisant autorité développé par l'association [cz.nic](https://nic.cz).