-
-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8868e5
commit e658765
Showing
78 changed files
with
735 additions
and
1,655 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,19 @@ | ||
# TODO: update to a more new version | ||
version: "2.1" | ||
services: | ||
|
||
emulator: | ||
build: | ||
context: ./ | ||
dockerfile: ./functions/Dockerfile.emulator | ||
ports: | ||
- 4001-4008:4001-4008 | ||
volumes: | ||
- ./functions:/app/functions | ||
- ./functions/data/emulator/:/app/seed | ||
# TODO: make logs easily viewable on the host machine. | ||
# - ./logs/ui-debug.log:/app/ui-debug.log | ||
# - ./logs/firestore-debug.log:/app/firestore-debug.log | ||
# - ./logs/database-debug.log:/app/database-debug.log | ||
# - ./logs/pubsub-debug.log:/app/pubsub-debug.log | ||
# - ./logs/firebase-debug.log:/app/firebase-debug.log |
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 |
---|---|---|
|
@@ -17,7 +17,6 @@ lib/ | |
dist | ||
|
||
# Emulator data | ||
data/emulated | ||
data/exported | ||
data/seed/* | ||
!data/seed/.gitkeep | ||
|
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,70 @@ | ||
#################################################################### | ||
# | ||
# Due to complexities with Yarn workspaces, this Dockerfile | ||
# does not create the `dist` folder. It should be mounted from | ||
# the host machine to the container, using the `-v` flag. | ||
# | ||
# Optionally, initial data can be setup by mounting `/app/seed`. | ||
# | ||
# COMMANDS (used from the root directory of the project): | ||
# docker build -f ./functions/Dockerfile.emulator -t emulator . | ||
# docker run -v ./functions:/app/functions -p 4001-4008:4001-4008 -it emulator | ||
# | ||
# HOW TO DEBUG THE CONTAINER WHILE IT IS RUNNING: | ||
# 1) Open a new terminal. | ||
# 2) Run `docker ps` command. | ||
# 3) Find the name for the container. | ||
# 4) Run `docker exec -it <name> bash` command. | ||
# | ||
# TECHNICAL NOTES: | ||
# Due to Docker, the Firebase emulators should run on 0.0.0.0 | ||
# https://stackoverflow.com/a/52518929 | ||
# | ||
#################################################################### | ||
|
||
FROM node:20.9.0-bullseye-slim | ||
|
||
ENV SHOULD_REGULARLY_EXPORT_DATA='false' | ||
|
||
WORKDIR /app | ||
|
||
RUN \ | ||
apt-get update && \ | ||
# For Firebase | ||
# https://firebase.google.com/docs/emulator-suite/install_and_configure | ||
apt-get -y install openjdk-11-jre-headless && \ | ||
# For debugging | ||
apt-get -y install nano && \ | ||
apt-get clean | ||
|
||
# TODO: someone else can figure out a good way to install the Firebase CLI. | ||
RUN npm install -g firebase-tools | ||
|
||
# Doing setup saves time when running the container. | ||
# There are no setup commands for functions, hosting, or auth. | ||
RUN \ | ||
firebase setup:emulators:ui && \ | ||
firebase setup:emulators:firestore && \ | ||
firebase setup:emulators:database && \ | ||
firebase setup:emulators:storage && \ | ||
firebase setup:emulators:pubsub | ||
|
||
COPY ./../firebase.json /app/firebase.json | ||
COPY ./../firebase.storage.rules /app/firebase.storage.rules | ||
COPY ./../firestore.indexes.json /app/firestore.indexes.json | ||
COPY ./../firestore.rules /app/firestore.rules | ||
|
||
# Create script for easy exporting | ||
RUN \ | ||
echo "#!/bin/bash\n" >> /app/export.sh && \ | ||
echo "firebase emulators:export --project demo-community-platform-emulated --force /app/dump\n" >> /app/export.sh && \ | ||
chmod +x /app/export.sh | ||
|
||
# These should be the ports specified in firebase.json | ||
EXPOSE 4001 4002 4003 4004 4005 4006 4007 4008 | ||
|
||
CMD \ | ||
firebase emulators:start \ | ||
--project demo-community-platform-emulated \ | ||
--only auth,functions,firestore,pubsub,storage,hosting,database \ | ||
--import=/app/seed |
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
Empty file.
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,72 @@ | ||
{ | ||
"kind": "identitytoolkit#DownloadAccountResponse", | ||
"users": [ | ||
{ | ||
"localId": "2djSop7XvY0NEg7QY5rZrm0Wc2N1", | ||
"createdAt": "1716744480141", | ||
"lastLoginAt": "1716746234545", | ||
"displayName": "admin", | ||
"passwordHash": "fakeHash:salt=fakeSaltRpTXy52dXY1DgyPT6odF:password=wow_backend_development_is_fun", | ||
"salt": "fakeSaltRpTXy52dXY1DgyPT6odF", | ||
"passwordUpdatedAt": 1716744766896, | ||
"providerUserInfo": [ | ||
{ | ||
"providerId": "password", | ||
"email": "admin@example.com", | ||
"federatedId": "admin@example.com", | ||
"rawId": "admin@example.com", | ||
"displayName": "admin" | ||
} | ||
], | ||
"validSince": "1716744766", | ||
"email": "admin@example.com", | ||
"emailVerified": false, | ||
"disabled": false, | ||
"lastRefreshAt": "2024-05-26T17:57:14.545Z" | ||
}, | ||
{ | ||
"localId": "WrCrfu7FS3vJcFswZr1yufwlPtCl", | ||
"lastLoginAt": "1716745935132", | ||
"emailVerified": false, | ||
"email": "precious-plastic@example.com", | ||
"salt": "fakeSalt5z1E4omMRGeny2KD9xUb", | ||
"passwordHash": "fakeHash:salt=fakeSalt5z1E4omMRGeny2KD9xUb:password=precious-plastic", | ||
"passwordUpdatedAt": 1716745327556, | ||
"validSince": "1716745327", | ||
"createdAt": "1716745327556", | ||
"providerUserInfo": [ | ||
{ | ||
"providerId": "password", | ||
"email": "precious-plastic@example.com", | ||
"federatedId": "precious-plastic@example.com", | ||
"rawId": "precious-plastic@example.com", | ||
"displayName": "precious-plastic" | ||
} | ||
], | ||
"lastRefreshAt": "2024-05-26T17:52:15.132Z", | ||
"displayName": "precious-plastic" | ||
}, | ||
{ | ||
"localId": "uf0mBGfLKGQwoJ1FWiqH0xQSatKM", | ||
"lastLoginAt": "1716746297841", | ||
"emailVerified": false, | ||
"email": "normal_jim@example.com", | ||
"salt": "fakeSalt88tfIY4E8ASJgTGvE3th", | ||
"passwordHash": "fakeHash:salt=fakeSalt88tfIY4E8ASJgTGvE3th:password=thanks_emulator_man", | ||
"passwordUpdatedAt": 1716746026812, | ||
"validSince": "1716746026", | ||
"createdAt": "1716746026812", | ||
"providerUserInfo": [ | ||
{ | ||
"providerId": "password", | ||
"email": "normal_jim@example.com", | ||
"federatedId": "normal_jim@example.com", | ||
"rawId": "normal_jim@example.com", | ||
"displayName": "normal_jim" | ||
} | ||
], | ||
"lastRefreshAt": "2024-05-26T17:58:17.841Z", | ||
"displayName": "normal_jim" | ||
} | ||
] | ||
} |
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,4 @@ | ||
{ | ||
"signIn": { "allowDuplicateEmails": false }, | ||
"emailPrivacyConfig": { "enableImprovedEmailPrivacy": false } | ||
} |
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,20 @@ | ||
{ | ||
"version": "13.10.1", | ||
"firestore": { | ||
"version": "1.19.6", | ||
"path": "firestore_export", | ||
"metadata_file": "firestore_export/firestore_export.overall_export_metadata" | ||
}, | ||
"database": { | ||
"version": "4.11.2", | ||
"path": "database_export" | ||
}, | ||
"auth": { | ||
"version": "13.10.1", | ||
"path": "auth_export" | ||
}, | ||
"storage": { | ||
"version": "13.10.1", | ||
"path": "storage_export" | ||
} | ||
} |
Binary file added
BIN
+52 Bytes
...ulator/firestore_export/all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata
Binary file not shown.
Binary file added
BIN
+75.8 KB
functions/data/emulator/firestore_export/all_namespaces/all_kinds/output-0
Binary file not shown.
Binary file added
BIN
+96 Bytes
functions/data/emulator/firestore_export/firestore_export.overall_export_metadata
Binary file not shown.
Binary file added
BIN
+59.4 KB
functions/data/emulator/storage_export/blobs/05b8a370-5ddd-482c-b0d6-ce02b7051f29
Binary file not shown.
Binary file added
BIN
+483 KB
functions/data/emulator/storage_export/blobs/20743a8c-c0d8-4783-b7e4-41aaa92ccee0
Binary file not shown.
Binary file added
BIN
+53.4 KB
functions/data/emulator/storage_export/blobs/2b1d32c3-ad90-418c-8c79-6e44e27d8395
Binary file not shown.
Binary file added
BIN
+138 KB
functions/data/emulator/storage_export/blobs/4ac51b75-a05d-4cdf-bbd5-7b2368a653e2
Binary file not shown.
Binary file added
BIN
+99.1 KB
functions/data/emulator/storage_export/blobs/714f679e-4277-4c48-98fb-9b017363748d
Binary file not shown.
Binary file added
BIN
+307 KB
functions/data/emulator/storage_export/blobs/95a2e8a5-532a-4c5e-a7aa-b22c99afaf51
Binary file not shown.
Binary file added
BIN
+63.9 KB
functions/data/emulator/storage_export/blobs/9ff1a024-832f-41d1-992b-3661f7c681cf
Binary file not shown.
Binary file added
BIN
+59.4 KB
functions/data/emulator/storage_export/blobs/a0465eb5-c951-4494-923b-04fc505c661e
Binary file not shown.
Binary file added
BIN
+67.5 KB
functions/data/emulator/storage_export/blobs/b5b0c53b-fc52-43f6-8659-ee8be8400dbd
Binary file not shown.
Binary file added
BIN
+1.12 MB
functions/data/emulator/storage_export/blobs/c3a7800a-0d2d-4bfd-bf84-96b82c0c2c4d
Binary file not shown.
Binary file added
BIN
+1.12 MB
functions/data/emulator/storage_export/blobs/c8a8fdc4-a9ae-416e-9547-e39f846ae91d
Binary file not shown.
Binary file added
BIN
+271 KB
functions/data/emulator/storage_export/blobs/cf987c74-660a-4c62-8a98-38843e29ace8
Binary file not shown.
Binary file added
BIN
+99.1 KB
functions/data/emulator/storage_export/blobs/d0988100-a335-4d1a-82c8-38fa4b0d58f5
Binary file not shown.
Binary file added
BIN
+307 KB
functions/data/emulator/storage_export/blobs/d7fffe1e-ee4e-4f3b-8ad9-23af091d0357
Binary file not shown.
Binary file added
BIN
+63.9 KB
functions/data/emulator/storage_export/blobs/ecc7d0c9-142d-40de-8486-e53052a72485
Binary file not shown.
Binary file added
BIN
+53.4 KB
functions/data/emulator/storage_export/blobs/fa4ba2f3-cf89-4f68-bea7-56871eb59acc
Binary file not shown.
Binary file added
BIN
+67.5 KB
functions/data/emulator/storage_export/blobs/fe340d02-9319-4a59-b306-404406a57e26
Binary file not shown.
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,10 @@ | ||
{ | ||
"buckets": [ | ||
{ | ||
"id": "demo-community-platform-emulated.appspot.com" | ||
}, | ||
{ | ||
"id": "default-bucket" | ||
} | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
functions/data/emulator/storage_export/metadata/05b8a370-5ddd-482c-b0d6-ce02b7051f29.json
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,17 @@ | ||
{ | ||
"name": "uploads/howtos/sSJu2x5kxs6piq2L0U6y/shredder-5-18fb5fb1d5f.jpg", | ||
"bucket": "default-bucket", | ||
"metageneration": 1, | ||
"generation": 1716745089801, | ||
"contentType": "image/jpeg", | ||
"storageClass": "STANDARD", | ||
"contentDisposition": "inline", | ||
"downloadTokens": ["10d20f04-0b90-4c8b-9b7e-c50c87bc0714"], | ||
"etag": "Nqnyu2+k4zpFsVWiaL5TPKwrBug", | ||
"customMetadata": {}, | ||
"timeCreated": "2024-05-26T17:38:09.801Z", | ||
"updated": "2024-05-26T17:38:09.801Z", | ||
"size": 60814, | ||
"md5Hash": "VmzZq8sK2od3snVOMkN8fw==", | ||
"crc32c": "3186773085" | ||
} |
17 changes: 17 additions & 0 deletions
17
functions/data/emulator/storage_export/metadata/20743a8c-c0d8-4783-b7e4-41aaa92ccee0.json
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,17 @@ | ||
{ | ||
"name": "uploads/users/precious-plastic/5e0701c9be0f82741b72d8b2_Version-4-team-18ee73f92fa-18fb600cf66.jpg", | ||
"bucket": "default-bucket", | ||
"metageneration": 1, | ||
"generation": 1716745458997, | ||
"contentType": "image/jpeg", | ||
"storageClass": "STANDARD", | ||
"contentDisposition": "inline", | ||
"downloadTokens": ["f2bb53ba-4797-4b87-a77f-f9b8c63568ab"], | ||
"etag": "cr6McE2FKWCJWvEYkPz1OIQ6KyE", | ||
"customMetadata": {}, | ||
"timeCreated": "2024-05-26T17:44:18.997Z", | ||
"updated": "2024-05-26T17:44:18.997Z", | ||
"size": 494337, | ||
"md5Hash": "BH2ssfCv5sFxvwv68s9qKQ==", | ||
"crc32c": "3221583768" | ||
} |
17 changes: 17 additions & 0 deletions
17
functions/data/emulator/storage_export/metadata/2b1d32c3-ad90-418c-8c79-6e44e27d8395.json
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,17 @@ | ||
{ | ||
"name": "uploads/howtos/sSJu2x5kxs6piq2L0U6y/shredder-2-18391b3997d-18fb5fa4b14.jpg", | ||
"bucket": "default-bucket", | ||
"metageneration": 1, | ||
"generation": 1716745089742, | ||
"contentType": "image/jpeg", | ||
"storageClass": "STANDARD", | ||
"contentDisposition": "inline", | ||
"downloadTokens": ["0180dc00-c762-498f-8353-d379d591554f"], | ||
"etag": "KjajQC8dFUsg0dzLFUPkJ/wJGI0", | ||
"customMetadata": {}, | ||
"timeCreated": "2024-05-26T17:38:09.742Z", | ||
"updated": "2024-05-26T17:38:09.742Z", | ||
"size": 54654, | ||
"md5Hash": "VVJqkJWfPH+7DH6rUj3fBA==", | ||
"crc32c": "1100890625" | ||
} |
Oops, something went wrong.