Skip to content

Commit

Permalink
Added emulators and fixed upload to server
Browse files Browse the repository at this point in the history
  • Loading branch information
porfanid committed Nov 25, 2024
1 parent 70736af commit aaeb677
Show file tree
Hide file tree
Showing 21 changed files with 3,163 additions and 32 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @porfanid
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.env
BackUp/
public/gallery/*

# Logs
logs
Expand All @@ -25,3 +26,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

scripts/ioannina-scouts-firebase-adminsdk-g6qgn-f625d59955.json
18 changes: 17 additions & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,21 @@
],
"postdeploy": "firebase deploy --only firestore"
}
]
],
"storage": {
"rules": "storage.rules"
},
"emulators": {
"functions": {
"port": 5001
},
"firestore": {
"port": 8080
},
"ui": {
"enabled": true,
"port": 4000
},
"singleProjectMode": true
}
}
10 changes: 9 additions & 1 deletion firestore.indexes.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
{
"indexes": [],
"indexes": [
{
"collectionGroup": "gallery",
"queryScope": "COLLECTION",
"fields": [
{ "fieldPath": "date", "order": "DESCENDING" }
]
}
],
"fieldOverrides": []
}
8 changes: 7 additions & 1 deletion firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ service cloud.firestore {
allow write: if request.auth != null && get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'admin';
}
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
allow read: if request.auth != null && request.auth.uid == userId;
allow write: if request.auth != null && request.auth.uid == userId && !(request.resource.data.keys().hasAny(['role']));
}
match /chiefs/{document=**} {
allow read: if true; // Public read access
allow write: if request.auth != null && get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "admin";
//allow write: if true;
}
match /gallery/{document=**} {
allow read: if true; // Public read access
//allow write: if request.auth != null && get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == "admin";
allow write: if true;
}
match /{document=**} {
allow read, write: if false;
}
Expand Down
Loading

0 comments on commit aaeb677

Please sign in to comment.