Infisical / infisical

♾ Infisical is the open-source secret management platform: Sync secrets across your team/infrastructure, prevent secret leaks, and manage internal PKI
https://infisical.com
Other
13k stars 677 forks source link

Specify multiple paths in the CLI #900

Open vmatsiiako opened 10 months ago

vmatsiiako commented 10 months ago

Is it possible to load several secret with infisical run ? For instance for all my apps, I want to load secrets from /global folder, and specific to the app (app-A folder). Right now I think I'd have to export both secret in a .env and load them from there. Another solution could be to use secret expension etc to create my app-A secret with everything from global. But in my use case I don't always want all secrets (it could depends on the environment for example) and I want to keep consistency with commands and secrets accross environment.

I'd love to be able to use --paths with multiple folders. Maybe my usecase is too specific though?

Slack Message

Khaaz commented 10 months ago

Thank you! I'll follow the evolution on this issue, cheers!!

50l3r commented 3 months ago

This can be very useful to have a good organization of the environment variables.

I have read about the secret reference but this implies me to have the following structure:

DATABASE
    URL=postgresql://postgres:${env.DATABASE.PASSWORD}@db:${env.DATABASE.PORT}/${env.DATABASE.NAME}
    NAME=cars
    PORT=5432
    PASSWORD=123456

REDIS
    HOST=127.0.0.1
    PORT=6379

DATABASE_URL=${env.DATABASE.URL}
DATABASE_NAME=${env.DATABASE.NAME}
DATABASE_PORT=${env.DATABASE.PORT}
DATABASE_PASSWORD=${env.DATABASE.PASSWORD}
REDIS_HOST=${env.REDIS.HOST}
REDIS_PORT=${env.REDIS.PORT}

Then:

infisical export --env=staging > .env

Give me:

DATABASE_URL=postgresql://postgres:123456@db:5432/cars
DATABASE_NAME=cars
DATABASE_PORT=5432
DATABASE_PASSWORD=123456
REDIS_HOST=127.0.0.1
REDIS_PORT=6379

It is quite tricky to manage multiple variables in this way. The fastest way would be avoid folders. Correct me if I'm missing something.

In advance, thank you very much for the work of this awesome & beautiful tool 🤟💖