summaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Change sqlite DB path default to data directory (#6198)John Olheiser2019-02-271-1/+2
|
* fix bug when update owner team then visit team's repo return 404 (#6119)Lunny Xiao2019-02-222-0/+20
|
* Admins can now do unlimited page size user search (listAllUsers & ↵John Olheiser2019-02-211-0/+3
| | | | | listAllOrgs) (#6143) Non-admins will default to 10 page size
* Add more tests and docs for issue indexer, add db indexer type for searching ↵Lunny Xiao2019-02-212-0/+59
| | | | | | | | | | | | | | from database (#6144) * add more tests and docs for issue indexer, add db indexer type for searching from database * fix typo * fix typo * fix lint * improve docs
* refactor issue indexer, add some testing and fix a bug (#6131)Lunny Xiao2019-02-213-152/+5
| | | | | | | | * refactor issue indexer, add some testing and fix a bug * fix error copyright year on comment header * issues indexer package import keep consistent
* Refactor issue indexer (#5363)Lunny Xiao2019-02-196-94/+126
|
* Show email if the authenticated user owns the profile page being requested ↵Lanre Adelowo2019-02-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for (#4981) * Show email if the authenticated user owns the profile page being requested for. Also removed `setting.UI.ShowUserEmail` as it's documentation says it only controls the email setting on the explore page * fix current user check... This prevents a panic as a user must be signed in before ctx.User is called * fix panic in tests * try to fix tests * Update year * Test CI fail * Revert change * User 3 is not allowed to authorize * Set user2 email to be private * Change to user4 in explore page as user2 now has private email option set
* Fix prohibit login check on authorization (#6106)Lunny Xiao2019-02-192-4/+55
| | | | | | | | | | | | * fix bug prohibit login not applied on dashboard * fix tests * fix bug user status leak * fix typo * return after render
* Implement "conversation lock" for issue comments (#5073)Lanre Adelowo2019-02-185-0/+79
|
* Allow to set organization visibility (public, internal, private) (#1763)Rémy Boulanouar2019-02-185-13/+194
|
* Fix deadlock in webhook PullRequest (#6102)zeripath2019-02-173-13/+15
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix panic: template: repo/issue/list:210: unexpected "=" in operand (#6041)Zsombor2019-02-131-0/+19
|
* Refactor editor upload, update and delete to use git plumbing and add LFS ↵zeripath2019-02-124-572/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | support (#5702) * Use git plumbing for upload: #5621 repo_editor.go: UploadRepoFile * Use git plumbing for upload: #5621 repo_editor.go: GetDiffPreview * Use git plumbing for upload: #5621 repo_editor.go: DeleteRepoFile * Use git plumbing for upload: #5621 repo_editor.go: UploadRepoFiles * Move branch checkout functions out of repo_editor.go as they are no longer used there * BUGFIX: The default permissions should be 100644 This is a change from the previous code but is more in keeping with the default behaviour of git. Signed-off-by: Andrew Thornton <art27@cantab.net> * Standardise cleanUploadFilename to more closely match git See verify_path in: https://github.com/git/git/blob/7f4e64169352e03476b0ea64e7e2973669e491a2/read-cache.c#L951 Signed-off-by: Andrew Thornton <art27@cantab.net> * Redirect on bad paths Signed-off-by: Andrew Thornton <art27@cantab.net> * Refactor to move the uploading functions out to a module Signed-off-by: Andrew Thornton <art27@cantab.net> * Add LFS support Signed-off-by: Andrew Thornton <art27@cantab.net> * Update upload.go attribution header Upload.go is essentially the remnants of repo_editor.go. The remaining code is essentially unchanged from the Gogs code, hence the Gogs attribution. * Delete upload files after session committed * Ensure that GIT_AUTHOR_NAME etc. are valid for git see #5774 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add in test cases per @lafriks comment * Add space between gitea and github imports Signed-off-by: Andrew Thornton <art27@cantab.net> * more examples in TestCleanUploadName Signed-off-by: Andrew Thornton <art27@cantab.net> * fix formatting Signed-off-by: Andrew Thornton <art27@cantab.net> * Set the SSH_ORIGINAL_COMMAND to ensure hooks are run Signed-off-by: Andrew Thornton <art27@cantab.net> * Switch off SSH_ORIGINAL_COMMAND Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add option to close issues via commit on a non master branch (#5992)Lanre Adelowo2019-02-108-17/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fixes #5957 * add tests to make sure config option is respected * use already defined struct * - use migration to make the flag repo wide not for the entire gitea instance Also note that the config value can still be set so as to be able to control the value for new repositories that are to be created - fix copy/paste error in copyright header year and rearrange import - use repo config instead of server config value to determine if a commit should close an issue - update testsuite * use global config only when creating a new repository * allow repo admin toggle feature via UI * fix typo and improve testcase * fix fixtures * add DEFAULT prefix to config value * fix test
* disable git fsck for mirrored repos by default (#6018)Lanre Adelowo2019-02-091-1/+1
|
* Feature - #3031 - search for org repos (#5986)Richard Mahn2019-02-081-0/+9
|
* Add API to list tags (#5850)Lunny Xiao2019-02-071-0/+24
| | | | | | | | | | | | | | * Add API to list tags * update dependency gitea sdk vendor * fix swagger generation * fix swagger * add tests * update code.gitea.io/git vendor
* Fix empty ssh key importing in ldap (#5984)zeripath2019-02-061-3/+6
|
* Fix serving of raw wiki files other than .md (#5814)Gabriel Silva Simões2019-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix serving of raw wiki files other than .md Closes #4690. Closes #4395. Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Simplify code at routers/repo/wiki.go Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Add more files to user2/repo1.wiki for testing Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Update macaron to v1.3.2 Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Add tests for WikiRaw Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Fix NewResponseWriter usage due to macaron update Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com> * Add raw to reserved wiki names Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>
* Pull request conflict files detection (#5951)Lunny Xiao2019-02-051-5/+30
| | | | | | | | | | * add conflict detection * test pull request conflict files * fix detection files number * fix comments
* Automatically clear stopwatch on merging a PR (#4327)Lanre Adelowo2019-02-051-2/+14
| | | | | | | | | | | | | | | | | | | | * Don't display buttons if there are no notices * clear stopwatch on merging a PR * remove redundant gt check * use ctx.Flash as per @bkcsoft comment * stop timer on closing issues/PRs too * updated translation as per review * redirect to login page after successfully activating account * remove unrelated changes * stop timer for issues that are closed via commits too..Not just the 'close' UI button
* Add label names as filter in issue search api (#5946)Lanre Adelowo2019-02-042-1/+38
|
* Fix ssh deploy and user key constraints (#1357) (#5939)zeripath2019-02-032-35/+73
| | | | | | | | | | | | | | | | 1. A key can either be an ssh user key or a deploy key. It cannot be both. 2. If a key is a user key - it can only be associated with one user. 3. If a key is a deploy key - it can be used in multiple repositories and the permissions it has on those repositories can be different. 4. If a repository is deleted, its deploy keys must be deleted too. We currently don't enforce any of this and multiple repositories access with different permissions doesn't work at all. This PR enforces the following constraints: - [x] You should not be able to add the same user key as another user - [x] You should not be able to add a ssh user key which is being used as a deploy key - [x] You should not be able to add a ssh deploy key which is being used as a user key - [x] If you add an ssh deploy key to another repository you should be able to use it in different modes without losing the ability to use it in the other mode. - [x] If you delete a repository you must delete all its deploy keys. Fix #1357
* show user who created the repository instead of the organization in action ↵Lanre Adelowo2019-02-041-2/+2
| | | | feed (#5948)
* handle milestone events for issues and PR (#5947)Lanre Adelowo2019-02-031-0/+8
|
* Remove all CommitStatus when a repo is deleted (#5940)John Olheiser2019-02-021-0/+1
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* fix log output (#5938)Sergey Romanov2019-02-021-1/+1
|
* support reviewing on a deleted file path (#5880)Lanre Adelowo2019-02-011-2/+3
|
* Only allow local login if password is non-empty (#5906)zeripath2019-01-301-1/+1
|
* Fix go-get URL generation (#5905)Lauris BH2019-01-301-1/+2
|
* Don't discard the value of DISABLE_REGULAR_ORG_CREATION (#5886)Lanre Adelowo2019-01-302-0/+45
| | | | | * Consider the configuration value of DISABLE_REGULAR_ORG_CREATION when creating a user
* Also ensure the repo is loaded (#5895)zeripath2019-01-291-0/+4
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Ensure issue.Poster is loaded in mailIssueCommentToParticipants (#5891)zeripath2019-01-291-2/+2
| | | | | | Previous code could potentially dereference nil - this PR ensures that the poster is loaded before dereferencing it. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix an error while adding a dependency via UI. (#5862)Harshit Bansal2019-01-272-2/+3
| | | Fixes: #5783
* Config option to disable automatic repo watching (#5852)sebastian-sauer2019-01-272-14/+24
| | | | | | | | | Add a new config option to enable / disable the automatic watching of repos for new repositories and if a user is added to a team. Fixes #653 Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
* Fix failing migration v67 (#5849)Jakub Arbet2019-01-261-8/+8
| | | Fixes #5848
* fix delete correct temp directory (#5839)yasuokav2019-01-251-1/+1
|
* Ensure valid git author names passed in signatures (#5774)zeripath2019-01-244-7/+60
| | | | | | | | | | | | | | | | | | | | * Ensure valid git author names passed in signatures Fix #5772 - Git author names are not allowed to include `\n` `<` or `>` and must not be empty. Ensure that the name passed in a signature is valid. * Account for pathologically named external users LDAP and the like usernames are not checked in the same way that users who signup are. Therefore just ensure that user names are also git safe and if totally pathological - Set them to "user-$UID" * Add Tests and adjust test users Make our testcases a little more pathological so that we be sure that integration tests have a chance to spot these cases. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make sure .git/info is created before generating .git/info/sparse-che… (#5825)Mura Li2019-01-241-1/+5
| | | | | | * Make sure .git/info is created before generating .git/info/sparse-checkout * fix permissions
* When creating new repository fsck option should be enabled (#5817)Lauris BH2019-01-231-6/+7
|
* New API routes added (#5594)Shashvat Kedia2019-01-231-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New API routes added * Comments added * Build fix * swagger_v1_json.tmpl without new line character * Typo fix * Code review changes * Code review changes * Add copyright * Add copyright * Add copyright * Update per @lafriks feedback * Update org.go * Update user.go * Update user.go * make fmt
* Feature: Archive repos (#5009)kolaente2019-01-231-2/+11
|
* Optimize pulls merging (#4921)Mura Li2019-01-231-16/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Optimize pulls merging By utilizing `git clone -s --no-checkout` rather than cloning the whole repo. * Use sparse-checkout to speedup pulls merge * Use bytes.Buffer instead of strings.Builder for backward compatibility * Fix empty diff-tree output for repos with only the initial commit * Fix missing argument for the format string * Rework diff-tree-list generation * Remove logging code * File list for sparse-checkout must be prefix with / Otherwise, they would match all files with the same name under subdirectories. * Update onto the rebased head * Use referecen repo to avoid fetching objects
* Pooled and buffered gzip implementation (#5722)zeripath2019-01-231-8/+8
| | | | | | | | | | | | | | | | | | | * Pooled and buffered gzip implementation * Add test for gzip * Add integration test * Ensure lfs check within transaction The previous code made it possible for a race condition to occur whereby a LFSMetaObject could be checked into the database twice. We should check if the LFSMetaObject is within the database and insert it if not in one transaction. * Try to avoid primary key problem in postgres The integration tests are being affected by https://github.com/go-testfixtures/testfixtures/issues/39 if we set the primary key high enough, keep a count of this and remove at the end of each test we shouldn't be affected by this.
* Add the ability to use multiple labels as filters(#5786)Lauris BH2019-01-223-15/+41
|
* fix migration 78 error mssql (#5791)Lunny Xiao2019-01-211-3/+2
|
* Fix the v78 migration script (#5776)zeripath2019-01-191-0/+12
| | | | | | | | Unfortunately the last fix didn't completely fix the migration to v79 of the db due to bug with schema locking during Sync2. This should fix this issue. Fix #5759 Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix migration bug (#5762)Lunny Xiao2019-01-181-8/+28
|
* Refactor repo.isBare to repo.isEmpty #5629 (#5714)zeripath2019-01-175-14/+58
| | | | | | | | * Refactor repo.isBare to repo.isEmpty #5629 Signed-off-by: Andrew Thornton <art27@cantab.net> * Remove Sync call
* Refactor notification for indexer (#5111)Lunny Xiao2019-01-174-15/+1
| | | | | | * notification for indexer * use NullNotifier as parent struct