Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ntrnl 400 add missing env variables to files and format consistently #57

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 16 additions & 26 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
PATH_SSL_PRIVATE_KEY="./infrastructure/host/test.key"
PATH_SSL_CERTIFICATE="./infrastructure/host/test.cert"

PORT=3000
NODE_ENV=development

AUTH_SIGN_IN_URL="https://cola.service.cabinetoffice.gov.uk/v2/<TEST>/login"
BASE_URL="http://localhost:3000"
CDN_HOST="test"
NODE_SSL_ENABLED="false"

COOKIE_ID_NAME="github-requests"
COOKIE_PARSER_SECRET="test"
COOKIE_SESSION_SECRET="test"

AUTH_SIGN_IN_URL="https://cola.service.cabinetoffice.gov.uk/v2/<TEST>/login"

USER_POOL_ID="test"
USER_POOL_CLIENT_ID="test"

COOKIE_ID_NAME="test"
SESSION_ID_NAME="test"
SESSION_APP_KEY="test"

FEATURE_FLAG_ENABLE_AUTH="true"
GITHUB_KEY="test"
GITHUB_OWNER="test"
GITHUB_TERRAFORM_REPO="test"
GITHUB_REPO_ISSUE_ASSIGNEE="test"
GITHUB_REPO_ISSUE_LABEL="test"

LOG_LEVEL=info
HUMAN=true

# Feature Flags

FEATURE_FLAG_ENABLE_AUTH="false"
GITHUB_TERRAFORM_REPO="test"
HUMAN="true"
LOG_LEVEL="info"
NODE_ENV="development"
NODE_SSL_ENABLED="false"
PATH_SSL_CERTIFICATE="./infrastructure/host/test.key"
PATH_SSL_PRIVATE_KEY="./infrastructure/host/test.cert"
PORT=3000
SESSION_APP_KEY="git"
SESSION_ID_NAME="connect.sid"
USER_POOL_CLIENT_ID="test"
USER_POOL_ID="test"
64 changes: 40 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,32 @@ The issue is then reviewed by the team, and further comments may be requested if

### Config variables

Key | Description | Example Value
----------------|--------------------------- |-------------------------
PATH_SSL_PRIVATE_KEY | Path to ssl private key | `./infrastructure/host/test.key`
PATH_SSL_CERTIFICATE | Path to ssl certificate | `./infrastructure/host/test.cert`
BASE_URL | Base application URL | `http://localhost:3000` (dev mode)
NODE_ENV | Node environment | `development` (or `production`)
PORT | Server port number | `3000`
CDN_HOST | CDN host | `cdn domain`
USER_POOL_ID | ID of the user pool in Amazon Cognito | `secret`
USER_POOL_CLIENT_ID | Client ID of an app registered with the user pool in Amazon Cognito | `secret`
AUTH_SIGN_IN_URL | Authentication sign in URL | `https://cola.service.cabinetoffice.gov.uk/v2/<YOUR_SERVICE>/login`
COOKIE_ID_NAME | The name of the cookie | `github-requests`
COOKIE_PARSER_SECRET | Secret used in validating/calculating the cookie signature | `secret`
COOKIE_SESSION_SECRET | Secret key for signing the session cookie | `secret`
LANDING_PAGE_URL | Github Requests landing Page | `/home/`
GITHUB_OWNER | Github organization name | `cabinetoffice`
GITHUB_TERRAFORM_REPO | Github private repo with terraform configurations with members, repos and teams files | `github-requests-terraform`
GITHUB_REPO_ISSUE_ASSIGNEE | Github team responsible to solve issues and update configs files | (eg. `IDP_TEAM`)
GITHUB_REPO_ISSUE_LABEL | Github label to categorize the related issues | (eg. `github-requests-app`)
LOG_LEVEL | Logging levels | `info`
HUMAN | Formatting messages form (default JSON) | `true` (Enable human formatting for log messages)
| Key | Description | Example Value |
|-----------------------------|---------------------------------------------------------------------|---------------------------------------------------------- |
| AUTH_SIGN_IN_URL | Authentication sign in URL | `https://cola.service.cabinetoffice.gov.uk/v2/<YOUR_SERVICE>/login`|
| BASE_URL | Base application URL | `http://localhost:3000` (dev mode) |
| CDN_HOST | CDN host | `cdn_domain` |
| COOKIE_ID_NAME | The name of the cookie | `github-requests` |
| COOKIE_PARSER_SECRET | Secret used in validating/calculating the cookie signature | `secret` |
| COOKIE_SESSION_SECRET | Secret key for signing the session cookie | `secret` |
| FEATURE_FLAG_ENABLE_AUTH | Enable authentication feature flag | `true` or `false` |
| GITHUB_KEY | GitHub key | `[github key]` |
| GITHUB_OWNER | GitHub organisation name | `cabinetoffice` |
| GITHUB_REPO_ISSUE_ASSIGNEE | GitHub team responsible to solve issues and update configs files | `IDP_TEAM` |
| GITHUB_REPO_ISSUE_LABEL | GitHub label to categorize the related issues | `github-requests-app` |
| GITHUB_TERRAFORM_REPO | GitHub private repo with terraform configurations with members, repos and teams files | `github-requests-terraform` |
| HUMAN | Formatting messages form (default JSON) | `true` (Enable human formatting for log messages) |
| LOG_LEVEL | Logging levels | `info` |
| NODE_ENV | Node environment | `development` or `production` |
| NODE_SSL_ENABLED | Whether SSL is enabled for Node | `true` or `false` |
| PATH_SSL_CERTIFICATE | Path to SSL certificate | `./infrastructure/host/test.cert` |
| PATH_SSL_PRIVATE_KEY | Path to SSL private key | `./infrastructure/host/test.key` |
| PORT | Server port number | `3000` |
| SESSION_APP_KEY | Session application key | `git` |
| SESSION_ID_NAME | Session ID name | `connect.sid` |
| USER_POOL_CLIENT_ID | Client ID of an app registered with the user pool in Amazon Cognito | `secret` |
| USER_POOL_ID | ID of the user pool in Amazon Cognito | `secret` |


## Launching the web-app

Expand All @@ -57,12 +62,23 @@ HUMAN | Formatting messages form (default JSON) | `true` (Enable human formattin

### Running local development environment with Docker

Docker is used to run the application in **development** mode, with tooling setup to detect changes in local `src` directory and reload the container's node server. Ensure that `NODE_ENV=development` is set in the `.env` file.
Docker is used to run the application in **development** mode, with tooling setup to detect changes in local `src` directory and reload the container's node server.

- Ensure that `NODE_ENV=development` is set in the `.env` file.

- In order for static assets to be loaded, the `CDN_HOST` must be set to a CDN domain which serves the GOV.UK static assets.

### Building the application

To build the project, run:

```sh
make build
```

### Building the Docker Image

1. Create a copy of the `.env.example` file and name it `.env`:
Then run:
Create a copy of the `.env.example` file and name it `.env`, then run:

```sh
make docker-build
Expand Down
Loading