-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove unused firebase config * Default Firebase DB to test * Add Prod Firebase DB as env var to action * Change URL from prod->beta per aaron
- Loading branch information
Showing
3 changed files
with
16 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,9 @@ | ||
import { initializeApp } from 'firebase/app'; | ||
|
||
export const connectToFirebase = (hostname, resourceType) => { | ||
// TODO -- OLD PROD CONFIG -- DOUBLECHECK IF THIS IS NEEDED | ||
// const prodConfig = { | ||
// apiKey: "AIzaSyA2E1tiV34Ou6CJU_wzlJtXxwATJXxi6K8", | ||
// authDomain: "phlask-web-map-new-taps.firebaseapp.com", | ||
// databaseURL: `https://phlask-web-map-new-taps.firebaseio.com`, | ||
// projectId: "phlask-web-map-new-taps", | ||
// storageBucket: "phlask-web-map-new-taps.appspot.com", | ||
// messagingSenderId: "673087230724", | ||
// appId: "1:673087230724:web:2545788342843cccdcf651" | ||
// }; | ||
|
||
let environment; | ||
|
||
if (hostname === 'phlask.me') { | ||
environment = 'prod'; | ||
} else if (hostname === 'beta.phlask.me') { | ||
environment = 'beta'; | ||
} else { | ||
environment = 'test'; | ||
} | ||
|
||
const firebaseConfig = { | ||
apiKey: 'AIzaSyABw5Fg78SgvedyHr8tl-tPjcn5iFotB6I', | ||
authDomain: 'phlask-web-map.firebaseapp.com', | ||
databaseURL: `https://phlask-web-map-${environment}-${resourceType}-verify.firebaseio.com`, | ||
projectId: 'phlask-web-map-new-taps', | ||
storageBucket: 'phlask-web-map.appspot.com', | ||
messagingSenderId: '428394983826', | ||
appId: '1:428394983826:web:b81abdcfd5af5401e0514b' | ||
}; | ||
|
||
// return firebase.initializeApp(firebaseConfig, "new"); | ||
return initializeApp(firebaseConfig, 'new'); | ||
}; | ||
|
||
export const WEBSITE_REGEX = new RegExp( | ||
'^([a-zA-Z]+:\\/\\/)?' + // protocol (optional) | ||
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name | ||
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR IP (v4) address | ||
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path | ||
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string | ||
'(\\#[-a-z\\d_]*)?$', // fragment locator | ||
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name | ||
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR IP (v4) address | ||
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path | ||
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string | ||
'(\\#[-a-z\\d_]*)?$', // fragment locator | ||
'i' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
export const contributorsConfig = { | ||
// Sets the Phlask Database URL to use the test instance unless overriden | ||
// This environment variable will also need to be set in the prod build pipeline to "https://phlask-prod.firebaseio.com" | ||
// https://github.com/phlask/phlask-map/issues/498 | ||
let phlaskDatabaseUrl = process.env.REACT_APP_DB_URL || "https://phlask-test.firebaseio.com" | ||
|
||
export const resourcesConfig = { | ||
apiKey: 'AIzaSyABw5Fg78SgvedyHr8tl-tPjcn5iFotB6I', | ||
authDomain: 'phlask-web-map.firebaseapp.com', | ||
databaseURL: 'https://phlask-contributors.firebaseio.com/', | ||
databaseURL: phlaskDatabaseUrl, | ||
projectId: 'phlask-web-map', | ||
storageBucket: 'phlask-web-map.appspot.com', | ||
messagingSenderId: '428394983826' | ||
}; | ||
|
||
export const resourcesConfig = { | ||
export const contributorsConfig = { | ||
apiKey: 'AIzaSyABw5Fg78SgvedyHr8tl-tPjcn5iFotB6I', | ||
authDomain: 'phlask-web-map.firebaseapp.com', | ||
databaseURL: 'https://phlask-beta.firebaseio.com', | ||
databaseURL: 'https://phlask-contributors.firebaseio.com/', | ||
projectId: 'phlask-web-map', | ||
storageBucket: 'phlask-web-map.appspot.com', | ||
messagingSenderId: '428394983826' | ||
}; | ||
}; |