aboutsummaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Fix OAuth Source Edit Page (#18495)zeripath2022-01-312-0/+7
| | | | | | | | * Fix OAuth Source Edit Page to ensure restricted and group settings are set * Also tolerate []interface in the groups Fix #18432 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Allow to filter repositories by language in explore, user and organization ↵Lauris BH2022-01-283-0/+20
| | | | repositories lists (#18430)
* Automatically pause queue if index service is unavailable (#15066)Lauris BH2022-01-275-17/+35
| | | | | | * Handle keyword search error when issue indexer service is not available * Implement automatic disabling and resume of code indexer queue
* Only view milestones from current repo (#18414)zeripath2022-01-262-3/+3
| | | | | | The endpoint /{username}/{reponame}/milestone/{id} is not currently restricted to the repo. This PR restricts the milestones to those within the repo. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Validate migration files (#18203)Aravinth Manivannan2022-01-261-4/+6
| | | | | | | JSON Schema validation for data used by Gitea during migrations Discussion at https://forum.forgefriends.org/t/common-json-schema-for-repository-information/563 Co-authored-by: Loïc Dachary <loic@dachary.org>
* Use base32 for 2FA scratch token (#18384)wxiaoguang2022-01-262-2/+2
| | | | * Use base32 for 2FA scratch token * rename Secure* to Crypto*, add comments
* API: Return primary language and repository language stats API URL (#18396)Lauris BH2022-01-252-0/+10
|
* Fix partial cloning a repo (#18373)Gusted2022-01-231-1/+1
| | | | | | | | - Pass the Global command args into serviceRPC. - Fixes error with partial cloning. - Add partial clone test - Include diff Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Switch to non-deprecation setting (#18358)Gusted2022-01-231-1/+1
| | | | | | * Switch to non-deprecation setting (Avoid by-default: "Deprecated fallback `[server]` `LFS_CONTENT_PATH` present. Use `[lfs]` `PATH` instead. This fallback will be removed in v1.18.0") * Update all references
* Add packagist webhook (#18224)Dr. Tobias Quathamer2022-01-232-0/+103
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Always use git command but not os.Command (#18363)Lunny Xiao2022-01-231-13/+10
|
* Pause queues (#15928)zeripath2022-01-222-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Start adding mechanism to return unhandled data Signed-off-by: Andrew Thornton <art27@cantab.net> * Create pushback interface Signed-off-by: Andrew Thornton <art27@cantab.net> * Add Pausable interface to WorkerPool and Manager Signed-off-by: Andrew Thornton <art27@cantab.net> * Implement Pausable and PushBack for the bytefifos Signed-off-by: Andrew Thornton <art27@cantab.net> * Implement Pausable and Pushback for ChannelQueues and ChannelUniqueQueues Signed-off-by: Andrew Thornton <art27@cantab.net> * Wire in UI for pausing Signed-off-by: Andrew Thornton <art27@cantab.net> * add testcases and fix a few issues Signed-off-by: Andrew Thornton <art27@cantab.net> * fix build Signed-off-by: Andrew Thornton <art27@cantab.net> * prevent "race" in the test Signed-off-by: Andrew Thornton <art27@cantab.net> * fix jsoniter mismerge Signed-off-by: Andrew Thornton <art27@cantab.net> * fix conflicts Signed-off-by: Andrew Thornton <art27@cantab.net> * fix format Signed-off-by: Andrew Thornton <art27@cantab.net> * Add warnings for no worker configurations and prevent data-loss with redis/levelqueue Signed-off-by: Andrew Thornton <art27@cantab.net> * Use StopTimer Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add config options to hide issue events (#17414)qwerty2872022-01-213-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add config option to hide issue events Adds a config option `HIDE_ISSUE_EVENTS` to hide most issue events (changed labels, milestones, projects...) on the issue detail page. If this is true, only the following events (comment types) are shown: * plain comments * closed/reopned/merged * reviews * Make configurable using a list * Add docs * Add missing newline * Fix merge issues * Allow changes per user settings * Fix lint * Rm old docs * Apply suggestions from code review * Use bitsets * Rm comment * fmt * Fix lint * Use variable/constant to provide key * fmt * fix lint * refactor * Add a prefix for user setting key * Add license comment * Add license comment * Update services/forms/user_form_hidden_comments.go Co-authored-by: Gusted <williamzijl7@hotmail.com> * check len == 0 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Refactor jwt.StandardClaims to RegisteredClaims (#18344)zeripath2022-01-201-14/+10
| | | | | | | | | | | | | | | * Refactor jwt.StandardClaims to RegisteredClaims go-jwt/jwt has deprecated the StandardClaims interface to use RegisteredClaims instead. This PR migrates to use this new format. Signed-off-by: Andrew Thornton <art27@cantab.net> * Apply suggestions from code review Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Gusted <williamzijl7@hotmail.com>
* format with gofumpt (#18184)65432022-01-2072-199/+160
| | | | | | | | | | | * gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
* Enable deprecation error for v1.17.0 (#18341)Gusted2022-01-201-0/+1
| | | Co-authored-by: Andrew Thornton <art27@cantab.net>
* Use correct translation key for errors (#18342)Gusted2022-01-201-3/+7
| | | | - Noted by: https://github.com/go-gitea/gitea/issues/17876#issuecomment-1017503614
* Refactor Router Logger (#17308)wxiaoguang2022-01-205-55/+32
| | | | | | Make router logger more friendly, show the related function name/file/line. [BREAKING] This PR substantially changes the logging format of the router logger. If you use this logging for monitoring e.g. fail2ban you will need to update this to match the new format.
* Change initial TrustModel to committer (#18335)zeripath2022-01-191-0/+2
|
* Propagate context and ensure git commands run in request context (#17868)zeripath2022-01-1941-205/+188
| | | | | | | | | This PR continues the work in #17125 by progressively ensuring that git commands run within the request context. This now means that the if there is a git repo already open in the context it will be used instead of reopening it. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Stop trimming preceding and suffixing spaces from editor filenames (#18334)v1.16.0-rc1zeripath2022-01-191-1/+1
| | | | | | | | | | | | | | * Stop trimming preceding and suffixing spaces from editor filenames In #5702 it was decided to trim preceding and suffixed spaces aswell as / from editing file filenames. This was because at this point in time the url-safety of Gitea was much poorer. We can now drop this requirement and file editing should work correctly. Fix #18176 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix incorrect OAuth message (#18332)wxiaoguang2022-01-191-1/+1
| | | | | As the title, Fix #18327
* Fix PR comments UI (#18323)wxiaoguang2022-01-192-9/+13
| | | | | Closes: * Review comment cannot be edited #17768 * Changing PR Comment Resolved State Disables Further Changes #18315