Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-crypt #124

Merged
merged 4 commits into from
Feb 16, 2019
Merged

git-crypt #124

merged 4 commits into from
Feb 16, 2019

Conversation

arcticicestudio
Copy link
Contributor

Resolves #123

Defined the first files that should be encrypted and ensured to exclude
the Git specific `.gitattributes` itself and `.gitignore` files.

GH-123
Initialized git-crypt for the repository with `git-crypt init`.

Added GPG keys of all core team members and the CI/CD virtual user using
`git-crypt add-gpg-user --trusted --no-commit <ID>` (`--no-commit` flag
prevents automatic commit of generated files while `--trusted` assumes
the GPG user IDs are trusted)

GH-123
The files are tracked by git-crypt and transparently encrypted
on-the-fly.

GH-123
Nord Docs uses git-crypt to encrypt Gatsby environment variables] (1)
stored in `.env*` files that are handled by dotenv (2). Another way
would be to use Circle CI's environment variables features (3) to make
sensitive data available during build time, but using git-crypt ensures
that all required project data is stored in the repository and tracked
by Git without the need to manually configure CI/CD providers and
servers.

Unfortunately Netlify currently doesn't provide a way to customize the
Docker container configuration so that it is not possible to set up GPG
and git-crypt to import the CI/CD GPG secret key, decrypt the files and
build the project. An attempted solution was to use Netlify's awesome
"Functions" feature (4) to run a function that executes shell commands
using the `deploy-building` trigger to set up GPG and git-crypt, but
there is no way to ins  tall `git-crypt` in the container so this
doesn't work.

Therefore is is necessary to manually set required environment variables
via Netlify's web app UI for build environment variables .

- `NORD_DOCS_GOOGLE_UNIVERSAL_ANALYTICS_TRACKING_ID` - Stores the
"Google Universal Analytics" tracking ID.

References:
  (1) https://www.gatsbyjs.org/docs/environment-variables
  (2) https://github.com/motdotla/dotenv
  (3) https://circleci.com/docs/2.0/env-vars
  (4) https://www.netlify.com/docs/functions
  (5) https://www.netlify.com/docs/continuous-deployment/#build-environment-variables

GH-123
@codecov
Copy link

codecov bot commented Feb 16, 2019

Codecov Report

Merging #124 into develop will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #124   +/-   ##
========================================
  Coverage    48.99%   48.99%           
========================================
  Files          239      239           
  Lines          998      998           
  Branches       151      151           
========================================
  Hits           489      489           
  Misses         509      509
Flag Coverage Δ
#unit 48.99% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c1bf2db...a7c0e76. Read the comment docs.

@arcticicestudio arcticicestudio marked this pull request as ready for review February 16, 2019 13:48
@arcticicestudio arcticicestudio merged commit 475c695 into develop Feb 16, 2019
@arcticicestudio arcticicestudio deleted the feature/gh-123-git-crypt branch February 16, 2019 13:55
@arcticicestudio arcticicestudio removed their assignment Feb 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants