lemur icon indicating copy to clipboard operation
lemur copied to clipboard

Feature request: Load/generate config from environment variables

Open lukasmrtvy opened this issue 7 years ago • 0 comments

python3 manage.py create_config should generate lemur.conf.py in format:

import os
_basedir = os.path.abspath(os.path.dirname(__file__))
...
LEMUR_DEFAULT_COUNTRY = os.environ.get('LEMUR_DEFAULT_COUNTRY ','DefaultCountry')
LEMUR_DEFAULT_STATE = os.environ.get('LEMUR_DEFAULT_STATE  ','DefaultState')
LEMUR_DEFAULT_LOCATION = os.environ.get('LEMUR_DEFAULT_LOCATION ','DefaultLocation')
LEMUR_DEFAULT_ORGANIZATION = os.environ.get('LEMUR_DEFAULT_ORGANIZATION ','DefaultOrg')
LEMUR_DEFAULT_ORGANIZATIONAL_UNIT = os.environ.get('LEMUR_DEFAULT_ORGANIZATIONAL_UNIT ','DefaultUnit')
...

This is much more consistent way to configure lemur for Docker images (docker run -d --name lemur -e LEMUR_DEFAULT_COUNTRY=CustomCountry -e LEMUR_DEFAULT_STATE=CustomState, etc) and it will not break anything.

Thanks

lukasmrtvy avatar Dec 20 '18 22:12 lukasmrtvy