firebase/snippets-node

Cloud Firestore Scheduled Backups

mornindew opened this issue · 2 comments

Thank you very much for the snippit of code. It was exactly what I needed. What is the best way to control who can run the export endpoint?

https://<MY_PROJECT_ID>.appspot.com/cloud-firestore-export?outputUriPrefix=gs://<MY_STORAGE_LOCATION>/backups

In a perfect world I would like to restrict access to that endpoint to only the cron job. Is that possible?

I solved this by controlling the firewall rules. I blacklisted everyone external and added a new rule for the IP address that the cronjob will come from (0.1.0.1). Not sure if it is the best way but it worked.

@mornindew sounds like a good way to me! Thanks for sharing your solution with the community.