Skip to content

Commit

Permalink
docs: update install docs for .env generation
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Nov 10, 2023
1 parent edbc4ce commit d56bde0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 72 deletions.
4 changes: 4 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ This can be created interactively by running:
bash scripts/gen-env.sh
```

> Note: If extra cors origins are required for testing, the variable
> `EXTRA_CORS_ORIGINS` is a set of comma separated strings, e.g.:
> <http://fmtm.localhost:7050,http://some.other.domain>
### Start the API with Docker

This is the easiest way to get started with FMTM.
Expand Down
60 changes: 31 additions & 29 deletions docs/dev/Production.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,35 +49,37 @@ with `cd fmtm`.

### Set up the environment and utilities to launch

Create the env file from the example with `cp .env.example .env`. Edit
that file to contain the needful (it should look like this):

# ODK Central
ODK_CENTRAL_URL=https://proxy
ODK_CENTRAL_USER=`<CHANGEME>`
ODK_CENTRAL_PASSWD=`<CHANGEME>`

# FMTM
FMTM_DOMAIN=https://fmtm.hotosm.org
CERT_EMAIL=`<EMAIL_ADDRESS_TO_GENERATE_CERT_FOR>`

# OSM
OSM_CLIENT_ID=`<CHANGEME>`
OSM_CLIENT_SECRET=`<CHANGEME>`
OSM_URL=https://www.openstreetmap.org
OSM_SCOPE=read_prefs
OSM_LOGIN_REDIRECT_URI=`<FRONTEND_URL>`/osmauth/
OSM_SECRET_KEY=`<CHANGEME>`

### S3 File Storage ###
S3_ENDPOINT="http://s3:9000"
S3_ACCESS_KEY=`<CHANGEME>`
S3_SECRET_KEY=`<CHANGEME>`

FMTM_DB_HOST=fmtm-db
FMTM_DB_USER=fmtm
FMTM_DB_PASSWORD=`<CHANGEME>`
FMTM_DB_NAME=fmtm
Create the env file interactively with:

```bash
bash scripts/gen-env.sh
```

OR

```bash
cp .env.example .env

# Then edit values manually
```

Main variables of note to update:

```dotenv
ODK_CENTRAL_USER=`<CHANGEME>`
ODK_CENTRAL_PASSWD=`<CHANGEME>`
CERT_EMAIL=`<EMAIL_ADDRESS_TO_GENERATE_CERT_FOR>`
OSM_CLIENT_ID=`<CHANGEME>`
OSM_CLIENT_SECRET=`<CHANGEME>`
S3_ACCESS_KEY=`<CHANGEME>`
S3_SECRET_KEY=`<CHANGEME>`
```

> Note: If extra cors origins are required for testing, the variable
> `EXTRA_CORS_ORIGINS` is a set of comma separated strings, e.g.:
> <http://fmtm.localhost:7050,http://some.other.domain>
#### API_PREFIX

Expand Down
56 changes: 13 additions & 43 deletions docs/dev/Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,51 +250,21 @@ The FMTM uses OAUTH2 with OSM to authenticate users. To properly configure your

4. Now Copy your Client ID and Client Secret. Put them in the `OSM_CLIENT_ID` and `OSM_CLIENT_SECRET` field of your `.env` file

### 2. Create an `.env` File

Environmental variables are used throughout this project. To get started, create `.env` file in the top level dir, Sample is `.env.example`

cp .env.example .env

Your env should look like this:

```dotenv
### ODK Central ###
ODK_CENTRAL_URL=https://proxy
ODK_CENTRAL_USER=`<any_valid_email_address>`
ODK_CENTRAL_PASSWD=`<password_of_central_user>`
### FMTM ###
# DEBUG=True
# LOG_LEVEL=DEBUG
FMTM_DOMAIN=fmtm.localhost
### OSM ###
OSM_CLIENT_ID=`<OSM_CLIENT_ID_FROM_ABOVE>`
OSM_CLIENT_SECRET=`<OSM_CLIENT_SECRET_FROM_ABOVE>`
OSM_URL=https://www.openstreetmap.org
OSM_SCOPE=read_prefs
OSM_LOGIN_REDIRECT_URI=http://127.0.0.1:7051/osmauth/
OSM_SECRET_KEY=<random_key_for_development>
### S3 File Storage ###
S3_ENDPOINT="http://s3:9000"
S3_ACCESS_KEY=`<a_long_access_key>`
S3_SECRET_KEY=`<a_long_secret_key>`
### Database (optional) ###
CENTRAL_DB_HOST=central-db
CENTRAL_DB_USER=odk
CENTRAL_DB_PASSWORD=odk
CENTRAL_DB_NAME=odk
FMTM_DB_HOST=fmtm-db
FMTM_DB_USER=fmtm
FMTM_DB_PASSWORD=fmtm
FMTM_DB_NAME=fmtm'
#### 2. Create an `.env` File

Environmental variables are used throughout this project.
To get started, create `.env` file in the top level dir,
a sample is located at `.env.example`.

This can be created interactively by running:

```bash
bash scripts/gen-env.sh
```

> Note: If extra cors origins are required for testing, the variable `EXTRA_CORS_ORIGINS` is a set of comma separated strings, e.g. <http://fmtm.localhost:7050,http://some.other.domain>
> Note: If extra cors origins are required for testing, the variable
> `EXTRA_CORS_ORIGINS` is a set of comma separated strings, e.g.:
> <http://fmtm.localhost:7050,http://some.other.domain>
## Verify Setup

Expand Down

0 comments on commit d56bde0

Please sign in to comment.