Best way to manage private key for Firebase Connection?

Posted April 11, 2021 125 views
SecurityDigitalOcean SpacesDigitalOcean App Platform


I am deploying an app using DigitalOcean Apps (Which was amazingly straightforward by the way!) However I can’t work out how to handle keys for my Firebase Admin connection. The docs specify that a JSON file should hold all the params:

The safest way to handle these creds securely would seem to be to use a build command to pull the JSON file from a store. (I want to use an environment variable to pull the right JSON file according to which environment I am deploying).

I was hoping to use a DO Space, but there appears to be no easy way to pull from it using a Build command as it needs to use the S3 API/ SDK which is not available to a build command for an App. Does anyone know how I might go about pulling this at build time?

Only other thing I can think is to run a shell script that builds my JSON from environment variables, but that seems like a sub-optimal solution!

Any suggestions welcome as I am quite new to this!


Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!