You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-20
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@
21
21
22
22
### Introduction
23
23
24
-
This document details the steps required in deploying a fully functional installment of Apollo 3. Apollo is a data management platform to support citizen election observation and other large-scale structured data collection efforts. Developed by Tim Akinbo and his team at TimbaObjects in conjunction with NDI’s Elections team, Apollo aids the management of observers, verification of collected information, and automated aggregation for analysis. Citizen watchdogs play a critical role in validating political processes, but to be convincing must back claims with data. Elections are one of the foundations of legitimate democracy when the official results truly represent the will of the voters. Systematic election observation requires large amounts of structured information from hundreds or thousands of observers and determining what it means – fast. Apollo aids the management of observers, verification of collected information, and automated aggregation for analysis.
24
+
This document details the steps required in deploying a fully functional installation of Apollo 3. Apollo is a data management platform to support citizen election observation and other large-scale structured data collection efforts. Developed by Tim Akinbo and his team at TimbaObjects in conjunction with NDI’s Elections team, Apollo aids the management of observers, verification of collected information, and automated aggregation for analysis. Citizen watchdogs play a critical role in validating political processes, but to be convincing must back claims with data. Elections are one of the foundations of legitimate democracy when the official results truly represent the will of the voters. Systematic election observation requires large amounts of structured information from hundreds or thousands of observers and determining what it means – fast. Apollo aids the management of observers, verification of collected information, and automated aggregation for analysis.
25
25
26
26
27
27
### Install
@@ -42,8 +42,6 @@ After installing git, you will be able to clone the current version of Apollo fr
Due to the fact this repository is private, to clone this repository to a regular server you will need to upload a deployment SSH to this repository [here](https://github.com/nditech/dev-elections/settings/keys), or use an authenticated URL (if you have an account on GitHub that has access to the repository).
46
-
47
45
After downloading, configure a settings file in the main folder called `settings.ini`. A basic sample settings file is shown below. The install will not work if a settings file is not created with a Secret Key specified. The secret key should be any randomly generated string of characters of similar length to the example provided. For more information on additional configuration settings, read the section "[Application Configuration Settings](#application-configuration-settings)" below.
48
46
49
47
```
@@ -58,9 +56,9 @@ In order to simplify the deployment process, Apollo now includes a docker compos
58
56
59
57
To build and start the application, simply run:
60
58
61
-
`docker-compose up -d`
59
+
`make docker`
62
60
63
-
The main application container and worker containers will be built and run together with the supporting database and task queue containers. After running the command initially, subsequent builds will use cached container images. To deploy the code from scratch without drawing upon the cached images (for example to incorporate subsequent any changes made to the Apollo code outside of the docker containers), run `docker run build --no-cache`.
61
+
The main application container and worker containers will be built and run together with the supporting database and task queue containers. After running the command initially, subsequent builds will use cached container images. To deploy the code from scratch without drawing upon the cached images (for example to incorporate subsequent any changes made to the Apollo code outside of the docker containers), run `docker-compose build --no-cache`.
64
62
65
63
66
64
@@ -112,25 +110,25 @@ You should now be able to login to your site by navigating to port `:5000` on yo
112
110
113
111
Each deployment installation can be further customized by modifying the contents of the `settings.ini` file. Here are a collection of settings parameters and sample values together with an explanation of what they do.
114
112
115
-
SECRET_KEY
113
+
**SECRET_KEY**
116
114
(e.g. LBZyd8EY80mALqb7bl8o3da8)
117
115
118
116
The secret key contains a random string of characters, numbers and symbols and is used internally for signing and encrypting cookies and other security-related tokens. Best security practice requires that you set the value to a random value before starting the containers. Note that if this value is changed after the application is already fully configured, then user logins will stop working as the application would not be able to decrypt stored passwords. So this should remain the same throughout the lifetime of the application. This is a compulsory configuration option.
119
117
120
118
121
-
SSL_REQUIRED
119
+
**SSL_REQUIRED**
122
120
(e.g. False)
123
121
124
122
This parameter determines whether the application server will explicitly check if all requests are being served over a secure (https) connection. By setting this value to True, you effectively turn this check on and all connections must be secure before access is granted.
125
123
126
124
127
-
TIMEZONE
125
+
**TIMEZONE**
128
126
(e.g. Africa/Lagos)
129
127
130
128
The timezone parameter configures the timezone that the application server uses by default. Usually this is set to the timezone of the country for which the application instance is deployed. For a full list of support timezone values, please visit this wikipedia article.
131
129
132
130
133
-
GOOGLE_TAG_MANAGER
131
+
**GOOGLE_TAG_MANAGER**
134
132
(e.g. GTM-1234567)
135
133
136
134
@@ -141,57 +139,85 @@ If you need to manage tags that are inserted into the application, one way to do
141
139
More information on using Google Tag Manager can be found [here](https://marketingplatform.google.com/about/tag-manager/), and [here](https://developers.google.com/tag-manager/).
142
140
143
141
144
-
REDIS_DATABASE
142
+
**REDIS_DATABASE**
145
143
(e.g. 0)
146
144
147
145
This value determines the redis database that is used by the application. It takes the default value of 0 but (in the unlikely event that you need to share a redis installation) it can be changed to a different value. By default most redis installations have a maximum value of 15.
148
146
149
147
150
-
REDIS_HOSTNAME
148
+
**REDIS_HOSTNAME**
151
149
(e.g. redis)
152
150
153
151
As was described above, if you require connecting to an external redis server, you can specify the value of the hostname for this redis database here.
154
152
155
153
156
-
DATABASE_HOSTNAME
154
+
**DATABASE_HOSTNAME**
157
155
(e.g. postgres)
158
156
159
157
As was the case in REDIS_HOSTNAME, there might be cases where an external PostgreSQL database is to be used, setting the DATABASE_HOSTNAME allows the application and worker applications to connect to this.
160
158
161
159
162
-
DATABASE_NAME
160
+
**DATABASE_NAME**
163
161
(e.g. apollo)
164
162
165
163
If you need to use the non-default database name for the installation, you can change the value here. Please note that if you are using an external PostgreSQL server, you may not need to create and link to the postgres container; in which case, simply providing the DATABASE_HOSTNAME and the DATABASE_NAME will be sufficient for the application containers to connect to the provided database.
166
164
167
165
You would also need to drop the DATABASE_NAME environment specification (-e DATABASE_NAME=...) when creating the application containers.
168
166
169
167
170
-
DEBUG
168
+
**DEBUG**
171
169
(e.g. False)
172
170
173
171
Debug information is usually only used when the application is being built or when an issue is being debugged. The default value of False is sufficient and should only be changed to True if there’s the need to debug the application. Setting DEBUG to True may reveal sensitive information to the user and should only be used when actual debugging is being done and reverted to the default value when debugging is over.
174
172
175
-
MAIL_SERVER
173
+
**MAIL_SERVER**
176
174
(e.g. smtp.sendgrid.net)
177
-
MAIL_PORT
175
+
**MAIL_PORT**
178
176
(e.g. 587)
179
-
MAIL_USE_TLS
177
+
**MAIL_USE_TLS**
180
178
(e.g. True)
181
-
MAIL_USERNAME
179
+
**MAIL_USERNAME**
182
180
(e.g. sendgrid-username)
183
-
MAIL_PASSWORD
181
+
**MAIL_PASSWORD**
184
182
(e.g sendgrid-apikey)
185
183
186
184
These set of configuration values allow the administrator to configure a mail server for the purpose of being able to send out transactional emails like password resets, notices on task completion, etc. It is highly recommended that these values are configured.
187
185
188
186
189
-
PROMETHEUS_SECRET
187
+
**PROMETHEUS_SECRET**
190
188
(e.g. pmsecretz)
191
189
192
190
Apollo 3 provides support for an external monitoring server (Prometheus) to be able to obtain application performance metrics. In order to randomize the URL from which the stats are retrieved from, the PROMETHEUS_SECRET is added as an additional URL fragment and must be correct for the metrics to be provided. The metrics url becomes https://apollo3servername/metrics/{PROMETHEUS_SECRET}.
193
191
194
192
193
+
**MAPBOX_TOKEN**
194
+
(e.g. pk.eyJ1I.BOh_5nWoa-sWP)
195
+
196
+
If you would rather have the better looking MapBox base tiles for the maps, you should add your MapBox API token as a parameter to the settings file.
197
+
198
+
199
+
**ENABLE_SOCIAL_LOGIN**
200
+
(e.g. True)
201
+
202
+
If you would like to offer the option to login with either a Facebook or Google account, you should enable the social login plugin by setting this parameter to True.
203
+
204
+
**GOOGLE_CLIENT_ID**
205
+
**GOOGLE_CLIENT_SECRET**
206
+
207
+
To enable Google authentication, you'll need to create credentials for the Apollo application in your Google account (https://console.developers.google.com/apis/credentials). Copy the client id and secret and set them to the `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` respectively.
208
+
209
+
**FACEBOOK_CLIENT_ID**
210
+
**FACEBOOK_CLIENT_SECRET**
211
+
212
+
Similarly, to enable Facebook login, you'll need to obtain Facebook Login (https://developers.facebook.com/docs/facebook-login) credentials to use with Apollo. After setting the appropriate parameters, login with Facebook will be enabled.
213
+
214
+
215
+
**API_KEY**
216
+
(e.g. 3a;lk9243)
217
+
218
+
The `API_KEY` setting enables external API access to the artefacts exposed by Apollo. This parameter specifies the key that must accompany every API request to enable access.
219
+
220
+
195
221
### Legacy Installation Method
196
222
197
223
An older installation method is documented below. In almost all cases, using docker compose is preferable. However if for some reason this is not possible, use the method below instead in place of the section above labeled *Installation and Deployment*.
0 commit comments