aboutsummaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* Update HTTP status codes to modern codes (#18063)KN4CK3R2022-03-2327-83/+81
| | | | | | * 2xx/3xx/4xx/5xx -> http.Status... * http.StatusFound -> http.StatusTemporaryRedirect * http.StatusMovedPermanently -> http.StatusPermanentRedirect
* Clean paths when looking in Storage (#19124)zeripath2022-03-221-11/+10
| | | | | | | | | | | | | * Clean paths when looking in Storage Ensure paths are clean for minio aswell as local storage. Use url.Path not RequestURI/EscapedPath in storageHandler. Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review Co-authored-by: Lauris BH <lauris@nix.lv>
* Use the new/choose link for New Issue on project page (#19172)zeripath2022-03-221-2/+9
| | | | | | | | | Extend issues/new/choose to pass the project id and change New Issue link on project page to use new/choose Fix #19170 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use `ctx` instead of `db.DefaultContext` in some ↵wxiaoguang2022-03-2225-64/+54
| | | | | | | | | | | | packages(routers/services/modules) (#19163) * Remove `db.DefaultContext` usage in routers, use `ctx` directly * Use `ctx` directly if there is one, remove some `db.DefaultContext` in `services` * Use ctx instead of db.DefaultContext for `cmd` and some `modules` packages * fix incorrect context usage
* Fix the bug: deploy key with write access can not push (#19010)wxiaoguang2022-03-224-43/+63
| | | Use DeployKeyID to replace the IsDeployKey, then CanWriteCode uses the DeployKeyID to check the write permission.
* Renamed ctx.User to ctx.Doer. (#19161)KN4CK3R2022-03-22118-807/+807
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix NPE `/repos/issues/search` when not signed in (#19154)Gusted2022-03-201-4/+9
| | | | | | - Don't panic when on `/repos/issues/search?{created,assigned,mentioned,review_requested}=true` when client didn't pass any authentication. - Resolves #19115
* Use custom favicon when viewing static files if it exists (#19130)Abheek Dhawan2022-03-191-0/+5
| | | | | Redirect `/favicon.ico` to `/assets/img/favicon.png`. Fix #19109
* Do not send notification emails to inactive users (#19131)zeripath2022-03-191-1/+1
| | | | | | | | Emails should not be sent to inactive users except for Activate and ResetPassword messages. Fix #18950 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Do not send activation email if manual confirm is set (#19119)zeripath2022-03-181-0/+6
| | | | | | | | | | If the mailer is configured then even if Manual confirm is set an activation email is still being sent because `handleUserCreated` is not checking for this case. Fix #17263 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Handle email address not exist. (#19089)KN4CK3R2022-03-151-1/+1
|
* Restrict email address validation (#17688)Lunny Xiao2022-03-145-4/+16
| | | This didn't follow the RFC but it's a subset of that. I think we should narrow the allowed chars at first and discuss more possibility in future PRs.
* Fix lfs bug (#19072)Lunny Xiao2022-03-141-0/+13
| | | * Fix lfs bug
* RSS/Atom support for Repos (#19055)65432022-03-136-64/+85
| | | | | | | * support for repos * refactor * advertise the feeds via meta tags * allow feed suffix and feed header * optimize performance
* Feeds: render markdown to html (#19058)Norwin2022-03-121-2/+23
| | | * feeds: render markdown to html
* Prevent 500 when there is an error during new auth source post (#19041)zeripath2022-03-101-5/+2
| | | | | Fix #19036 Signed-off-by: Andrew Thornton <art27@cantab.net>
* RSS/Atom support for Orgs (#17714)65432022-03-102-29/+29
| | | part of #569
* Add button for issue deletion (#19032)Otto Richter (fnetX)2022-03-092-0/+16
| | | | Co-authored-by: Norwin <noerw@users.noreply.github.com> Co-authored-by: 6543 <6543@obermui.de>
* Fix wrong scopes caused by empty scope input (#19029)wxiaoguang2022-03-081-1/+13
|
* Add config option to disable "Update branch by rebase" (#18745)Jimmy Praet2022-03-042-0/+5
|
* ignore missing comment for user notifications (#18954)eladyn2022-03-031-1/+1
| | | | | | | | | | * ignore missing comment for user notifications * instead fix bug in notifications model * use local variable instead Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Add note to GPG key response if user has no keys (#18961)KN4CK3R2022-03-021-0/+3
| | | | | | | | | | | * Prevent invalid key response. * Display note instead of 404 response. * Fixed test. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Refactor admin user filter query parameters (#18965)wxiaoguang2022-03-022-2/+11
| | | | Only pass `status_filter` on admin page Use a more general method to pass query parameters, remove hard-coded keys
* Send 404 on `/{org}.gpg` (#18959)Gusted2022-03-011-1/+9
|
* Accounts with WebAuthn only (no TOTP) now exist ... fix code to handle that ↵65432022-03-021-10/+25
| | | | case (#18897)
* Fix admin user list pagination (#18957)Otto Richter (fnetX)2022-03-011-0/+1
|
* [API] Allow removing issues (#18879)Otto Richter (fnetX)2022-03-012-1/+48
| | | | | | | | Add new feature to delete issues and pulls via API Co-authored-by: fnetx <git@fralix.ovh> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Fix page and missing return on unadopted repos API (#18848)qwerty2872022-02-271-0/+4
| | | | | | | | | * Fix page and missing return on unadopted repos API Page must be 1 if it's not specified and it should return after sending an internal server error. * Allow ignore pages Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Uncapitalize errors (#18915)Gusted2022-02-263-9/+9
| | | | | - See: https://github.com/golang/go/wiki/CodeReviewComments#error-strings Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* BeforeSourcePath should point to base commit (#18799)Jimmy Praet2022-02-251-2/+2
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update assignees check to include any writing team and change org sidebar ↵zeripath2022-02-231-0/+2
| | | | | | | | | | | | (#18680) Following the merging of #17811 teams can now have differing write and readonly permissions, however the assignee list will not include teams which have mixed perms. Further the org sidebar is no longer helpful as it can't describe these mixed permissions situations. Fix #18572 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Lock gofumpt to v0.3.0 and run it (#18866)silverwind2022-02-231-1/+2
| | | | | We can't depend on `latest` version of gofumpt because the output will not be stable across versions. Lock it down to the latest version released yesterday and run it again.
* Don't report signal: killed errors in serviceRPC (#18850)zeripath2022-02-221-1/+3
| | | | | Fix #18849 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Show fullname on issue edits and gpg/ssh signing info (#18827)Wim2022-02-201-1/+9
| | | | | Show missing full names when configured to do so Co-authored-by: zeripath <art27@cantab.net>
* Fix template bug of LFS lock (#18784)Lunny Xiao2022-02-161-0/+1
|
* Fix display time of milestones (#18753)René Schaar2022-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * Fix display time of milestones * Move the SecToTime function From the models/issue_stopwatch.go file to the modules/util package * Rename the sec_to_time file * Updated formatting * Include copyright notice in sec_to_time.go * Apply PR review suggestions - Update copyright notice dates to 2022 - Change `1 day 3h 5min 7s` to `1d 3h 5m 7s` * Rename hrs var and combine conditions * Update unit tests to match new time pattern Changed `1min` to `1m` Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix broken cancel button link on patch page (#18718)Lunny Xiao2022-02-142-3/+3
| | | | | | | | | | * Fix broken cacnel button link on patch page * remove treepath="patch" elsewhere too Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Add LDAP group sync to Teams, fixes #1395 (#16299)Sven Seeberg2022-02-111-0/+2
| | | | | | | | | | * Add setting for a JSON that maps LDAP groups to Org Teams. * Add log when removing or adding team members. * Sync is being run on login and periodically. * Existing group filter settings are reused. * Adding and removing team members. * Sync not existing LDAP group. * Login with broken group map JSON.
* Change git.cmd to RunWithContext (#18693)Martin Scholz2022-02-111-8/+16
| | | | | | | Change all `cmd...Pipeline` commands to `cmd.RunWithContext`. #18553 Co-authored-by: Martin Scholz <martin.scholz@versasec.com>
* Always set PullRequestWorkInProgressPrefixes in PrepareViewPullInfo (#18713)zeripath2022-02-111-2/+2
| | | | | | | | Move setting PullRequestWorkInProgressPrefixes to the start of PrepareViewPullInfo. Fix #18706 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Disable unnecessary OpenID/OAuth2 elements (#18491)Paweł Bogusławski2022-02-091-4/+11
| | | | | | | This mod fixes disabling unnecessary OpenID elements. Related: https://github.com/go-gitea/gitea/pull/13129 Author-Change-Id: IB#1115256
* Add apply-patch, basic revert and cherry-pick functionality (#17902)zeripath2022-02-095-0/+422
| | | | | | | | | | | | | | | This code adds a simple endpoint to apply patches to repositories and branches on gitea. This is then used along with the conflicting checking code in #18004 to provide a basic implementation of cherry-pick revert. Now because the buttons necessary for cherry-pick and revert have required us to create a dropdown next to the Browse Source button I've also implemented Create Branch and Create Tag operations. Fix #3880 Fix #17986 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update object repo with the migrated repository (#18684)Hugo Hoitink2022-02-091-1/+1
| | | | | | | | | When migrating a repository (from GitHub) using the API (**POST** `repos/migrate`), the Code Indexer is not updated. Searching in the user interface will not return any results. When migrating the same repository using **+/New Migration** in the web interface, the search index is updated and searching works as expected. Caused by the fact that object `repo` is never updated with the migrated repo so `setting.Indexer.RepoIndexerEnabled && !repo.IsEmpty` in `modules/notification/indexer/indexer.go:NotifyMigrateRepository` always evaluates to `false`. Tested with gitea:1.16.1, MariaDB:10, Breve in `Run Mode: Dev`.
* Added auto-save whitespace behavior if it changed manually (#15566)Viktor Suprun2022-02-081-3/+21
|
* Refactor i18n, use Locale to provide i18n/translation related functions (#18648)wxiaoguang2022-02-083-16/+7
| | | | | | | | * remove unnecessary web context data fields, and unify the i18n/translation related functions to `Locale` * in development, show an error if a translation key is missing * remove the unnecessary loops `for _, lang := range translation.AllLangs()` for every request, which improves the performance slightly * use `ctx.Locale.Language()` instead of `ctx.Data["Lang"].(string)` * add more comments about how the Locale/LangType fields are used
* Delete old git.NewCommand() and use it as git.NewCommandContext() (#18552)65432022-02-064-9/+9
|
* Ensure that blob-excerpt links work for wiki (#18587)zeripath2022-02-052-1/+29
| | | | | | | | It appears that the blob-excerpt links do not work on the wiki - likely since their introduction. This PR adds support for the wiki on these links. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent panic on prohibited user login with oauth2 (#18562)zeripath2022-02-031-1/+1
| | | | | | | | | | | There was an unfortunate regression in #17962 where following detection of the UserProhibitLogin error the err is cast to a pointer by mistake. This causes a panic due to an interface error. Fix #18561 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Collaborator trust model should trust collaborators (#18539)zeripath2022-02-022-2/+2
| | | | | | | | | | * Collaborator trust model should trust collaborators There was an unintended regression in #17917 which leads to only repository admin commits being trusted. This PR restores the old logic. Fix #18501 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add `GetUserTeams` (#18499)Gusted2022-02-012-7/+6
| | | | | | | | | | | | | | | | | | | | * COrrect use `UserID` in `SearchTeams` - Use `UserID` in the `SearchTeams` function, currently it was useless to pass such information. Now it does a INNER statement to `team_user` which obtains UserID -> TeamID data. - Make OrgID optional. - Resolves #18484 * Seperate searching specific user * Add condition back * Use correct struct type Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>