Skip to content

Commit

Permalink
Create and document Fortmatic environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
KiChjang committed Mar 19, 2020
1 parent 4125ece commit 70e8164
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app/app/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ def preprocess(request):
'INFURA_V3_PROJECT_ID': settings.INFURA_V3_PROJECT_ID,
'giphy_key': settings.GIPHY_KEY,
'youtube_key': settings.YOUTUBE_API_KEY,
'fortmatic_live_key': settings.FORTMATIC_LIVE_KEY,
'fortmatic_test_key': settings.FORTMATIC_TEST_KEY,
'orgs': profile.organizations if profile else [],
'profile_id': profile.id if profile else '',
'hotjar': settings.HOTJAR_CONFIG,
Expand Down
4 changes: 3 additions & 1 deletion app/app/local.env
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ CONTACT_EMAIL=
FEE_ADDRESS=
FEE_ADDRESS_PRIVATE_KEY=
GIPHY_KEY=
YOUTUBE_API_KEY=
YOUTUBE_API_KEY=
FORTMATIC_LIVE_KEY=
FORTMATIC_TEST_KEY=
2 changes: 2 additions & 0 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#social integrations
GIPHY_KEY = env('GIPHY_KEY', default='LtaY19ToaBSckiLU4QjW0kV9nIP75NFy')
YOUTUBE_API_KEY = env('YOUTUBE_API_KEY', default='YOUR-SupEr-SecRet-YOUTUBE-KeY')
FORTMATIC_LIVE_KEY = env('FORTMATIC_LIVE_KEY', default='YOUR-SupEr-SecRet-LiVe-FoRtMaTiC-KeY')
FORTMATIC_TEST_KEY = env('FORTMATIC_TEST_KEY', default='YOUR-SupEr-SecRet-TeSt-FoRtMaTiC-KeY')

# Ratelimit
RATELIMIT_ENABLE = env.bool('RATELIMIT_ENABLE', default=True)
Expand Down
3 changes: 1 addition & 2 deletions app/assets/v2/js/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,7 @@ $(document).ready(function() {
const Web3Connect = window.Web3Connect.default;
// Determine if we're on prod or not
const isProd = document.location.href.startsWith('https://gitcoin.co');
// FIXME: Use Fortmatic API key provided by Gitcoin
const formaticKey = isProd ? 'pk_live_99CEDFB950A446EC' : 'pk_test_A9E82CC253A9C8E4';
const formaticKey = isProd ? document.contxt['fortmatic_live_key'] : document.contxt['fortmatic_test_key'];
const providerOptions = {
authereum: {
'package': Authereum
Expand Down
7 changes: 7 additions & 0 deletions docs/ENVIRONMENT_VARIABLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ All of the environment variables used by this application conform to the [`djang
| --- | --- | --- | --- |
| INSTALLED_APPS | A list of additional apps to be recognized by Django. | `list` | [] |

## Fortmatic

| Variable | Description | Type | Default |
| --- | --- | --- | --- |
| FORTMATIC_LIVE_KEY | The Formatic live (production) API key | `str` | '' |
| FORTMATIC_TEST_KEY | The Formatic test API key | `str` | '' |

## Github Authentication

| Variable | Description | Type | Default |
Expand Down
10 changes: 10 additions & 0 deletions docs/THIRD_PARTY_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ CONTACT_EMAIL=xxx
ENABLE_NOTIFICATIONS_ON_NETWORK=None
```

## Setup Fortmatic Integration

1. Sign up/Login to Fortmatic dashboard at https://dashboard.fortmatic.com
2. Update the `web/app/app/.env` file to include the values provided by Fortmatic:

```shell
FORTMATIC_LIVE_KEY=xxx
FORTMATIC_TEST_KEY=xxx
```

## Gitcoinbot Installation Instructions

### This integration requires the Github OAuth2 App Integration
Expand Down

0 comments on commit 70e8164

Please sign in to comment.