Basic local dev setup
If you want to connect to S3 to save wagtail media, and uploaded docs, create an
.env file in the
root of the project and add the below snippet to it. This file in not version controlled and is always
present so you do not need to constantly export vars.
S3_STORAGE=True, if you want to upload to the local host, then set it to
Security You need to have your IP whitelisted to be able to sync your database for security reasons.
AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID> AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY> AWS_STORAGE_BUCKET_NAME=ids-com-dev S3_STORAGE=True ES_HOST=elasticsearch ES_PASS=<ES_PASS> ES_INDEX_PREFIX=dev DOCS_API_KEY=<DOCS_API_KEY>
make up make syncdb make migrate make index_backend make index_s3 make dev_site #for frontend dev make dev_backend #for backend dev
make shell_backend and
chown uwsgi:uwsgi -R /home/app/media/, if you are working with media files locally.
If you need to update python packages or make other changes to the docker image:
- Update requirements.txt and/or prod.txt
- Update references to
docs-backendversion number, as seen in this commit
- Then build and push the docker container as follows, getting the docker credentials from an admin:
make build_backend docker login docker push hookandloop/docs-backend:1.0.6
Make sure to update the
push command with the version number you just created.
To browse the indexes through the browser, navigate to here https://localhost:9200/_cat/indices?v
- Properly manage SSL certificates between the ES and backend container.
- Set our own username.
- Nightly ES index backup to S3.
- Securing the index that is currently deployed on the EC2 instance. Which should be done after the above.
Generate a certificate for prod
Stop nginx first.
sudo certbot certonly -d design.infor.com
sudo certbot certonly -d staging.design.infor.com
sudo certbot renew
Crontab for auto renew every 12 hours.
0 */24 * * * /usr/local/bin/cert_renew.sh >> /var/log/cronjob.log 2>&1