Turboku/Heroku: Google JSON Creds

Hi there!

We used Turboku to deploy a Heroku app with fly and almost everything worked seamlessly.

For loading a Google key we used this solution: in a .profile File we print an environment variable into a JSON-File.

Heroku automatically loads .profile files. Is there a way to achieve this with fly?

Hi @Mario_Trost! I’m not seasoned at this yet, but a sensitive environment variable sounds like it could be a job for fly secrets.

1 Like

@Mario_Trost I’m informed it may not be so simple if you need to get the key into the filesystem before boot. :upside_down_face:

Why can you not use the Google-recommended solution in the other answer in the Stack overflow question that you referenced: Loading credentials from environment variables?

Per @Chris_Nicoll suggestion, you’d create a secret in Fly with a value of the Service Account’s key, JSON.parse the key and then auth.fromJSON the result.

1 Like

Thanks for the replies, @daz.wilkin you’re totally right: the accepted answer on Stack overflow works for us!

1 Like

Excellent!