summaryrefslogtreecommitdiffstats
path: root/models
Commit message (Collapse)AuthorAgeFilesLines
* Enhance Ghost comment mitigation Settings (#14392)65432021-01-215-26/+57
| | | | | | | | | | | | | | | | | | | | | | | | | * refactor models.DeleteComment and delete related reactions too * use deleteComment for UserDeleteWithCommentsMaxDays in DeleteUser * nits * Use time.Duration as other time settings have * docs * Resolve Fixme & fix potential deadlock * Disabled by Default * Update Config Value Description * switch args * Update models/issue_comment.go Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Allow ssh-keygen on Windows to detect ssh key type (#14413)Chester Liu2021-01-211-5/+0
|
* Display current stopwatch in navbar (#14122)Norwin2021-01-211-0/+10
| | | | | | | | | | | | | | | | | * add notification about running stopwatch to header * serialize seconds, duration in stopwatches api * ajax update stopwatch i should get my testenv working locally... * new variant: hover dialog * noscript compatibility * js: live-update stopwatch time * js live update robustness
* Add support for ed25519_sk and ecdsa_sk SSH keys (#13462)Artemis Tosini2021-01-202-17/+35
| | | | | | | | | | | | | | * Add support for ed25519_sk and ecdsa_sk SSH keys These start with sk-ssh-ed25519@openssh.com and sk-ecdsa-sha2-nistp256@openssh.com. They are supported in recent versions of go x/crypto/ssh and OpenSSH 8.2 or higher. * skip ssh-keygen Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Project: show referenced PRs in issue cards (#14183)Roberto Santalla2021-01-201-0/+4
| | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Check if label template exist first (#14384)65432021-01-182-23/+17
| | | | | | | * add check * refactor * rollback repo on error after session closed
* exclude authored PRs from Review Requested filter (#14368)Jimmy Praet2021-01-181-0/+1
| | | Co-authored-by: Lauris BH <lauris@nix.lv>
* Implement ghost comment mitigation (#14349)65432021-01-171-1/+11
| | | | | | | | | | | | | * Implement ghost comment mitigation Adds a config option USER_DELETE_WITH_COMMENTS_MAX_DAYS to the [service] section. See https://codeberg.org/Codeberg/Discussion/issues/24 for the underlying issue. * cleanup * use setting module correctly * add to docs Co-authored-by: Moritz Marquardt <git@momar.de>
* Add review requested filter on pull request overview (#13701)Jimmy Praet2021-01-171-62/+97
| | | | | | | | | | | | | * Add review requested filter on pull request overview #13682 fix formatting * add review_requested filter to /repos/issues/search API endpoint * only Approve and Reject status should supersede Request status * add support for team reviews * refactor: remove duplication of issue filtering conditions
* Sort issue search results by revelance (#14353)Lauris BH2021-01-162-2/+2
|
* KanBan: be able to set default board (#14147)65432021-01-151-20/+75
| | | | Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: zeripath <art27@cantab.net>
* Merge default and system webhooks under one menu (#14244)Lauris BH2021-01-151-17/+3
|
* Use IsProd instead of testing if it's equal. (#14336)Lunny Xiao2021-01-141-2/+2
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Issues overview should not show issues from archived repos (#13220)Elena Neuschild2021-01-129-6/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add lots of comments to user.Issues() * Answered some questions from comments * fix typo in comment * Refac user.Issues(): add func repoIDs * Refac user.Issues(): add func userRepoIDs * Refac user.Issues(): add func issueIDsFromSearch * Refac user.Issues(): improve error handling * Refac user.Issues(): add inline documentation and move variable declarations closer to their usages * Refac user.Issues(): add func repoIDMap * Refac user.Issues(): cleanup * Refac: Separate Issues from Pulls during routing * fix typo in comment * Adapt Unittests to Refactoring * Issue13171: Issue and PR Overviews now ignore archived Repositories * changed some verbatim SQL conditions to builder.Eq * models/issue.go: use OptionalBool properly Co-authored-by: 6543 <6543@obermui.de> * Use IsArchived rather than ExcludeArchivedRepos * fixed broken test after merge * added nil check * Added Unit Test securing Issue 13171 fix * Improved IsArchived filtering in issue.GetUserIssueStats * Removed unused func * Added grouping to avoid returning duplicate repo IDs Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Gitea <gitea@fake.local> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [Refactor] Passwort Hash/Set (#14282)65432021-01-105-21/+145
| | | | | | | | | * move SaltGeneration into HashPasswort and rename it to what it does * Migration: Where Password is Valid with Empty String delete it * prohibit empty password hash * let SetPassword("") unset pwd stuff
* Add option to change username to the admin panel (#14229)65432021-01-101-7/+7
| | | | | Co-authored-by: Bwko <bouwko@gmail.com> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net>
* Do not reload page after adding comments in Pull Request reviews (#13877)Jimmy Praet2021-01-081-20/+45
| | | | | | | | | | | | | | | | Fixed #8861 * use ajax on PR review page * handle review comments * extract duplicate code FetchCodeCommentsByLine was initially more or less copied from fetchCodeCommentsByReview. Now they both use a common findCodeComments function instead * use the Engine that was passed into the method Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Some code improvements (#14266)Lunny Xiao2021-01-061-0/+3
|
* Fix wrong type on hooktask to convert typ from char(16) to varchar(16) (#14148)Lunny Xiao2021-01-064-5/+111
| | | | | | | | | | | | | | | | | | | | | | | | | * Fix wrong type on hooktask to convert typ from char(16) to varchar(16) * Fix bugs * Improve code * Use different trim function for MSSQL * Fix bug * Removed wrong changed line * Removed wrong changed line * Fix nullable * Fix lint * Ignore sqlite on migration * Fix mssql modify column failure * Move modifyColumn to migrations.go so that other migrate function could use it
* Add MirrorInterval to the API (#14163)Paul Barton2021-01-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added MirrorInterval to the API * Remove MirrorInterval from CreateRepository * Removed Duplicate UpdateMirror Function * Updated Error Logging * Update Log Message for is not Mirror Co-authored-by: 6543 <6543@obermui.de> * Delete Debug Statement that snuck in Co-authored-by: zeripath <art27@cantab.net> * Add Check for If Interval is too small * Output to API Call * Add Error Object when time is Less than Min Interval * Frequency Error Message Co-authored-by: zeripath <art27@cantab.net> * Allow Zero Mirror Interval Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Fix avatar bugs (#14217)Lunny Xiao2021-01-021-4/+3
|
* Send notifications for mentions in pulls, issues, (code-)comments (#14218)Jimmy Praet2021-01-021-0/+14
| | | | | Fixes #14187: mention handling extracted from email notification code Fixes #14013: add notification for mentions in pull request code comments Fixes #13450: Not receiving any emails with setting "Only Email on Mention"
* Ensure that schema search path is set with every connection on postgres (#14131)zeripath2021-01-022-11/+85
| | | | | | | | | | | | | | | | | | | | | | | * Ensure that schema search path is set with every connection on postgres Unfortunately every connection to postgres requires that the search path is set appropriately. This PR shadows the postgres driver to ensure that as soon as a connection is open, the search_path is set appropriately. Fix #14088 Signed-off-by: Andrew Thornton <art27@cantab.net> * no golangci-lint that is not a helpful suggestion Signed-off-by: Andrew Thornton <art27@cantab.net> * Use Execer if available Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix dashboard issues labels filter bug (#14210)Lunny Xiao2021-01-011-12/+22
| | | Co-authored-by: zeripath <art27@cantab.net>
* Minimal OpenID Connect implementation (#14139)Johnny Oskarsson2021-01-025-4/+96
| | | | | | | | | | | | | | | | | | | | | | | | | This is "minimal" in the sense that only the Authorization Code Flow from OpenID Connect Core is implemented. No discovery, no configuration endpoint, and no user scope management. OpenID Connect is an extension to the (already implemented) OAuth 2.0 protocol, and essentially an `id_token` JWT is added to the access token endpoint response when using the Authorization Code Flow. I also added support for the "nonce" field since it is required to be used in the id_token if the client decides to include it in its initial request. In order to enable this extension an OAuth 2.0 scope containing "openid" is needed. Other OAuth 2.0 requests should not be impacted by this change. This minimal implementation is enough to enable single sign-on (SSO) for other sites, e.g. by using something like `mod_auth_openidc` to only allow access to a CI server if a user has logged into Gitea. Fixes: #1310 Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Custom icons for OAuth sources (#14161)Timo Ley2020-12-282-1/+6
| | | | | | | | | | | | | * Add Icon URL to Backend * Template for Icon URL * Localization & Edit Icon URL * Improve Custom Icon URL * Removed not working else Co-authored-by: 6543 <6543@obermui.de>
* Team dashboards (#14159)Jimmy Praet2020-12-274-8/+49
|
* Dump github/gitlab/gitea repository data to a local directory and restore to ↵Lunny Xiao2020-12-272-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gitea (#12244) * Dump github/gitlab repository data to a local directory * Fix lint * Adjust directory structure * Allow migration special units * Allow migration ignore release assets * Fix lint * Add restore repository * stage the changes * Merge * Fix lint * Update the interface * Add some restore methods * Finish restore * Add comments * Fix restore * Add a token flag * Fix bug * Fix test * Fix test * Fix bug * Fix bug * Fix lint * Fix restore * refactor downloader * fmt * Fix bug isEnd detection on getIssues * Refactor maxPerPage * Remove unused codes * Remove unused codes * Fix bug * Fix restore * Fix dump * Uploader should not depend downloader * use release attachment name but not id * Fix restore bug * Fix lint * Fix restore bug * Add a method of DownloadFunc for base.Release to make uploader not depend on downloader * fix Release yml marshal * Fix trace information * Fix bug when dump & restore * Save relative path on yml file * Fix bug * Use relative path * Update docs * Use git service string but not int * Recognize clone addr to service type
* Change topic name size from 25 to 50 (#14150)Lunny Xiao2020-12-263-1/+37
| | | | | | | | | * Change topic name size from 25 to 50 * recreateTable requires full bean definition Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Disable SSH key deletion of externally managed Keys (#13985)zeripath2020-12-251-0/+76
| | | | | | | | | | | | | | | | * Disable SSH key addition and deletion when externally managed When a user has a login source which has SSH key management key addition and deletion using the UI should be disabled. Fix #13983 Signed-off-by: Andrew Thornton <art27@cantab.net> * Make only externally managed keys disabled Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* migrate from com.* to alternatives (#14103)65432020-12-2513-43/+41
| | | | | | | | | | | | | | | * remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
* Fix creating OAuth2 auth source from CLI (#14116)Daniil Pankratov2020-12-241-1/+11
| | | | | | | | Fix creation OAuth2 auth source from CLI. Fix #8356 Co-authored-by: Daniil Pankratov <daniil.pankratov@t-systems.com>
* rework heatmap permissions (#14080)Norwin2020-12-224-54/+98
| | | | | | | | | | | | | | | | * now uses the same permission model as for the activity feed: only include activities in repos, that the doer has access to. this might be somewhat slower. * also improves handling of user.KeepActivityPrivate (still shows the heatmap to self & admins) * extend tests * adjust integration test to new behaviour * add access to actions for admins * extend heatmap unit tests
* Add StatDir and replace com.StatDir (#14099)Lunny Xiao2020-12-221-1/+1
| | | | | | | | | * Add StatDir and replace com.StatDir * a nit * Remove wrong file Co-authored-by: 6543 <6543@obermui.de>
* Add mentionable teams to tributeValues and change team mention rules to gh's ↵a10121127962020-12-212-27/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | style (#13198) * Add mentionable teams to tributeValues Signed-off-by: a1012112796 <1012112796@qq.com> * Apply suggestions from code review Co-authored-by: silverwind <me@silverwind.io> * Change team mention rules to gh's style * use org's avator as team avator in ui Signed-off-by: a1012112796 <1012112796@qq.com> * Update modules/markup/html.go * Update models/issue.go Co-authored-by: Lauris BH <lauris@nix.lv> * Update models/issue.go * fix a small nit and update test code Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de>
* Show dropdown with all statuses for commit (#13977)Cirno the Strongest2020-12-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Show dropdown with all statuses for commit * Use popups * Remove unnecessary change * Style popup * Use divided list * As per @silverwind * Refactor GetLastCommitStatus * Missing dropdown on repo home and commit page * Fix tests * Make status icon be a part of a link on PR list * Fix missing translation call * Indent fix Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix feed push tag (#14064)Lunny Xiao2020-12-201-0/+5
| | | | | | | | | * Fix dashboard feed bug when push tag * Fix variable name * Fix delete tag Co-authored-by: 6543 <6543@obermui.de>
* Accept multiple SSH keys in single LDAP SSHPublicKey attribute (#13989)zeripath2020-12-182-8/+90
| | | | | | | | * Accept multiple SSH keys in single LDAP SSHPublicKey attribute Fix #13984 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [Refactor] CombinedStatus and CommitStatus related functions & structs (#14026)65432020-12-181-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * RM unused struct * rename (*CommitStatus) loadRepo() -> loadAttributes() * move ToCommitStatus into its own file * use CommitStatusState instead of StatusState * move CombinedStatus convertion into convert package * let models.GetLatestCommitStatus use repoID direct and accept ListOptions * update swagger docs * fix tests * Fix swagger docs * rm page * fix swagger docs!!! * return json null * always return json * rename api.Status to api.CommitStatus * fix swagger docs * sec swagger fix
* HotFix: Hide private partisipation in Orgs (#13994)65432020-12-171-0/+1
| | | | | * HotFix: Hide private partisipation in Orgs * refactor & add node to fuc GetOrganizations
* Trim the branch prefix from action.GetBranch (#13981)zeripath2020-12-141-1/+2
| | | | | | | | | | | | | | | | | | | * Trim the branch prefix from action.GetBranch #13882 has revealed that the refname of an action is actually only a refname pattern and necessarily a branch. For examplem pushing to refs/heads/master will result in action with refname refs/heads/master but pushing to master will result in a refname master. The simplest solution to providing a fix here is to trim the prefix therefore this PR proposes this. Signed-off-by: Andrew Thornton <art27@cantab.net> * Update models/action.go Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: a1012112796 <1012112796@qq.com>
* Fix bug for webhook and feishu caused by API changed (#13937)Lunny Xiao2020-12-111-1/+3
| | | | | * Fix bug for webhook * Fix bug for feishu
* Fix broken migration on webhook (#13911)Lunny Xiao2020-12-094-16/+77
| | | | | | | * Fix broken migration on webhook * Fix lint Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Fix action avatar loading (#13909)silverwind2020-12-091-3/+4
| | | | | Fixes #13883 Co-authored-by: 6543 <6543@obermui.de>
* Fix frontpage avatars (#13853)silverwind2020-12-091-0/+6
| | | | | | | | | | The frontpage uses a rather strange method to obtain the commit's avatar which I've overlooked earlier. I don't exactly understand how it works but this change fixes the wrong default avatars by using the function that was in previous use. Also introduced a few constants for size an size increase factor. Fixes: https://github.com/go-gitea/gitea/issues/13844
* [Docu] Fix Location of Comments in migrations.go (#13900)65432020-12-091-4/+4
|
* Move webhook type from int to string (#13664)Lunny Xiao2020-12-084-82/+73
| | | | | | | | | | | | | | * Move webhook type from int to string * rename webhook_services * finish refactor * Fix merge * Ignore unnecessary ci Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Direct avatar rendering (#13649)silverwind2020-12-034-14/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Direct avatar rendering This adds new template helpers for avatar rendering which output image elements with direct links to avatars which makes them cacheable by the browsers. This should be a major performance improvment for pages with many avatars. * fix avatars of other user's profile pages * fix top border on user avatar name * uncircle avatars * remove old incomplete avatar selector * use title attribute for name and add it back on blame * minor refactor * tweak comments * fix url path join and adjust test to new result * dedupe functions
* Move LFSLock APIFormat into convert package (#13808)65432020-12-031-14/+0
|
* Move Repo APIFormat to convert package (#13787)65432020-12-021-134/+0
| | | | | * Move Repo APIFormat to convert package * tweek