Code Monkey home page Code Monkey logo

bots's Introduction

hi my name is cowboy
during the day i write enterprise software
during the evening i make music

pro tip: if you feel you have to add a comment that says /* Valid JavaScript */ it's enterprise ready

bots's People

Contributors

cowboy avatar

Stargazers

 avatar  avatar

Watchers

 avatar

bots's Issues

Review .env -> encrypted vault methodology

Right now, I want to avoid using a separate system for managing secrets, because I have very few of them. To that end, I'm using ansible-vault to encrypt a vault.yml ansible vars file that gets committed with the project.

The idea is that, since all the secrets I care about are already stored in a .gitignored .env file that my app also consumes as if they were environment vars, via the dotenv lib, I can just programmatically convert the .env file, which looks something like this:

SECRET_ONE=some_secret_value
SECRET_TWO=another_secret_value
...

Into the vault.yml ansible vars file, which looks something like this:

---
vault_env: |
  SECRET_ONE=some_secret_value
  SECRET_TWO=another_secret_value
  ...

That gets used in an upstart script template file like so, effectively making them actual environment vars for the app process to use:

...
{% for key in vault_env.splitlines() %}
env {{key}}
{% endfor %}
...

script
  /usr/bin/npm start --prefix {{site_path}}
end script

And I've created a fairly simple bash script that does the .env -> vault.yml -> encrypt so that updated secrets can be easily committed.

I might also make a decrypt-env.sh script that reverses the process, creating a .env file from the vault.yml, to facilitate that process, should I need it.

But before I do that, does this approach make sense? /cc @tkellen @gnarf @MattSurabian

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.