https://github.com/shopify/ejson2env
Decrypt EJSON secrets and export them as environment variables.
https://github.com/shopify/ejson2env
containers ejson shell-scripting
Last synced: about 1 month ago
JSON representation
Decrypt EJSON secrets and export them as environment variables.
- Host: GitHub
- URL: https://github.com/shopify/ejson2env
- Owner: Shopify
- License: mit
- Created: 2018-08-31T18:51:18.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2025-05-13T22:09:58.000Z (about 1 month ago)
- Last Synced: 2025-05-15T19:49:35.429Z (about 1 month ago)
- Topics: containers, ejson, shell-scripting
- Language: Go
- Homepage:
- Size: 264 KB
- Stars: 79
- Watchers: 374
- Forks: 16
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://travis-ci.org/Shopify/ejson2env)
[](https://goreportcard.com/report/github.com/Shopify/ejson2env)# ejson2env
`ejson2env` is a tool to simplify storing secrets that should be accessible in the shell environment in your git repo. `ejson2env` is based on the [ejson library](https://github.com/Shopify/ejson) and extends the `ejson` file format.
`ejson2env` exports all of the values in the `environment` object in the `ejson` file to the shell environment.
For example, with the below `ejson` file:
```json
{
"_public_key": "",
"environment": {
"SECRET_SHELL_VARIABLE": ""
}
}
```Running:
```shell
$ ejson2env test.ejson
```Would result in the following output:
```
export SECRET_SHELL_VARIABLE=
```You can then have your shell evaluate this output:
```shell
$ eval $(ejson2env test.ejson)
```## Using ejson2env
`ejson2env`'s usage information is described in it's included `--help` flag.
## Installing ejson2env
`ejson2env` is available through a number of different routes and package managers. If you plan on modifying `ejson2env`, it is suggested that you install via `go get`.
### Go
`ejson2env` can be installed using the regular `go install` tool:
```shell
$ go install github.com/Shopify/ejson2env/v2/cmd/ejson2env@latest
```You can then find the compiled binary in `$GOPATH/bin`
### Debian Package
You can download the latest version of the Debian package from [the releases page](https://github.com/Shopify/ejson2env/releases).
Install the downloaded package by calling:
```shell
$ dpkg -i ejson2env_1.0.3_amd64.deb
```### RubyGems
You can install `ejson2env` using Ruby's Gem tool:
```shell
$ gem install ejson2env
```### Homebrew
Provided your install of Homebrew is configured to pull from [Shopify's Homebrew repo](https://github.com/shopify/homebrew-shopify), you can install `ejson2env` by calling:
```shell
$ brew install ejson2env
```## Contributing
Please review the [Contributing document](CONTRIBUTING.md) if you are
interested in helping improve ejson2env!