Config¶
We use flask.app.config
, so to use it do:
from flask import current_app as app
print(app.config['SERVER_DOMAIN'])
Configuration is combination of default settings module and settings module in application repo.
Default settings¶
Mongo connections¶
PORT
¶
Default [API]: '5700'
Default [FileServer]: '5750'
Env. Var [API]: SAMS_PORT
Env. Var [FileServer]: SAMS_PUBLIC_PORT
Elastic settings¶
Monitoring settings¶
LOG_CONFIG_FILE
¶
Default: logging_config.yml
(in the current working directory)
Env. Var [API]: SAMS_LOG_CONFIG
Env. Var [FileServer]: SAMS_PUBLIC_LOG_CONFIG
Storage Provider/Destination settings¶
STORAGE_PROVIDERS
¶
Default:
[
'sams.storage.providers.mongo.MongoGridFSProvider',
'sams.storage.providers.amazon.AmazonS3Provider',
]
STORAGE_DESTINATION_<x>
¶
Default: None
Asset settings¶
MAX_ASSET_SIZE
¶
Default: '0'
Env. Var: SAMS_MAX_ASSET_SIZE
Set’s a global restriction on the maximum size of an Asset allowed to be uploaded.
Authentication¶
Use the following config attribute to control the type of authentication the application will use. This variable will point to the Python module to use.
SAMS_AUTH_TYPE
¶
Default: 'sams.auth.public'
Env. Var [API]: SAMS_AUTH_TYPE
Env. Var [FileServer]: SAMS_PUBLIC_AUTH_TYPE
In-built authentication modules:
sams.auth.public
(No Authentication)sams.auth.basic
(Basic HTTP Authentication)
CLIENT_API_KEYS
¶
This config attribute is for use by sams.auth.basic
module, and will provide the API Keys to allow.
The value should be a comma separated list of API Keys.
Default: ''
Env. Var [API]: SAMS_CLIENT_API_KEYS
Env. Var [FileServer]: SAMS_PUBLIC_API_KEYS