Compare commits

...

27 Commits

Author SHA1 Message Date
Austin Chen
a48755b283 Merge branch 'main' into theoremone 2022-03-08 18:45:04 -08:00
Austin Chen
20e55f829a Add "dev:dev" alias 2022-03-07 20:58:46 -08:00
Austin Chen
22799d1c3c Rename access.ts to envs/constants.ts 2022-03-07 20:52:10 -08:00
Austin Chen
dcafb50e06 Move IS_PRIVATE_MANIFOLD to access.ts 2022-03-07 20:47:50 -08:00
Austin Chen
cb071fc9b3 Generify most of the customizable brand stuff 2022-03-07 18:34:49 -08:00
Austin Chen
deed8426f1 Spin out config files for each environment 2022-03-07 18:19:36 -08:00
Austin Chen
21180c2ff0 Move more logic into access 2022-03-07 17:43:23 -08:00
Austin Chen
bb897a0a0f Fix props to be empty object 2022-03-07 17:14:51 -08:00
Austin Chen
dc29ca531c Conditionally use SSG depending on public vs private instance 2022-03-07 16:20:06 -08:00
Austin Chen
ae63f70a30 More migrations to PROJECT_ID 2022-03-07 15:52:13 -08:00
Austin Chen
4b216b682e Migrate per-env code into common/ 2022-03-07 15:43:26 -08:00
Austin Chen
95e24e9b87 Switch /analytics to propz 2022-03-07 14:20:15 -08:00
Austin Chen
0fcfee6d77 Update firestore.indexes.json 2022-03-07 14:19:55 -08:00
Austin Chen
a3bcbd0518 Update placeholders for teams 2022-03-07 13:42:25 -08:00
Austin Chen
5d64d53c65 Merge branch 'main' into theoremone 2022-03-07 13:39:00 -08:00
Austin Chen
5e4a205025 Hide Discord & About Page too 2022-03-01 17:30:49 -08:00
Austin Chen
064d7e4ccc "M$" => "T$" 2022-03-01 17:19:40 -08:00
Austin Chen
3633167d8a Hide "Add Funds" and "Personalize your feed" 2022-03-01 17:19:20 -08:00
Austin Chen
c1fd17aba1 Brand instance for TheoremOne 2022-03-01 17:18:46 -08:00
Austin Chen
de10504606 Merge branch 'main' into theoremone 2022-03-01 16:42:41 -08:00
Austin Chen
e29174d622 Merge branch 'main' into theoremone 2022-03-01 16:39:38 -08:00
Austin Chen
c8add8ea51 Hide 404 for private Manifolds 2022-03-01 16:37:37 -08:00
Austin Chen
20d18f3588 Client-side render pages that need auth
These pages are now client-side rendered:
- /home
- /leaderboards
- /market/...
- /fold/...
2022-03-01 16:32:31 -08:00
Austin Chen
eef35cd7d0 Forbid reads from unauthenticated users 2022-03-01 16:31:03 -08:00
Austin Chen
a722de09d0 Add new indices 2022-02-28 18:09:43 -08:00
Austin Chen
bfefa61d35 Restrict signups to theoremone.co emails 2022-02-28 16:05:31 -08:00
Austin Chen
9258cf0f3d Add dev target for TheoremOne 2022-02-26 23:45:32 -08:00

View File

@ -5,14 +5,16 @@ service cloud.firestore {
match /databases/{database}/documents { match /databases/{database}/documents {
function isAdmin() { function isAdmin() {
return request.auth.uid == 'igi2zGXsfxYPgB0DJTXVJVmwCOr2' // Austin return request.auth.uid == 'OTd2JFY7LOdvQg2ZQGYLUqrXAiD2' // Austin
|| request.auth.uid == '5LZ4LgYuySdL1huCWe7bti02ghx2' // James || request.auth.uid == 'czxKSN1Z03Mzu7UqIio3ppM0eDt2' // David
|| request.auth.uid == 'tlmGNz9kjXc2EteizMORes4qvWl2' // Stephen }
|| request.auth.uid == 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2' // Manifold
function isAuthed() {
return request.auth != null
} }
match /users/{userId} { match /users/{userId} {
allow read; allow read: if isAuthed();
allow update: if resource.data.id == request.auth.uid allow update: if resource.data.id == request.auth.uid
&& request.resource.data.diff(resource.data).affectedKeys() && request.resource.data.diff(resource.data).affectedKeys()
.hasOnly(['bio', 'bannerUrl', 'website', 'twitterHandle', 'discordHandle']); .hasOnly(['bio', 'bannerUrl', 'website', 'twitterHandle', 'discordHandle']);
@ -23,7 +25,7 @@ service cloud.firestore {
} }
match /contracts/{contractId} { match /contracts/{contractId} {
allow read; allow read: if isAuthed();
allow update: if request.resource.data.diff(resource.data).affectedKeys() allow update: if request.resource.data.diff(resource.data).affectedKeys()
.hasOnly(['description', 'closeTime', 'tags', 'lowercaseTags']); .hasOnly(['description', 'closeTime', 'tags', 'lowercaseTags']);
allow update: if isAdmin(); allow update: if isAdmin();
@ -31,25 +33,25 @@ service cloud.firestore {
} }
match /{somePath=**}/bets/{betId} { match /{somePath=**}/bets/{betId} {
allow read; allow read: if isAuthed();
} }
match /{somePath=**}/comments/{commentId} { match /{somePath=**}/comments/{commentId} {
allow read; allow read: if isAuthed();
allow create: if request.auth != null; allow create: if request.auth != null;
} }
match /{somePath=**}/answers/{answerId} { match /{somePath=**}/answers/{answerId} {
allow read; allow read: if isAuthed();
} }
match /folds/{foldId} { match /folds/{foldId} {
allow read; allow read: if isAuthed();
allow update, delete: if request.auth.uid == resource.data.curatorId; allow update, delete: if request.auth.uid == resource.data.curatorId;
} }
match /{somePath=**}/followers/{userId} { match /{somePath=**}/followers/{userId} {
allow read; allow read: if isAuthed();
allow write: if request.auth.uid == userId; allow write: if request.auth.uid == userId;
} }
} }