laravel-google-cloud-storage
laravel-google-cloud-storage copied to clipboard
Fix key_file config
Actually it might be a bug of laravel, a GOOGLE_CLOUD_PRIVATE_KEY is having many line break chars in a single string, the private key works when hard-coded in config file, but when reading private key from .env file, laravel replaced the '\n' to '\\n', and ended at 'openssl_sign(): supplied key param cannot be coerced into a private key' when uploading files.
+1 ! We hit this exact same bug(?) and your PR fixes it for us. Thanks!!!
There is indeed an issue here, not sure why an issue was never created.
@nicja Are you saying that you successfully authenticated without a json file and setting the various key_file
environment variables?
My GOOGLE_CLOUD_PRIVATE_KEY is set to something like this:
-----BEGIN PRIVATE KEY-----\nprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekeyprivatekey\n-----END PRIVATE KEY-----\n
there are newlines characters in there. i'm curious how you got this to work without OP's PR
first google app engine do not support .env file to you are expected to move all your environment variable to a file called app.yaml eg:
runtime: php72
env_variables:
Put production environment variables here.
APP_KEY: YOUR_APP_KEY APP_STORAGE: /tmp VIEW_COMPILED_PATH: /tmp SESSION_DRIVER: cookie
first google app engine do not support .env file to you are expected to move all your environment variable to a file called app.yaml eg:
runtime: php72
env_variables:
Put production environment variables here.
APP_KEY: YOUR_APP_KEY APP_STORAGE: /tmp VIEW_COMPILED_PATH: /tmp SESSION_DRIVER: cookie
I am not using google app engine. Your comment does not apply to this PR or to the issue in question.
Cool! Works with updating this PR. Thanks.
It worked. Thank you a lot.