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: content/en/docs/Getting started/configuration.md
+16-18Lines changed: 16 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,25 +28,25 @@ Currently, the only Oauth provider offered is GitHub. Contributions of addition
28
28
29
29
#### GitHub Oauth
30
30
31
-
You must set up an "Oauth Application" that Elekto can use. In GitHub, this is under Settings-->Developer Tools-->Oauth Applications. Note that Oauth Apps are belong to *accounts* rather than organizations, so you'll want to set up an account with shared access in your infra team. We also recommend setting up a separate Oauth App for Elekto rather than re-using one created for other purposes, and giving each Elekto instance its own secret key.
31
+
You must set up an "Oauth Application" that Elekto can use. In GitHub, this is under Settings-->Developer Tools-->Oauth Applications. Note that Oauth Apps are belong to *accounts* rather than organizations, so you'll want to set up an account with shared access in your infra team. We also recommend setting up a separate Oauth App for Elekto rather than re-using ones created for other purposes, and giving each Elekto instance its own secret key.
32
32
33
33
The Oauth App must have the following settings:
34
34
35
35
* Application Name: whatever you've named your Elekto instance
36
36
* Homepage URL: the url of your Elekto instance
37
-
* Authorization Callback URL: https://your.elekto.domain/oauth/github/callback (note that this can be changed in ENV)
37
+
* Authorization Callback URL: `https://your.elekto.domain/oauth/github/callback` (note that this can be changed in ENV)
38
38
39
39
Once you create the Oauth App, GitHub will create a ClientID for it, which you populate in GITHUB_CLIENT_ID in ENV. You then create a new Oauth secret under the app and copy the value for that, and that gets populated in GITHUB_CLIENT_SECRET.
40
40
41
41
#### GitHub Repository Webhook
42
42
43
-
In order to receive changes from the repo, you need to add a webhook that pushes changes whenever you merge. Webhooks are under "settings" for the individual repository (which also means you must be a repo onwer).
43
+
To receive changes from the repo, you need to add a webhook that pushes changes whenever you merge. Webhooks are under "settings" for the individual repository (which also means you must be a repo owner).
@@ -57,12 +57,12 @@ This "secret" is an arbitrary string that authenticates the push to the Elekto s
57
57
58
58
Elekto is designed to accept its runtime configuration as ENV variables in its shell environment. A sample `.env.example` file can be found in the base directory of the Elekto source. These ENV configuration variables are not expected to change frequently, or at all, for any particular running Elekto instance. Changing them generally requires restarting Elekto.
59
59
60
-
All of these env variables need to be set before starting Elekto as a uwsgi application, or even in developer mode; without them, Elekto will error out and refuse to start. You can set this up however you please:
60
+
All of these env variables need to be set before starting Elekto as a uWSGI application, or even in developer mode; without them, Elekto will error out and refuse to start. You can set this up however you please:
61
61
62
62
* as the `.bashrc` for the elekto application user
63
63
* as ENV variables for a container running Elekto
64
64
* preloaded in a systemd unit file
65
-
* injected through a ConfigMap and a Secret into an Kubernetes pod
65
+
* injected through a ConfigMap and a Secret into a Kubernetes pod
66
66
67
67
Since we use ENV for Elekto configuration, this does mean that Elekto must be launched under a shell.
68
68
@@ -86,11 +86,9 @@ Example: `production` or `development`
86
86
87
87
**APP_KEY**
88
88
89
-
*Optional*Seed string for Flask encryption if running Flask in standalone mode. Not required if fronting with an HTTPS webserver.
89
+
*Optional*Encryption seed for application cookies. Deprecated; will be set automatically by Elekto in the future, but for now set it to a random 8byte+ value.
90
90
91
-
Example: ``
92
-
93
-
FIXME
91
+
Example: `2400229255`
94
92
95
93
**APP_DEBUG**
96
94
@@ -100,13 +98,13 @@ Example: `True` or `False`
100
98
101
99
**APP_URL**
102
100
103
-
*Optional* URL of the Elekto instance. Used by some uwsgi and/or Nginx configurations. Not used internally by Elekto.
101
+
*Optional* URL of the Elekto instance. Used by some uWSGI and/or Nginx configurations. Not used internally by Elekto.
104
102
105
103
Example: `http://elections.knative.dev`
106
104
107
105
**APP_PORT**
108
106
109
-
*Optional* Used in some uwsgi start scripts, and when running Flask in standalone mode. Port on which to serve Elekto.
107
+
*Optional* Used in some uWSGI start scripts, and when running Flask in standalone mode. Port on which to serve Elekto.
110
108
111
109
Example: `5000`
112
110
@@ -118,15 +116,15 @@ Example: `localhost`
118
116
119
117
**APP_CONNECT**
120
118
121
-
*Optional* Whether to serve uwsgi over HTTP or via a local unix socket. Used by some startup scripts; see `entrypoint.sh` for an example.
119
+
*Optional* Whether to serve uWSGI over HTTP or via a local Unix socket. Used by some startup scripts; see `entrypoint.sh` for an example.
122
120
123
121
Example: `http` or `socket`
124
122
125
123
#### Database Connection
126
124
127
125
**DB_CONNECTION**
128
126
129
-
*Required* Which database connection type to use. Currently only postgresql, mysql, and sqlite are supported.
127
+
*Required* Which database connection type to use. Currently only PostgreSQL, MySQL, and SQLite backends are supported.
130
128
131
129
Example: `postgresql`, `mysql`, or `sqlite`
132
130
@@ -182,7 +180,7 @@ Example: `local`, `sidecar`
182
180
183
181
**META_PATH**
184
182
185
-
*Required* Local file location at which to store a clone of the election data repository. This directory will be created by Elekto at sync time, so the application must have the ability to write to the parent directory. May be absolute or relative; if relative, will be under the eletko source directory. Defaults to `meta`. For containers, a directory under `/tmp` is recommended to make sure the location is writeable.
183
+
*Required* Local file location at which to store a clone of the election data repository. This directory will be created by Elekto at sync time, so the application must have the ability to write to the parent directory. The directory may be absolute or relative; if it is relative, it will be under the Eletko source directory. Otherwise it defaults to `meta`. For containers, a directory under `/tmp` is recommended to make sure the location is writeable.
At this time, there are only settings available for GitHub because other Oauth sources haven't been implemented. When other sources get added to Elekto, each will get their own configuration variables.
201
+
At this time, there are only settings available for GitHub because other Oauth sources haven't been implemented. When other sources get added to Elekto, each will get its own configuration variables.
Copy file name to clipboardExpand all lines: content/en/docs/Getting started/devinstall.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This guide will help you create a development installation of Elekto on your lap
10
10
11
11
## Create a development environment
12
12
13
-
The application is written in `python` using `flask` and `sqlalchemy`. This repository ships a `requirements.txt` and a`environment.yml` for conda users.
13
+
The application is written in Python using Flask and SQLAlchemy. This repository ships a `requirements.txt` and an`environment.yml` for conda users.
14
14
15
15
```bash
16
16
# Installation with pip
@@ -59,7 +59,8 @@ META_BRANCH=main
59
59
META_SECRET=db5a951969c379e75d0bf15ad6ff8b4a36fbeb02 # same as webhook of the same meta repository
60
60
```
61
61
62
-
Update the Oauth info, create an github oauth app if already not created.
62
+
Update the Oauth info, create a GitHub Oauth app if already not created.
Copy file name to clipboardExpand all lines: content/en/docs/Getting started/installation.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,20 +12,20 @@ This guide walks you through installing Elekto by hand on a server or VM.
12
12
13
13
For Elekto to run in production, you need the following small application stack:
14
14
15
-
* The Elekto python/flask/uwsgi application
15
+
* The Elekto python/flask/uWSGI application
16
16
* A backing SQL database instance
17
17
* A web proxy such as Nginx or Kubernetes Ingress
18
18
* A GitHub repository
19
19
* An Oauth authentication source
20
20
21
-
Elekto can be installed either as a native application, or as a container. The instructions below cover installation as a native application. For installation in a container, see [Kubernetes installation]({{< relref "kubernetes.md" >}})
21
+
Elekto can be installed either as a native application or as a container. The instructions below cover installation as a native application. For installation in a container, see [Kubernetes installation]({{< relref "kubernetes.md" >}})
22
22
23
23
## Installing Requirements and Python Binaries
24
24
25
-
Elekto is a Python/Flask/uwsgi application developed in Python 3. Building it from source requires the following prerequisites, which should be installed using your OS's packaging system:
25
+
Elekto is a Python/Flask/uWSGI application developed in Python 3. Building it from source requires the following prerequisites, which should be installed using your OS's packaging system:
26
26
27
27
* Python3 Pip and supporting build tools (like gcc), or Conda
28
-
*uwsgi server
28
+
*uWSGI server
29
29
* Database client libraries for your chosen database (see below)
Please check the above build process carefully for error messages; the only acceptable errors are (a) warnings about out-of-date versions and (b) missing database libraries for the databases you're not using.
43
43
44
-
It is completely possible that you could run Elekto using fastcgi instead of uwsgi, but at this time we have no documentation on how to do this.
44
+
It is possible that you could run Elekto using fastcgi instead of uWSGI, but at this time we have no documentation on how to do this.
45
45
46
46
## Backing SQL Database
47
47
48
-
Github stores ballots and some metadata in a designated SQL database, which is up to you to install and run. Currently Elekto supports the following:
48
+
Github stores ballots and some metadata in a designated SQL database, which is up to you to install and run. Currently, Elekto supports the following:
49
49
50
50
* PostgreSQL
51
51
* MySQL (and its forks)
@@ -55,25 +55,25 @@ However, as Elekto uses SQLAlchemy, it can potentially support any SQL database
55
55
56
56
Database requirements are very light, so it is completely feasible to run the database on the same server as the python application. The database server needs less than 2 CPUs, 1GB memory, and 25GB storage. You can also use a cloud database service; the included database support was chosen specifically because there are multiple cloud database services available. In that case, you are likely to use the smallest size of cloud database available.
57
57
58
-
The Elekto database user needs to have permissions to create tables. The database must be configured with user/password login. Other forms of authentication are not yet supported.
58
+
The Elekto database user needs to have permission to create tables. The database must be configured with user/password login. Other forms of authentication are not yet supported.
59
59
60
60
The Elekto application will not run if the database is unavailable. The ballot data contained in the database is not stored anywhere else, and as such is unrecoverable if the database is lost. For this reason, it is up to the administrator to set up and manage backups and high availability. This is particularly a concern for SQLite, which is an embedded database; you will need to set up cron jobs on the server to back this up.
61
61
62
62
## Web Server
63
63
64
-
Elekto runs in the python uwsgi web application server. Uwsgi is not very scalable, though, and does not handle SSL connections. As such, for anything other than developer mode, we recommend that you put a web server in front of it.
64
+
Elekto runs in the python uWSGI web application server. uWSGI is not very scalable, though, and does not handle SSL connections. As such, for anything other than developer mode, we recommend that you put a web server in front of it.
65
65
66
66
Nginx works well for this, whether as a standalone or as part of Kubernetes Ingress. See the sample Nginx configuration in the installation directory of the Elekto repository for an example setup. If running directly on a host with an Nginx proxy, you'll want to run Eletko in "socket" connection mode. Other web servers would also work, but Nginx is the only sample configuration supplied.
67
67
68
-
On Kubernetes, you'll want to access Elekto via Ingress. See `installation/deployment` for an example of this. In a Kubernetes setup, you want to run Elekto in http mode.
68
+
On Kubernetes, you'll want to access Elekto via Ingress. See `installation/deployment` for an example of this. In a Kubernetes setup, you want to run Elekto in `http` mode.
69
69
70
70
## GitHub Repository
71
71
72
-
Elekto's workflow is GitOps-based. This means that, in order to use Elekto, you must have a GitHub (GitLab TBD) repository for Elekto to attach to. This must be a repository you own and have administration rights on, as you will be setting up a webhook and directories.
72
+
Elekto's workflow is GitOps-based. This means that to use Elekto, you must have a GitHub (GitLab TBD) repository for Elekto to attach to. This must be a repository you own and have administration rights on, as you will be setting up a webhook and directories.
73
73
74
74
It does *not* need to be a repository that's exclusively dedicated to Elekto. Most organizations using Elekto place its election metadata into a subdirectory of a repository that's used for other community documents (e.g. `knative/community/elections`). Given that Elekto will refresh for every webhook push, however, it's probably better if it's not a repository that gets multiple commits per hour.
75
75
76
-
See [Configuration]() for how to set up this GitHub repository, and the [Administration Guide]() for what files go into it.
76
+
See [Configuration]({{< relref "configuration.md" >}}) for how to set up this GitHub repository, and the [Administration Guide]() for what files go into it.
77
77
78
78
## Oauth Authentication Source
79
79
@@ -83,8 +83,8 @@ See Configuration for how to configure this in GitHub.
83
83
84
84
## Other System Requirements
85
85
86
-
Elekto does not require elevated privileges to run, so for security we recommend running it under an elekto, www, or python application account with restricted permissions.
86
+
Elekto does not require elevated privileges to run, so for security, we recommend running it under an `elekto`, `www`, or `python` application account with restricted permissions.
87
87
88
88
Elekto caches a copy of the election respository on disk, and as such needs a file location to which it can write, with storage equal to the storage size of a git clone of that repository.
89
89
90
-
If you've completed everything in Installation, please proceed to [Configuration]().
90
+
If you've completed everything in Installation, please proceed to [Configuration]({{< relref "configuration.md" >}}).
0 commit comments