Server configuration¶
A SimDB server reads its settings from an INI-style file named app.cfg in the
application configuration directory. Find that directory with:
dirname "$(simdb config path)"
The file must have 0600 permissions (owner read/write only), because it
contains secrets such as the admin password and Flask secret key.
This page is the reference for every app.cfg option. For task-oriented setup,
see the Operating a server guides.
[database]¶
Option |
Required |
Description |
|---|---|---|
|
Yes |
Database type: |
|
If |
SQLite database file. Defaults to |
|
If |
Database host. |
|
If |
Database port. |
|
If |
Database name. |
See Set up PostgreSQL.
[server]¶
Option |
Required |
Description |
|---|---|---|
|
Yes |
Root directory where simulation files are stored. |
|
Yes |
Password for the |
|
No |
Port the built-in server listens on. Defaults to 5000. |
|
No |
|
|
If |
Path to the SSL certificate file. |
|
If |
Path to the SSL key file. |
|
No |
Days that generated tokens stay valid. Defaults to 30. |
|
No |
Host set on ingested IMAS URIs so data can be fetched via an IMAS remote access server. For example |
|
No |
Port set on ingested IMAS URIs. See |
[flask]¶
Option |
Required |
Description |
|---|---|---|
|
Yes |
Key used to sign server messages and authentication tokens. Use at least 20 characters. |
|
No |
|
|
No |
|
|
No |
|
|
No |
Default Swagger UI state: |
[validation]¶
Option |
Required |
Description |
|---|---|---|
|
No |
|
|
No |
|
[file_validation]¶
Options for validating the contents of simulation data files. Currently only
the ids_validator is available. See
Configure validation.
Option |
Required |
Description |
|---|---|---|
|
No |
Name of the file validator, for example |
|
For |
Comma-separated directories containing extra rulesets. |
|
For |
Comma-separated ruleset names to apply. |
|
For |
|
|
For |
|
|
For |
Only apply rulesets whose names match these comma-separated values. |
|
For |
Only apply rulesets for these comma-separated IDS names. |
[email]¶
Outgoing SMTP server used to send watcher notifications.
Option |
Required |
Description |
|---|---|---|
|
Yes |
SMTP server hostname. |
|
Yes |
SMTP server port. |
|
Yes |
SMTP user to send mail from. |
|
Yes |
SMTP user password. |
[authentication]¶
Option |
Required |
Description |
|---|---|---|
|
Yes |
Authentication method: |
|
No |
|
|
If |
Name of the firewall header carrying the username. |
|
If |
Name of the firewall header carrying the user’s email. |
Active Directory (type = ActiveDirectory)¶
Option |
Required |
Description |
|---|---|---|
|
Yes |
Active Directory server. |
|
Yes |
Active Directory domain. |
|
No |
Path to the root CA certificate. |
LDAP (type = LDAP)¶
Option |
Required |
Description |
|---|---|---|
|
Yes |
LDAP server URI. |
|
Yes |
Bind string. May contain |
|
Yes |
Search base, for example |
|
Yes |
Filter to find the user. May contain |
|
No |
Bind user for queries. If omitted, queries run as the authenticated user. |
|
No |
Password for |
|
No |
Name of the user parameter in the search result. Defaults to |
|
No |
Name of the email parameter in the search result. Defaults to |
[cache]¶
Option |
Required |
Description |
|---|---|---|
|
No |
|
|
No |
Directory for |
|
No |
Default cache timeout in seconds. |
|
No |
Maximum number of items before eviction ( |
More options are available; take any setting from the
Flask-Caching documentation,
drop the CACHE_ prefix and lowercase it, for example CACHE_ARGS becomes
args.
[development]¶
Option |
Required |
Description |
|---|---|---|
|
No |
|
[celery]¶
Used by the optional background workers in the Docker Compose deployment.
Option |
Required |
Description |
|---|---|---|
|
For workers |
Message broker URL, for example |
|
For workers |
Result backend URL, for example |
[partition]¶
Option |
Required |
Description |
|---|---|---|
|
No |
Directory used for partitioned data, for example |
[role "NAME"]¶
Defines a named role. Each role section needs a users option.
Option |
Required |
Description |
|---|---|---|
|
Yes |
Comma-separated list of usernames in this role. |
Currently only the admin role is used: it grants access to the
simdb remote admin subcommands.
[role "admin"]
users = admin,user1,user2
Example: SQLite server¶
[flask]
flask_env = development
debug = True
testing = True
secret_key = CHANGE_ME_TO_A_LONG_RANDOM_STRING
[server]
upload_folder = /tmp/simdb/simulations
ssl_enabled = False
admin_password = admin
[database]
type = sqlite
[validation]
auto_validate = True
error_on_fail = True
[email]
server = smtp.example.org
port = 465
user = simdb@example.org
password = CHANGE_ME
[authentication]
type = None
Example: PostgreSQL server¶
[server]
upload_folder = /var/lib/simdb/simulations
ssl_enabled = False
admin_password = CHANGE_ME
[flask]
secret_key = CHANGE_ME_TO_A_LONG_RANDOM_STRING
[database]
type = postgres
host = localhost
port = 5432
name = simdb
[authentication]
type = None
Validation schema¶
Servers can require specific metadata through a validation-schema.yaml file in
the same configuration directory as app.cfg. It uses
Cerberus rules:
description:
required: true
type: string
Clients can inspect the active schema with simdb remote SERVER schema. See
Validation.