Wiki

Clone wiki

kobo-install / enketo

Enketo

TODO

  • Play nicely with kobocat/kpi nginx

Prerequisites

  • clone the kobo-install repository in ~/src (git clone git@bitbucket.org:unhcr/enketo-express.git) and switch to docker-unhcr branch: git fetch && git checkout docker-unhcr

Settings

  • Set Enketo Express's API key, the linked form and data server, and any additional desired configurations in the file setup/docker/envfile.txt.
diff --git a/setup/docker/envfile.txt b/setup/docker/envfile.txt
index 8a27dbe..25caf03 100644
--- a/setup/docker/envfile.txt
+++ b/setup/docker/envfile.txt
@@ -1,9 +1,9 @@
 # Necessary variable.
-ENKETO_API_KEY=
+ENKETO_API_KEY=secret

 # Optional variables (and their default values).
 #ENKETO_OFFLINE_SURVEYS=True
-#ENKETO_FORM_DATA_SERVER_URL=kobocat
+ENKETO_FORM_DATA_SERVER_URL=.*
 #ENKETO_REDIS_MAIN_HOST=redis_main
 #ENKETO_REDIS_MAIN_PORT=6379
 #ENKETO_REDIS_MAIN_PASSWORD=
  • (Optional) For HTTPS, copy your SSL certificate and key files to setup/docker/secrets/ssl.crt and setup/docker/secrets/ssl.key respectively (take care not to commit these files back to any public git repository). Plain HTTP requests to Enketo Express will be automatically redirected to https://${SSL_HOSTNAME}/$request_uri; the SSL_HOSTNAME environment variable can set e.g. with export SSL_HOSTNAME=ee-staging.kobotoolbox.org before running Enketo (see step 4).

  • Set the REDIS_HOST env var: export REDIS_HOST=$(ifconfig | grep -A 1 'docker0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1). TODO: include in set_vars

Installation

  1. Execute docker-compose up -d from the project directory and wait to see e.g. Worker 1 ready for duty....

  2. To stop, execute docker-compose stop from the project directory. Database dumps from the main Redis instance will be mapped to the directory setup/docker/redis_main_data/.

The app should now be running on localhost.

Updated