ahripak / cert-viewer

A web app for viewing and validating digital certificates on the Bitcoin blockchain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

cert-viewer

The cert-viewer project is a Flask webapp to display and verify blockchain certificates after they have been issued and to allow learners to request a certificate and generate their own Bitcoin identity needed for the certificate creation process.

Quick Start using Docker

Steps

  1. First ensure you have Docker installed. See our Docker installation help.

  2. Git clone the repository and change to the directory

    git clone https://github.com/blockchain-certificates/cert-viewer.git && cd cert-viewer
  3. From a command line in the cert-viewer dir, run docker-compose

    docker-compose build
  4. Start the container

    docker-compose up
  5. The output of the previous command (example below) will tell you how to access the site. You can enter that value in a browser.

    web_1         | INFO -  * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
    

About Docker Setup

The quick start steps do the following:

  1. Creates a container that runs the cert-viewer Flask app with MongoDB using Docker Compose details
  2. Copies the certificates in cert_data into the Docker container's file system.
  3. Starts the container. This configuration exposes port 5000.

Installation and Configuration

These steps allow you to install and run outside outside of Docker. Step 5 describes the configuration options that should be changed if you're using this for anything other than demo purposes.

Steps

  1. Ensure you have an python environment. Recommendations

  2. Install mongodb

  3. Git clone the repository and change to the directory

    git clone https://github.com/blockchain-certificates/cert-viewer.git && cd cert-viewer
  4. Setup your conf.ini file (see 'Configuration')

  5. Start mongo database. --dbpath can be left off if you used the default location

    mongod --dbpath <path to data directory>
  6. Run cert-viewer setup

    pip install .
  7. Run the flask server

    python run.py
  8. Open http://localhost:5000

Configuration

  1. Copy the template ini file

    cp conf_template.ini conf.ini
  2. Edit the following entries (refer to conf_sample.ini for examples):

    • secret_key is a random string used by Flask as a secret key to enable cryptographically signed session
    • mandrill_api_key is used to send out notifications when a user signs up. Setup your mandrill account at https://www.mandrill.com/
    • mongodb_uri is used to access your mongodb instance. The canonical form is mongodb://<username>:<password>@<domain>:<mongo_port>/<db_name>. Examples follow:
      • Local mongo installation: mongodb_uri = mongodb://localhost:27017/test
      • Docker installation: mongodb_uri = mongodb://<DOCKER_MACHINE_IP>:27017/test, where DOCKER_MACHINE_IP is given by docker-machine ip
    • cert_store_type is the type of key value store to use for certificates
    • cert_store_path is the file system path to the certificates

See cert-store for information on advanced certificate storage setup.

Unit tests

This project uses tox to validate against several python environments.

  1. Ensure you have an python environment. Recommendations

  2. Run tests

    ./run_tests.sh
    

Database collections

About the database collections

Contact

Contact info@blockcerts.org with questions

About

A web app for viewing and validating digital certificates on the Bitcoin blockchain

License:MIT License


Languages

Language:Python 40.4%Language:HTML 38.8%Language:CSS 10.5%Language:JavaScript 10.3%Language:Shell 0.0%