-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a CDN for file upload links (#174)
- Loading branch information
1 parent
5ea6331
commit 6d8ee46
Showing
14 changed files
with
326 additions
and
268 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: CI Checks | ||
|
||
on: | ||
pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
VITE_APP_CDN_URL: "" | ||
VITE_DISCORD_INVITE_LINK: "" | ||
VITE_FATHOM_EVENT_CTA_CONTINUE_WITH_PRO: "" | ||
VITE_FATHOM_EVENT_CTA_MODAL_UPGRADE: "" | ||
VITE_FATHOM_EVENT_CTA_OPEN_APP: "" | ||
VITE_FATHOM_EVENT_CTA_SETTINGS_UPGRADE: "" | ||
VITE_FATHOM_EVENT_CTA_SIGN_UP_NOW: "" | ||
VITE_FATHOM_EVENT_CTA_TRY_IT_OUT: "" | ||
VITE_FATHOM_EVENT_CTA_UPGRADE_TO_PRO: "" | ||
VITE_FATHOM_GOAL_ACCOUNT_REGISTRATION: "" | ||
VITE_FATHOM_GOAL_CTA_SYNC_DOCS: "" | ||
VITE_FATHOM_SITE_ID: "" | ||
VITE_FATHOM_SITE_URL: "" | ||
VITE_FIREBASE_API_KEY: "" | ||
VITE_FIREBASE_APP_ID: "" | ||
VITE_FIREBASE_AUTH_DOMAIN: "" | ||
VITE_FIREBASE_DATABASE_URL: "" | ||
VITE_FIREBASE_LOG_LEVEL: "" | ||
VITE_FIREBASE_MESSAGING_SENDER_ID: "" | ||
VITE_FIREBASE_PROJECT_ID: "" | ||
VITE_FIREBASE_STORAGE_BUCKET: "" | ||
VITE_STRIPE_MONTHLY_PRICE: "" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn build |
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 was deleted.
Oops, something went wrong.
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,28 +1,40 @@ | ||
rules_version = '2'; | ||
rules_version = '2' | ||
|
||
service firebase.storage { | ||
match /b/{bucket}/o { | ||
match /files/v1/{uid} { | ||
match /{file=**} { | ||
allow read: if true; | ||
allow write: if authenticated() && authorized() && pro() && underQuota(); | ||
} | ||
|
||
function authenticated() { | ||
return request.auth != null; | ||
} | ||
|
||
function authorized() { | ||
return request.auth.uid == uid; | ||
} | ||
|
||
function pro() { | ||
return request.auth.token.stripeRole == 'subscriber'; | ||
} | ||
|
||
function underQuota() { | ||
return request.resource.size < 10 * 1024 * 1024 | ||
} | ||
match /{file=**} { | ||
allow read: if true | ||
allow create: if allowed() && ownsRequest() | ||
allow delete: if allowed() && ownsResource() | ||
allow update: if allowed() && ownsRequest() && ownsResource() | ||
} | ||
|
||
function allowed() { | ||
return authenticated() && underQuota() && (ambassador() || pro()) | ||
} | ||
|
||
function ambassador() { | ||
return request.auth.token.ambassador | ||
} | ||
|
||
function authenticated() { | ||
return request.auth != null | ||
} | ||
|
||
function ownsResource() { | ||
return request.auth.uid == resource.metadata.ownerId | ||
} | ||
|
||
function ownsRequest() { | ||
return request.auth.uid == request.resource.metadata.ownerId | ||
} | ||
|
||
function pro() { | ||
return request.auth.token.stripeRole == 'subscriber' | ||
} | ||
|
||
function underQuota() { | ||
return request.resource.size < 10 * 1024 * 1024 | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.