-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mono-repo with multi-services support + local setup and scope config file improvement (.infisical.json) #243
Comments
I'm aware that's a big issue which combine multiple feature requests, but they're all related, I'll try to split it into smaller issues, easier to work on ✌🏽 I'll try to attach a flow/structure diagram for the above, soon! 📊 🚀 |
Thank you so much @Grraahaam! This is SUPER useful! |
Hey @Grraahaam just reading this, quite comprehensive. I agree, Infisical needs better mongo repo support. I'll get back to you with more questions as I think about the suggestions. Side note, are you also looking to contribute to the CLI code base? If so let us know! |
Thanks for your consideration!
It's on my todo list, I'd be my second experience with Go, so let's see how it goes! |
We could even simplify it to avoid a big backend refactoring by simply looping through the main project 's "dependencies" ( |
We are thinking of creating a new feature that allows secrets to be tagged. For instance, if you have multiple microservices for a specific project, you can tag secrets according to the microservice they belong to. So we can tag secrets such as microservice-1, microservice-2, etc within the same project. When you start a mongo repo application, you can specify CC: @jon4hz @asheliahut |
I think you've got this the wrong way round, as I'm trying to explore using Infisical in a mono repository with a few dozen services and at the moment it's rather painful. Infisical already supports folders, which is almost perfect to map to a mono repository. Imagine an Infisical project with the following structure:
We want to use a single project for the mono repository, so that we can have shared globals, such as the CLOUDFLARE_ACCOUNT_ID. We want to use path based structure that resembles the mono repositories own hierarchy. We need every developer, backend and frontend, and operator, and potentially product, access to this single project. RBAC now becomes a huge challenge based on current implementation. The way I would love this to work:
Now we have the RBAC problem, currently roles only allow me to assign glob paths to them. But we do have tags and those shouldn't be used to allocate secrets to services; but instead to expose secrets to roles. I have 3 main users who need access:
If I tag my secrets, the values returned for I hope this makes sense, @maidul98; happy to go into it more detail if we want to cover more use-cases. |
One final suggestion: Allow me in related: #938 |
I closed #1329 as I was unable to get any feedback from Infisical to progress with making Infisical work for monorepositories. |
Feature description 🚀
Today, AKAIK there's no easy way to run Infisical's CLI in a monorepo with multiple services divided into multiple infisical projects, e.g.
infisical run -- docker-compose up -d
...Imagine a monorepo with three services (pretty common) controlled by
docker-compose
:frontend
backend
database
I have a Infisical project for each of the above services (best practice?) and I can't easily find a way without refactoring the code (e.g. install infisical CLI in a specific Dockerfile stage and pass a env token as an argument) to inject my secrets within when running
docker-compose
Suggestions ✨
Writing documentation about Infisical monorepo/multi-service best practices, support and maybe adaptation of the API/CLI (I presume, to generate tokens bound to multiple projects)
An option in both the dashboard & the CLI to generate single access token to multiple projects, and a single config in each of them (otherwise it won't make sense 🙃 )
Token structure integration 🎫
For the token structure, the token
xxxx-xxxxxxxxxxxxxxx-xxxxxxx
points to three different Infisical projects (<project-name>:<config>
) :project-one:dev
project-three:dev
project-four:prd
When requesting the secrets with this token, I'd like to get all the secrets of the above projects (from their respective configs), making it mono-repo friendly by allowing the user to easily inject multiple infisical projects secrets into a single app (made of multiple services)
CLI integration 💻
For the CLI, here's two suggestions :
Interactive setup
And the
.infisical.json
repository setup file could look like the following (check if we want to keep using JSON instead of YAML?) :Then, running
infisical init --no-interactive
would auto-generate the following entries in~/.infisical/.infisical.json
(we could have a global scope in the USER home directory, allowing us to use theinfisical
command anywhere without providing project/env args) :Finally, how to use it in the CLI :
Inline command
# Get secrets from multiple projects passed inline (':' aren't allowed in the project names so it works as a separator) infisical secrets --project project-one:dev,project-two:stg
Recap
Here's a simplified list of the above suggestions :
.infisical.json
structure and theinfisical init
process (make it possible to setup aproject+env
non-interactively from.infisical.json
).infisical.json
and~/.infisical/.infisical.json
(YAML is commonly used by the devops and the syntax may be a bit easier)~/.infisical/.infisical.json
for the user (callinginfisical
will use those defaults)Disclaimer: Since our company still use Doppler, and they lack this feature as well, I've cross-posted this request initially posted in their repository
The text was updated successfully, but these errors were encountered: