---
title: "Configuration"
description: "Configuration file of the LumiScan Annotation Web server: address and port, HTTPS, project folders, database, backups, box suggestions, built-in networks, S3, sign-in, logging and personal data in the log."
product: "LumiScan Annotation Web"
component: "lumiscan-annotation-web"
version: "2.6.0"
display_version: "2.6.0.1"
latest_version: false
language: "en"
url: "https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/configuration.html"
---

# Configuration – LumiScan Annotation Web

The server reads one JSON file, given with `--config`. An example with every section is in `config\annotation-server.example.json`. Relative paths are relative to the folder of the configuration file. Secrets (passwords, keys) can be kept in separate files that only the service account may read: use the keys ending in `_file`.

## Example

```json
{
  "bind": "0.0.0.0",
  "port": 8080,
  "public_url": "https://annotation.example.com",
  "projects_root": "../projects",
  "project_folders": ["D:/LumiScan"],
  "data_root": "D:/LumiScan/annotation-data",
  "database": "annotation-server.db",
  "web_root": "../www",
  "log_dir": "../logs",
  "backup": { "dir": "../backups", "every_hours": 24, "keep": 14 },
  "pre_annotation": [
    { "url": "http://gpu-server:8090", "token_file": "preannotate.token" }
  ],
  "auth": {
    "local_login": true,
    "default_role": "annotator",
    "ldap": { "enabled": false },
    "oidc": { "enabled": false }
  }
}
```

## Keys

