Configuration¶
The service allowed two variant of configuration:
use the Configurator service
use the configuration file
The service reads settings from the configuration file by default.
You can specify the –luna-config option for pulling settings from the Configurator service, see configurator.
Auto reload configuration¶
The service supports an auto-reload of configurations. You can enable this feature by specifying a config-reload option in the command line. The service periodically checks new settings. If current settings and new pulled settings are the same the service will not perform any actions. You can specify the check period in the pulling-time command line argument (10 seconds by default).
If a configuration fetching has failed, the service will work without applying any changes to the existing configurations.
If check connections with the new configuration have failed, the service will retry pulling new configuration after pulling-time seconds. The service will shut down after 10 failed attempts.
Warning
Service can work incorrectly while the new settings are being applied. It is strongly recommended not to send requests to the service when you change important settings (s3 credentials, work plugins list, and others).
Configuration files for administrator¶
# LUNA Image Store configurator file
[LUNA_CONFIGURATOR]
#: [integer] load configs from LUNA Configurator
USE_CONFIGURATOR = 0
#: [string] LUNA Configurator protocol, IP address, and port
LUNA_CONFIGURATOR_ORIGIN = http://127.0.0.1:5070
#: [integer] API version of the LUNA Configurator
LUNA_CONFIGURATOR_API = 1
[LUNA_IMAGE_STORE_LOGGER]
#: [string] folder, where logs are saved (relative path begins in directory with application)
FOLDER_WITH_LOGS = ./
#: [string] level of debug print, by priority: "ERROR", "WARNING", "INFO", "DEBUG"
LOG_LEVEL = INFO
#: [string] time format used in log records: "LOCAL" or "UTC"
LOG_TIME = LOCAL
#: [integer] maximum log file size in megabytes before performing rotation (0 - without rotation)
MAX_LOG_FILE_SIZE = 1024
#: send log to stdout
LOG_TO_STDOUT = 1
#: send log to file
LOG_TO_FILE = 0
#: allow multiline stack trace in logs
MULTILINE_STACK_TRACE = 1
[INFLUX_MONITORING]
#: [integer] send data for monitoring to InfluxDB
SEND_DATA_FOR_MONITORING = 0
#: [string] InfluxDB 2.x workspace
ORGANIZATION = luna
#: [string] InfluxDB 2.x authentication token
TOKEN = kofqt4Pfqjn6o0RBtMDQqVoJLgHoxxDUmmhiAZ7JS6VmEnrqZXQhxDhad8AX9tmiJH6CjM7Y1U8p5eSEocGzIA==
#: [string] InfluxDB 2.x bucket name
BUCKET = luna_monitoring
#: [string] InfluxDB IP address
HOST = 127.0.0.1
#: [integer] InfluxDB port
PORT = 8086
#: [integer] use HTTPS to connect to InfluxDB
USE_SSL = 0
#: [integer] frequency of sending monitoring data to InfluxDB (in seconds)
FLUSHING_PERIOD = 1
[LUNA_IMAGE_STORE_HTTP_SETTINGS]
#: web server http settings
#: [integer] service request timeout (in seconds)
REQUEST_TIMEOUT = 60
#: [integer] service response timeout (in seconds)
RESPONSE_TIMEOUT = 600
#: [integer] max request size (in bytes), default ~130gb
REQUEST_MAX_SIZE = 137438953472
#: [integer] service http keep-alive timeout (in seconds)
KEEP_ALIVE_TIMEOUT = 15
[OTHER]
#: [string] type of storage: "S3" or "LOCAL", where "LOCAL" is HDD
STORAGE_TYPE = LOCAL
#: [string] folder, where images are stored (relative path begins in directory with application)
LOCAL_STORAGE = ./local_storage
#: [string] current image extension: jpg or png
DEFAULT_IMAGE_EXTENSION = jpg
#: [list(string)] list of active plugins
LUNA_IMAGE_STORE_ACTIVE_PLUGINS = []
# Luna image store configurator file
[LUNA_IMAGE_STORE_LOGGER]
#: folder, where logs are saved
FOLDER_WITH_LOGS = ./
#: level of debug print, by priority: "ERROR", "WARNING", "INFO", "DEBUG"
LOG_LEVEL = INFO
#: time format used in log records: "LOCAL" or "UTC"
LOG_TIME = LOCAL
#: maximum log file size in megabytes before performing rotation (0 - without rotation)
MAX_LOG_FILE_SIZE = 1024
#: send log to stdout
LOG_TO_STDOUT = 1
#: send log to file
LOG_TO_FILE = 1
#: allow multiline stack trace in logs
MULTILINE_STACK_TRACE = 1
[INFLUX_MONITORING]
#: [integer] send data for monitoring to InfluxDB
SEND_DATA_FOR_MONITORING = 1
#: [string] InfluxDB 2.x workspace
ORGANIZATION =
#: [string] InfluxDB 2.x authentication token
TOKEN =
#: [string] InfluxDB 2.x bucket name
BUCKET = luna_monitoring
#: [string] InfluxDB IP address
HOST = 127.0.0.1
#: [integer] InfluxDB port
PORT = 8086
#: [integer] use HTTPS to connect to InfluxDB
USE_SSL = 0
#: [integer] frequency of sending monitoring data to InfluxDB (in seconds)
FLUSHING_PERIOD = 1
[OTHER]
#: [string] type of storage: "S3" or "LOCAL", where "LOCAL" is HDD
STORAGE_TYPE = S3
#: path to store images on hard drive
LOCAL_STORAGE = ./local_storage
[S3]
#: public *access key* to access s3
AWS_PUBLIC_ACCESS_KEY = ZNKIA8F7EAKF3VAS93DC
#: private *access key* to access s3
AWS_SECRET_ACCESS_KEY = YsC9dDiyA3JE18ATR3wusi9y7RMRItpjQHAmUgMu
#: endpoint of S3
HOST = https://s3.eu-central-1.amazonaws.com
#: region of amazon s3
REGION = eu-central-1
#: version of authorization signature ("s3v2" or "s3v4")
AUTHORIZATION_SIGNATURE = s3v4
Extended administrator configuration¶
Module for parsing config file
Module set values in global variables.