Closed markhalliwell closed 4 years ago
👋 @markcarver we would love to solve this with environment variables on the dashboard, but that's not possible at this time.
As started in the readme, you can use Lockr for secrets that are sensitive and in different environments. Alternatively, if you have a complicated workflow, you can create your secrets file in live and pull it down.
@sugaroverflow I think you misunderstand. I'm not talking about shell environment variables. I'm talking about Pantheon environment names (i.e. dev/test/live/multidev).
@markcarver Note that this plugin already allows you to choose your filename when you write your secrets file. You could make it a policy to always write your secrets to the live environment with a file-naming scheme of your choice. Of course it is up to your code to decide how to select and read the secrets files.
Note that your proposal to call the Terminus secrets plugin to write secrets to the dev environment is not a reliable way to keep your secrets persistent. If you sync your filesystem from live to a multidev environment, any file not present in the live environment will be erased in the target environment. This plugin was designed for writing secrets to short-lived PR multidevs where it is presumed that you will not sync the filesystem from another environment. If you need more than that, you should use Lockr.
Closing, as the current behavior is already about as close as I think we can get for the scope of what this plugin was intended to cover.
Problem
Not trying to be negative here, but this is a really bad design/workflow.
Solution
It's really simple: include the environment in the filename:
secrets.{PANTHEON_ENV}.json
That way, even if they are synced down, they don't overwrite each other and the plugin always choses the correct one based on the environment being targeted.