• Stars
    star
    168
  • Rank 225,507 (Top 5 %)
  • Language
    Python
  • Created about 6 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A command-line installer for setting up and running KoboToolbox on a remote server or local computer, using kobo-docker.

The purpose of the script is to install KoboToolbox in minutes without messing with configuration files. It prompts the user to answer some questions to create configuration files automatically and to start docker containers based on kobo-docker.

⚠️ You must observe the following when upgrading:

…from any release older than 2.022.44 (November 2022)

If you have already installed KoboToolbox between March 2019 and November 2022, you must complete a manual upgrade process before trying to upgrade. If you do not, kobo-install will not be able to start.

…from any release older than 2.020.18 (May 2020)

Prior to release 2.020.18, KPI and KoBoCAT both shared a common Postgres database. They now each have their own. If you are upgrading an existing single-database installation, you must follow these instructions to migrate the KPI tables to a new database and adjust your configuration appropriately.

If you do not want to upgrade at this time, please use the shared-database-obsolete branch instead.

…installations made prior to March 2019

If you have already installed KoboToolbox with kobo-docker prior March 2019, you must complete a manual upgrade process before using this repository. If you do not, kobo-install will not be able to start.

Versions

Branch master is the recommended branch to use kobo-install on your production environment. Just run git checkout master before your first run.

Branch beta is a pre-release of the next version. It contains new features and bug fixes.

Other branches are for development purposes.

Usage

$kobo-install> python3 run.py

First time the command is executed, setup will be launched.
Subsequent executions will launch docker containers directly.

Rebuild configuration:
$kobo-install> python3 run.py --setup

Get info:
$kobo-install> python3 run.py --info

Get docker logs:
$kobo-install> python3 run.py --logs

Update KoBoToolbox:
$kobo-install> python3 run.py --update [branch or tag]

By default, fetch the latest version of master branch

Stop KoBoToolbox:
$kobo-install> python3 run.py --stop

Get help:
$kobo-install> python3 run.py --help

Get version:
$kobo-install> python3 run.py --version

Build kpi and kobocat (dev mode):
$kobo-install> python3 run.py --build

Run docker commands on front-end containers:
$kobo-install> python3 run.py --compose-frontend [docker-compose arguments]

Run docker commands on back-end containers:
$kobo-install> python3 run.py --compose-backend [docker-compose arguments]

Start maintenance mode:
$kobo-install> python3 run.py --maintenance

Stop maintenance mode:
$kobo-install> python3 run.py --stop-maintenance

Build the configuration

User can choose between 2 types of installations:

  • Workstation: KoBoToolbox doesn't need to be accessible from anywhere except the computer where it's installed. No DNS needed
  • Server: KoBoToolbox needs to be accessible from the local network or from the Internet. DNS are needed

Options

Option Default Workstation Server
Installation directory ../kobo-docker βœ“ βœ“
SMTP information βœ“ βœ“ (front end only)
Public domain name kobo.local βœ“ (front end only)
Subdomain names kf, kc, ee βœ“ (front end only)
Use HTTPS1 False (Workstation)
True (Server)
βœ“ (front end only)
Super user's username super_admin βœ“ βœ“ (front end only)
Super user's password Random string βœ“ βœ“ (front end only)
Activate backups2 False βœ“ βœ“ (back end only)

Advanced Options

Option Default Workstation Server
Webserver port 80 βœ“
Reverse proxy interal port 8080 βœ“ (front end only)
Network interface Autodetected βœ“ βœ“ (front end only)
Use separate servers No βœ“
Use DNS for private routes No βœ“ (front end only)
Primary back end IP (if previous answer is no) Local IP βœ“ (front end only)
PostgreSQL DB kobo βœ“ βœ“
PostgreSQL user's username kobo βœ“ βœ“
PostgreSQL user's password Autogenerate βœ“ βœ“
PostgreSQL number of connections3 100 βœ“ βœ“ (back end only)
PostgreSQL RAM3 2 βœ“ βœ“ (back end only)
PostgreSQL Application Profile3 Mixed βœ“ βœ“ (back end only)
PostgreSQL Storage3 HDD βœ“ βœ“ (back end only)
MongoDB super user's username root βœ“ βœ“
MongoDB super user's password Autogenerate βœ“ βœ“
MongoDB user's username kobo βœ“ βœ“
MongoDB user's password Autogenerate βœ“ βœ“
Redis password4 Autogenerate βœ“ βœ“
Use AWS storage5 No βœ“ βœ“
Use WAL-E PostgreSQL backups6 No βœ“ βœ“ (back end only)
uWGI workers start: 2, max: 4 βœ“ βœ“ (front end only)
uWGI memory limit 128 MB βœ“ βœ“ (front end only)
uWGI harakiri timeout 120s βœ“ βœ“ (front end only)
uWGI worker reload timeout 120s βœ“ βœ“ (front end only)
Google UA βœ“ βœ“ (front end only)
Google API Key βœ“ βœ“ (front end only)
Raven tokens βœ“ βœ“ (front end only)
Debug False βœ“
Developer mode False βœ“
Staging mode False βœ“ (front end only)

