layerindex-web/docker
Amber Elliot 9a9bbeb8b6 Add user security questions
Add user security questions upon registration as extra authentication
for password reset. Three unique security questions must be chosen and
answered. Answers are then stored in the database with the same hashing
algorithm as the users's password.

On password reset, users get two chances to get two out of three
security questions answered correctly. After a second failure their
account is locked and email is sent to the admin. The same template is
shown for the axes lockout. Super user cannot reset their password until
they set security questions.

Users can update their security questions or add them if they weren't
originally set (in the case of super user) in Edit Profile.

Signed-off-by: Amber Elliot <amber.n.elliot@intel.com>
2019-07-17 11:30:56 +12:00
..
certs dockersetup: add HTTPS support and use by default 2019-07-17 11:30:56 +12:00
.gitconfig docker: correct comment in .gitconfig 2018-08-29 21:42:02 +12:00
git-proxy Docker based environment setup 2015-10-07 11:34:34 +01:00
migrate.sh docker: migrate all applications, not just layerindex 2018-07-23 08:40:00 +02:00
nginx-ssl.conf nginx: set some limits for DDOS protection 2019-07-17 11:30:56 +12:00
nginx.conf nginx: set some limits for DDOS protection 2019-07-17 11:30:56 +12:00
README docker: add setup script 2019-07-17 11:30:56 +12:00
refreshlayers.sh docker: enhance example setup 2018-07-23 08:40:00 +02:00
settings.py Add user security questions 2019-07-17 11:30:56 +12:00
updatelayers.sh docker: don't reload in updatelayers.sh 2018-07-23 08:40:00 +02:00

Layerindex Docker Setup Instructions

The script setup.py will set up and configure a cluster of 5 docker containers:

  • layersapp: the application
  • layersdb: the database
  • layersweb: NGINX web server (as a proxy and for serving static content)
  • layerscelery: Celery (for running background jobs)
  • layersrabbit: RabbitMQ (required by Celery)

The script will edit all necessary configuration files, build and launch all containers, and do the initial database setup. It is advised that you start with a .sql database file to prepopulate your database. The following instructions will walk you through the setup.

  1. Install docker and docker-compose per instructions: https://docs.docker.com/compose/install/ ** Note: for latest docker-compose version follow the directions above, rather than using apt.

  2. Clone the repo and checkout appropriate branch: git clone https://github.intel.com/peggleto/layerindex-web.git git checkout origin/dev_snapshot

  3. Run the setup script (dockerstup.py). You can optionally supply your hostname, proxy settings, a sql database file of layer mappings to import, and a host to container port mapping. For more information, run: ./dockersetup.py -h

    Example command to run containers with a proxy and with a database to import: ./dockersetup.py -d ~/databasedump.sql -p http://proxy-chain.intel.com:911

    During the setup you will be asked for a username, email and password to set up a super user for the database. This will allow you to access the database later, should you need to.

  4. Once the script completes, open a web browser and navigate to :<mapped_port>/layerindex. If you haven't supplied hostname and/or port mapping, this will by default be localhost:8080.

  5. If you have chosen to not supply a prepopulated database and are instead starting fresh, you should now follow the instructions in the "Database Setup" section of the main README.

  6. If you need to rerun this script for any reason a second time, make sure to tear the containers down first with docker-compose down. Otherwise, your new automatically generated root database password will not match.

  7. To update the layers in the future, you can optionally do the following:

    Run the layer updates docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py

    Or do a full refresh docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py -r

TROUBLESHOOTING:

  • Network issues behind a proxy when building container: On some Ubuntu systems, /etc/resolv.conf is set to 127.0.0.x, rather than your local DNS server. Docker will look there for your DNS server, and when it fails to find it it will default to using a public one (frequently 8.8.8.8). Many corporate proxies blocks public DNS servers, so you will need to manually supply the DNS server to docker using /etc/docker/daemon.json: {"dns": ["xx.xx.xx.xx] }