Adding a local file path as environment variable
midnightxander
HOBBYOP

10 months ago

I have a google application credential environment variable in my project that is used to authenticate to the google AI API. The variable is a path to the credentials file provided by google which is stored locally on my pc, So my problem is i want to know how to upload my file to the production server, get the path and add it as an environment variable since i don't see any options like that. Or another method if there is one ?

Solved

3 Replies

10 months ago

You should be able to copy and paste in the credentials file into the environment variables. It supports multiline etc


Status changed to Awaiting User Response Railway 11 months ago


jake

You should be able to copy and paste in the credentials file into the environment variables. It supports multiline etc

midnightxander
HOBBYOP

10 months ago

I just tried it and that would have been a great and simple way for doing that but google seem to be trying to load the credentials from a file and hence does not recognize the path when i add the content of the file in the env variable


Status changed to Awaiting Railway Response Railway 11 months ago


midnightxander
HOBBYOP

10 months ago

Okay i solved the issue by managing authentication manually in-code by creating a temp-file in the server, store the credentials,get the path and load the auth client with it and it worked. I stored the credentials as a json in the environment variable.


Status changed to Solved brody 11 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...