Skip to content

Commit ce1f31a

Browse files
committed
Some additional cleanup for WIP installation docs.
Signed-off-by: Josh Berkus <josh@agliodbs.com>
1 parent caf762b commit ce1f31a

File tree

3 files changed

+117
-8
lines changed

3 files changed

+117
-8
lines changed

content/en/docs/Getting started/configuration.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,26 @@ You must set up an "Oauth Application" that Elekto can use. In GitHub, this is
3232

3333
The Oauth App must have the following settings:
3434

35-
*
35+
* Application Name: whatever you've named your Elekto instance
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)
3638

37-
Having configured this, you can populate GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET in Elekto's runtime environment.
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.
3840

3941
#### GitHub Repository Webhook
4042

4143
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).
4244

4345
The Webhook should have the following settings:
4446

45-
* Push webhook
46-
* JSON data format
47-
* Use TLS
48-
*
47+
* Payload URL: https://your.election.domain/v1/webhooks/meta/sync
48+
* Content Type: application/json
4949
* Shared Secret set to the same as META_SECRET
50+
* Enable SSL Verification
51+
* Just The Push Event
52+
* Check "Active" to turn it on
5053

51-
This last "secret" is an arbitrary string that authenticates the push to the Elekto server. It can be any string, such as one created by a password generator or a passphrase you like. This string then gets set in META_SECRET.
54+
This "secret" is an arbitrary string that authenticates the push to the Elekto server. It can be any string, such as one created by a password generator or a passphrase you like. This string then gets set in META_SECRET.
5255

5356
## The Environment File
5457

@@ -167,7 +170,7 @@ Example: `https://github.com/kalkayan/k8s.elections.meta.git`
167170

168171
**ELECTION_DIR**
169172

170-
*Required* Directory, relative to the Git repository root, containing the set of election subdirectories. Can be an arbitrarily deep path. Do not use a leading or trailing `/`.
173+
*Required* Directory, relative to the Git repository root, containing the set of election subdirectories. Must be a parent directory. Can be an arbitrarily deep path. Do not use a leading or trailing `/`.
171174

172175
Example: `elections`, `gov/steering/elections`
173176

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
title: "Development Installation"
3+
linkTitle: "Development Installation"
4+
weight: 1
5+
description: >
6+
Create a dev install on your laptop
7+
---
8+
9+
This guide will help you create a development installation of Elekto on your laptop, for hacking and testing purposes.
10+
11+
## Create a development environment
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.
14+
15+
```bash
16+
# Installation with pip
17+
pip install -r requirements.txt
18+
19+
# Installation with Conda
20+
conda env create -f environment.yml && conda activate elekto
21+
```
22+
23+
## Setup env variables
24+
25+
The repository has a `.env.example` file which can be used as a template for `.env` file, update the environment file after copying from `.env.example`.
26+
27+
```bash
28+
# create a new .env file from .env.example
29+
cp .env.example .env
30+
```
31+
32+
Set the basic information about the application in the upper section
33+
```bash
34+
APP_NAME=k8s.elections # set the name of the application
35+
APP_ENV=development # development | production
36+
APP_KEY= # random secret key (!! important !!)
37+
APP_DEBUG=True # True | False (production)
38+
APP_URL=http://localhost # Url where the application is hosted
39+
APP_PORT=5000 # Default Running port for development
40+
APP_HOST=localhost # Default Host for developmemt
41+
```
42+
43+
Update the database credentials,
44+
```bash
45+
DB_CONNECTION=mysql # Mysql is only supported
46+
DB_HOST=localhost
47+
DB_PORT=3306
48+
DB_DATABASE=name
49+
DB_USERNAME=user
50+
DB_PASSWORD=password
51+
```
52+
53+
Update the meta repository info
54+
```bash
55+
META_REPO=https://github.com/elekto-io/elekto.meta.test.git
56+
META_DEPLOYMENT=local
57+
META_PATH=meta
58+
META_BRANCH=main
59+
META_SECRET=db5a951969c379e75d0bf15ad6ff8b4a36fbeb02 # same as webhook of the same meta repository
60+
```
61+
62+
Update the Oauth info, create an github oauth app if already not created.
63+
```bash
64+
GITHUB_REDIRECT=/oauth/github/callback
65+
GITHUB_CLIENT_ID=d79f002c1d2e3cf20521
66+
GITHUB_CLIENT_SECRET=2f64fff6612c46f87314ad5bb81d05c8fd29c561
67+
```
68+
69+
#### Migrate and Sync DB with Meta
70+
71+
The `console` script in the repository is used to perform all the table creations and syncing of the meta.
72+
73+
```bash
74+
# to migrate the database from command line
75+
python console --migrate
76+
```
77+
78+
To sync the database with the meta files
79+
80+
```bash
81+
# to the sync the database with the meta
82+
python console --sync
83+
```
84+
85+
#### Run the application Server locally
86+
87+
The flask server will start on `5000` by default but can be changed using `--port` option.
88+
89+
```bash
90+
# to run the server on default configs
91+
python console --run
92+
93+
# to change host and port
94+
python console --port 8080 --host 0.0.0.0 --run
95+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "Kubernetes Installation"
3+
linkTitle: "Kubernetes Installation"
4+
weight: 2
5+
description: >
6+
Installing Elekto on Kubernetes
7+
---
8+
9+
This guide walks you through installing Elekto on a Kubernetes cluster.
10+
11+
TBD.

0 commit comments

Comments
 (0)