envkey 1.3.0 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.gitignore +4 -1
- data/envkey.gemspec +1 -3
- data/lib/envkey/core.rb +16 -39
- data/lib/envkey/fetch.rb +7 -3
- data/lib/envkey/platform.rb +5 -5
- data/lib/envkey/version.rb +2 -2
- data/sdkruby-version.txt +1 -0
- metadata +9 -39
- data/README.md +0 -86
- data/ext/envkey-fetch_1.2.9_darwin_amd64/LICENSE +0 -21
- data/ext/envkey-fetch_1.2.9_darwin_amd64/README.md +0 -97
- data/ext/envkey-fetch_1.2.9_darwin_amd64/envkey-fetch +0 -0
- data/ext/envkey-fetch_1.2.9_darwin_arm64/LICENSE +0 -21
- data/ext/envkey-fetch_1.2.9_darwin_arm64/README.md +0 -97
- data/ext/envkey-fetch_1.2.9_darwin_arm64/envkey-fetch +0 -0
- data/ext/envkey-fetch_1.2.9_freebsd_amd64/LICENSE +0 -21
- data/ext/envkey-fetch_1.2.9_freebsd_amd64/README.md +0 -97
- data/ext/envkey-fetch_1.2.9_freebsd_amd64/envkey-fetch +0 -0
- data/ext/envkey-fetch_1.2.9_linux_amd64/LICENSE +0 -21
- data/ext/envkey-fetch_1.2.9_linux_amd64/README.md +0 -97
- data/ext/envkey-fetch_1.2.9_linux_amd64/envkey-fetch +0 -0
- data/ext/envkey-fetch_1.2.9_windows_amd64/LICENSE +0 -21
- data/ext/envkey-fetch_1.2.9_windows_amd64/README.md +0 -97
- data/ext/envkey-fetch_1.2.9_windows_amd64/envkey-fetch.exe +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 31a9dddd146a8054a368007c2606d116451ce77acb6f970fc2f24c8bca91fb35
|
4
|
+
data.tar.gz: 6160ccf2852fbf5496d2ffef2458b14f509676aab18acc4e6e152038fb11e17f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b00a9b936aa9abb433c6b85e1aa0dd54980a23f1723acbb5e6f3ba41ef06a0702608432472fc8adb916b92ea4d2022a2ecfa41133f4376b0a5753b559540d9fd
|
7
|
+
data.tar.gz: 644976b8eadd5f08a84dd288b3078364db1aeb1924f819d0fb7919c9b616038dca781b5b2e07142b32eb8a7379bbf0e290c3b0bcc7708be494220045c708375e
|
data/.gitignore
CHANGED
data/envkey.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Dane Schneider"]
|
10
10
|
spec.email = ["dane@envkey.com"]
|
11
11
|
|
12
|
-
spec.summary = "Envkey secures and simplifies
|
12
|
+
spec.summary = "Envkey secures and simplifies configuration and secrets management."
|
13
13
|
spec.homepage = "https://www.envkey.com"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -32,6 +32,4 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "bundler", "~> 1.13"
|
33
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
34
|
spec.add_development_dependency "rspec", "~> 3.0"
|
35
|
-
|
36
|
-
spec.add_runtime_dependency "dotenv", "~> 2.0"
|
37
35
|
end
|
data/lib/envkey/core.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'dotenv'
|
2
1
|
require 'set'
|
3
2
|
require 'json'
|
4
3
|
require 'envkey/fetch'
|
@@ -7,50 +6,28 @@ module Envkey::Core
|
|
7
6
|
|
8
7
|
def self.load_env
|
9
8
|
original_env = ENV.to_h
|
10
|
-
dotenv_vars = Dotenv.parse
|
11
|
-
|
12
|
-
overwrite_dotenv_vars = JSON.parse(ENV["__ENVKEY_DOT_ENV_VARS"] || "[]")
|
13
9
|
overwrite_envkey_vars = JSON.parse(ENV["__ENVKEY_VARS"] || "[]")
|
14
10
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
# handle changed ENVKEY
|
25
|
-
if key && updated_dotenv_vars.include?("ENVKEY") && key != original_env["ENVKEY"]
|
26
|
-
overwrite_envkey_vars.each {|var| ENV.delete(var) }
|
27
|
-
end
|
28
|
-
|
29
|
-
if (key = ENV["ENVKEY"])
|
30
|
-
res = Envkey::Fetch.fetch_env(key)
|
31
|
-
if res && res.gsub("\n","").gsub("\r", "") != "" && !res.start_with?("error:")
|
32
|
-
envs = JSON.parse(res)
|
33
|
-
updated_envkey_vars = []
|
34
|
-
envs.each do |k,v|
|
35
|
-
var = k.upcase
|
36
|
-
if !ENV[var] || overwrite_envkey_vars.include?(var)
|
37
|
-
updated_envkey_vars << var
|
38
|
-
ENV[var] = v
|
39
|
-
end
|
11
|
+
res = Envkey::Fetch.fetch_env
|
12
|
+
if res && res.gsub("\n","").gsub("\r", "") != "" && !res.start_with?("error:")
|
13
|
+
envs = JSON.parse(res)
|
14
|
+
updated_envkey_vars = []
|
15
|
+
envs.each do |k,v|
|
16
|
+
var = k.upcase
|
17
|
+
if !ENV[var] || overwrite_envkey_vars.include?(var)
|
18
|
+
updated_envkey_vars << var
|
19
|
+
ENV[var] = v
|
40
20
|
end
|
21
|
+
end
|
41
22
|
|
42
|
-
|
43
|
-
ENV["__ENVKEY_VARS"] = updated_envkey_vars.to_json
|
23
|
+
ENV["__ENVKEY_VARS"] = updated_envkey_vars.to_json
|
44
24
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
else
|
50
|
-
raise "ENVKEY invalid. Couldn't load vars."
|
51
|
-
end
|
25
|
+
return updated_envkey_vars
|
26
|
+
elsif res.start_with?("error:")
|
27
|
+
STDERR.puts "envkey-source " + res
|
28
|
+
raise "ENVKEY invalid. Couldn't load vars."
|
52
29
|
else
|
53
|
-
raise "ENVKEY
|
30
|
+
raise "ENVKEY invalid. Couldn't load vars."
|
54
31
|
end
|
55
32
|
end
|
56
33
|
|
data/lib/envkey/fetch.rb
CHANGED
@@ -2,16 +2,20 @@ require 'envkey/platform'
|
|
2
2
|
|
3
3
|
module Envkey::Fetch
|
4
4
|
|
5
|
-
def self.fetch_env
|
5
|
+
def self.fetch_env
|
6
6
|
fetch_env_path = Envkey::Platform.fetch_env_path
|
7
|
-
`#{fetch_env_path} #{
|
7
|
+
`#{fetch_env_path} --json#{should_cache ? ' --cache' : ''} --client-name envkey-ruby --client-version #{Envkey::VERSION} 2>&1`
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.should_cache
|
11
|
+
is_dev || ENV["ENVKEY_SHOULD_CACHE"]
|
8
12
|
end
|
9
13
|
|
10
14
|
def self.is_dev
|
11
15
|
dev_vals = %w(development test)
|
12
16
|
dev_vals.include?(ENV["RAILS_ENV"]) ||
|
13
17
|
dev_vals.include?(ENV["RACK_ENV"]) ||
|
14
|
-
(ENV["RAILS_ENV"].nil? && ENV["RACK_ENV"].nil?
|
18
|
+
(ENV["RAILS_ENV"].nil? && ENV["RACK_ENV"].nil?)
|
15
19
|
end
|
16
20
|
|
17
21
|
end
|
data/lib/envkey/platform.rb
CHANGED
@@ -21,7 +21,7 @@ module Envkey::Platform
|
|
21
21
|
"x86"
|
22
22
|
when /ppc|powerpc/
|
23
23
|
"powerpc"
|
24
|
-
when /^arm/
|
24
|
+
when /^arm|^aarch/
|
25
25
|
"arm"
|
26
26
|
else
|
27
27
|
cpu
|
@@ -37,7 +37,7 @@ module Envkey::Platform
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def self.arch_part
|
40
|
-
if platform_part == "darwin" && ARCH == "arm"
|
40
|
+
if (platform_part == "darwin" || platform_part == "linux") && ARCH == "arm"
|
41
41
|
"arm64"
|
42
42
|
elsif ARCH == "x86_64"
|
43
43
|
"amd64"
|
@@ -51,11 +51,11 @@ module Envkey::Platform
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def self.fetch_env_path
|
54
|
-
File.expand_path("../../ext/#{lib_file_dir}/envkey-
|
54
|
+
File.expand_path("../../ext/#{lib_file_dir}/envkey-source#{ext}", File.dirname(__FILE__))
|
55
55
|
end
|
56
56
|
|
57
57
|
def self.lib_file_dir
|
58
|
-
["envkey-
|
58
|
+
["envkey-source", Envkey::ENVKEY_SOURCE_VERSION.to_s, platform_part, arch_part].join("_")
|
59
59
|
end
|
60
60
|
|
61
|
-
end
|
61
|
+
end
|
data/lib/envkey/version.rb
CHANGED
data/sdkruby-version.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.5
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envkey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dane Schneider
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,21 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.0'
|
55
|
-
|
56
|
-
name: dotenv
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '2.0'
|
62
|
-
type: :runtime
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '2.0'
|
69
|
-
description:
|
55
|
+
description:
|
70
56
|
email:
|
71
57
|
- dane@envkey.com
|
72
58
|
executables: []
|
@@ -78,38 +64,23 @@ files:
|
|
78
64
|
- ".travis.yml"
|
79
65
|
- Gemfile
|
80
66
|
- LICENSE.txt
|
81
|
-
- README.md
|
82
67
|
- Rakefile
|
83
68
|
- bin/console
|
84
69
|
- bin/setup
|
85
70
|
- envkey.gemspec
|
86
|
-
- ext/envkey-fetch_1.2.9_darwin_amd64/LICENSE
|
87
|
-
- ext/envkey-fetch_1.2.9_darwin_amd64/README.md
|
88
|
-
- ext/envkey-fetch_1.2.9_darwin_amd64/envkey-fetch
|
89
|
-
- ext/envkey-fetch_1.2.9_darwin_arm64/LICENSE
|
90
|
-
- ext/envkey-fetch_1.2.9_darwin_arm64/README.md
|
91
|
-
- ext/envkey-fetch_1.2.9_darwin_arm64/envkey-fetch
|
92
|
-
- ext/envkey-fetch_1.2.9_freebsd_amd64/LICENSE
|
93
|
-
- ext/envkey-fetch_1.2.9_freebsd_amd64/README.md
|
94
|
-
- ext/envkey-fetch_1.2.9_freebsd_amd64/envkey-fetch
|
95
|
-
- ext/envkey-fetch_1.2.9_linux_amd64/LICENSE
|
96
|
-
- ext/envkey-fetch_1.2.9_linux_amd64/README.md
|
97
|
-
- ext/envkey-fetch_1.2.9_linux_amd64/envkey-fetch
|
98
|
-
- ext/envkey-fetch_1.2.9_windows_amd64/LICENSE
|
99
|
-
- ext/envkey-fetch_1.2.9_windows_amd64/README.md
|
100
|
-
- ext/envkey-fetch_1.2.9_windows_amd64/envkey-fetch.exe
|
101
71
|
- lib/envkey.rb
|
102
72
|
- lib/envkey/core.rb
|
103
73
|
- lib/envkey/fetch.rb
|
104
74
|
- lib/envkey/platform.rb
|
105
75
|
- lib/envkey/rails.rb
|
106
76
|
- lib/envkey/version.rb
|
77
|
+
- sdkruby-version.txt
|
107
78
|
homepage: https://www.envkey.com
|
108
79
|
licenses:
|
109
80
|
- MIT
|
110
81
|
metadata:
|
111
82
|
allowed_push_host: https://rubygems.org
|
112
|
-
post_install_message:
|
83
|
+
post_install_message:
|
113
84
|
rdoc_options: []
|
114
85
|
require_paths:
|
115
86
|
- lib
|
@@ -124,9 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
95
|
- !ruby/object:Gem::Version
|
125
96
|
version: '0'
|
126
97
|
requirements: []
|
127
|
-
|
128
|
-
|
129
|
-
signing_key:
|
98
|
+
rubygems_version: 3.1.2
|
99
|
+
signing_key:
|
130
100
|
specification_version: 4
|
131
|
-
summary: Envkey secures and simplifies
|
101
|
+
summary: Envkey secures and simplifies configuration and secrets management.
|
132
102
|
test_files: []
|
data/README.md
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
# envkey gem
|
2
|
-
|
3
|
-
Integrate [EnvKey](https://www.envkey.com) with your Ruby or Ruby On Rails projects to keep api keys, credentials, and other configuration securely and automatically in sync for developers and servers.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
In your Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'envkey'
|
11
|
-
```
|
12
|
-
|
13
|
-
If you're using Rails, that's all you need. In plain Ruby, you need to require envkey at the entry point of your application.
|
14
|
-
|
15
|
-
```ruby
|
16
|
-
require 'envkey'
|
17
|
-
```
|
18
|
-
|
19
|
-
## Usage
|
20
|
-
|
21
|
-
Generate an `ENVKEY` in the [EnvKey App](https://github.com/envkey/envkey-app). Then set `ENVKEY=...`, either in a gitignored `.env` file in the root of your project (in development) or in an environment variable (on servers).
|
22
|
-
|
23
|
-
Now all your EnvKey variables will be available on `ENV`.
|
24
|
-
|
25
|
-
### Errors
|
26
|
-
|
27
|
-
The gem will throw an error if an `ENVKEY` is missing or invalid.
|
28
|
-
|
29
|
-
### Example
|
30
|
-
|
31
|
-
Assume you have `STRIPE_SECRET_KEY` set to `sk_test_2a33b045e998d2ef60c7861d2ac22ea8` for the `development` environment in the EnvKey App. You generate a local development `ENVKEY`.
|
32
|
-
|
33
|
-
In your project's **gitignored** `.env` file:
|
34
|
-
|
35
|
-
```bash
|
36
|
-
# .env
|
37
|
-
ENVKEY=GsL8zC74DWchdpvssa9z-nk7humd7hJmAqNoA
|
38
|
-
```
|
39
|
-
|
40
|
-
In `config/initializers/stripe.rb`:
|
41
|
-
|
42
|
-
```ruby
|
43
|
-
Stripe.api_key = ENV.fetch("STRIPE_SECRET_KEY")
|
44
|
-
```
|
45
|
-
|
46
|
-
Now `STRIPE_SECRET_KEY` will stay automatically in sync for all the developers on your team.
|
47
|
-
|
48
|
-
For a server, generate a server `ENVKEY` in the EnvKey App, then set the `ENVKEY` as an environment variable instead of putting it in a `.env` file.
|
49
|
-
|
50
|
-
Now your servers will stay in sync as well. If you need to rotate your `STRIPE_SECRET_KEY` you can do it in a few seconds in the EnvKey App, restart your servers, and you're good to go. All your team's developers and all your servers will have the new value.
|
51
|
-
|
52
|
-
### Overriding Vars
|
53
|
-
|
54
|
-
The envkey gem will not overwrite existing environment variables or additional variables set in a `.env` file. This can be convenient for customizing environments that otherwise share the same configuration. You can also use [sub-environments](https://blog.envkey.com/development-staging-production-and-beyond-85f26f65edd6) in the EnvKey app for this purpose.
|
55
|
-
|
56
|
-
### Working Offline
|
57
|
-
|
58
|
-
The envkey gem caches your encrypted config in development so that you can still use it while offline. Your config will still be available (though possibly not up-to-date) the next time you lose your internet connection. If you do have a connection available, envkey will always load the latest config. Your cached encrypted config is stored in `$HOME/.envkey/cache`
|
59
|
-
|
60
|
-
For caching purposes, the gem assumes you're in development mode if either `ENV["RAILS_ENV"]` or `ENV["RACK_ENV"]` is `"development"` or `"test"`. If you aren't using Rails or Rack, then it's assumed you're in development mode when a `.env` file exists in the root of your project.
|
61
|
-
|
62
|
-
## envkey-fetch binaries
|
63
|
-
|
64
|
-
If you look in the `ext` directory of this gem, you'll find a number of `envkey-fetch` binaries for various platforms and architectures. These are output by the [envkey-fetch Go library](https://github.com/envkey/envkey-fetch). It contains EnvKey's core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It is completely open source.
|
65
|
-
|
66
|
-
## x509 error / ca-certificates
|
67
|
-
|
68
|
-
On a stripped down OS like Alpine Linux, you may get an `x509: certificate signed by unknown authority` error when the envkey gem attempts to load your config. [envkey-fetch](https://github.com/envkey/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:
|
69
|
-
```
|
70
|
-
apk add --no-cache ca-certificates
|
71
|
-
```
|
72
|
-
|
73
|
-
## Further Reading
|
74
|
-
|
75
|
-
For more on EnvKey in general:
|
76
|
-
|
77
|
-
Read the [docs](https://docs.envkey.com).
|
78
|
-
|
79
|
-
Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
|
80
|
-
|
81
|
-
Read the [security and cryptography overview](https://security.envkey.com).
|
82
|
-
|
83
|
-
## Need help? Have questions, feedback, or ideas?
|
84
|
-
|
85
|
-
Post an [issue](https://github.com/envkey/envkey-ruby/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
|
86
|
-
|
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright © 2021 Envkey Inc. <support@envkey.com>
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# envkey-fetch
|
2
|
-
|
3
|
-
This 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.
|
4
|
-
|
5
|
-
It 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.
|
6
|
-
|
7
|
-
If 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.
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
envkey-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)..
|
12
|
-
|
13
|
-
**Install via bash:**
|
14
|
-
|
15
|
-
```bash
|
16
|
-
curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
|
17
|
-
```
|
18
|
-
|
19
|
-
**Install manually:**
|
20
|
-
|
21
|
-
Find 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).
|
22
|
-
|
23
|
-
**Install from source:**
|
24
|
-
|
25
|
-
With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
|
26
|
-
|
27
|
-
**Cross-compile from source:**
|
28
|
-
|
29
|
-
To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
|
30
|
-
|
31
|
-
Then to cross-compile, run:
|
32
|
-
|
33
|
-
`goreleaser`
|
34
|
-
|
35
|
-
Binaries for each platform will be output to the `dist` folder.
|
36
|
-
|
37
|
-
## Usage
|
38
|
-
|
39
|
-
```bash
|
40
|
-
envkey-fetch YOUR-ENVKEY [flags]
|
41
|
-
```
|
42
|
-
|
43
|
-
This 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.
|
44
|
-
|
45
|
-
### Example json output
|
46
|
-
|
47
|
-
```json
|
48
|
-
{"TEST":"it","TEST_2":"works!"}
|
49
|
-
```
|
50
|
-
|
51
|
-
### Example error output
|
52
|
-
|
53
|
-
```text
|
54
|
-
error: ENVKEY invalid
|
55
|
-
```
|
56
|
-
|
57
|
-
### Flags
|
58
|
-
|
59
|
-
```text
|
60
|
-
--cache cache encrypted config as a local backup (default is false)
|
61
|
-
--cache-dir string cache directory (default is $HOME/.envkey/cache)
|
62
|
-
--client-name string calling client library name (default is none)
|
63
|
-
--client-version string calling client library version (default is none)
|
64
|
-
-h, --help help for envkey-fetch
|
65
|
-
--retries uint8 number of times to retry requests on failure (default 3)
|
66
|
-
--retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
|
67
|
-
--timeout float timeout in seconds for http requests (default 10)
|
68
|
-
--verbose print verbose output (default is false)
|
69
|
-
-v, --version prints the version
|
70
|
-
```
|
71
|
-
|
72
|
-
## x509 error / ca-certificates
|
73
|
-
|
74
|
-
On 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:
|
75
|
-
```
|
76
|
-
apk add --no-cache ca-certificates
|
77
|
-
```
|
78
|
-
|
79
|
-
## Further Reading
|
80
|
-
|
81
|
-
For more on EnvKey in general:
|
82
|
-
|
83
|
-
Read the [docs](https://docs.envkey.com).
|
84
|
-
|
85
|
-
Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
|
86
|
-
|
87
|
-
Read the [security and cryptography overview](https://security.envkey.com).
|
88
|
-
|
89
|
-
## Need help? Have questions, feedback, or ideas?
|
90
|
-
|
91
|
-
Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
Binary file
|
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright © 2021 Envkey Inc. <support@envkey.com>
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# envkey-fetch
|
2
|
-
|
3
|
-
This 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.
|
4
|
-
|
5
|
-
It 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.
|
6
|
-
|
7
|
-
If 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.
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
envkey-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)..
|
12
|
-
|
13
|
-
**Install via bash:**
|
14
|
-
|
15
|
-
```bash
|
16
|
-
curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
|
17
|
-
```
|
18
|
-
|
19
|
-
**Install manually:**
|
20
|
-
|
21
|
-
Find 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).
|
22
|
-
|
23
|
-
**Install from source:**
|
24
|
-
|
25
|
-
With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
|
26
|
-
|
27
|
-
**Cross-compile from source:**
|
28
|
-
|
29
|
-
To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
|
30
|
-
|
31
|
-
Then to cross-compile, run:
|
32
|
-
|
33
|
-
`goreleaser`
|
34
|
-
|
35
|
-
Binaries for each platform will be output to the `dist` folder.
|
36
|
-
|
37
|
-
## Usage
|
38
|
-
|
39
|
-
```bash
|
40
|
-
envkey-fetch YOUR-ENVKEY [flags]
|
41
|
-
```
|
42
|
-
|
43
|
-
This 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.
|
44
|
-
|
45
|
-
### Example json output
|
46
|
-
|
47
|
-
```json
|
48
|
-
{"TEST":"it","TEST_2":"works!"}
|
49
|
-
```
|
50
|
-
|
51
|
-
### Example error output
|
52
|
-
|
53
|
-
```text
|
54
|
-
error: ENVKEY invalid
|
55
|
-
```
|
56
|
-
|
57
|
-
### Flags
|
58
|
-
|
59
|
-
```text
|
60
|
-
--cache cache encrypted config as a local backup (default is false)
|
61
|
-
--cache-dir string cache directory (default is $HOME/.envkey/cache)
|
62
|
-
--client-name string calling client library name (default is none)
|
63
|
-
--client-version string calling client library version (default is none)
|
64
|
-
-h, --help help for envkey-fetch
|
65
|
-
--retries uint8 number of times to retry requests on failure (default 3)
|
66
|
-
--retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
|
67
|
-
--timeout float timeout in seconds for http requests (default 10)
|
68
|
-
--verbose print verbose output (default is false)
|
69
|
-
-v, --version prints the version
|
70
|
-
```
|
71
|
-
|
72
|
-
## x509 error / ca-certificates
|
73
|
-
|
74
|
-
On 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:
|
75
|
-
```
|
76
|
-
apk add --no-cache ca-certificates
|
77
|
-
```
|
78
|
-
|
79
|
-
## Further Reading
|
80
|
-
|
81
|
-
For more on EnvKey in general:
|
82
|
-
|
83
|
-
Read the [docs](https://docs.envkey.com).
|
84
|
-
|
85
|
-
Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
|
86
|
-
|
87
|
-
Read the [security and cryptography overview](https://security.envkey.com).
|
88
|
-
|
89
|
-
## Need help? Have questions, feedback, or ideas?
|
90
|
-
|
91
|
-
Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
Binary file
|
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright © 2021 Envkey Inc. <support@envkey.com>
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# envkey-fetch
|
2
|
-
|
3
|
-
This 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.
|
4
|
-
|
5
|
-
It 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.
|
6
|
-
|
7
|
-
If 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.
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
envkey-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)..
|
12
|
-
|
13
|
-
**Install via bash:**
|
14
|
-
|
15
|
-
```bash
|
16
|
-
curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
|
17
|
-
```
|
18
|
-
|
19
|
-
**Install manually:**
|
20
|
-
|
21
|
-
Find 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).
|
22
|
-
|
23
|
-
**Install from source:**
|
24
|
-
|
25
|
-
With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
|
26
|
-
|
27
|
-
**Cross-compile from source:**
|
28
|
-
|
29
|
-
To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
|
30
|
-
|
31
|
-
Then to cross-compile, run:
|
32
|
-
|
33
|
-
`goreleaser`
|
34
|
-
|
35
|
-
Binaries for each platform will be output to the `dist` folder.
|
36
|
-
|
37
|
-
## Usage
|
38
|
-
|
39
|
-
```bash
|
40
|
-
envkey-fetch YOUR-ENVKEY [flags]
|
41
|
-
```
|
42
|
-
|
43
|
-
This 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.
|
44
|
-
|
45
|
-
### Example json output
|
46
|
-
|
47
|
-
```json
|
48
|
-
{"TEST":"it","TEST_2":"works!"}
|
49
|
-
```
|
50
|
-
|
51
|
-
### Example error output
|
52
|
-
|
53
|
-
```text
|
54
|
-
error: ENVKEY invalid
|
55
|
-
```
|
56
|
-
|
57
|
-
### Flags
|
58
|
-
|
59
|
-
```text
|
60
|
-
--cache cache encrypted config as a local backup (default is false)
|
61
|
-
--cache-dir string cache directory (default is $HOME/.envkey/cache)
|
62
|
-
--client-name string calling client library name (default is none)
|
63
|
-
--client-version string calling client library version (default is none)
|
64
|
-
-h, --help help for envkey-fetch
|
65
|
-
--retries uint8 number of times to retry requests on failure (default 3)
|
66
|
-
--retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
|
67
|
-
--timeout float timeout in seconds for http requests (default 10)
|
68
|
-
--verbose print verbose output (default is false)
|
69
|
-
-v, --version prints the version
|
70
|
-
```
|
71
|
-
|
72
|
-
## x509 error / ca-certificates
|
73
|
-
|
74
|
-
On 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:
|
75
|
-
```
|
76
|
-
apk add --no-cache ca-certificates
|
77
|
-
```
|
78
|
-
|
79
|
-
## Further Reading
|
80
|
-
|
81
|
-
For more on EnvKey in general:
|
82
|
-
|
83
|
-
Read the [docs](https://docs.envkey.com).
|
84
|
-
|
85
|
-
Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
|
86
|
-
|
87
|
-
Read the [security and cryptography overview](https://security.envkey.com).
|
88
|
-
|
89
|
-
## Need help? Have questions, feedback, or ideas?
|
90
|
-
|
91
|
-
Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
Binary file
|
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright © 2021 Envkey Inc. <support@envkey.com>
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# envkey-fetch
|
2
|
-
|
3
|
-
This 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.
|
4
|
-
|
5
|
-
It 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.
|
6
|
-
|
7
|
-
If 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.
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
envkey-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)..
|
12
|
-
|
13
|
-
**Install via bash:**
|
14
|
-
|
15
|
-
```bash
|
16
|
-
curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
|
17
|
-
```
|
18
|
-
|
19
|
-
**Install manually:**
|
20
|
-
|
21
|
-
Find 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).
|
22
|
-
|
23
|
-
**Install from source:**
|
24
|
-
|
25
|
-
With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
|
26
|
-
|
27
|
-
**Cross-compile from source:**
|
28
|
-
|
29
|
-
To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
|
30
|
-
|
31
|
-
Then to cross-compile, run:
|
32
|
-
|
33
|
-
`goreleaser`
|
34
|
-
|
35
|
-
Binaries for each platform will be output to the `dist` folder.
|
36
|
-
|
37
|
-
## Usage
|
38
|
-
|
39
|
-
```bash
|
40
|
-
envkey-fetch YOUR-ENVKEY [flags]
|
41
|
-
```
|
42
|
-
|
43
|
-
This 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.
|
44
|
-
|
45
|
-
### Example json output
|
46
|
-
|
47
|
-
```json
|
48
|
-
{"TEST":"it","TEST_2":"works!"}
|
49
|
-
```
|
50
|
-
|
51
|
-
### Example error output
|
52
|
-
|
53
|
-
```text
|
54
|
-
error: ENVKEY invalid
|
55
|
-
```
|
56
|
-
|
57
|
-
### Flags
|
58
|
-
|
59
|
-
```text
|
60
|
-
--cache cache encrypted config as a local backup (default is false)
|
61
|
-
--cache-dir string cache directory (default is $HOME/.envkey/cache)
|
62
|
-
--client-name string calling client library name (default is none)
|
63
|
-
--client-version string calling client library version (default is none)
|
64
|
-
-h, --help help for envkey-fetch
|
65
|
-
--retries uint8 number of times to retry requests on failure (default 3)
|
66
|
-
--retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
|
67
|
-
--timeout float timeout in seconds for http requests (default 10)
|
68
|
-
--verbose print verbose output (default is false)
|
69
|
-
-v, --version prints the version
|
70
|
-
```
|
71
|
-
|
72
|
-
## x509 error / ca-certificates
|
73
|
-
|
74
|
-
On 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:
|
75
|
-
```
|
76
|
-
apk add --no-cache ca-certificates
|
77
|
-
```
|
78
|
-
|
79
|
-
## Further Reading
|
80
|
-
|
81
|
-
For more on EnvKey in general:
|
82
|
-
|
83
|
-
Read the [docs](https://docs.envkey.com).
|
84
|
-
|
85
|
-
Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
|
86
|
-
|
87
|
-
Read the [security and cryptography overview](https://security.envkey.com).
|
88
|
-
|
89
|
-
## Need help? Have questions, feedback, or ideas?
|
90
|
-
|
91
|
-
Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
Binary file
|
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright © 2021 Envkey Inc. <support@envkey.com>
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# envkey-fetch
|
2
|
-
|
3
|
-
This 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.
|
4
|
-
|
5
|
-
It 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.
|
6
|
-
|
7
|
-
If 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.
|
8
|
-
|
9
|
-
## Installation
|
10
|
-
|
11
|
-
envkey-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)..
|
12
|
-
|
13
|
-
**Install via bash:**
|
14
|
-
|
15
|
-
```bash
|
16
|
-
curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
|
17
|
-
```
|
18
|
-
|
19
|
-
**Install manually:**
|
20
|
-
|
21
|
-
Find 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).
|
22
|
-
|
23
|
-
**Install from source:**
|
24
|
-
|
25
|
-
With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
|
26
|
-
|
27
|
-
**Cross-compile from source:**
|
28
|
-
|
29
|
-
To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
|
30
|
-
|
31
|
-
Then to cross-compile, run:
|
32
|
-
|
33
|
-
`goreleaser`
|
34
|
-
|
35
|
-
Binaries for each platform will be output to the `dist` folder.
|
36
|
-
|
37
|
-
## Usage
|
38
|
-
|
39
|
-
```bash
|
40
|
-
envkey-fetch YOUR-ENVKEY [flags]
|
41
|
-
```
|
42
|
-
|
43
|
-
This 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.
|
44
|
-
|
45
|
-
### Example json output
|
46
|
-
|
47
|
-
```json
|
48
|
-
{"TEST":"it","TEST_2":"works!"}
|
49
|
-
```
|
50
|
-
|
51
|
-
### Example error output
|
52
|
-
|
53
|
-
```text
|
54
|
-
error: ENVKEY invalid
|
55
|
-
```
|
56
|
-
|
57
|
-
### Flags
|
58
|
-
|
59
|
-
```text
|
60
|
-
--cache cache encrypted config as a local backup (default is false)
|
61
|
-
--cache-dir string cache directory (default is $HOME/.envkey/cache)
|
62
|
-
--client-name string calling client library name (default is none)
|
63
|
-
--client-version string calling client library version (default is none)
|
64
|
-
-h, --help help for envkey-fetch
|
65
|
-
--retries uint8 number of times to retry requests on failure (default 3)
|
66
|
-
--retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
|
67
|
-
--timeout float timeout in seconds for http requests (default 10)
|
68
|
-
--verbose print verbose output (default is false)
|
69
|
-
-v, --version prints the version
|
70
|
-
```
|
71
|
-
|
72
|
-
## x509 error / ca-certificates
|
73
|
-
|
74
|
-
On 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:
|
75
|
-
```
|
76
|
-
apk add --no-cache ca-certificates
|
77
|
-
```
|
78
|
-
|
79
|
-
## Further Reading
|
80
|
-
|
81
|
-
For more on EnvKey in general:
|
82
|
-
|
83
|
-
Read the [docs](https://docs.envkey.com).
|
84
|
-
|
85
|
-
Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
|
86
|
-
|
87
|
-
Read the [security and cryptography overview](https://security.envkey.com).
|
88
|
-
|
89
|
-
## Need help? Have questions, feedback, or ideas?
|
90
|
-
|
91
|
-
Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
Binary file
|