-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
39 lines (38 loc) · 1.8 KB
/
Copy pathstorage.rules
File metadata and controls
39 lines (38 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
rules_version = '2';
// Deploy: firebase deploy --only storage (from project root)
// Requires default Storage bucket to exist (create once in Firebase Console > Build > Storage if needed).
service firebase.storage {
match /b/{bucket}/o {
// Session presentation files: PDFs and images shared by host during live sessions.
// Authenticated users can read (participants) and write (host uploads).
// Path: sessions/{sessionId}/presentation/{filename}
match /sessions/{sessionId}/presentation/{fileName} {
allow read: if request.auth != null;
allow write: if request.auth != null
&& (request.resource == null // delete
|| (request.resource.size < 50 * 1024 * 1024 // 50 MB max
&& (request.resource.contentType.matches('application/pdf')
|| request.resource.contentType.matches('image/.*'))));
}
// Live session cover thumbnails (Create Live Session → Thumbnail). Auth required.
match /liveSessionThumbnails/{fileName} {
allow read: if request.auth != null;
allow write: if request.auth != null
&& request.resource != null
&& request.resource.size < 10 * 1024 * 1024 // 10 MB max
&& request.resource.contentType.matches('image/.*');
}
// Session recordings (replay). Path: sessionRecordings/{sessionId}.mp4. Auth required; 2 GB max per file.
match /sessionRecordings/{fileName} {
allow read: if request.auth != null;
allow write: if request.auth != null
&& request.resource != null
&& request.resource.size < 2 * 1024 * 1024 * 1024 // 2 GB max
&& request.resource.contentType == 'video/mp4';
}
// Optional: allow other app paths with auth. Tighten as needed.
match /{allPaths=**} {
allow read, write: if request.auth != null;
}
}
}