aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add pprof labels in processes and for lifecycles (#19202)zeripath2022-03-254-48/+55
| | | | | | Use pprof labelling to help identify goroutines with stacks. Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated translations via CrowdinGiteaBot2022-03-2523-44/+2
|
* Bump goldmark to v1.4.11 (#19201)Robert Kaussow2022-03-243-3/+16
| | | | | | | | | * Bump goldmark to v1.4.11 * add testcase Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Bump minimist from 1.2.5 to 1.2.6 (#19194)dependabot[bot]2022-03-241-6/+6
|
* Changelog for 1.16.5 (#19189) (#19192)65432022-03-242-1/+32
| | | | | * Changelog for 1.16.5 (#19189) * bump version
* Fix showing issues in your repositories (#18916)Gusted2022-03-232-5/+53
| | | | | - Make a restriction on which issues can be shown based on if you the user or team has write permission to the repository. - Fixes a issue whereby you wouldn't see any associated issues with a specific team on a organization if you wasn't a member(fixed by zeroing the User{ID} in the options). - Resolves #18913
* Update issue_no_dependencies description (#19112)MeIchthys2022-03-231-2/+2
| | | | | | To be more consistent and concise we could change the issue_no_dependencies from: `This issue currently doesn't have any dependencies. ` to `No dependencies set.` like we do for the due date and others. Co-authored-by: delvh <dev.lh@web.de>
* Prevent redirect to Host (2) (#19175)zeripath2022-03-231-0/+6
| | | | | | | | | | | | | | | Unhelpfully Locations starting with `/\` will be converted by the browser to `//` because ... well I do not fully understand. Certainly the RFCs and MDN do not indicate that this would be expected. Providing "compatibility" with the (mis)behaviour of a certain proprietary OS is my suspicion. However, we clearly have to protect against this. Therefore we should reject redirection locations that match the regular expression: `^/[\\\\/]+` Reference #9678 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent start panic due to missing DotEscape functionAndrew Thornton2022-03-231-0/+1
| | | | | | | | | | Unfortunately #19169 causing a panic at startup in prod mode. This was hidden by dev mode because the templates are compiled dynamically there. The issue is that DotEscape is not in the original FuncMap at the time of compilation which causes a panic. Ref #19169 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix compare link in active feeds for new branch (#19149)a10121127962022-03-232-1/+35
| | | | | | | | | | | | | | | | | | | When a new branch is pushed the old SHA is always listed as the empty sha and thus the compare link that is created does not work correctly. Therefore when creating the compare link for new branches: 1. Attempt to get the parent of the first commit and use that as the basis for the compare link. 2. If this is not possible make a comparison to the default branch 3. Finally if that is not possible simply do not show a compare link. However, there are multiple broken compare links remaining therefore, in order for these to not break we will simply make the compare link redirect to the default branch. Fix #19144 Signed-off-by: a1012112796 <1012112796@qq.com> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Redirect .wiki/* ui link to /wiki (#18831)a10121127962022-03-231-0/+20
| | | | | | | | | | Redirect .wiki/* ui link to /wiki fix #18590 Signed-off-by: a1012112796 <1012112796@qq.com> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Try to prevent autolinking of displaynames by email readers (#19169)zeripath2022-03-238-22/+38
| | | | | | | | | | | | | | Unfortunately many email readers will (helpfully) detect url or url-like names and automatically create links to them, even in HTML emails. This is not ideal when usernames can have dots in them. This PR tries to prevent this behaviour by sticking ZWJ characters between dots and also set the meta tag to prevent format detection. Not every email template has been changed in this way - just the activation emails but it may be that we should be setting the above meta tag in all of our emails too. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update HTTP status codes to modern codes (#18063)KN4CK3R2022-03-2376-212/+211
| | | | | | * 2xx/3xx/4xx/5xx -> http.Status... * http.StatusFound -> http.StatusTemporaryRedirect * http.StatusMovedPermanently -> http.StatusPermanentRedirect
* Remove the Go version in UI, add a link on Gitea Version to show config ↵wxiaoguang2022-03-231-2/+14
| | | | | | | | | details (Go/Git version) (#19173) This PR mainly helps maintainers to save time from asking the issue reporters to get the correct version. There are so many reporters that have difficulty to get the correct Gitea version. Some of they just report Go version. The Go version doesn't help debug except in very limited circumstances. Instead, there is a new link on the Gitea version, the link is for the admin/config page which shows all version information, including Gitea, Go, Git, it could help more.
* [skip ci] Updated translations via CrowdinGiteaBot2022-03-231-1/+1
|
* Clean paths when looking in Storage (#19124)zeripath2022-03-224-51/+40
| | | | | | | | | | | | | * 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-223-5/+12
| | | | | | | | | 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>
* Ensure that setting.LocalURL always has a trailing slash (#19171)zeripath2022-03-221-1/+4
| | | | | Fix #19166 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use `ctx` instead of `db.DefaultContext` in some ↵wxiaoguang2022-03-2251-124/+117
| | | | | | | | | | | | 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-2211-64/+78
| | | 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-22129-881/+881
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [docs] Enhance container selection in docker dump (#14292)Robin2022-03-221-1/+1
| | | | | | * Enhance container selection in docker dump The problem with the previous query was, that it sometimes selected multiple containers, which make the command file with a hard to understand message. Now, use '^...$' to make sure a regex full match.
* Cleanup protected branches when deleting users & teams (#19158)Norwin2022-03-223-2/+103
| | | | | | | | | | | * Clean up protected_branches when deleting user fixes #19094 * Clean up protected_branches when deleting teams * fix issue Co-authored-by: Lauris BH <lauris@nix.lv>
* Reorder issue templates and automatically add labels (#18875)delvh2022-03-213-57/+60
| | | | | | | | | | | | | | | * Reorder bug-report.yaml * Add bug label on bug-report.yaml * Add feature label on feature-request.yaml * Reorder ui.bug-report.yaml * Apply suggestions Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Use IterateBufferSize whilst querying repositories during adoption check ↵zeripath2022-03-211-0/+7
| | | | | | | | | | | | | (#19140) The adoption page checks directories to see if they are repositories by querying the db on a per user basis. This can lead to problems if a user has a large number of repositories or putative repositories. This PR changes the buffering to check the db in IterataeBufferSize batches instead. Fix #19137 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add 1.18 (#19151)Sasha Melentyev2022-03-211-1/+2
| | | Co-authored-by: 6543 <6543@obermui.de>
* [skip ci] Updated translations via CrowdinGiteaBot2022-03-214-0/+14
|
* 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
* [skip ci] Updated licenses and gitignoresGiteaBot2022-03-201-0/+6
|
* 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
* not send notification emails to inactive users (part 2) (#19142)zeripath2022-03-191-0/+4
| | | | | | | | | Unfortunately fixing changes to `mail_issue.go` did not get included in #19131. We also need to not send issue comment mails to deactivated users. Fix #18950 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make migrations SKIP_TLS_VERIFY apply to git too (#19132)zeripath2022-03-193-23/+32
| | | | | | | | Make SKIP_TLS_VERIFY apply to git data migrations too through adding the `-c http.sslVerify=false` option to the git clone command. Fix #18998 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Do not send notification emails to inactive users (#19131)zeripath2022-03-193-5/+13
| | | | | | | | Emails should not be sent to inactive users except for Activate and ResetPassword messages. Fix #18950 Signed-off-by: Andrew Thornton <art27@cantab.net>
* remove not needed (#19128)65432022-03-183-73/+2
|
* Add warning to set SENDMAIL_ARGS to -- (#19102)zeripath2022-03-183-1/+3
| | | | | | | Even with #17688 email addresses that contain an initial `-` may still be present in the db and it may in future still be possible to imagine a situation whereby initial `-` are repermitted. This PR simply updates the documentation to warn users to set their SENDMAIL_ARGS with a terminal `--` to prevent this possibility email addresses being interpreted as options. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Do not send activation email if manual confirm is set (#19119)zeripath2022-03-183-0/+9
| | | | | | | | | | 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>
* Update tool dependencies (#19120)silverwind2022-03-181-4/+4
| | | | - Use tag over hash for all tool dependencies - Update them to latest released versions
* Delete related notifications on issue deletion too (#18953)Otto Richter (fnetX)2022-03-172-1/+2
| | | | | * use .Decr for issue comment counting * Remove notification on issue removal
* nit fix (#19116)65432022-03-172-2/+4
|
* Store the foreign ID of issues during migration (#18446)Aravinth Manivannan2022-03-1732-332/+451
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Storing the foreign identifier of an imported issue in the database is a prerequisite to implement idempotent migrations or mirror for issues. It is a baby step towards mirroring that introduces a new table. At the moment when an issue is created by the Gitea uploader, it fails if the issue already exists. The Gitea uploader could be modified so that, instead of failing, it looks up the database to find an existing issue. And if it does it would update the issue instead of creating a new one. However this is not currently possible because an information is missing from the database: the foreign identifier that uniquely represents the issue being migrated is not persisted. With this change, the foreign identifier is stored in the database and the Gitea uploader will then be able to run a query to figure out if a given issue being imported already exists. The implementation of mirroring for issues, pull requests, releases, etc. can be done in three steps: 1. Store an identifier for the element being mirrored (issue, pull request...) in the database (this is the purpose of these changes) 2. Modify the Gitea uploader to be able to update an existing repository with all it contains (issues, pull request...) instead of failing if it exists 3. Optimize the Gitea uploader to speed up the updates, when possible. The second step creates code that does not yet exist to enable idempotent migrations with the Gitea uploader. When a migration is done for the first time, the behavior is not changed. But when a migration is done for a repository that already exists, this new code is used to update it. The third step can use the code created in the second step to optimize and speed up migrations. For instance, when a migration is resumed, an issue that has an update time that is not more recent can be skipped and only newly created issues or updated ones will be updated. Another example of optimization could be that a webhook notifies Gitea when an issue is updated. The code triggered by the webhook would download only this issue and call the code created in the second step to update the issue, as if it was in the process of an idempotent migration. The ForeignReferences table is added to contain local and foreign ID pairs relative to a given repository. It can later be used for pull requests and other artifacts that can be mirrored. Although the foreign id could be added as a single field in issues or pull requests, it would need to be added to all tables that represent something that can be mirrored. Creating a new table makes for a simpler and more generic design. The drawback is that it requires an extra lookup to obtain the information. However, this extra information is only required during migration or mirroring and does not impact the way Gitea currently works. The foreign identifier of an issue or pull request is similar to the identifier of an external user, which is stored in reactions, issues, etc. as OriginalPosterID and so on. The representation of a user is however different and the ability of users to link their account to an external user at a later time is also a logic that is different from what is involved in mirroring or migrations. For these reasons, despite some commonalities, it is unclear at this time how the two tables (foreign reference and external user) could be merged together. The ForeignID field is extracted from the issue migration context so that it can be dumped in files with dump-repo and later restored via restore-repo. The GetAllComments downloader method is introduced to simplify the implementation and not overload the Context for the purpose of pagination. It also clarifies in which context the comments are paginated and in which context they are not. The Context interface is no longer useful for the purpose of retrieving the LocalID and ForeignID since they are now both available from the PullRequest and Issue struct. The Reviewable and Commentable interfaces replace and serve the same purpose. The Context data member of PullRequest and Issue becomes a DownloaderContext to clarify that its purpose is not to support in memory operations while the current downloader is acting but is not otherwise persisted. It is, for instance, used by the GitLab downloader to store the IsMergeRequest boolean and sort out issues. --- [source](https://lab.forgefriends.org/forgefriends/forgefriends/-/merge_requests/36) Signed-off-by: Loïc Dachary <loic@dachary.org> Co-authored-by: Loïc Dachary <loic@dachary.org>
* Remove italics for `due_date_not_set` (#19113)MeIchthys2022-03-171-1/+1
| | | To be more consistent with other `repo.issues.x` formatting, we can remove the italics from `dute_date_not_set`.
* [skip ci] Updated translations via CrowdinGiteaBot2022-03-171-32/+32
|
* Fixed log path in fail2ban documentation (#19103)Fredrik Ekre2022-03-161-1/+1
| | | | This updates the log path in the [gitea-docker] jail configuration to match the path in the [gitea] jail, which was updated in #13726.
* rm .sample hooks which aren't used (#19101)techknowlogick2022-03-16279-15846/+0
|
* use go1.18 to build gitea (#19099)techknowlogick2022-03-1610-63/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | * use go1.18 to build gitea& update min go version to 1.17 * bump in a few more places * add a few simple tests for isipprivate * update go.mod * update URL to https://go.dev/dl/ * golangci-lint * attempt golangci-lint workaround * change version * bump fumpt version * skip strings.title test * go mod tidy * update tests as some aren't private?? * update tests
* Use `go run` for tool dependencies, require go 1.17 (#18874)silverwind2022-03-157-69/+60
| | | | | | | | | | This ensures the tools only run in the versions we've tested and it also does not polute PATH with those tools so they are truly isolated. This syntax of `go run` requires go 1.17, so the minimum version is set accordingly. Fixes: https://github.com/go-gitea/gitea/issues/18867 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Update golang.org/x/crypto (#19097)Gusted2022-03-166-62/+6
| | | | | | | | | | | | | | | | | | | | * Update golang.org/x/crypto - Update dependency to include fix for CVE. - See https://groups.google.com/g/golang-announce/c/-cp44ypCT5s/m/wmegxkLiAQAJ?utm_medium=email&utm_source=footer * Fix deprecation notice * Remove workaround - Introduced in https://github.com/go-gitea/gitea/pull/17281 - Fixed in x/crypto: - https://github.com/golang/crypto/commit/5d542ad81a58c89581d596f49d0ba5d435481bcf - & https://github.com/golang/crypto/commit/3147a52a75dda54ac3a611ef8978640d85188a2a * Update Kex Algorithms - Use standardized name for curve22519-sha256. https://github.com/golang/crypto/commit/9b076918e3c7e908b2bdea932f272a9979f2488a - Prefer SHA256 version over SHA1 version. https://github.com/golang/crypto/commit/e4b3678e5f38521e67eba223ddd1902ceb3a303c
* Handle email address not exist. (#19089)KN4CK3R2022-03-151-1/+1
|
* Frontport Changelogs (#19088)65432022-03-142-1/+100
| | | | | * Frontport Changelogs * bump version in docs
* Restrict email address validation (#17688)Lunny Xiao2022-03-149-11/+110
| | | 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.