Skip to content

Commit

Permalink
Env variables (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamLee514 authored May 28, 2021
1 parent e15ec90 commit 72523be
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ GITHUB_CLIENT_ID=test
GITHUB_CLIENT_SECRET=test

BUCKET_NAME=foo
# As per README, remove spaces in the below, i.e GCP_STORAGE_SERVICE_ACCOUNT='{"type":"service_account","project_id":"foo"...}'
GCP_STORAGE_SERVICE_ACCOUNT='{ \
"type": "service_account", \
"project_id": "foo", \
Expand All @@ -34,6 +35,7 @@ GCP_STORAGE_SERVICE_ACCOUNT='{ \
"client_x509_cert_url": "acerturl" \
}'


AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Expand All @@ -44,3 +46,5 @@ MSFT_CLIENT_SECRET=test
MSFT_REDIRECT_URL="http://localhost:8081/api/auth/microsoft/callback"

CALENDARID=foo

SENTRY_URL=foo
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@
"registration"
],
"contributors": [
"Matt Leon <[email protected]> (https://mattleon.com)",
"Irfaan Khalid <[email protected]> (https://irfaan.me)",
"Felix Tiet <[email protected]> (http://ftiet.com)",
"Alan Wilms <[email protected]>",
"Benjamin Cooper <[email protected]> (https://benc.io)",
"Kwuang Tang <[email protected]> (https://github.com/cktang88)"
"VandyHacks <[email protected]> (https://vandyhacks.org)"
],
"bugs": {
"url": "https://github.com/VandyHacks/vaken/issues"
Expand Down
1 change: 0 additions & 1 deletion src/client/assets/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"APPLICATION_DECLINED_STATUSCOLOR": "#FFFFFF",
"TEXT_AREA_MAX_LENGTH": 1500,
"INPUT_MAX_LENGTH": 100,
"SENTRY_URL": "https://[email protected]/1766495",
"NO_EVENTS_MESSAGE": "There are no current events.",
"PERMISSIONS_HACKER_TABLE": "hackertable",
"PERMISSIONS_RESUME": "resume",
Expand Down
2 changes: 1 addition & 1 deletion src/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as Sentry from '@sentry/browser';
import Vaken from './app';
import STRINGS from './assets/strings.json';

Sentry.init({ dsn: STRINGS.SENTRY_URL, tracesSampleRate: 1.0 });
Sentry.init({ dsn: SENTRY_URL, tracesSampleRate: 1.0 });

const client = new ApolloClient({
cache: new InMemoryCache(),
Expand Down
5 changes: 5 additions & 0 deletions src/client/types/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export {};

declare global {
var SENTRY_URL: string;
}
5 changes: 5 additions & 0 deletions webpack/webpack.common.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
require('dotenv').config();

const ASSET_PATH = process.env.ASSET_PATH || '/';
module.exports = {
Expand Down Expand Up @@ -45,6 +47,9 @@ module.exports = {
template: './src/client/index.html',
favicon: './src/client/assets/img/favicon.ico',
}), // For index.html entry point
new webpack.DefinePlugin({
SENTRY_URL: JSON.stringify(process.env.SENTRY_URL),
}), // For user-specific Sentry logging
],
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
Expand Down

0 comments on commit 72523be

Please sign in to comment.