Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
03567ad5cf | ||
|
9974de574a | ||
|
581319cc53 | ||
|
245036ea69 |
|
@ -1,5 +1,6 @@
|
|||
import { DEV_CONFIG } from './dev'
|
||||
import { EnvConfig, PROD_CONFIG } from './prod'
|
||||
import { SUPERSYNC_CONFIG } from './supersync'
|
||||
import { THEOREMONE_CONFIG } from './theoremone'
|
||||
|
||||
const ENV = process.env.NEXT_PUBLIC_FIREBASE_ENV ?? 'PROD'
|
||||
|
@ -8,6 +9,7 @@ const CONFIGS = {
|
|||
PROD: PROD_CONFIG,
|
||||
DEV: DEV_CONFIG,
|
||||
THEOREMONE: THEOREMONE_CONFIG,
|
||||
SUPERSYNC: SUPERSYNC_CONFIG,
|
||||
}
|
||||
// @ts-ignore
|
||||
export const ENV_CONFIG: EnvConfig = CONFIGS[ENV]
|
||||
|
|
27
common/envs/supersync.ts
Normal file
27
common/envs/supersync.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
import { EnvConfig, PROD_CONFIG } from './prod'
|
||||
|
||||
export const SUPERSYNC_CONFIG: EnvConfig = {
|
||||
domain: 'supersync.manifold.markets',
|
||||
firebaseConfig: {
|
||||
apiKey: 'AIzaSyCV2THIZ_DPuFe4SI033uE13XNjzBLHPGM',
|
||||
authDomain: 'supersync-manifold.firebaseapp.com',
|
||||
projectId: 'supersync-manifold',
|
||||
storageBucket: 'supersync-manifold.appspot.com',
|
||||
messagingSenderId: '385180520313',
|
||||
appId: '1:385180520313:web:e4d99bf5b888d76b43a9a8',
|
||||
measurementId: 'G-C28MP0GSDJ',
|
||||
},
|
||||
adminEmails: [...PROD_CONFIG.adminEmails],
|
||||
whitelistEmail: '@supsync.com',
|
||||
moneyMoniker: 'S$',
|
||||
visibility: 'PRIVATE',
|
||||
faviconPath: '/favicon.ico',
|
||||
navbarLogoPath:
|
||||
'https://supsync.com/content/images/2021/03/supsync-logo-invert-1.svg',
|
||||
newQuestionPlaceholders: [
|
||||
'Will we have at least 5 new team members by the end of this quarter?',
|
||||
'Will we meet or exceed our goals this sprint?',
|
||||
'Will we sign on 3 or more new clients this month?',
|
||||
'Will Paul shave his beard by the end of the month?',
|
||||
],
|
||||
}
|
|
@ -5,14 +5,16 @@ service cloud.firestore {
|
|||
match /databases/{database}/documents {
|
||||
|
||||
function isAdmin() {
|
||||
return request.auth.uid == 'igi2zGXsfxYPgB0DJTXVJVmwCOr2' // Austin
|
||||
|| request.auth.uid == '5LZ4LgYuySdL1huCWe7bti02ghx2' // James
|
||||
|| request.auth.uid == 'tlmGNz9kjXc2EteizMORes4qvWl2' // Stephen
|
||||
|| request.auth.uid == 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2' // Manifold
|
||||
return request.auth.uid == 'P0UsBCW7VmSR0co39kFlsjxWgLQ2' // Austin
|
||||
// || request.auth.uid == 'czxKSN1Z03Mzu7UqIio3ppM0eDt2' // David
|
||||
}
|
||||
|
||||
function isAuthed() {
|
||||
return request.auth != null
|
||||
}
|
||||
|
||||
match /users/{userId} {
|
||||
allow read;
|
||||
allow read: if isAuthed();
|
||||
allow update: if resource.data.id == request.auth.uid
|
||||
&& request.resource.data.diff(resource.data).affectedKeys()
|
||||
.hasOnly(['bio', 'bannerUrl', 'website', 'twitterHandle', 'discordHandle']);
|
||||
|
@ -23,7 +25,7 @@ service cloud.firestore {
|
|||
}
|
||||
|
||||
match /contracts/{contractId} {
|
||||
allow read;
|
||||
allow read: if isAuthed();
|
||||
allow update: if request.resource.data.diff(resource.data).affectedKeys()
|
||||
.hasOnly(['description', 'closeTime', 'tags', 'lowercaseTags']);
|
||||
allow update: if isAdmin();
|
||||
|
@ -31,25 +33,25 @@ service cloud.firestore {
|
|||
}
|
||||
|
||||
match /{somePath=**}/bets/{betId} {
|
||||
allow read;
|
||||
allow read: if isAuthed();
|
||||
}
|
||||
|
||||
match /{somePath=**}/comments/{commentId} {
|
||||
allow read;
|
||||
allow read: if isAuthed();
|
||||
allow create: if request.auth != null;
|
||||
}
|
||||
|
||||
match /{somePath=**}/answers/{answerId} {
|
||||
allow read;
|
||||
allow read: if isAuthed();
|
||||
}
|
||||
|
||||
match /folds/{foldId} {
|
||||
allow read;
|
||||
allow read: if isAuthed();
|
||||
allow update, delete: if request.auth.uid == resource.data.curatorId;
|
||||
}
|
||||
|
||||
match /{somePath=**}/followers/{userId} {
|
||||
allow read;
|
||||
allow read: if isAuthed();
|
||||
allow write: if request.auth.uid == userId;
|
||||
}
|
||||
}
|
||||
|
|
1
functions/.env
Normal file
1
functions/.env
Normal file
|
@ -0,0 +1 @@
|
|||
NEXT_PUBLIC_FIREBASE_ENV=SUPERSYNC
|
3
functions/.gitignore
vendored
3
functions/.gitignore
vendored
|
@ -1,6 +1,3 @@
|
|||
# Secrets
|
||||
.env*
|
||||
|
||||
# Compiled JavaScript files
|
||||
lib/**/*.js
|
||||
lib/**/*.js.map
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
"devdev": "NEXT_PUBLIC_FIREBASE_ENV=DEV concurrently -n NEXT,TS -c magenta,cyan \"FIREBASE_ENV=DEV next dev -p 3000\" \"FIREBASE_ENV=DEV yarn ts --watch\"",
|
||||
"dev:dev": "yarn devdev",
|
||||
"dev:the": "NEXT_PUBLIC_FIREBASE_ENV=THEOREMONE concurrently -n NEXT,TS -c magenta,cyan \"FIREBASE_ENV=THEOREMONE next dev -p 3000\" \"FIREBASE_ENV=THEOREMONE yarn ts --watch\"",
|
||||
"dev:ss": "NEXT_PUBLIC_FIREBASE_ENV=SUPERSYNC concurrently -n NEXT,TS -c magenta,cyan \"FIREBASE_ENV=SUPERSYNC next dev -p 3000\" \"FIREBASE_ENV=SUPERSYNC yarn ts --watch\"",
|
||||
"ts": "tsc --noEmit --incremental --preserveWatchOutput --pretty",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
|
|
Loading…
Reference in New Issue
Block a user