1) HTTPS certificates must be installed on a Reverse Proxy. kobo-install can install one and use Let's Encrypt to generate certificates thanks to nginx-certbot project

2) If AWS credentials are provided, backups are sent to configured bucket

3) Custom settings are provided by PostgreSQL Configuration Tool API

4) Redis password is optional but strongly recommended

5) If AWS storage is selected, credentials must be provided if backups are activated

6) WAL-E backups for PostgreSQL are only available when using AWS storage

β„Ή Intercom App ID must now be configured through "Per user settings" in the Django admin interface of KPI.

Requirements

  • Linux 5 / macOS 6

  • Python 3.7+

  • Docker & Docker Compose

  • Available TCP Ports: 7

    1. 80 NGINX
    2. 443 NGINX (if you use kobo-install with LetsEncrypt proxy)
    3. Additional ports when expose ports advanced option has been selected
      1. 5432 PostgreSQL
      2. 6379-6380 redis
      3. 27017 MongoDB

    WARNING:

    • If you use a firewall, be sure to open traffic publicly on NGINX port, otherwise kobo-install cannot work
    • By default, additional ports are not exposed except when using multi servers configuration. If you choose to expose them, be sure to not expose them publicly (e.g. use a firewall and allow traffic between front-end and back-end containers only. NGINX port still has to stay publicly opened though).

5) It has been tested with Ubuntu 14.04, 16.04 and 18.04, CentOS 8

6) Docker on macOS is slow. First boot usually takes a while to be ready. You may have to answer Yes once or twice to question Wait for another 600 seconds? when prompted

7) These are defaults but can be customized with advanced options

Tests

Tests can be run with tox.
Be sure it is installed before running the tests.

$kobo-install> sudo apt install python3-pip
$kobo-install> pip3 install tox
$kobo-install> tox

or

$kobo-install> sudo apt install tox
$kobo-install> tox

More Repositories

1

kobo-docker

Stack of docker containers to all server-side components of KoBoToolbox (kpi, kobocat, enketo-express).
Shell
178
star
2

kpi

kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
Python
129
star
3

kobocat

Our (backend) server for providing blank forms to Collect and Enketo and for receiving and storing submissions.
Python
117
star
4

docs

The official KoboToolbox userguide website.
HTML
14
star
5

formpack

formpack is a tool used by kpi to parse and repackage survey data for exports, reports, and maps based on different languages available from the form definition.
Python
14
star
6

dkobo

Inactive and preserved for reference only
CoffeeScript
14
star
7

dist-kobo-devel

A script to download and configure all server components of KoBoToolbox for installation on a local machine
Shell
13
star
8

xls-import

⚠️ THIS IS NOT A SUPPORTED REPOSITORY. It is here with the hope that it's helpful for your own efforts.
Python
8
star
9

kobo-transfer

Transfer assets and submissions between two projects.
Python
7
star
10

android-deploy

A script to simply the setup of Android devices based on a single configuration
Batchfile
6
star
11

kobomaps-orig

JavaScript
5
star
12

kobocat-template

Template files to modify default kobocat styling
HTML
5
star
13

kobo-helm-chart

This project is new. We do not yet release stable versions.
Smarty
4
star
14

kobosync

A standalone Java app to copy data from Android to local computer and aggregate survey records into a CSV file
Java
4
star
15

form-builder-translations

3
star
16

kobo-notebooks

Guided walkthroughs using Kobo's APIs and Jupyter Notebooks.
3
star
17

kobo-geonode

Kobo to GeoNode integration and documentation
C#
2
star
18

koboform

A Java/GWT based formbuilder (no longer supported). Replaced by dkobo.
Java
2
star
19

covidportal

HTML
2
star
20

rundeck

Scripts used on ansible with a Rundeck Web UI for action automation.
Shell
1
star
21

restframework-tutorial

Python
1
star
22

wfp-svg-map-documentation

1
star
23

mockobo

Make mock submissions to a deployed Kobo form
Python
1
star
24

kobomaps-old

A cloud based system for uploading data and visualizing it geospatially.
PHP
1
star
25

reports

SCSS
1
star
26

enketo-image-customization-widget

Enketo Widget to customize SVG images
JavaScript
1
star
27

enketo-express-extra-widgets

Docker configuration for building Enketo Express with extra widgets
Dockerfile
1
star