Skip to content

Commit

Permalink
add public defaults to config
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Dec 30, 2023
1 parent 0180f82 commit 358ded8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

NODE_ENV=development
YOUTUBE_API_KEY=REPLACE_ME
# The empty string causes firebase not to be used, allowing access to all features without login
VITE_FIREBASE_CONFIG=
# VITE_FIREBASE_CONFIG={"apiKey":"AIzaSyA2fkXeFokJ-Ei_jnzDso5AmjbIaMdzuEc","authDomain":"watchparty-273604.firebaseapp.com","databaseURL":"https://watchparty-273604.firebaseio.com","projectId":"watchparty-273604","storageBucket":"watchparty-273604.appspot.com","messagingSenderId":"769614672795","appId":"1:769614672795:web:54bbda86288ab1a034273e"}
# FIREBASE_ADMIN_SDK_CONFIG=REPLACE_ME
# DATABASE_URL=postgresql://postgres@localhost:5432/postgres?sslmode=disable
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
- run: npm run build --if-present
env:
CI: true
VITE_FIREBASE_CONFIG: '{"apiKey":"AIzaSyA2fkXeFokJ-Ei_jnzDso5AmjbIaMdzuEc","authDomain":"watchparty-273604.firebaseapp.com","databaseURL":"https://watchparty-273604.firebaseio.com","projectId":"watchparty-273604","storageBucket":"watchparty-273604.appspot.com","messagingSenderId":"769614672795","appId":"1:769614672795:web:54bbda86288ab1a034273e"}'
VITE_RECAPTCHA_SITE_KEY: 6LeDGP4UAAAAAGYZZenyU-3fRdhL3p0BaBmiK9mM
VITE_STRIPE_PUBLIC_KEY: pk_live_eVMbIifj5lnvgBleBCRaCv4E00aeXQkPxQ
NODE_ENV: production
- name: Push to remote
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/ProfileModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class ProfileModal extends React.Component<{

authDiscord = () => {
const url = `https://discord.com/api/oauth2/authorize?client_id=1071707916719095908&redirect_uri=${encodeURIComponent(
config.VITE_OAUTH_REDIRECT_HOSTNAME ?? 'https://www.watchparty.me'
config.VITE_OAUTH_REDIRECT_HOSTNAME
)}%2Fdiscord%2Fauth&response_type=token&scope=identify`;
window.open(
url,
Expand Down
15 changes: 11 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
export default {
VITE_SERVER_HOST: import.meta.env.VITE_SERVER_HOST,
VITE_OAUTH_REDIRECT_HOSTNAME: import.meta.env.VITE_OAUTH_REDIRECT_HOSTNAME,
VITE_FIREBASE_CONFIG: import.meta.env.VITE_FIREBASE_CONFIG,
VITE_STRIPE_PUBLIC_KEY: import.meta.env.VITE_STRIPE_PUBLIC_KEY,
VITE_RECAPTCHA_SITE_KEY: import.meta.env.VITE_RECAPTCHA_SITE_KEY,
VITE_OAUTH_REDIRECT_HOSTNAME:
import.meta.env.VITE_OAUTH_REDIRECT_HOSTNAME ?? 'https://www.watchparty.me',
VITE_FIREBASE_CONFIG:
import.meta.env.VITE_FIREBASE_CONFIG ??
'{"apiKey":"AIzaSyA2fkXeFokJ-Ei_jnzDso5AmjbIaMdzuEc","authDomain":"watchparty-273604.firebaseapp.com","databaseURL":"https://watchparty-273604.firebaseio.com","projectId":"watchparty-273604","storageBucket":"watchparty-273604.appspot.com","messagingSenderId":"769614672795","appId":"1:769614672795:web:54bbda86288ab1a034273e"}',
VITE_STRIPE_PUBLIC_KEY:
import.meta.env.VITE_STRIPE_PUBLIC_KEY ??
'pk_live_eVMbIifj5lnvgBleBCRaCv4E00aeXQkPxQ',
VITE_RECAPTCHA_SITE_KEY:
import.meta.env.VITE_RECAPTCHA_SITE_KEY ??
'6LeDGP4UAAAAAGYZZenyU-3fRdhL3p0BaBmiK9mM',
NODE_ENV: import.meta.env.DEV ? 'development' : 'production',
};

0 comments on commit 358ded8

Please sign in to comment.