Commit ea96289d authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixes to configuration.

parent 1af5d2b1
......@@ -13,30 +13,14 @@
# limitations under the License.
import os
import argparse
SECRET_KEY = 'InVzZXIxQGdtlsLmNvbSI.YH6iB4wE5dDMNjpf-cX2Q9MIjyY'
_default_dmss_host = os.environ.get('ENC_DMSS_HOST', 'localhost')
_default_dmss_port = int(os.environ.get('ENC_DMSS_PORT', '27017'))
_default_dmss_db = os.environ.get('ENC_DMSS_DB', 'nomad_dmss')
_default_es_host = os.environ.get('ENC_ES_HOST', 'localhost')
_default_es_port = int(os.environ.get('ENC_ES_PORT', '9200'))
_default_es_index = os.environ.get('ENC_ES_INDEX', 'nomad')
parser = argparse.ArgumentParser(description='The encyclopedia API.')
parser.add_argument('--dmss-host', help='the mongo dmss host name or ip address', default=_default_dmss_host)
parser.add_argument('--dmss-port', help='the mongo dmss port', default=_default_dmss_port, type=int)
parser.add_argument('--dmss-db', help='the mongo db that contains the dmss data to serve', default=_default_dmss_db)
parser.add_argument('--es-host', help='the elasticsearch host name or ip address', default=_default_es_host)
parser.add_argument('--es-port', help='the elasticsearch port', default=_default_es_port, type=int)
parser.add_argument('--es-index', help='the elasticsearch index that should be used for searches', default=_default_es_index)
dmss_config = dict(host=os.environ.get('ENC_DMSS_HOST', 'localhost'),
port=int(os.environ.get('ENC_DMSS_PORT', '27017')),
db=os.environ.get('ENC_DMSS_DB', 'nomad_dmss'))
args = parser.parse_args()
es_config = dict(host=os.environ.get('ENC_ES_HOST', 'localhost'),
port=int(os.environ.get('ENC_ES_PORT', '9200')),
index=os.environ.get('ENC_ES_INDEX', 'nomad'))
dmss_config = dict(host=args.dmss_host, port=args.dmss_port, db=args.dmss_db)
es_config = dict(host=args.es_host, port=args.es_port, index=args.es_index)
......@@ -14,5 +14,6 @@
from app import app
if __name__ == '__main__':
app.run(debug=True)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment