Configuration Parameters¶
In this section you will find all options which are configurable to make the application fit your needs.
When you have natively installed the MUSCLE application ,
create a file called .muscleenv (alternatively .env)
in the top level directory of the backend source, where you export all configuration parameters.
When you are using docker, you can export the variables in the docker compose file or when starting the container with -e.
Below are the configurable parameters of the following form:
CONFIGURATION_PARAMETER = default_value
Application¶
MUSCLE_BRAND_NAME = MUSCLE
The brand name which will be displayed in the application.
MUSCLE_USER_DEFAULT_PWD = muscle
The default password which a user gets if no other is specified in the register procedure.
MUSCLE_USER_PWD_MIN_LENGTH = 8
The minimum password length, this does not affect the default password. Must not be greater than 100, the application will fail to start otherwise.
Database¶
MUSCLE_DB_PATH = <BACKEND_INSTALL_DIR>/backend/database/
The path where the database file gets stored.
MUSCLE_DB_NAME = muscle.db
The name of the database file. Since the used DB is SQLite by default, it is a single file.
MUSCLE_DATABASE_URL = sqlite:///<MUSCLE_DB_PATH><MUSCLE_DB_NAME>
Overrides the database connection entirely with any SQLAlchemy-compatible URL, for example to use PostgreSQL or MySQL instead of the default SQLite file. When set, MUSCLE_DB_PATH and MUSCLE_DB_NAME are ignored.
Devices¶
MUSCLE_DEVICE_RESP_TIMEOUT = 1000
The maximum time in milliseconds the application will wait for a device to answer. Must not be less than 1000, the application will fail to start otherwise.
MUSCLE_DEVICE_OFFLINE_SAMPLING = 60000
The sampling in milliseconds for the application to poll the devices for dashboard data if they are offline. This is mostly to detect when the device gets available. Must not be less than 60000, the application will fail to start otherwise.
MUSCLE_DEVICE_ONLINE_SAMPLING = 10000
The sampling in milliseconds for the application to poll the devices for dashboard data if they are online but no action initiated by the application is taking place. Must not be less than 100, the application will fail to start otherwise.
MUSCLE_DEVICE_RUNNING_SAMPLING = 1000
The sampling in milliseconds for the application to poll the devices for dashboard data if the device is fulfilling a task initiated by the application. Must not be less than 50, the application will fail to start otherwise.
Logging¶
MUSCLE_LOG_PATH = <MUSCLE_INSTALL_DIR>/logs/
Where the access and application logs will be stored.
Note
Setting this to /dev together with MUSCLE_LOG_FILE/MUSCLE_ACCESS_LOG_FILE set to
stdout routes logs to the process’s standard output/error instead of files - this is what the
docker image uses by default.
MUSCLE_LOG_MAX_SIZE = 10485760
Maximum size of one log file in Bytes, default is 10MiB. When the size is reached a new one will be created, at maximum MUSCLE_LOG_MAX_BACKUPS before the oldest gets overwritten. Must not be greater than the default (10MiB), the application will fail to start otherwise - i.e. this value can only be decreased.
MUSCLE_LOG_MAX_BACKUPS = 5
How many log files to store before overwriting the oldest one. Must not be greater than 10, the application will fail to start otherwise.
MUSCLE_LOG_FILE = muscle.log
The name of the application log file.
MUSCLE_LOG_LEVEL = ERROR
Log level for the application log. Can be either DEBUG, INFO, WARNING, ERROR or CRITICAL
MUSCLE_ACCESS_LOG_ENABLE = true
Enable server access logs.
MUSCLE_ACCESS_LOG_FILE = muscle_access.log
The name of the access log file.
Sessions & Security¶
Warning
The secret key used to sign login sessions is generated randomly every time the backend process starts and is not configurable. This means restarting the backend (e.g. redeploying, restarting the docker container) invalidates every currently logged-in session - all users will be logged out.
Access tokens expire after 10 minutes and refresh tokens after 60 minutes (neither is currently configurable). Session cookies are not marked Secure, so consider this when deciding whether to place a TLS-terminating reverse proxy in front of MUSCLE.