Share secrets/env variables between projects
# support
d
We're multi-tenant self-hosted with each provider org having its own project. We have some environment variables/secrets that are shared between projects. Currently, we're adding them to each project manually, but I'm looking into ways to share these (would be easier to rotate things like api keys, easier project set up, etc.) 1. Is there any way to share secrets between projects? Any server-scoped values that could be accessed? 2. If not, any suggestions on how we could make updates to these values easier across projects?
r
Unfortunately, there isn't a central repository of server secrets at the moment
And also unfortunately Bots in the SuperAdmin project can't listen to Project creation.
The best I can offer is to have a bot in the SuperAdmin project to sync resources to a specific project, and to invoke this bot manually at the time of project creation
d
That makes sense—we're actually also working on a project initialization/setup script so we could add that call there
On a related note, for that set up/initialization script, we were planning to use a client on SuperAdmin to clone a template project and deploy bots to that project. Questions there: 1. Would it be safe to do this all with a SuperAdmin client? Or would it be better to create a project, create a client in that project, and then do the rest of the initialization via that client? 2. If we were to use the clone operation in our initialization script to clone a template project, could we just set that project up with secrets as well as our bots and clone that? Are there any gotchas or links around cloning that could cause issues here?
r
Good questions! 1. We generally recommend using Super Admin for the smallest subset of tasks necessary, as a security precaution 2. I believe that should work. The only "gotcha" is that you will have to rerun the '$deploy' operation once clone the project
Is this cloning setup part of your developer process? I.e. 1 clone per branch?
d
No this isn't in our CI/CD pipeline if that's what you're asking. We want to use this whenever we onboard a new clinic. To set up their initial project with all of the context it needs, we want to just clone a template project and deploy the bots to it. We'd be manually running this script to kick off their onboarding process
147 Views