| Key | Meaning |
| --- | --- |
| `bind`, `port` | Listen address (default `0.0.0.0`, all network interfaces) and port (default `8080`). |
| `public_url` | The address users open, for example `https://annotation.example.com`. Needed behind a reverse proxy and for single sign-on (redirect address). |
| `https` | `auto` (default), `on` or `off`. See [HTTPS](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/configuration.html#https). |
| `tls_cert`, `tls_key` | Certificate and private key (PEM) for HTTPS. Without them the server uses a self-signed certificate. See [HTTPS](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/configuration.html#https). |
| `tls_names` | Optional list: further host names or IP addresses for the self-signed certificate. |
| `web_root` | The web pages. Default: `www` next to the program. |
| `data_root` | Optional: an image folder that becomes the project `default`, open to all users. This is how existing installations of version 2.0 keep working. |
| `projects_root` | Folder for new and imported projects. Default: `projects` next to the configuration. |
| `project_folders` | Optional list: admins may create projects on existing folders only below these. |
| `s3_targets` | Optional list of S3 buckets for projects, see [Projects in S3 Buckets](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/projects-in-s3-buckets.html). |
| `pre_annotation` | Optional: one box suggestion service or a list of them, each with `url`, `token_file` (or `token`), `timeout_s`, `enabled`. See [Box Suggestion Service](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/box-suggestion-service.html). An entry with `"type": "onnx"` runs the networks of a folder inside the server instead, see [Built-in networks](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/configuration.html#built-in-networks). |
| `update_check` | `true`: once a day the server asks docs.hdvisionsystems.com which version is current and shows project admins **Version … available**. Nothing is downloaded. Default: off; on in the single-PC installation. |
| `database` | The database: accounts, sessions, projects, history, notes. Default: `annotation-server.db` next to the configuration. **Local disk only**, never on a network share. |
| `index_refresh_seconds` | How often the project folders are scanned for changes made outside the web app. Default 60. |
| `upload_max_mb` | Largest image file project admins may [add through the browser](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/adding-images.html), in MB. Default 2048. |
| `translations_dir` | Folder with your own translation tables of the interface; they win over the tables installed with the app. Default: `translations` next to the configuration. See [Languages and Translations](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/languages-and-translations.html). |
| `lock_lease_seconds` | How long an edit lock lasts without renewal. Default 60; the browser renews it while the image is open. |
| `log_dir` | Folder for rotating log files. Without it, the log goes to the console only. |
| `log_personal_data` | `keep` (default), `pseudonymize` or `omit`: what happens to user names, computer addresses and e-mail addresses in the console and the log files, from version 2.6. See [Personal data in the log](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/configuration.html#personal-data). |
| `log_pseudonym_key_file` | The key of the pseudonyms. Default: `log-pseudonym.key` next to the configuration. See [Personal data in the log](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/configuration.html#personal-data). |
| `telemetry` | Optional: also send the log to an OpenTelemetry collector (Loki, OpenTelemetry Collector, Grafana Alloy), from version 2.6. See [Logging with OpenTelemetry](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/logging-with-opentelemetry.html). |
| `backup.dir`, `backup.every_hours`, `backup.keep` | Automatic backups: folder (default `backups` next to the configuration), interval in hours (default 24), number kept (default 14). See [Backup and Restore](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/backup-and-restore.html). |
| `auth` | Sign-in methods and sessions, see [Sign-in Methods](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/sign-in-methods.html). |
| `license` | The licence check: `check_interval_s`, seconds between checks (default 30). Leave `access` at its default: the server uses the LumiScan Key plugged into it. See [Licence](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/requirements.html#licence). |

## Built-in networks {#built-in-networks}

An entry of `pre_annotation` with `"type": "onnx"` runs your trained LumiScan networks inside the server, without a box suggestion service and without Python, as the [single-PC installation](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/single-pc-installation.html#box-suggestions-without-a-server) does. It can stand next to services in the list.

```json
"pre_annotation": [
  { "type": "onnx", "networks": "networks", "device": "auto" }
]
```

| Key | Meaning |
| --- | --- |
| `networks` | Folder with the network folders exported by LumiScan Training (`network.onnx` + `network_description.json`), one folder per network. Default: `networks` next to the configuration. |
| `device` | Where the networks run. `auto` (default): an NVIDIA graphics card with CUDA if the computer can run it (NVIDIA driver, CUDA 12 and cuDNN 9), otherwise the processor. `cuda` or `cpu` chooses one; if it cannot be used, the networks run on the processor and the log says why. Builds with other ONNX Runtime providers also accept `openvino` (Intel), `migraphx` (AMD, Linux) and `coreml` (macOS). |
| `gpu` | Which graphics card, when the computer has several: `0` (default) is the first. |
| `threads` | Processor threads per network; `0` (default): as many as the processor has. |
| `bgr` | `true` for networks trained on BGR images. |
| `runtime` | Optional: a folder with an ONNX Runtime of your own (`onnxruntime.dll`, `libonnxruntime.so.1`), used instead of the one installed with the server. |

The log names the ONNX Runtime and the device of every network at the start, for example `network 'line-5-parts' (3 classes, input anyxany) on CUDA (GPU 0)`. The [REST API](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/rest-api.html) reports them too: `GET /api/preannotate/services` gives `device` per service and per network.

## HTTPS {#https}

The server speaks HTTPS by default, so passwords and session cookies never travel unencrypted. Users open `https://<server>:<port>/`, for example `https://annotation-pc:8080/`. The port speaks either HTTPS or HTTP: an address with `http://` gets no answer.

- **Self-signed certificate (default):** Without `tls_cert` and `tls_key`, the server creates a certificate at the first start and keeps it in the folder `tls` next to the configuration (`self-signed-cert.pem`, `self-signed-key.pem`). Nothing needs to be set up.
  - The certificate names the computer’s host name, `localhost`, the computer’s network addresses, the host of `public_url` and the entries of `tls_names`. Add to `tls_names` any further name or IP address users type, for example a DNS alias.
  - It is valid for 825 days. The server renews it 30 days before it expires, also while it runs, and when a name from `public_url` or `tls_names` is missing in it.
  - Browsers show a warning such as "Your connection is not private" until they trust the certificate. Compare the SHA-256 fingerprint in the warning’s certificate details with the one the server log shows at the start (`HTTPS: SHA-256 fingerprint …`), then continue. To avoid the warning, import `self-signed-cert.pem` on the clients as a trusted certificate (Windows: **Trusted Root Certification Authorities**, macOS: Keychain, **Always Trust**), or use a certificate of your company’s CA.
  - Back up the `tls` folder with the configuration (the automatic backups include it). A new certificate means a new warning on every client.

- **Your own certificate:** Set `tls_cert` and `tls_key` to the PEM files of a certificate from your company’s CA or a public CA (the certificate with its intermediate certificates) and its key. The server checks at the start that both belong together and warns 30 days before the certificate expires. Restart the server after replacing the files.
  ```json
    "tls_cert": "tls/annotation.pem",
    "tls_key": "tls/annotation.key",
  ```

- **Behind a reverse proxy (nginx, IIS, Apache):** The proxy terminates TLS and forwards to the server on the same computer, for example on `127.0.0.1:8080`. With `"bind": "127.0.0.1"` the server stays on plain HTTP by itself (`"https": "auto"`); otherwise set `"https": "off"`. Set `public_url` to the address users open. The proxy should send the header `X-Forwarded-Proto: https`, so the session cookie is marked secure.
  ```nginx
  server {
      listen 443 ssl;
      server_name annotation.example.com;
      ssl_certificate     /etc/ssl/annotation.pem;
      ssl_certificate_key /etc/ssl/annotation.key;
      client_max_body_size 64m;
      location / {
          proxy_pass http://127.0.0.1:8080;
          proxy_set_header Host $host;
          proxy_set_header X-Forwarded-Proto https;
          proxy_read_timeout 600s;
      }
  }
  ```

  `client_max_body_size` must allow the 8 MB pieces of a project import.

## Personal data in the log {#personal-data}

The log names users and the addresses of their computers, for example when someone signs in: `jdoe logged in (oidc) from 192.168.31.77`. From version 2.6 you decide for each log output what happens to such values:

| Setting | In the log |
| --- | --- |
| `keep` | The values as they are: `jdoe logged in (oidc) from 192.168.31.77`. |
| `pseudonymize` | A pseudonym instead of each value: `user-3f9a1c2b7d logged in (oidc) from addr-8e01c47a2b`. The same user always gets the same pseudonym on this server, so the lines of one user can still be followed; without the server’s key nobody can tell who it is. |
| `omit` | A placeholder: `[user] logged in (oidc) from [address]`. |

```json
  "log_personal_data": "keep",
  "telemetry": { "endpoint": "http://monitoring01:3100/otlp", "personal_data": "pseudonymize" },
```

- `log_personal_data`: the console and the log files. Default `keep`, as in earlier versions.

- `telemetry.personal_data`: the records sent with [OpenTelemetry](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/logging-with-opentelemetry.html). Default `pseudonymize`; `omit` when `log_personal_data` is `omit`.

- At the start the log says which setting applies, for example `Personal data in the log: keep (console, log file), pseudonymize (OpenTelemetry)`.
  - **What counts as personal data:**

- The names of all accounts of the server (local, LDAP, single sign-on), wherever they appear in a line, as whole words. Names of only 1 or 2 characters are recognised where the line marks them (sign-in and user administration), not elsewhere, so that ordinary words are not replaced.

- User names typed at a failed sign-in, also when there is no such account (it may be a password typed into the wrong field).

- The network addresses of the users' computers.

- E-mail addresses.

  Project names, folder and file names, labels and the server’s own addresses stay as they are. Passwords, tokens and image contents never appear in the log.
  - **The key of the pseudonyms:** At the first start that needs it, the server creates `log-pseudonym.key` next to the configuration, readable by the service account only; `log_pseudonym_key_file` names another file. The key is part of the [backups](https://docs.hdvisionsystems.com/en/lumiscan-annotation-web/2.6.0/backup-and-restore.html). Keep it as safe as the configuration: whoever has it can check which user a pseudonym stands for. A new key gives every user a new pseudonym. If the key cannot be read or written, the server leaves the values out and says so in the log.
  - **Finding the lines of a user:** `--pseudonym` prints the pseudonyms of a user name, an address or an e-mail address; then search the log for it.
    ```shell
    lumiscan-annotation-server --config annotation-server.json --pseudonym jdoe
    user:    user-3f9a1c2b7d
    address: addr-6b0d9e2f41
    e-mail:  email-0c7a5d93e8
    ```

## Sessions and security

- Sign-in creates a session cookie (HttpOnly, SameSite=Lax, Secure over HTTPS). A session ends after `auth.session_hours` without activity (default 12) and after `auth.max_session_days` at the latest (default 7).
- After 5 failed sign-ins an account is blocked for 15 minutes (30 failed attempts per network address).
- Disabling a user or resetting a password ends their sessions at once.
- Every change request needs the header `X-Requested-With: lsa`, which protects against cross-site requests.
