Skip to content

Digital identity demo and test application

Notifications You must be signed in to change notification settings

MikeClickr/di-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Repository di_demo

Config

The CONFIG environment variable points to a configuration file.

{
    /* The requestor defined in irmaserver.json in the IRMA server */
    "requestorname": "openstad_voting_pk",

    /* Every poll must have it's unique uuid, use a generator to create one */
    "uuid": "06c5a013-4e71-439a-b8da-65e35b6419f0",

    /* URL of the IRMA server */
    "irma": "https://attr.auth.amsterdam.nl",

    /* URL of Node server, optional with port number */
    "nodeUrl": "http://localhost:8000",

    /* Port number the Node server listens to */
    "port": 8000,

    /* Document root of site to serve, only for demo */
    "docroot": "../openstad",

    /* Keys of voting options */
    "voting_options": ["community", "tech", "zen"]
}

Install

cd voting_node
docker build -t voting_node .

Run

  1. Make sure IRMA is running (see https://gitlab.com/stanguldemond/irma_server_container)
  2. Add the URL of IRMA to server/*.json)
  3. Make sure PostgreSQL is running and a user is created:
cd dev/db
./postgres.sh

Run locally without Docker

cd voting_node/server
npm install
cd ../../dev
./start.sh

Run production mode

cd voting_node
docker run --rm -p80:8000 -e NODE_ENV=production -e CONFIG=config-prod.json -e PRIVATE_KEY="$(cat ../dev/private_key.pem)" -e POSTGRES_HOST=localhost -e POSTGRES_DATABASE=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=hj21kjy --name voting_container voting_node

Replace POSTGRES_HOST=localhost with IP address of Postgres.

Run development mode

cd voting_node
cp ../dev/config-dev.json server
docker build -t voting_node .
docker run -it --rm -p80:8000 -e CONFIG=config-dev.json -e PRIVATE_KEY="$(cat ../dev/private_key.pem)" -e POSTGRES_HOST=localhost -e POSTGRES_DATABASE=postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=hj21kjy --name voting_container voting_node

Replace POSTGRES_HOST=localhost with IP address of Postgres.

About

Digital identity demo and test application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 73.3%
  • JavaScript 14.4%
  • HTML 11.9%
  • Other 0.4%