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

Env variables #813

Merged
merged 5 commits into from
May 28, 2021
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
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