From d56bde0da457ff1da94d387a09c134e7ff26c9b6 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Fri, 10 Nov 2023 05:24:57 +0000 Subject: [PATCH] docs: update install docs for .env generation --- INSTALL.md | 4 +++ docs/dev/Production.md | 60 ++++++++++++++++++++++-------------------- docs/dev/Setup.md | 56 +++++++++------------------------------ 3 files changed, 48 insertions(+), 72 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 041fb67df6..583b450907 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -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.: +> + ### Start the API with Docker This is the easiest way to get started with FMTM. diff --git a/docs/dev/Production.md b/docs/dev/Production.md index 67cd54c4a7..82e454e663 100644 --- a/docs/dev/Production.md +++ b/docs/dev/Production.md @@ -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=`` - ODK_CENTRAL_PASSWD=`` - - # FMTM - FMTM_DOMAIN=https://fmtm.hotosm.org - CERT_EMAIL=`` - - # OSM - OSM_CLIENT_ID=`` - OSM_CLIENT_SECRET=`` - OSM_URL=https://www.openstreetmap.org - OSM_SCOPE=read_prefs - OSM_LOGIN_REDIRECT_URI=``/osmauth/ - OSM_SECRET_KEY=`` - - ### S3 File Storage ### - S3_ENDPOINT="http://s3:9000" - S3_ACCESS_KEY=`` - S3_SECRET_KEY=`` - - FMTM_DB_HOST=fmtm-db - FMTM_DB_USER=fmtm - FMTM_DB_PASSWORD=`` - 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=`` +ODK_CENTRAL_PASSWD=`` + +CERT_EMAIL=`` +OSM_CLIENT_ID=`` +OSM_CLIENT_SECRET=`` + +S3_ACCESS_KEY=`` +S3_SECRET_KEY=`` +``` + +> Note: If extra cors origins are required for testing, the variable +> `EXTRA_CORS_ORIGINS` is a set of comma separated strings, e.g.: +> #### API_PREFIX diff --git a/docs/dev/Setup.md b/docs/dev/Setup.md index 5a6d5477d5..43f88634b3 100644 --- a/docs/dev/Setup.md +++ b/docs/dev/Setup.md @@ -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=`` -ODK_CENTRAL_PASSWD=`` - -### FMTM ### -# DEBUG=True -# LOG_LEVEL=DEBUG -FMTM_DOMAIN=fmtm.localhost - -### OSM ### -OSM_CLIENT_ID=`` -OSM_CLIENT_SECRET=`` -OSM_URL=https://www.openstreetmap.org -OSM_SCOPE=read_prefs -OSM_LOGIN_REDIRECT_URI=http://127.0.0.1:7051/osmauth/ -OSM_SECRET_KEY= - -### S3 File Storage ### -S3_ENDPOINT="http://s3:9000" -S3_ACCESS_KEY=`` -S3_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. +> Note: If extra cors origins are required for testing, the variable +> `EXTRA_CORS_ORIGINS` is a set of comma separated strings, e.g.: +> ## Verify Setup