Hello - I have a doppler project Project A that is integrated. with a fly.io app. This adds the DOPPLER_CONFIG, DOPPLER_ENVIRONMENT, and DOPPLER_PROJECT secrets to my project. Ok great.
However, in the app for Project A i would like set secrets for doppler Project B. So i install the doppler cli in Project A, create a service token for Project B, and add the service token as a secret named DOPPLER_TOKEN in Project A.
A bit confusing i know. But when i try to set secrets for Project B from within Project A i get the following error
Unable to set secrets
Doppler Error: This token does not have access to requested project 'PROEJCT A'
I believe DOPPLER_CONFIG, DOPPLER_ENVIRONMENT, and DOPPLER_PROJECT environmental variables are causing he CLI tool to think i want to push secrets to Project A event though my token is for Project B.
Anybody have tips on how to workaround this issue? thanks in advance.
There are a couple possible solutions for this. The first, and potentially simplest solution if you’re doing this from a shell script is unset those variables in script:
#!/usr/bin/env bash
DOPPLER_PROJECT=""
DOPPLER_CONFIG=""
doppler secrets set ...
Another option would be to manually specify the project and config using those flags:
doppler secrets set -p PROJECT -c CONFIG ...
Those flags take precedence over the environment variables that are set.
Finally, you could use the --no-read-env flag:
doppler secrets set --token YOUR_TOKEN --no-read-env ...
That option would require you to pass the token in via the flag though, which would mean it would show up in a process listing while the command runs.
Thank you for the quick reply. Wow yes potentially all of these would work. I tried simply unsetting the variables in my shell script and yes that worked. Appreciate the guidance here. Thanks!