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

Sign merges, CRUD, Wiki and Repository initialisation with gpg key #7631

Merged
merged 27 commits into from
Oct 16, 2019
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b205fdf
Enable use of default gpg key for signing commits
zeripath Jul 26, 2019
9f8cdb5
fix more unix date uses
zeripath Aug 1, 2019
35b68ce
Merge branch 'master' into web-sign
zeripath Aug 7, 2019
e5f8508
Merge branch 'master' into web-sign
zeripath Aug 16, 2019
5e5d201
fix verification for provided key id and file response
zeripath Aug 16, 2019
c4fda14
Add some integration test for gpg signing
zeripath Aug 16, 2019
483ac21
fix issue with default reason
zeripath Aug 17, 2019
7d0ffa9
Merge branch 'master' into web-sign
zeripath Aug 17, 2019
4c8487f
update vendor
zeripath Aug 17, 2019
dae22e7
Use gpg.error.not_signed_commit instead of unsigned for unsigned commits
zeripath Aug 17, 2019
f4a07a5
Restore old signing key, name, and email at end of gpg_git_test
zeripath Aug 17, 2019
b674f17
fix repofiles_delete_test
zeripath Aug 17, 2019
52740e6
Make it possible to get per repository signing-keys
zeripath Aug 17, 2019
09d771a
Update documentation
zeripath Aug 17, 2019
cf35ac6
Merge branch 'master' into web-sign
zeripath Aug 17, 2019
a7dca0b
Merge branch 'master' into web-sign
zeripath Oct 9, 2019
5d827d5
Adjust the app.ini.sample to make SIGNING_* clearer
zeripath Oct 9, 2019
83fc620
Fix duplicate declaration of modules/settings in file_test
zeripath Oct 9, 2019
61bb5c2
Merge branch 'master' into web-sign
zeripath Oct 13, 2019
942ccbe
Ensure early git functionality
zeripath Oct 13, 2019
d245253
Add functionality note
zeripath Oct 13, 2019
a1f4a0d
Oops -m is present since 1.7.2 on commit
zeripath Oct 13, 2019
e1979a7
Merge branch 'master' into web-sign
zeripath Oct 14, 2019
b03ca96
Update docs/content/doc/advanced/signing.en-us.md
zeripath Oct 15, 2019
070a5c2
Merge branch 'master' into web-sign
zeripath Oct 15, 2019
7a01822
Add swagger definitions
zeripath Oct 15, 2019
f9f14c0
Merge branch 'master' into web-sign
lafriks Oct 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into web-sign
  • Loading branch information
zeripath committed Oct 13, 2019
commit 61bb5c291a6fe5059ed93a1278dccf6bc6e7a835
16 changes: 13 additions & 3 deletions modules/repofiles/temp_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,11 @@ func (t *TemporaryUploadRepository) CommitTree(author, committer *models.User, t
authorSig := author.NewGitSig()
committerSig := committer.NewGitSig()

binVersion, err := git.BinVersion()
if err != nil {
return "", fmt.Errorf("Unable to get git version: %v", err)
}

// Because this may call hooks we should pass in the environment
env := append(os.Environ(),
"GIT_AUTHOR_NAME="+authorSig.Name,
Expand All @@ -266,20 +271,25 @@ func (t *TemporaryUploadRepository) CommitTree(author, committer *models.User, t
"GIT_COMMITTER_DATE="+commitTimeStr,
)

args := []string{"commit-tree", treeHash, "-p", "HEAD", "-m", message}
messageBytes := new(bytes.Buffer)
_, _ = messageBytes.WriteString(message)
_, _ = messageBytes.WriteString("\n")

args := []string{"commit-tree", treeHash, "-p", "HEAD"}

// Determine if we should sign
sign, keyID := t.repo.SignCRUDAction(author, t.basePath, "HEAD")
if sign {
args = append(args, "-S"+keyID)
} else {
} else if version.Compare(binVersion, "2.0.0", ">=") {
args = append(args, "--no-gpg-sign")
}

commitHash, stderr, err := process.GetManager().ExecDirEnv(5*time.Minute,
commitHash, stderr, err := process.GetManager().ExecDirEnvStdIn(5*time.Minute,
t.basePath,
fmt.Sprintf("commitTree (git commit-tree): %s", t.basePath),
env,
messageBytes,
git.GitExecutable, args...)
if err != nil {
return "", fmt.Errorf("git commit-tree: %s", stderr)
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.