1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
|
# Configure LAVA
## Creating a superuser
Admins can create superuser accounts from the command line:
=== "Docker"
```shell
docker-compose exec lava-server lava-server manage createsuperuser
```
=== "Debian"
```shell
lava-server manage createsuperuser
```
## Settings
### Configuration files
LAVA settings are stored in **yaml** in:
* `/etc/lava-server/settings.conf`
* `/etc/lava-server/settings.yaml`
* `/etc/lava-server/settings.d/*.yaml`
LAVA will load the files in this exact order. Files in the `settings.d`
directory will be alphabetically ordered.
!!! tip "Merging files"
If a variable is defined in two files, the value from the last file will
override the value from the first one.
In a fresh installation, LAVA installer will automatically create some setting files
for you:
* `/etc/lava-server/settings.d/00-secret-key.yaml`: django [SECRET_KEY]
* `/etc/lava-server/settings.d/00-database.yaml`: django [DATABASES]
You can then create some file to customize your instance.
The list of available values is listed in:
* [Django settings](https://docs.djangoproject.com/en/3.2/ref/settings/)
* [LAVA settings](https://gitlab.com/lava/lava/-/blob/master/lava_server/settings/common.py)
!!! warning "Legacy configuration"
In previous LAVA versions, the settings where saved in three files:
* `/etc/lava-server/settings.conf` (json)
* `/etc/lava-server/secret_key.conf` (json)
* `/etc/lava-server/instance.conf` (ini)
LAVA will still load this files prior to load the new setting files.
!!! tip "Applying changes"
When updating the settings, you should restart **every** LAVA services.
### Environment variables
Admins can also pass settings via environment variables. This is mainly used in
cloud setup like docker-compose or k8s.
The following variables are supported:
* `ALLOWED_HOSTS`
* `DATABASE_URL` (see django-url documentation)
* `INSTANCE_NAME`
* `SECRET_KEY`
* `LAVA_SETTINGS_*` (without the `LAVA_SETTINGS_` prefix).
In order to add complex types, admins can use `LAVA_JSON_SETTINGS`. This
variable should contain a dictionary of settings as a json string base64
encoded.
```python
import base64
import json
data = {
"WORKER_AUTO_REGISTER_NETMASK": ["::1"]
}
print(base64.b64encode(json.dumps(data).encode("utf-8")).decode("utf-8"))
```
In order to use it, add to the environment: `LAVA_JSON_SETTINGS="eyJXT1JLRVJfQVVUT19SRUdJU1RFUl9ORVRNQVNLIjogWyI6OjEiXX0="`.
## Worker configuration
### Devices
The device dictionaries are stored into `/etc/lava-server/dispatcher-config/devices/`.
The files should belong to `lavaserver` user and group.
More information in the [technical reference](../../../technical-references/configuration/device-dictionary.md).
### Device-types
The device-type templates are stored into `/etc/lava-server/dispatcher-config/device-types/`
The files should belong to `lavaserver` user and group.
For supported device-types, the templates provided by LAVA are stored in
`/usr/share/lava-server/device-types`. LAVA looks for the template first in
`/etc/lava-server/dispatcher-config/device-types/` and then fallback to
`/usr/share/lava-server/device-types`.
More information in the [technical reference](../../../technical-references/configuration/device-type-template.md).
### Health-checks
The health-checks are stored into `/etc/lava-server/dispatcher-config/health-checks/`
The files should belong to `lavaserver` user and group.
More information in the [technical reference](../../../technical-references/configuration/health-check.md).
### Dispatcher
!!! warning "TODO"
--8<-- "refs.txt"
|