Coder Social home page Coder Social logo

Comments (8)

nickatsegment avatar nickatsegment commented on June 10, 2024 5

@jradtilbrook Yep, looks good enough to me. Actually, it's so small, you should just copy-paste the code I'd say. Let's not get left-padded here :)

(BTW, https://github.com/alessio/shellescape/blob/master/escargs/escargs.go really should have been called "escargo" :P)

from chamber.

jradtilbrook avatar jradtilbrook commented on June 10, 2024 2

This sounds like quite a useful addition. I'd be willing to give it a go if no one else has elected to do it and/or you need some help. Let me know

from chamber.

alessio avatar alessio commented on June 10, 2024 1

@nickatsegment proposal accepted - I'll rename the tool shortly :)

from chamber.

otterley avatar otterley commented on June 10, 2024

Hi! Can you tell us about your use case?

It's not possible for a child process to manipulate the environment of its caller, so what you're asking for isn't technically possible. Specifically, chamber is a child process of the shell from which you're invoking it -- once chamber exits, any environment variables it sets disappear along with it.

There are a few workarounds possible.

One is to make chamber have a mode that emits a shell script that can then be evaluated by the invoking shell. You'd then capture the environment variables by invoking it like eval "$(chamber export)".

The other option, which you can use without any modifications to Chamber, is to run something like exec chamber exec ... /bin/bash. This substitutes the current shell process with one that has been populated with the environment variables from Parameter Store.

from chamber.

omerxx avatar omerxx commented on June 10, 2024

@otterley Hi, my use case is populating secrets to an environment that runs locally.
I thought about something like your second option with eval "$(chamber export)"
If you think that this is not a good use then you can drop it...

Anyway, chamber is truly awesome. our production is using it completely now and I've written a blog post about it - https://medium.com/prodopsio/managing-application-secrets-on-aws-with-ssm-and-chamber-3615d08cc599

Kudos!

from chamber.

otterley avatar otterley commented on June 10, 2024

I've updated the title to better describe your request. Specifically, something like a chamber env that prints a shell script that can be eval'ed by the caller.

from chamber.

nickatsegment avatar nickatsegment commented on June 10, 2024

@jradtilbrook Go for it!

One thing you'd have to watch out for is safe shell quoting. That's non-trivial code; maybe there's a library out there to do it for us

from chamber.

jradtilbrook avatar jradtilbrook commented on June 10, 2024

Sounds good. I've found this pretty simple library, https://github.com/alessio/shellescape. Are you happy for me to use that?

from chamber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.