This python flask app provides REST API endpoints for centralized configuration. Configuration data is stored as JSON in a Mongo database, and backed up in flat files.
This system uses MongoDB, gunicorn and nginx, and depends on docker and docker-compose to run.
To run on production:
sh restart_prod.sh
- Update files for the MongoDB read/write user
cp mongo-init_template.js mongo-init.js cp api/config_template.cfg api/config.cfg
- In mongo-init.js, replace the asterisks with the desired password.
- In api/config.cfg, on the MONGO_URI line: a. Replace the asterisks with the desired password. b. Replace "hostname" with the correct hostname.
- Update docker-compose-prod.yml or docker-compose-dev.yml as appropriate to reflect the desired password for the root user in the MONGO_INITDB_ROOT_PASSWORD line.
- Update nginx.conf or nginx-dev.conf as appropriate to reflect the correct hostname.
- Run the application using restart_prod.sh or restart_dev.sh as appropriate.
- The API is now available at
http://your-hostname/
. Opening this url in your browser will bring up the API documentation.
Rob Svirskas (svirskasr@janelia.hhmi.org)