git-crypt在使用 git CLI 时工作得非常好。我已经为 git-crypt ( .gitattributes
)进行了适当的设置。创建/编辑我想要加密的文件后,我执行:
git add .
Run Code Online (Sandbox Code Playgroud)
文件已经上演,现在我执行:
git commit -m "Commit encrypted file"
git push
Run Code Online (Sandbox Code Playgroud)
但是当我使用 GitKraken 并暂存文件时,它似乎没有复制git add .
CLI。
有没有人成功使用过 GitKraken 和 git-crypt?
尝试了解基于 git-crypt 的保密解决方案的完整工作流程。
该工具本身在开发机器上运行得非常好,甚至扩展到多个开发人员似乎也运行良好。
但是,我不清楚当部署到云上的多个服务器时,这将如何工作,有些服务器是按需创建的:
在新服务器上无人值守创建 GPG 密钥的挑战(需要有人创建密码,或者它位于源代码管理中,那么,这一切有什么价值?)
创建 GPG 后,如何将其添加到环中?
假设我们决定跳过 #1 并仅在服务器之间共享密钥,那么密码短语作为“git-crypt 解锁”过程的一部分是如何提供的?
我真的尝试过搜索,但找不到一个好的端到端工作流程。
我知道如何通过git-crypt加密存储库中的文件:
echo "*.crypt.* filter=git-crypt diff=git-crypt" > .gitattributes
echo "supersecret info" > somethingTo.crypt.txt
git add .gitattributes somethingTo.crypt.txt
git crypt status # somethingTo.crypt.txt results encrypted
git commit
git push
Run Code Online (Sandbox Code Playgroud)
我知道如何使用git-lfs存储文件(在自托管的 GitLab 上;在项目设置中启用 LFS):
git lfs track somethingTo.crypt.txt
git add .gitattributes # updated LFS rule for tracked file
git commit
git push
Run Code Online (Sandbox Code Playgroud)
...但是,如何在同一个文件上使用它们呢?
即使在用于存储在 LFS 上的过滤器之前.gitattributes
有用于加密的git-filter,该文件也不会被加密(报告“未加密”)。LFS 未跟踪的所有其他文件均已正确加密。git crypt status | grep somethingTo
*.crypt.*
我想问题在于我somethingTo.crypt.txt
现在只是存储库中的引用对象,而不是实际的(加密的)文件。但我希望(感谢 s git-filter
)文件在被推送到LFS Store之前会被过滤/加密。 …
我使用git-crypt分叉了一个 repo,我需要更新 git-crypt 密钥,以便上游 git-crypt 密钥无法解密新的 repo。
该git-crypt help
文档和README似乎没有解释如何改变一个git-加密密钥。
我尝试了各种擦除 git-crypt 配置并重新初始化的方法。不幸的是,所有这样做的尝试似乎都破坏了各种事情,例如 git diff 显示诸如smudge filter git-crypt failed
. 其中一些行为记录在在已初始化的存储库上运行git-crypt init
会使数据不可读。https://github.com/AGWA/git-crypt/issues/47评论中的任何建议都无法防止 git diff 致命错误。(我对 git diff 显示未加密的二进制文件历史记录的无用输出感到满意,但在某些提交中给出致命错误是不行的,即使是未加密的文件也无法进行差异git diff
。)
这似乎是 git-crypt 的一个主要要求,所以我不敢相信这不受支持,例如,如果您因为有人离开公司而需要轮换 git-crypt 密钥。
我有一个包含加密文件的存储库,使用 git-crypt。我已将密钥导出到文件中。现在我使用 gitlab 上的默认 docker 镜像构建模板来构建我的镜像。管道工作得很好。我只是不知道如何在构建过程中“解锁”文件,以便图像具有可供使用的明文文件。管道构建如下所示:
docker-build:
# Use the official docker image.
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag …
Run Code Online (Sandbox Code Playgroud) 对于Linux和MacOS,存在git-crypt指令,但对于Windows,这些说明似乎被省略了.如何在Windows上安装Git-crypt?
git-crypt ×6
git ×4
deployment ×1
docker ×1
encryption ×1
git-filter ×1
git-lfs ×1
gitkraken ×1
gitlab ×1
gnupg ×1
security ×1
windows ×1