From 4d68f2a76697234e345aaf583f034e9aecb298ac Mon Sep 17 00:00:00 2001 From: Olli Vanhapiha Date: Tue, 13 Mar 2018 14:51:36 +0200 Subject: [PATCH] Document env variables in one place --- README.md | 3 ++- docs/env.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 docs/env.md diff --git a/README.md b/README.md index 494e3eee..86a17ddb 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,8 @@ To develop the application and to see changes live, start the frontend developme yarn run dev -**You also need to [configure Google Maps api key](./docs/google-maps.md)** +**You need to configure Client Id, Google Maps API key and Stripe +publishable API key via [environment variables](./docs/env.md).** **Known issues:** diff --git a/docs/env.md b/docs/env.md new file mode 100644 index 00000000..9e1a9d26 --- /dev/null +++ b/docs/env.md @@ -0,0 +1,34 @@ +# Environment configuration variables + +The following configuration variables can be set to control the +Starter App behaviour. Most of them have defaults that work for +development environment. For production deploys most should be set. + +| Variable | Must be set? | Default | Description | +| --------- | ------------ | ------------- | ------------------------ | +| REACT_APP_GOOGLE_MAPS_API_KEY | X | - | See: [Google Maps API key](./google-maps.md) | +| REACT_APP_SHARETRIBE_SDK_CLIENT_ID | X | - | Client ID (API key). You will get this from the Sharetribe team. | +| REACT_APP_STRIPE_PUBLISHABLE_KEY | X | - | Stripe publishable API key for generating tokens with Stripe API. | +| REACT_APP_SHARETRIBE_SDK_BASE_URL | | `http://localhost:8088` | The base url to access the Marketplace API. | +| REACT_APP_SHARETRIBE_MARKETPLACE_CURRENCY | | USD | The currency used in the Marketplace as ISO 4217 currency code. For example: USD, EUR, CAD, AUD, etc. | +| REACT_APP_CANONICAL_ROOT_URL | | `http://localhost:3000` | Canonical root url of the marketplace is running. Needed for social media sharing and SEO optimization. | +| NODE_ENV | | ? | Node env. Use 'dev' for development and 'production' for production. | +| REACT_APP_ENV | | production | TODO Didn't understand NODE_ENV vs this? | +| REACT_APP_SHARETRIBE_USING_SSL | | false | Redirect HTTP to HTTPS. | +| SERVER_SHARETRIBE_TRUST_PROXY | | false | Set when running the app behind a reverse proxy. | +| REACT_APP_PUBLIC_SENTRY_DSN | | - | See: [Error logging with Sentry](./sentry.md) | +| SERVER_SENTRY_DSN | | - | See: [Error logging with Sentry](./sentry.md) | +| REACT_APP_CSP | | - | See: [Content Security Policy (CSP)](./content-security-policy.md) | +| BASIC_AUTH_USERNAME | | - | Set to enable HTTP Basic Auth | +| BASIC_AUTH_PASSWORD | | - | Set to enable HTTP Basic Auth | +| REACT_APP_GOOGLE_ANALYTICS_ID | | - | See: [Google Analytics](./analytics.md) | + + +## Defining the env variables + +When the Starter App is started locally with `yarn run dev` you can +set environment variables by using the file +.env.development.local. However, the server process doesn't currently +pick up values from this file. In production it is recommended to set +the environment variables on OS level. +