{"id":18369233,"url":"https://github.com/envkey/envkey-fetch","last_synced_at":"2025-04-06T17:32:00.821Z","repository":{"id":54720570,"uuid":"99627847","full_name":"envkey/envkey-fetch","owner":"envkey","description":"Core EnvKey fetch/decryption/verification logic. Give it an ENVKEY, get back decrypted config as json. Compiles static cross platform binaries that can be easily built upon.","archived":false,"fork":false,"pushed_at":"2022-03-10T21:37:07.000Z","size":413441,"stargazers_count":21,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T04:03:23.274Z","etag":null,"topics":["configuration","configuration-management","encryption","envkey","golang","openpgp","secret-management","secret-sharing","secret-storage","secrets","web-of-trust"],"latest_commit_sha":null,"homepage":"https://www.envkey.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/envkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-07T23:01:48.000Z","updated_at":"2022-10-05T08:25:56.000Z","dependencies_parsed_at":"2022-08-14T00:41:03.890Z","dependency_job_id":null,"html_url":"https://github.com/envkey/envkey-fetch","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envkey%2Fenvkey-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envkey%2Fenvkey-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envkey%2Fenvkey-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/envkey%2Fenvkey-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/envkey","download_url":"https://codeload.github.com/envkey/envkey-fetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247522468,"owners_count":20952557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","configuration-management","encryption","envkey","golang","openpgp","secret-management","secret-sharing","secret-storage","secrets","web-of-trust"],"created_at":"2024-11-05T23:28:49.753Z","updated_at":"2025-04-06T17:32:00.311Z","avatar_url":"https://github.com/envkey.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# envkey-fetch\n\nThis library contains [EnvKey](https://www.envkey.com)'s core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It accepts an `ENVKEY` generated by the [EnvKey App](https://www.github.com/envkey/envkey-app) and returns decrypted configuration for a specific app environment as json.\n\nIt is used by EnvKey's various Client Libraries, including [envkey-source](https://github.com/envkey/envkey-source) for bash, [envkey-ruby](https://github.com/envkey/envkey-ruby) for Ruby and Rails, [envkey-python](https://github.com/envkey/envkey-python) for Python, [envkey-node](https://github.com/envkey/envkey-node) for Node.js, and [envkeygo](https://github.com/envkey/envkeygo) for Go.\n\nIf you want to build an EnvKey library in a language that isn't yet officially supported, build some other type of integration, or simply play around with EnvKey on the command line, envkey-fetch is the library for you. If you just want to integrate EnvKey with your project, check out one of the aforementioned higher level libraries.\n\n# v2\n\nIn [EnvKey v2](https://v2.envkey.com), this library has been folded into [envkey-source](https://github.com/envkey/envkey/tree/main/public/sdks/envkey-source). Equivalent functionality can be accomplished using `envkey-source --json`. Using v2 requires an EnvKey v2 organization (it won't work with ENVKEYs generated in a v1 org).\n\n[Here's a guide on migrating from v1 to v2.](https://docs-v2.envkey.com/docs/migrating-from-v1)\n\n## Installation\n\nenvkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this, as well as a [homebrew tap](https://github.com/envkey/homebrew-envkey)..\n\n**Install via bash:**\n\n```bash\ncurl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash\n```\n\n**Install manually:**\n\nFind the [release](https://github.com/envkey/envkey-fetch/releases) for your platform and architecture, and stick the appropriate binary somewhere in your `PATH` (or wherever you like really).\n\n**Install from source:**\n\nWith Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.\n\n**Cross-compile from source:**\n\nTo compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.\n\nThen to cross-compile, run:\n\n`goreleaser`\n\nBinaries for each platform will be output to the `dist` folder.\n\n## Usage\n\n```bash\nenvkey-fetch YOUR-ENVKEY [flags]\n```\n\nThis will either write your the app environment's configuration associated with your `ENVKEY` as json to stdout or write an error message beginning with `error:` to stdout.\n\n### Example json output\n\n```json\n{\"TEST\":\"it\",\"TEST_2\":\"works!\"}\n```\n\n### Example error output\n\n```text\nerror: ENVKEY invalid\n```\n\n### Flags\n\n```text\n    --cache                   cache encrypted config as a local backup (default is false)\n    --cache-dir string        cache directory (default is $HOME/.envkey/cache)\n    --client-name string      calling client library name (default is none)\n    --client-version string   calling client library version (default is none)\n-h, --help                    help for envkey-fetch\n    --retries uint8           number of times to retry requests on failure (default 3)\n    --retryBackoff float      retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)\n    --timeout float           timeout in seconds for http requests (default 10)\n    --verbose                 print verbose output (default is false)\n-v, --version                 prints the version\n```\n\n## x509 error / ca-certificates\n\nOn a stripped down OS like Alpine Linux, you may get an `x509: certificate signed by unknown authority` error when `envkey-fetch` attempts to load your config. `envkey-fetch` tries to handle this by including its own set of trusted CAs via [gocertifi](https://github.com/certifi/gocertifi), but if you're getting this error anyway, you can fix it by ensuring that the `ca-certificates` dependency is installed. On Alpine you'll want to run:\n```\napk add --no-cache ca-certificates\n```\n\n## Further Reading\n\nFor more on EnvKey in general:\n\nRead the [docs](https://docs.envkey.com).\n\nRead the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).\n\nRead the [security and cryptography overview](https://security.envkey.com).\n\n## Need help? Have questions, feedback, or ideas?\n\nPost an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvkey%2Fenvkey-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenvkey%2Fenvkey-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenvkey%2Fenvkey-fetch/lists"}