Commit Graph

14 Commits (ba5f2acb9ccb40281ca8ab7eaf9dea6a77eb220d)

Author SHA1 Message Date
wxiaoguang 2b55422cd7
Fix the bug: deploy key with write access can not push ()
Use DeployKeyID to replace the IsDeployKey, then CanWriteCode uses the DeployKeyID to check the write permission.
Lunny Xiao 719bddcd76
Move repository model into models/repo ()
* Some refactors related repository model

* Move more methods out of repository

* Move repository into models/repo

* Fix test

* Fix test

* some improvements

* Remove unnecessary function
Lunny Xiao a666829a37
Move user related model into models/user ()
* Move user related model into models/user

* Fix lint for windows

* Fix windows lint

* Fix windows lint

* Move some tests in models

* Merge
Bo-Yi Wu 167b0f46ef
chore(models): rewrite code format. ()
* chore: rewrite format.

* chore: update format

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: update format

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: Adjacent parameters with the same type should be grouped together

* chore: update format.
zeripath a722dd72db
Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes ()
* Set setting.AppURL as GITEA_ROOT_URL environment variable during pushes

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath d257485bc0
Rename models.ProtectedBranchRepoID to models.EnvRepoID and ensure EnvPusherEmail is set ()
Signed-off-by: Andrew Thornton <art27@cantab.net>
Lunny Xiao 48ce135cc9
Move PushUpdateAddDeleteTags to repository module from models ()
* Move PushUpdateAddDeleteTags to repository module from models

* Fix deadlock on sqlite
Lunny Xiao 5765212c6d
Add owner_name column for table repository for maintaince reason ()
* Add owner_name column for table repository for maintaince reason

* refactor

* Fix tests

* fix test

* fix bug when fork repository

Co-authored-by: zeripath <art27@cantab.net>
zeripath 4acca9d2e8
Properly enforce gitea environment for pushes ()
 attempted to enforce the gitea environment for pushes - unfortunately it tested the settings before they were actually read in - and therefore does not do that!
Lunny Xiao 6782a704ef Fix bug create/edit wiki pages when code master branch protected ()
* fix bug create/edit wiki pages when code master branch protected

* improve FullPushingEnvironment function
zeripath 3563650bdb Run hooks on merge/edit and cope with protected branches ()
* Fix  by checking PullRequest ID on pushing

* Ensure we have the owner name, the pr attributes and the the issue

* Fix TestSearchRepo by waiting till indexing is done

* Update integrations/repo_search_test.go

* changes as per @mrsdizzie

* missing comma

* Spelling mistake

* Fix full pushing environment
zeripath 356854fc5f Move serv hook functionality & drop GitLogger ()
* Move hook functionality internally

* Internalise serv logic

* Remove old internal paths

* finally remove the gitlogger

* Disallow push on archived repositories

* fix lint error

* Update modules/private/key.go

* Update routers/private/hook.go

* Update routers/private/hook.go

* Update routers/private/hook.go

* Updated routers/private/serv.go

* Fix LFS Locks over SSH

* rev-list needs to be run by the hook process

* fixup

* Improve git test

* Ensure that the lfs files are created with a different prefix

* Reduce the replication in git_test.go

* slight refactor

* Remove unnecessary "/"

* Restore ensureAnonymousClone

* Restore ensureAnonymousClone

* Run rev-list on server side

* Try passing in the alternative directories instead

* Mark test as skipped

* Improve git test

* Ensure that the lfs files are created with a different prefix
* Reduce the replication in git_test.go
* Remove unnecessary "/"
zeripath 96b412bb87 Stop running hooks on pr merge ()
* Stop running hooks on pr merge

* Remove SSH_ORIGINAL_COMMAND from the pushing environment
zeripath ce8de35334 Remove local clones & make hooks run on merge/edit/upload ()
* 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: Andrew Thornton <art27@cantab.net>

* Remove Repository.LocalCopyPath()

* Move temporary repo to use the standard temporary path

* Fix the tests

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Remove LocalWikiPath

* Fix missing remove

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Use AppURL for Oauth user link ()

* Use AppURL for Oauth user link

Fix 

* Update oauth.go

* Update oauth.go

* internal/ssh: ignore env command totally ()

* ssh: ignore env command totally

* Remove commented code 

Needed fix described in issue 

* Escape the commit message on issues update and title in telegram hook ()

* update sdk to latest ()

* improve description of branch protection (fix ) ()

The branch protection description text were not quite accurate.

* Fix logging documentation ()

* 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 ()

* move sdk structs to moduels/structs

* fix tests

* fix fmt

* fix swagger

* fix vendor