diff --git a/.env.example b/.env.example deleted file mode 100644 index af6f51e4..00000000 --- a/.env.example +++ /dev/null @@ -1,19 +0,0 @@ -# Django Development Variables -DEBUG=1 -SECRET_KEY=foo -DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] -DJANGO_LOG_LEVEL=INFO - -# Catalogue Variables -CATALOGUE_TOKEN=mycatalogtoken -CATALOGUE_URL=https://datahub-catalogue-dev.apps.live.cloud-platform.service.justice.gov.uk/api/gms - -# Sentry Variables -SENTRY_DSN_WORKAROUND=< obtain from onepassword > - -# Azure Variables (Examples) -AZURE_AUTH_ENABLED=true # any string value other than true to disable Azure authentication -AZURE_CLIENT_ID=< obtain from onepassword > -AZURE_CLIENT_SECRET=< obtain from onepassword > -AZURE_REDIRECT_URI="http://localhost:8000/azure_auth/callback" -AZURE_AUTHORITY="https://login.microsoftonline.com/c6874728-71e6-41fe-a9e1-2e8c36776ad8" # Real value for Azure tennant diff --git a/.env.tpl b/.env.tpl new file mode 100644 index 00000000..17de1dcf --- /dev/null +++ b/.env.tpl @@ -0,0 +1,20 @@ +# Django Development Variables +DEBUG=op://Data-Catalogue/Find-Moj-Data/${ENV}/Django-Debug +SECRET_KEY=op://Data-Catalogue/Find-Moj-Data/${ENV}/Django-Secret-Key # pragma: allowlist secret +DJANGO_ALLOWED_HOSTS=op://Data-Catalogue/Find-Moj-Data/${ENV}/Django-Allowed-Hosts +DJANGO_LOG_LEVEL=op://Data-Catalogue/Find-Moj-Data/${ENV}/Django-Log-Level + +# Catalogue Variables +CATALOGUE_TOKEN=op://Data-Catalogue/Find-Moj-Data/${ENV}/Catalogue-Token +CATALOGUE_URL=op://Data-Catalogue/Find-Moj-Data/${ENV}/Catalogue-Gms-Url + +# Azure Variables +# Any value other than 'false' to enable Azure Auth +AZURE_AUTH_ENABLED=op://Data-Catalogue/Find-Moj-Data/${ENV}/Azure-Auth-Enabled +AZURE_CLIENT_ID=op://Data-Catalogue/Find-Moj-Data/${ENV}/Azure-Client-ID +AZURE_CLIENT_SECRET=op://Data-Catalogue/Find-Moj-Data/${ENV}/Azure-Client-Secret # pragma: allowlist secret +AZURE_REDIRECT_URI=op://Data-Catalogue/Find-Moj-Data/${ENV}/Azure-Redirect-Uri +AZURE_AUTHORITY=op://Data-Catalogue/Find-Moj-Data/${ENV}/Azure-Authority + +# Sentry Variables +SENTRY_DSN__WORKAROUND=op://Data-Catalogue/Find-Moj-Data/${ENV}/Sentry-Dsn diff --git a/README.md b/README.md index 455a5ae6..da719d62 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,42 @@ ## Quick start -You will need npm (for javascript dependencies) and poetry (for python dependencies). +Please refer to Prerequisites for dependencies and installation instructions 1. Run `poetry install` to install python dependencies 1. Run `npm install` to download frontend static dependencies. 1. Run `poetry run python -m nltk.downloader punkt` to install nltk data -1. Copy `.env.example` to `.env`. -1. You wil need to obtain an access token from Datahub catalogue and populate the - `CATALOGUE_TOKEN` var in .env to be able to retrieve search data. +1. Set the `ENV` var to `local` i.e. `export ENV=local` +1. Run `op inject --in-file .env.tpl --out-file .env` to generate a compatible `.env` file +1. Optionally substitute value for `CATALOGUE_TOKEN` var in .env with your own PAT value to be able to retrieve search data. 1. Run `poetry run python manage.py runserver` ```sh poetry install --no-root npm install poetry run python -m nltk.downloader punkt +export ENV=local +op inject --in-file .env.tpl --out-file .env poetry run python manage.py runserver ``` +# Prerequisites + +## Npm + Required for building the front end javascript dependencies + +## Poetry + Required for managing python package dependencies. + Follow installation instructions here https://python-poetry.org/docs/#installation + +## 1Password + Organisational level tool for storing application secrets and passwords securely. +There are a number of 1password utilities available to manage credentials from cli and desktop environments. + +1. Install the 1Password desktop app - https://support.1password.com/get-the-apps/ +2. Install the 1Password CLI app - https://developer.1password.com/docs/cli/get-started/ +3. Follow the steps to turn on and test the 1password desktop app integration + ## Current Endpoints /search