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?
1 Like
Hi @mariotrost! I’m not seasoned at this yet, but a sensitive environment variable sounds like it could be a job for fly secrets.
1 Like
@mariotrost I’m informed it may not be so simple if you need to get the key into the filesystem before boot.
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 @catflydotio 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.
2 Likes
Thanks for the replies, @DazWilkin you’re totally right: the accepted answer on Stack overflow works for us!
1 Like
For other APIs, there’s often an undocumented {credentials: parsed_key_json}
argument to the constructor that works instead of the auth.fromJSON
function.