You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git-secret/man/man7/git-secret.7

80 lines
3.6 KiB
Groff

9 years ago
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SECRET" "7" "April 2018" "sobolevn" "git-secret"
9 years ago
.
.SH "NAME"
\fBgit\-secret\fR
.
9 years ago
.SH "Usage"
9 years ago
These steps cover the basic process of using \fBgit\-secret\fR:
.
.IP "1." 4
Before starting, make sure you have created \fBgpg\fR RSA key\-pair: public and secret key identified by your email address\.
.
.IP "2." 4
Initialize \fBgit\-secret\fR repository by running \fBgit secret init\fR command\. \fB\.gitsecret/\fR folder will be created, \fBnote\fR that \fB\.gitsecret/\fR folder should \fBnot\fR be ignored \fIhttps://github\.com/sobolevn/git\-secret/issues/39\fR\.
9 years ago
.
.IP "3." 4
Add first user to the system by running \fBgit secret tell your@gpg\.email\fR\.
9 years ago
.
.IP "4." 4
Now it\'s time to add files you wish to encrypt inside the \fBgit\-secret\fR repository\. It can be done by running \fBgit secret add <filenames\.\.\.>\fR command\. Make sure these files are ignored, otherwise \fBgit\-secret\fR won\'t allow you to add them, as these files will be stored unencrypted\.
9 years ago
.
.IP "5." 4
9 years ago
When done, run \fBgit secret hide\fR all files, which you have added by \fBgit secret add\fR command will be encrypted with added public\-keys by the \fBgit secret tell\fR command\. Now it is safe to commit your changes\. \fBBut\fR\. It\'s recommended to add \fBgit secret hide\fR command to your \fBpre\-commit\fR hook, so you won\'t miss any changes\.
9 years ago
.
.IP "6." 4
Now decrypt files with \fBgit secret reveal\fR command\. It will ask you for your password\. And you\'re done!
.
.IP "" 0
9 years ago
.
.SS "I want to add someone to the repository"
.
.IP "1." 4
Get their \fBgpg\fR public\-key\. \fBYou won\'t need their secret key\.\fR
9 years ago
.
.IP "2." 4
Import this key inside your \fBgpg\fR by running \fBgpg \-\-import KEY_NAME\fR
.
.IP "3." 4
Now add this person to the \fBgit\-secret\fR by running \fBgit secret tell persons@email\.id\fR
.
.IP "4." 4
9 years ago
Reencypt the files, now they will be able to decrypt them with their secret key\.
9 years ago
.
.IP "" 0
.
.P
9 years ago
Note, that it is possible to add yourself to the system without decrypting existing files\. It will be possible to decrypt them after reencrypting them with the new keyring\. So, if you don\'t want unexpected keys added, make sure to configure some server\-side security policy with the \fBpre\-receive\fR hook\.
.
.SH "Configuration"
You can configure several things to suit your workflow better\. To do so, just set the required variable to the value you need\. This can be done in your shell environment file or with the each \fBgit\-secret\fR command\.
.
.P
These settings are available to be changed:
.
.IP "\(bu" 4
7 years ago
\fB$SECRETS_GPG_COMMAND\fR \- sets the \fBgpg\fR alternatives, defaults to \fBgpg\fR\. It can be changed to \fBgpg\fR, \fBgpg2\fR, \fBpgp\fR, \fB/usr/local/gpg\fR or any other value\. After doing so rerun the tests to be sure that it won\'t break anything\. Tested to be working with: \fBgpg\fR, \fBgpg2\fR\.
.
.IP "\(bu" 4
\fB$SECRETS_EXTENSION\fR \- sets the secret files extension, defaults to \fB\.secret\fR\. It can be changed to any valid file extension\.
.
.IP "" 0
.
.SH "Internals"
.
.SS "<code>\.gitsecret</code> folder"
This folder contains every piece of information about the project\. It stores:
.
.IP "\(bu" 4
public keys for the project
.
.IP "\(bu" 4
path mappings\. Or in other words: what files are tracked to be hidden and revealed
.
.IP "" 0
.
.P
This folder should not be ignored\. In case it is application would not work raising an error: \fB\'\.gitsecret/\' is ignored\. abort\.\'\fR\. However, it is possible to ignore individual files \fIhttps://github\.com/sobolevn/git\-secret/issues/93\fR inside it: \fBrandom_seed\fR would be the most popular example\.