-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generate multiple config file by env
- Loading branch information
1 parent
881e44e
commit 5cac276
Showing
7 changed files
with
139 additions
and
7 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,45 @@ | ||
{ | ||
"storage": { | ||
"rules": "./storage.cloudnord.rules" | ||
}, | ||
"firestore": { | ||
"rules": "firestore.cloudnord.rules", | ||
"indexes": "firestore.indexes.json" | ||
}, | ||
"functions": [ | ||
{ | ||
"source": "functions", | ||
"codebase": "default", | ||
"ignore": ["node_modules", ".git", "firebase-debug.log", "firebase-debug.*.log"], | ||
"predeploy": ["npm --prefix \"$RESOURCE_DIR\" run build"] | ||
} | ||
], | ||
"hosting": { | ||
"public": "public/dist/front/browser", | ||
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"], | ||
"rewrites": [ | ||
{ | ||
"source": "**", | ||
"destination": "/index.html" | ||
} | ||
] | ||
}, | ||
"emulators": { | ||
"auth": { | ||
"port": 9099 | ||
}, | ||
"functions": { | ||
"port": 5001 | ||
}, | ||
"firestore": { | ||
"port": 8080 | ||
}, | ||
"hosting": { | ||
"port": 5000 | ||
}, | ||
"ui": { | ||
"enabled": true | ||
}, | ||
"singleProjectMode": true | ||
} | ||
} |
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
File renamed without changes.
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,32 @@ | ||
rules_version = '2'; | ||
service cloud.firestore { | ||
match /databases/{database}/documents { | ||
match /companies-2023/{companyId} { | ||
allow list, update: if isGdgLille() || notUpdating('name'); | ||
allow create, get: if true; | ||
} | ||
match /companies-2024/{companyId} { | ||
allow list, update: if isGdgLille() || notUpdating('name'); | ||
allow create, get: if true; | ||
} | ||
match /workflows/{workflowId} { | ||
allow list: if true; | ||
allow get: if true; | ||
} | ||
match /configuration/{configurationId} { | ||
allow get: if true; | ||
allow update: if isGdgLille(); | ||
} | ||
} | ||
} | ||
|
||
function notUpdating(field) { | ||
return !(field in request.resource.data) | ||
|| resource.data[field] == request.resource.data[field] | ||
} | ||
function isOwner(companyId) { | ||
return request.auth.token.email in resource.data.email; | ||
} | ||
function isGdgLille() { | ||
return request.auth.token.email.matches(".*@gdglille.org") | ||
} |
File renamed without changes.
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,54 @@ | ||
rules_version = '2'; | ||
service firebase.storage { | ||
match /b/{bucket}/o { | ||
match /logo { | ||
match /{allPaths=**} { | ||
allow read: if true; | ||
} | ||
match /{imageId} { | ||
allow write: if request.resource.size < 5 * 1024 * 1024 | ||
&& request.resource.contentType.matches('image/.*'); | ||
} | ||
} | ||
match /facture { | ||
match /{allPaths=**} { | ||
allow read: if true; | ||
allow write: if isGdgLille(); | ||
} | ||
} | ||
match /flyers { | ||
match /{allPaths=**} { | ||
allow read: if true; | ||
allow write: if isGdgLille(); | ||
} | ||
} | ||
match /devis { | ||
match /{allPaths=**} { | ||
allow read: if true; | ||
allow write: if isGdgLille(); | ||
} | ||
} | ||
match /conventionSigned { | ||
match /{allPaths=**} { | ||
allow read: if true; | ||
allow write: if true; | ||
} | ||
} | ||
match /signed { | ||
match /{allPaths=**} { | ||
allow read: if true; | ||
allow write: if true; | ||
} | ||
} | ||
match /convention { | ||
match /{allPaths=**} { | ||
allow read: if true; | ||
allow write: if isGdgLille(); | ||
} | ||
} | ||
|
||
} | ||
} | ||
function isGdgLille() { | ||
return request.auth.token.email.matches(".*@gdglille.org") | ||
} |