aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add API to check if team has repo access (#19540)qwerty2872022-05-014-1/+117
| | | | | * Add API to check if team has repo access * Add test case
* Avoid MoreThanOne Error (#19557)99rgosse2022-05-011-1/+1
|
* [skip ci] Updated licenses and gitignoresGiteaBot2022-05-012-0/+466
|
* Simplify loops to copy (#19569)Gusted2022-05-012-6/+3
| | | - Simplify two loops into `copy` statements.
* Use middleware to open gitRepo (#19559)65432022-04-302-7/+3
|
* Added X-Mailer header to outgoing emails (#19562)Ivan Fedorov2022-04-301-0/+1
| | | | - It's a non-standard mentioned in https://www.ietf.org/rfc/rfc2076.html#section-3.4 - This header makes emails filtering easier
* fix #19545 (#19563)65432022-04-301-4/+5
|
* [skip ci] Updated translations via CrowdinGiteaBot2022-04-301-0/+2
|
* Respect DefaultUserIsRestricted system default when creating new user (#19310)Jimmy Praet2022-04-2917-85/+170
| | | | | | | | | | | | | | | | | | | * Apply DefaultUserIsRestricted in CreateUser * Enforce system defaults in CreateUser Allow for overwrites with CreateUserOverwriteOptions * Fix compilation errors * Add "restricted" option to create user command * Add "restricted" option to create user admin api * Respect default setting.Service.RegisterEmailConfirm and setting.Service.RegisterManualConfirm where needed * Revert "Respect default setting.Service.RegisterEmailConfirm and setting.Service.RegisterManualConfirm where needed" This reverts commit ee95d3e8dc9e9fff4fa66a5111e4d3930280e033.
* Mute link in diff header (#19556)silverwind2022-04-291-1/+1
| | | | Followup to https://github.com/go-gitea/gitea/pull/19534. Make the link render in color only on hover.
* Add API to query collaborators permission for a repository (#18761)Florin Hillebrand2022-04-298-3/+317
| | | | | | | | | | | | | | | | | | | | | Targeting #14936, #15332 Adds a collaborator permissions API endpoint according to GitHub API: https://docs.github.com/en/rest/collaborators/collaborators#get-repository-permissions-for-a-user to retrieve a collaborators permissions for a specific repository. ### Checks the repository permissions of a collaborator. `GET` `/repos/{owner}/{repo}/collaborators/{collaborator}/permission` Possible `permission` values are `admin`, `write`, `read`, `owner`, `none`. ```json { "permission": "admin", "role_name": "admin", "user": {} } ``` Where `permission` and `role_name` hold the same `permission` value and `user` is filled with the user API object. Only admins are allowed to use this API endpoint.
* Permalink files In PR diff (#19534)KN4CK3R2022-04-291-3/+4
|
* Fix Pull Request comment filename word breaks (#19535)parnic2022-04-292-2/+4
| | | | | | | | | | | | | | | | | | | | | * Fix word breaks in Chrome This fixes word wrapping on the filename for a comment on a PR. A previous commit fixed this problem in Firefox, but not Chrome. Fixes #16248 * Don't break Outdated badge This prevents the Outdated badge on a PR from wrapping in the middle of the word for a comment on a long filename. * Move word break to recommended element * Add overflow-wrap per PR review * Update web_src/less/helpers.less Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Don't error when branch's commit doesn't exist (#19547)Gusted2022-04-291-2/+8
| | | | | | | | | | * Don't error when branch's commit doesn't exist - If one of the branches no longer exists, don't throw an error, it's possible that the branch was destroyed during the process. Simply skip it and disregard it. - Resolves #19541 * Don't send empty objects * Use more minimal approach
* [skip ci] Updated translations via CrowdinGiteaBot2022-04-291-0/+6
|
* Support `hostname:port` to pass host matcher's check #19543 (#19543)wxiaoguang2022-04-292-2/+9
| | | hostmatcher: split the hostname from the `hostname:port` string, use the correct hostname to do the match.
* Add "Allow edits from maintainer" feature (#18002)qwerty2872022-04-2829-60/+359
| | | | | | | | | | | | | | | | | Adds a feature [like GitHub has](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) (step 7). If you create a new PR from a forked repo, you can select (and change later, but only if you are the PR creator/poster) the "Allow edits from maintainers" option. Then users with write access to the base branch get more permissions on this branch: * use the update pull request button * push directly from the command line (`git push`) * edit/delete/upload files via web UI * use related API endpoints You can't merge PRs to this branch with this enabled, you'll need "full" code write permissions. This feature has a pretty big impact on the permission system. I might forgot changing some things or didn't find security vulnerabilities. In this case, please leave a review or comment on this PR. Closes #17728 Co-authored-by: 6543 <6543@obermui.de>
* Better describe what `/repos/{owner}/{repo}/raw/{filepath}` returns on 200 ↵Gusted2022-04-282-2/+2
| | | | | | (#19542) - Set on the description that it returns the raw file content. - Resolves #19514
* more context for models (#19511)65432022-04-2854-244/+274
| | | | | make more usage of context, to have more db transaction in one session (make diff of #9307 smaller)
* Prevent intermittent race in attribute reader close (#19537)zeripath2022-04-281-16/+1
| | | | | | | | | | | | There is a potential rare race possible whereby the c.running channel could be closed twice. Looking at the code I do not see a need for this c.running channel and therefore I think we can remove this. (I think the c.running might have been some attempt to prevent a hang but the use of os.Pipes should prevent that.) Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Make repository file list useable on mobile (#19515)Gusted2022-04-281-0/+24
| | | | | | | | | | | | | | | | | | | | | * Make repository file list useable on mobile - When you're browsing a repository on mobile, you're met by a giant block called the "repository file list". The current design is not useable for mobile and is a big annoyance while browsing a repo on mobile. This PR removes that annoyance by making it more suitable design when on mobile. - Adds HTML for the commit/file time to align it vertically(noticeable on mobile, not on PC). - Show all information horizontally and not vertically. - Remove the last commit message of the file, there isn't enough space on mobile to place this anywhere, so we're not trying to make a best-effort here and instead just not display it. * Remove unnecessary `!important` * Fix broken HTML * Simplify code
* Update image URL for Discord webhook (#19536)John Olheiser2022-04-272-2/+1
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2022-04-281-0/+1
|
* Fix 64-bit atomic operations on 32-bit machines (#19531)Gusted2022-04-271-1/+4
| | | | | | | | | - Doing 64-bit atomic operations on 32-bit machines is a bit tricky by golang, as they can only be done under certain set of conditions(https://pkg.go.dev/sync/atomic#pkg-note-BUG). - This PR fixes such case whereby the conditions weren't met, it moves the int64 to the first field of the struct, which will 64-bit operations happening on this property on 32-bit machines. - Resolves #19518
* Fix `upgrade.sh` script error with `su -c` (#19483)YISH2022-04-261-1/+2
| | | | | | | | | | | | | * Fix scirpt err with `su -c`, add env auto loading. * Update upgrade.sh * Update upgrade.sh * Update contrib/upgrade.sh Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* When view _Siderbar or _Footer, just display once (#19501)Lunny Xiao2022-04-261-26/+47
| | | Co-authored-by: zeripath <art27@cantab.net>
* Fix migrate release from github (#19510)Lunny Xiao2022-04-261-9/+12
| | | | | * Fix migrate release from github * Fix bug
* Prevent dangling archiver goroutine (#19516)zeripath2022-04-263-3/+3
| | | | | | | | | | | | | | | | | | | | | | Within doArchive there is a service goroutine that performs the archiving function. This goroutine reports its error using a `chan error` called `done`. Prior to this PR this channel had 0 capacity meaning that the goroutine would block until the `done` channel was cleared - however there are a couple of ways in which this channel might not be read. The simplest solution is to add a single space of capacity to the goroutine which will mean that the goroutine will always complete and even if the `done` channel is not read it will be simply garbage collected away. (The PR also contains two other places when setting up the indexers which do not leak but where the blocking of the sending goroutine is also unnecessary and so we should just add a small amount of capacity and let the sending goroutine complete as soon as it can.) Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Don't let repo clone URL overflow (#19517)Gusted2022-04-261-1/+1
| | | | | | - Apparently `<input>` elements differ from other elements have a size attribute that act as a `min-width` CSS property, this causes a overflow on mobile. By setting this size to `1` it doesn't try to force a min-width and nicely shrink down.
* Add commit status popup to issuelist (#19375)parnic2022-04-264-25/+33
| | | | | | | | | | This gets the necessary data to the issuelist for it to support a clickable commit status icon which pops up the full list of commit statuses related to the commit. It accomplishes this without any additional queries or fetching as the existing codepath was already doing the necessary work but only returning the "last" status. All methods were wrapped to call the least-filtered version of each function in order to maximize code reuse. Note that I originally left `getLastCommitStatus()` in `pull.go` which called to the new function, but `make lint` complained that it was unused, so I removed it. I would have preferred to keep it, but alas. The only thing I'd still like to do here is force these popups to happen to the right by default instead of the left. I see that the only other place this is popping up right is on view_list.tmpl, but I can't figure out how/why right now. Fixes #18810
* Disable unnecessary GitHooks elements (#18485)Paweł Bogusławski2022-04-260-0/+0
| | | | | | | | | * Disable unnecessary GitHooks elements This mod fixes disabling unnecessary GitHooks elements. Related: https://github.com/go-gitea/gitea/pull/13129 Author-Change-Id: IB#1115251
* Disable unnecessary GitHooks elementsPawel Boguslawski2022-04-263-1/+3
| | | | | | | This mod fixes disabling unnecessary GitHooks elements. Related: https://github.com/go-gitea/gitea/pull/13129 Author-Change-Id: IB#1115251
* Improve dashboard's repo list performance (#18963)Gusted2022-04-263-36/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Improve dashboard's repo list performance - Avoid a lot of database lookups for all the repo's, by adding a undocumented "minimal" mode for this specific task, which returns the data that's only needed by this list which doesn't require any database lookups. - Makes fetching these list faster. - Less CPU overhead when a user visits home page. * Refactor javascript code + fix Fork icon - Use async in the function so we can use `await`. - Remove `archivedFilter` check for count, as it doesn't make sense to show the count of repos when you can't even see them(as they are filited away). * Add `count_only` * Remove uncessary code * Improve comment Co-authored-by: delvh <dev.lh@web.de> * Update web_src/js/components/DashboardRepoList.js Co-authored-by: delvh <dev.lh@web.de> * Update web_src/js/components/DashboardRepoList.js Co-authored-by: delvh <dev.lh@web.de> * By default apply minimal mode * Remove `minimal` paramater * Refactor count header * Simplify init Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* By default force vertical tabs on mobile (#19486)Gusted2022-04-266-33/+17
| | | | | | | | | | | | | | | | | | | * By default force vertical tabs on mobile - While experimenting with using vertical tabs instead of horizontal tabs on gitea for a better mobile experience, I made a recent PR(https://github.com/go-gitea/gitea/pull/19468) in order to see if there was any objections to this new behavior for the repo headers(one of the most annoying horizontal tabs). This PR had no objections and even a user commenting that this change is brilliant. - This PR now improves upon the previous PR by making this the de-facto behavior for all menu's on mobile. The only exemption is the navbar which also uses the menu but caught some layout errors with the changes. * Fix organisation * Fix repo/wiki buttons Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Refactor readme file renderer (#19502)Lunny Xiao2022-04-261-112/+125
| | | | | * Refactor readme file renderer * improve
* Allow package dump skipping (#19506)KN4CK3R2022-04-262-23/+40
| | | | | | | | | | | | | | * Added addReader to support verbose. * Allow skipping packages. * Updated docs. * Update cmd/dump.go Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Unset git author/committer variables when running integration tests (#19512)zeripath2022-04-261-0/+7
| | | | | | | | | | TestAPIGitTag (and likely others) will fail if the running environment contains GIT_AUTHOR_NAME and other env variables like it. This PR simply unsets these when running the integration tests. Fix #14247 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Allow commit status popup on /pulls page (#19507)parnic2022-04-263-13/+20
| | | | | | | | | | | * Allow commit status popup on /pulls page The /pulls page doesn't contain a "repository" element, so the early-out here was preventing the commit status popup hook from working. However, the only thing the .repository element is being used for here is determining whether the popup should be on the right or on the left, so we don't actually need the element to exist for the hook to work. Pull request #19375 allows the statuses on /pulls pages to appear clickable, but this commit is required to make the popup actually work there. * Move commit statuses popup hook to dedicated func * Add missing import
* Use router param for filepath in GetRawFile (#19499)John Olheiser2022-04-261-0/+1
| | | | | | | | | | | | * Use router param for filepath Signed-off-by: jolheiser <john.olheiser@gmail.com> * Move TreePath back into RepoRefForAPI Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Fix two typos (#19504)Lunny Xiao2022-04-262-2/+2
|
* Add a new menu in file view to open blame view and fix blame view select ↵Lunny Xiao2022-04-263-5/+23
| | | | range bug (#19500)
* Fix two UI bugs: JS error in imagediff.js, 500 error in diff/compare.tmplwxiaoguang2022-04-262-5/+12
| | | Co-authored-by: 6543 <6543@obermui.de>
* [skip ci] Updated translations via CrowdinGiteaBot2022-04-2628-1/+127
|
* Improve Stopwatch behavior (#18930)Gusted2022-04-255-33/+77
| | | | - Don't send empty stopwatch over and over again, only send once. - Stop interval to update stopwatch's timer when there is no more stopwatch.
* Pass gitRepo down to GetRawDiff, since its used for main repo and wiki (#19461)65432022-04-254-31/+23
| | | | | as per https://github.com/go-gitea/gitea/pull/19449#issuecomment-1105283931 pass gitRepo down to GetRawDiff, since its used for main repo and wiki
* Use queue instead of memory queue in webhook send service (#19390)Lunny Xiao2022-04-256-157/+66
|
* add a directory prefix `gitea-src-VERSION` to release-tar-file (#19396)jklippel2022-04-261-1/+3
| | | | Use a directory prefix instead on creating the tar file. Fixes: #19066
* User specific repoID or xorm builder conditions for issue search (#19475)65432022-04-258-34/+25
| | | | | | | | | * extend models.IssuesOptions to have more specific repo filter options * use new options * unrelated refactor * rm RepoIDs
* Add notags to fetch (#19487)65432022-04-251-1/+1
|
* Simplify the code to get issue count (#19380)Lunny Xiao2022-04-251-11/+1
| | | | | * Simple the code to get issue count * Improve codes