1. 16 Jun, 2022 1 commit
  2. 10 Jun, 2022 1 commit
    • wxiaoguang's avatar
      Refactor git module, make Gitea use internal git config (#19732) · a0051634
      wxiaoguang authored
      
      * Refactor git module, make Gitea use internal git config, add safe.directory config
      
      * introduce git.InitSimple and git.InitWithConfigSync, make serv cmd use gitconfig
      
      * use HOME instead of GIT_CONFIG_GLOBAL, because git always needs a correct HOME
      
      * fix cmd env in cmd/serv.go
      
      * fine tune error message
      
      * Fix a incorrect test case
      
      * fix configAddNonExist
      
      * fix configAddNonExist logic, add `--fixed-value` flag, add tests
      
      * add configSetNonExist function in case it's needed.
      
      * use configSetNonExist for `user.name` and `user.email`
      
      * add some comments
      
      * Update cmd/serv.go
      Co-authored-by: default avatarzeripath <art27@cantab.net>
      
      * Update cmd/serv.go
      Co-authored-by: default avatarzeripath <art27@cantab.net>
      
      * Update modules/git/git.go
      Co-authored-by: default avatarzeripath <art27@cantab.net>
      
      * Update modules/setting/setting.go
      Co-authored-by: default avatarzeripath <art27@cantab.net>
      
      * Update modules/git/repo_attribute.go
      Co-authored-by: default avatarzeripath <art27@cantab.net>
      
      * fix spaces in messages
      
      * use `configSet("core.protectNTFS", ...)` instead of `globalCommandArgs`
      
      * remove GIT_CONFIG_NOSYSTEM, continue to use system's git config
      
      * Update cmd/serv.go
      Co-authored-by: default avatarzeripath <art27@cantab.net>
      
      * fix merge
      
      * remove code for safe.directory
      
      * separate git.CommonEnvs to CommonGitCmdEnvs and CommonCmdServEnvs
      
      * avoid Golang's data race error
      Co-authored-by: default avatarzeripath <art27@cantab.net>
      Co-authored-by: default avatarLunny Xiao <xiaolunwen@gmail.com>
      Unverified
      a0051634
  3. 01 Apr, 2022 1 commit
  4. 11 Feb, 2022 1 commit
  5. 06 Feb, 2022 1 commit
  6. 20 Dec, 2021 1 commit
  7. 30 Nov, 2021 1 commit
  8. 17 Dec, 2020 1 commit
  9. 21 Oct, 2020 1 commit
  10. 19 Sep, 2020 1 commit
    • zeripath's avatar
      Add configurable Trust Models (#11712) · 4979f15c
      zeripath authored
      
      * Add configurable Trust Models
      
      Gitea's default signature verification model differs from GitHub. GitHub
      uses signatures to verify that the committer is who they say they are -
      meaning that when GitHub makes a signed commit it must be the committer.
      The GitHub model prevents re-publishing of commits after revocation of a
      key and prevents re-signing of other people's commits to create a
      completely trusted repository signed by one key or a set of trusted
      keys.
      
      The default behaviour of Gitea in contrast is to always display the
      avatar and information related to a signature. This allows signatures to
      be decoupled from the committer. That being said, allowing arbitary
      users to present other peoples commits as theirs is not necessarily
      desired therefore we have a trust model whereby signatures from
      collaborators are marked trusted, signatures matching the commit line
      are marked untrusted and signatures that match a user in the db but not
      the committer line are marked unmatched.
      
      The problem with this model is that this conflicts with Github therefore
      we need to provide an option to allow users to choose the Github model
      should they wish to.
      Signed-off-by: default avatarAndrew Thornton <art27@cantab.net>
      
      * Adjust locale strings
      Signed-off-by: default avatarAndrew Thornton <art27@cantab.net>
      
      * as per @6543
      Co-authored-by: default avatar6543 <6543@obermui.de>
      
      * Update models/gpg_key.go
      
      * Add migration for repository
      Signed-off-by: default avatarAndrew Thornton <art27@cantab.net>
      Co-authored-by: default avatar6543 <6543@obermui.de>
      Co-authored-by: default avatarLunny Xiao <xiaolunwen@gmail.com>
      Unverified
      4979f15c
  11. 05 Sep, 2020 1 commit
  12. 16 Oct, 2019 1 commit
    • zeripath's avatar
      Sign merges, CRUD, Wiki and Repository initialisation with gpg key (#7631) · fcb535c5
      zeripath authored
      This PR fixes #7598 by providing a configurable way of signing commits across the Gitea instance. Per repository configurability and import/generation of trusted secure keys is not provided by this PR - from a security PoV that's probably impossible to do properly. Similarly web-signing, that is asking the user to sign something, is not implemented - this could be done at a later stage however.
      
      ## Features
      - [x] If commit.gpgsign is set in .gitconfig sign commits and files created through repofiles. (merges should already have been signed.)
      - [x] Verify commits signed with the default gpg as valid
      - [x] Signer, Committer and Author can all be different
          - [x] Allow signer to be arbitrarily different - We still require the key to have an activated email on Gitea. A more complete implementation would be to use a keyserver and mark external-or-unactivated with an "unknown" trust level icon.
      - [x] Add a signing-key.gpg endpoint to get the default gpg pub key if available
          - Rather than add a fake web-flow user I've added this as an endpoint on /api/v1/signing-key.gpg
          - [x] Try to match the default key with a user on gitea - this is done at verification time
      - [x] Make things configurable?
          - app.ini configuration done
          - [x] when checking commits are signed need to check if they're actually verifiable too
      - [x] Add documentation
      
      I have decided that adjusting the docker to create a default gpg key is not the correct thing to do and therefore have not implemented this.
      Unverified
      fcb535c5
  13. 12 Oct, 2019 1 commit
    • zeripath's avatar
      Restore functionality for early gits (#7775) · 5e759b60
      zeripath authored
      * Change tests to make it possible to run TestGit with 1.7.2
      
      * Make merge run on 1.7.2
      
      * Fix tracking and staging branch name problem
      
      * Ensure that git 1.7.2 works on tests
      
      * ensure that there is no chance for conflicts
      
      * Fix-up missing merge issues
      
      * Final rm
      
      * Ensure LFS filters run on the tests
      
      * Do not sign commits from temp repo
      
      * Restore tracking fetch change
      
      * Apply suggestions from code review
      
      * Update modules/repofiles/temp_repo.go
      5e759b60
  14. 05 Aug, 2019 1 commit
  15. 31 Jul, 2019 1 commit
  16. 23 Jul, 2019 1 commit
  17. 11 May, 2019 1 commit
    • zeripath's avatar
      Remove local clones & make hooks run on merge/edit/upload (#6672) · ce8de353
      zeripath authored
      
      * Add options to git.Clone to make it more capable
      
      * Begin the process of removing the local copy and tidy up
      
      * Remove Wiki LocalCopy Checkouts
      
      * Remove the last LocalRepo helpers
      
      * Remove WithTemporaryFile
      
      * Enable push-hooks for these routes
      
      * Ensure tests cope with hooks
      Signed-off-by: default avatarAndrew Thornton <art27@cantab.net>
      
      * Remove Repository.LocalCopyPath()
      
      * Move temporary repo to use the standard temporary path
      
      * Fix the tests
      Signed-off-by: default avatarAndrew Thornton <art27@cantab.net>
      
      * Remove LocalWikiPath
      
      * Fix missing remove
      Signed-off-by: default avatarAndrew Thornton <art27@cantab.net>
      
      * Use AppURL for Oauth user link (#6894)
      
      * Use AppURL for Oauth user link
      
      Fix #6843
      
      * Update oauth.go
      
      * Update oauth.go
      
      * internal/ssh: ignore env command totally (#6825)
      
      * ssh: ignore env command totally
      
      * Remove commented code 
      
      Needed fix described in issue #6889
      
      * Escape the commit message on issues update and title in telegram hook (#6901)
      
      * update sdk to latest (#6903)
      
      * improve description of branch protection (fix #6886) (#6906)
      
      The branch protection description text were not quite accurate.
      
      * Fix logging documentation (#6904)
      
      * ENABLE_MACARON_REDIRECT should be REDIRECT_MACARON_LOG
      
      * Allow DISABLE_ROUTER_LOG to be set in the [log] section
      
      * [skip ci] Updated translations via Crowdin
      
      * Move sdk structs to modules/structs (#6905)
      
      * move sdk structs to moduels/structs
      
      * fix tests
      
      * fix fmt
      
      * fix swagger
      
      * fix vendor
      ce8de353
  18. 03 May, 2019 1 commit
  19. 19 Apr, 2019 1 commit
  20. 27 Mar, 2019 1 commit
    • Lunny Xiao's avatar
      move code.gitea.io/git to code.gitea.io/gitea/modules/git (#6364) · d578b71d
      Lunny Xiao authored
      * move code.gitea.io/git to code.gitea.io/gitea/modules/git
      
      * fix imports
      
      * fix fmt
      
      * fix misspell
      
      * remove wrong tests data
      
      * fix unit tests
      
      * fix tests
      
      * fix tests
      
      * fix tests
      
      * fix tests
      
      * fix tests
      
      * enable Debug to trace the failure tests
      
      * fix tests
      
      * fix tests
      
      * fix tests
      
      * fix tests
      
      * fix tests
      
      * comment commit count tests since git clone depth is 50
      
      * fix tests
      
      * update from code.gitea.io/git
      
      * revert change to makefile
      Unverified
      d578b71d
  21. 28 Nov, 2018 1 commit
    • Michael Kuhn's avatar
      Explicitly disable Git credential helper (#5367) · 0222623b
      Michael Kuhn authored
      * Explicitly disable Git credential helper
      
      If the user running Gitea has configured a credential helper, Git
      credentials might leak out of Gitea.
      
      There are two problems with credential helpers when combined with Gitea:
      
      1. Credentials entered by a user when doing a migration or setting up a
         mirror will end up in the credential store. In the worst case, this
         is the plain text file ~/.git-credentials.
      2. Credentials in the credential store will be used for migrations and
         mirrors by all users. For example, if user A sets up a mirror, their
         credentials will be stored. If user B later sets up a mirror from the
         same host and does not enter any credentials, user A's credentials
         will be used.
      
      This PR prepends -c credential.helper= to all Git commands to clear the
      list of helpers. This requires at least Git version 2.9, as previous
      versions will try to load an empty helper instead. For more details, see
      https://github.com/git/git/commit/24321375cda79f141be72d1a842e930df6f41725
      
      * Update git module
      0222623b
  22. 22 Dec, 2016 1 commit
  23. 10 Nov, 2016 1 commit
  24. 06 Nov, 2016 1 commit
  25. 04 Nov, 2016 1 commit