aboutsummaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* Add option to close issues via commit on a non master branch (#5992)Lanre Adelowo2019-02-101-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix metrics auth token detection (#6006)Paul2019-02-091-1/+1
| | | Signed-off-by: Pauls Barkans <paulsb@gmail.com>
* Feature - #3031 - search for org repos (#5986)Richard Mahn2019-02-081-9/+60
|
* Fix #5799 - swagger for mergePullRequest (#5996)Thomas Loubiou2019-02-082-0/+6
|
* Add API to list tags (#5850)Lunny Xiao2019-02-074-0/+73
| | | | | | | | | | | | | | * Add API to list tags * update dependency gitea sdk vendor * fix swagger generation * fix swagger * add tests * update code.gitea.io/git vendor
* fix bug when deleting a linked account will removed all (#5989)Lunny Xiao2019-02-071-3/+8
|
* Expose issue stopwatch toggling via API (#5970)Lanre Adelowo2019-02-062-0/+142
|
* Feature - Pagination for git tree API (#5838)Richard Mahn2019-02-062-18/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feature - Pagination for git tree API * Handles case when page is negative * Does a for loop over the start and end rather than all entries * Removed redundent logic * Adds per_page as a query parameter * Adds DEFAULT_GIT_TREES_PER_PAGE for settings, ran make fmt * Fix typo in cheat-sheet en * Makes page start at 1, generated swagger * Use updates to SDK * Updates to use latest sdk * Updates swagger for tree api * Adds test for GetTreeBySHA * Updates per PR reviews * Updates per PR reviews * Remove file * Formatting * Fix to swagger file * Fix to swagger * Update v1_json.tmpl * Fix to swagger file
* Allow Macaron to be set to log through to gitea.log (#5667)zeripath2019-02-051-3/+26
| | | | | | * Allow Macaron to be set to log through gitea.log Fix #4291
* Fix serving of raw wiki files other than .md (#5814)Gabriel Silva Simões2019-02-053-16/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-0/+5
| | | | | | | | | | * 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-053-0/+33
| | | | | | | | | | | | | | | | | | | | * 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-041-1/+15
|
* Issue 5924 fix compare button (#5929)zeripath2019-02-032-4/+4
| | | | | | | | | | | | * Revert #5877 This unfortunately was not the solution. Signed-off-by: Andrew Thornton <art27@cantab.net> * Change permission check to create pull requests to CanReadIssuesOrPulls Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix ssh deploy and user key constraints (#1357) (#5939)zeripath2019-02-034-0/+24
| | | | | | | | | | | | | | | | 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
* Add single commit API support (#5843)Lunny Xiao2019-02-023-0/+129
| | | | * add single commit API support
* Disable redirect for i18n (#5910)techknowlogick2019-01-311-1/+1
|
* Provide better panic handling (#5902)zeripath2019-01-301-0/+3
| | | | | | | This PR gitea'ises the macaron.Recovery() handler meaning that in the event of panic we get proper gitea 500 pages and the stacktrace is logged with the gitea logger. Signed-off-by: Andrew Thornton <art27@cantab.net>
* don't allow pull requests to be created on an archived repository (#5883)Lanre Adelowo2019-01-302-7/+14
| | | | | | * don't allow pull requests to be created on an archived repository Also disable the "PR" button if the repo is archived * Refuse creating an issue/PR via API calls too
* respect value of REQUIRE_SIGNIN_VIEW (#5901)Lanre Adelowo2019-01-301-1/+1
|
* Fix new release creation API to allow empty target (#5870)Lauris BH2019-01-301-0/+4
| | | | | | | | * Fix new release creation API to allow empty target * Add more test cases * Update swagger
* if repo does not exist, show a 404 not a 500 (#5900)Lanre Adelowo2019-01-301-1/+4
|
* New Issue ?body= query (#5851)kekero2019-01-281-0/+2
| | | | | | | | * New Issue ?body= query * Override issue template with body query * Add documentation for issue body query
* API: Fix null pointer in attempt to Sudo if not logged in (#5872)zeripath2019-01-281-1/+1
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix MinInterval (#5856)yasuokav2019-01-261-1/+1
| | | Fixes #5847
* update swagger for release API pagination (#5841)Lunny Xiao2019-01-251-0/+8
|
* improve the releases api paging (#5831)Lunny Xiao2019-01-241-1/+17
| | | | | | * improve the releases api paging * add max limit on API paging
* Added docs for the tree api (#5834)kolaente2019-01-242-0/+31
| | | | | | | | * Added docs for the tree api * Added missing response definition * Fixed swagger docs
* Fix topics saving internal error and disable for archived repos (#5821)Lauris BH2019-01-241-1/+1
|
* New API routes added (#5594)Shashvat Kedia2019-01-233-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-236-22/+69
|
* Pooled and buffered gzip implementation (#5722)zeripath2019-01-231-2/+2
| | | | | | | | | | | | | | | | | | | * 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-4/+25
|
* Disallow empty titles (#5785)Lanre Adelowo2019-01-213-1/+22
| | | | | | | | | | | | * add util method and tests * make sure the title of an issue cannot be empty * wiki title cannot be empty * pull request title cannot be empty * update to make use of the new util methof
* Ensure error is logged on db reconnection attempts (#5780)Paul Brackin2019-01-201-1/+1
| | | Unfortunately a scoping problem was missed on the previous PR which meant that the only nil error was logged on failure to connect to the db. This pr fixes this.
* Make db connect more robust (#5738)Paul Brackin2019-01-191-4/+24
|
* Refactor repo.isBare to repo.isEmpty #5629 (#5714)zeripath2019-01-175-28/+28
| | | | | | | | * 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-172-0/+10
| | | | | | * notification for indexer * use NullNotifier as parent struct
* api: Add missing GET teams endpoints (#5382)Harshit Bansal2019-01-162-0/+68
| | | | | | | | | | | | | | | | | | | | * api: Add an endpoint to list a particular member of team. * models: Rename `GetUserTeams()` to `GetUserOrgTeams()` in `org_team` model. `GetUserTeams()` sounds a bit misnomer since it actually returns the teams that user belongs to in a given organization rather than all the teams across all the organization that the user has joined. * models: Add `GetUserTeams()`. Returns all the teams that a user belongs to. * api: Add an endpoint for GET '/user/teams'. A GET request to this endpoint lists all the teams that a user belongs to.
* Add Default Pull Request Title (#5735)Elijah Oyekunle2019-01-161-2/+17
| | | | | | | | * add default PR title Set default PR title to commit summary if there's a single commit on the head branch, else set it to the head branch name * set default PR description If there's a single commit on the head branch, and it's multiline, then set it as the default PR description
* Add proper CORS preflight origin validation (#5740)silverwind2019-01-151-2/+14
|
* Support CORS headers to git smart http protocol (#5719)Lunny Xiao2019-01-141-0/+12
|
* Prioritize "readme.md" (#5691)Khaled Hamed2019-01-141-5/+18
| | | | | | | | * prioritize readme.md * Improve IsReadmeFile * Add more tests
* Do not display the raw OpenID error in the UI (#5705)zeripath2019-01-121-1/+2
| | | | | | | | | | | | | | | | | * Do not display the raw OpenID error in the UI If there are no `WHITELIST_URIS` or `BLACKLIST_URIS` set in the openid section of the app.ini, it is possible that gitea can leak sensitive information about the local network through the error provided by the UI. This PR hides the error information and logs it. Fix #4973 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update auth_openid.go Place error log within the `err != nil` branch.
* Allow for user specific themes (#5668)Lanre Adelowo2019-01-092-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | * add migration and basic UI for changing a user's theme * update user themem * use right text on button * load theme based on users' selection * load theme based on users' selection in pwa too * update sample config * delete older theme loading * implement AfterLoad to set users' theme properly * set up default theme when creating a user. This uses the installation wide theme * use flash messages for error * set default theme when creating a user from the cli * fix @lunny review
* Added URL mapping for Release attachments like on github.com (#1707)gdeverlant2019-01-062-0/+35
|
* fix commit page showing status for current default branch (#5650)Julian2019-01-061-1/+1
| | | Signed-off-by: Julian Tölle <julian.toelle97@gmail.com>
* SECURITY: protect DeleteFilePost et al with cleanUploadFileName (#5631)zeripath2019-01-041-2/+18
| | | | | This commit wraps more of the TreePaths with cleanUploadFileName Signed-off-by: Andrew Thornton <art27@cantab.net>
* branch: Trigger update when deleting branch via UI. (#5617)Harshit Bansal2019-01-021-1/+13
| | | Fixes: #5309.
* Issue is not overdue when it is on the same date #5566 (#5568)Rodrigo Villablanca Vásquez2019-01-012-5/+11
| | | | | | | | | | * Due date time of issues and milestones is set to 23:59:59 * Add docs * make gen swagger * fix swagger gen