-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from zotoio/feature/encrypted-env
Feature/encrypted env
- Loading branch information
Showing
44 changed files
with
750 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const dotenv = require('dotenv'); | ||
const config = dotenv.config(); | ||
|
||
if (config.error) { | ||
console.error(config.error); | ||
} | ||
|
||
//console.log(json.plain(_.extend(sharedConfig.parsed, localConfig.parsed))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
display_usage() { | ||
echo "Please supply env var name and value to encrypt" | ||
echo "eg. ./encrypt.sh GTM_CRYPT_MY_VARIABLE supers3cret" | ||
} | ||
|
||
if [ $# -eq 0 ]; then | ||
display_usage | ||
exit 1 | ||
fi | ||
|
||
export $(cat .env | grep -v ^# | xargs) | ||
node --require ./dotenv.js ./node_modules/serverless/bin/serverless encrypt -k $GTM_AWS_KMS_KEY_ID -n $1 -v $2 | ||
# todo add encrypted values to .env from kms secrets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
secrets: | ||
GTM_CRYPT_GITHUB_TOKEN: AQICAHhK1adeaGaap/XxRtXdFB/VkZT3XeQtDEMkVYvemdBEiQEJcnivPXbcJwnZzTQTxu31AAAAhzCBhAYJKoZIhvcNAQcGoHcwdQIBADBwBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDFP2pE25RzVb1ZrnlAIBEIBDfziIOzj0CgNt/OuDDoWtIpDXtHRvyVKxMtUOHalsNs8RDVQFPTMGX0qr/BkMeEIO0yG1UF4g2i5p7ZRUJQ68IEgRAQ== | ||
GTM_CRYPT_GITHUB_WEBHOOK_SECRET: AQICAHhK1adeaGaap/XxRtXdFB/VkZT3XeQtDEMkVYvemdBEiQEEkJghXzLnVn+mkZOvU24nAAAAbjBsBgkqhkiG9w0BBwagXzBdAgEAMFgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQM8JJgdprhT1xeMJ2iAgEQgCtCYXg7hhBX4A1PvVqN5adTeGBGVvoQ5o2Mv9y8ryfoybUqSSVclmJ4XMu0 | ||
GTM_CRYPT_AGENT_AWS_ACCESS_KEY_ID: AQICAHhK1adeaGaap/XxRtXdFB/VkZT3XeQtDEMkVYvemdBEiQGVqoF0YYPkVr2XywzcnsPtAAAAcjBwBgkqhkiG9w0BBwagYzBhAgEAMFwGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMs0VIMb7Ver78YYylAgEQgC+bNI7V97dCWeE4n9D7CKFUbD8i4t3ZbbgniTsaoThOczAlYhBxmLtVcAQ78b6mnw== | ||
GTM_CRYPT_AGENT_AWS_SECRET_ACCESS_KEY: AQICAHhK1adeaGaap/XxRtXdFB/VkZT3XeQtDEMkVYvemdBEiQH3RvbGVR/b3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| ||
GTM_CRYPT_JENKINS_TOKEN: AQICAHhK1adeaGaap/XxRtXdFB/VkZT3XeQtDEMkVYvemdBEiQEmEA1yZBLobp7pyJTncAPiAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMofG5CUTNcaNv5quYAgEQgDu5LVDrZZ6uvquX+9xNjzyVV1muTU1WKIq7w01TuHY5ffPc4BCaReP8CoqzLjhD+nMQHVL2WGWEfQSa0A== | ||
keyArn: 'arn:aws:kms:ap-southeast-2:347186442473:key/f7caff09-20ff-4698-b6a5-5ebe3ccf8556' |
Oops, something went wrong.