summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Move issues related files into models/issues (#19931)Lunny Xiao2022-06-13180-3675/+3665
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Move access and repo permission to models/perm/access * fix test * fix git test * Move functions sequence * Some improvements per @KN4CK3R and @delvh * Move issues related code to models/issues * Move some issues related sub package * Merge * Fix test * Fix test * Fix test * Fix test * Rename some files
* fix: some typos (#19956)yutotnh2022-06-136-7/+7
|
* [skip ci] Updated translations via CrowdinLunny Xiao2022-06-1328-70/+143
|
* Move some code into models/git (#19879)Lunny Xiao2022-06-1267-495/+549
| | | | | | | | | | | | | | | | | | | * Move access and repo permission to models/perm/access * fix test * Move some git related files into sub package models/git * Fix build * fix git test * move lfs to sub package * move more git related functions to models/git * Move functions sequence * Some improvements per @KN4CK3R and @delvh
* Fix signal loop in graceful manager (#19943)wxiaoguang2022-06-121-0/+1
|
* Prettify number of issues (#17760)Gusted2022-06-1214-45/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Prettify number of issues - Use the PrettyNumber function to add commas in large amount of issues. * Use client-side formatting * prettify on both server and client * remove unused i18n entries * handle more cases, support other int types in PrettyNumber * specify locale to avoid issues with node default locale * remove superfluos argument * introduce template helper, octicon tweaks, js refactor * Update modules/templates/helper.go * Apply some suggestions. * Add comment * Update templates/user/dashboard/issues.tmpl Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Improve file header on mobile (#19945)Gusted2022-06-122-2/+4
| | | | | - File headers can become quite width, so ensure the file size is not being wrapped into itself(width + padding-right) and allow the overflow to be scrolled(overflow-x).
* Unify repo settings & show better error (#19828)Gusted2022-06-127-14/+18
| | | | * Unify context data * Actually show invalid url in error
* [skip ci] Updated translations via Crowdinxkcdstickfigure2022-06-124-0/+27
|
* fixed comment typo (#19944)xkcdstickfigure2022-06-111-1/+1
|
* Auto merge pull requests when all checks succeeded via WebUI (#19648)65432022-06-1110-137/+300
| | | | | | | | Add WebUI part of Auto merge feature close #19621 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Fix some mirror bugs (#18649)Lunny Xiao2022-06-1110-32/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix some mirror bugs * Remove unnecessary code * Fix lint * rename stdard url * Allow more charactors in git ssh protocol url * improve the detection * support ipv6 for git url parse * Fix bug * Fix template * Fix bug * fix template * Fix tmpl * Fix tmpl * Fix parse ssh with interface * Rename functions name Co-authored-by: zeripath <art27@cantab.net>
* Fix data-race problems in git module (quick patch) (#19934)wxiaoguang2022-06-118-54/+45
| | | | | | | * Fix data-race problems in git module * use HomeDir instead of setting.RepoRootPath Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via Crowdinsilverwind2022-06-1128-2/+45
|
* Fix copy/paste of empty lines (#19798)silverwind2022-06-104-61/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix copy/paste of empty newlines again Fixes: https://github.com/go-gitea/gitea/issues/19331 Regressed by: https://github.com/go-gitea/gitea/pull/18270 Needed to do another newline addition to the Chroma output HTML to get copy/paste work again. The previous replacement conditions are probably obsolete, but as I'm not 100% sure, I opted to keep them. Specifically, the Chroma HTML change mentioned in https://github.com/go-gitea/gitea/pull/18270#issuecomment-1013350246 broke our previous newline replacement for such empty lines. Also included are a few changes to make the test more pleasant to work with. * run go mod tidy * add util.Dedent * copy in the code Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Normalize line endings in fomantic build files (#19932)silverwind2022-06-101-0/+1
| | | | | | Ensures consistent line endings to avoid useless diffs because there is somthing platform-dependant in that build. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Make user profile image show full image on mobile (#19840)Eekle2022-06-102-13/+8
| | | | * Make user profile image show full image on mobile
* Custom regexp external issues (#17624)Sandro Santilli2022-06-1013-26/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement custom regular expression for external issue tracking. Signed-off-by: Alexander Beyn <malex@fatelectrons.org> * Fix syntax/style * Update repo.go * Set metas['regexp'] * gofmt * fix some tests * fix more tests * refactor frontend * use LRU cache for regexp * Update modules/markup/html_internal_test.go Co-authored-by: Alexander Beyn <malex@fatelectrons.org> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use Golang 1.18 for Gitea 1.17 release (#19918)wxiaoguang2022-06-105-6/+6
| | | | | | | Use Golang 1.18 (as minimal requirement) for Gitea 1.17 release, make sure the Golang version is still actively supported during Gitea 1.17 lifecycle. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Refactor git module, make Gitea use internal git config (#19732)wxiaoguang2022-06-1021-190/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Refactor git module, make Gitea use internal git config, add safe.directory config * introduce git.InitSimple and git.InitWithConfigSync, make serv cmd use gitconfig * use HOME instead of GIT_CONFIG_GLOBAL, because git always needs a correct HOME * fix cmd env in cmd/serv.go * fine tune error message * Fix a incorrect test case * fix configAddNonExist * fix configAddNonExist logic, add `--fixed-value` flag, add tests * add configSetNonExist function in case it's needed. * use configSetNonExist for `user.name` and `user.email` * add some comments * Update cmd/serv.go Co-authored-by: zeripath <art27@cantab.net> * Update cmd/serv.go Co-authored-by: zeripath <art27@cantab.net> * Update modules/git/git.go Co-authored-by: zeripath <art27@cantab.net> * Update modules/setting/setting.go Co-authored-by: zeripath <art27@cantab.net> * Update modules/git/repo_attribute.go Co-authored-by: zeripath <art27@cantab.net> * fix spaces in messages * use `configSet("core.protectNTFS", ...)` instead of `globalCommandArgs` * remove GIT_CONFIG_NOSYSTEM, continue to use system's git config * Update cmd/serv.go Co-authored-by: zeripath <art27@cantab.net> * fix merge * remove code for safe.directory * separate git.CommonEnvs to CommonGitCmdEnvs and CommonCmdServEnvs * avoid Golang's data race error Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinRoger Luo2022-06-1024-24/+3
|
* Feature: Find files in repo (#15028)Roger Luo2022-06-0913-3/+235
| | | | | | | | | | | | | | | | * Create finding files page ui in repo page * Get tree entries for find repo files. * Move find files JS to individual file. * gen swagger. * Add enry.IsVendor to exclude entries Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Prevent NPE whilst migrating if there is a team request review (#19855)zeripath2022-06-097-8/+42
| | | | | | | | | A pr.Reviewer may be nil when migrating from Gitea if this is a team request review. We do not migrate teams therefore we cannot map these requests, but we can migrate user requests. Signed-off-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated translations via CrowdinLauris BH2022-06-0923-23/+2
|
* Add support for rendering terminal output with colors (#19497)Lauris BH2022-06-0910-0/+466
|
* Fix viewed images not loading in a PR (#19919)wxiaoguang2022-06-081-1/+2
| | | | Close #19651
* Remove out-dated comments (#19921)wxiaoguang2022-06-081-6/+0
|
* Automatically render wiki TOC (#19873)zeripath2022-06-088-50/+146
| | | | | | Automatically add sidebar in the wiki view containing a TOC for the wiki page. Make the TOC collapsable Signed-off-by: Andrew Thornton <art27@cantab.net>
* Improve wording on delete access token modal (#19909)André Jaenisch2022-06-072-3/+5
| | | | | | | | This PR highlights the nature of the destructive action. It also rewords the action buttons to remove ambiguity. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de> Co-authored-by: Lauris BH <lauris@nix.lv>
* [skip ci] Updated translations via CrowdinGusted2022-06-081-0/+1
|
* Add breaking email restrictions checker in doctor (#19903)Gusted2022-06-071-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add breaking change check in doctor - This patch introduces a new kind of doctor type, breaking. This file is made to register checks that helps with detecting when a breaking change might impact a Gitea instance. - For now the only check here(and the reason of creating this) is to check if all users in the database has a valid email address, which might not be the case after https://github.com/go-gitea/gitea/pull/17688. This _simply_ uses the validation function to detect and report these cases. - Helps admins with detecting #19897. - I have no clue which priority should be and IsDefault is true, because when breaking change happen and we have a doctor check for it, we can say "run `gitea doctor` to help you with this and maybe you find other errors :wink:". * Makes no sense tbh * Fix copyright * Update modules/doctor/breaking.go Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Ensure minimum mirror interval is reported on settings page (#19895)zeripath2022-06-073-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Ensure minimum mirror interval is reported on settings page Expecting users to guess the minimum mirror interval appears a little unkind. In this PR we simply change the locale string to include the minimum interval. This will of course be affected by our current localization framework but... we can fix that else where. This PR also includes some fixes for error handling on the settings page as previously the mirror block amongst others would simply disappear on error. Fix #3737 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update options/locale/locale_en-US.ini Co-authored-by: Gusted <williamzijl7@hotmail.com> * placate lint Signed-off-by: Andrew Thornton <art27@cantab.net> * Update options/locale/locale_en-US.ini Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Improve UX on modal for deleting an access token (#19894)André Jaenisch2022-06-071-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Improve UX on modal for deleting an access token Before, both action buttons where coloured on hover. Otherwise they appeared as ghost buttons. UX tells us, that call to action must not be displayed as ghost button. Using red is perceived as warning colour in Western cultures. It was used for the non-destructive action before. This PR swaps the colour and turns the cancel button into a filled one, so it is saver to do nothing then to accidentally delete an access button. We want the person to do this consciously. In another iteration the wording here could be improved. See the associated issue for further details. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de> * Use tabs instead of spaces. Linter does not complain anymore. I was expecting the formatter to pick this up but it didn't. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* update discord invite (#19907)Eugene2022-06-071-1/+1
|
* Only log non ErrNotExist errors in git.GetNote (#19884)Lunny Xiao2022-06-071-1/+4
| | | | | | | | | * Fix GetNote * Only log errors if the error is not ErrNotExist Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* [skip ci] Updated translations via Crowdinwxiaoguang2022-06-072-0/+2
|
* Update frontend guideline (#19901)wxiaoguang2022-06-061-11/+21
| | | | | | | * update frontend guideline * "Native" => "Vanilla JS", fix typo comma. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make AppDataPath absolute against the AppWorkPath if it is not (#19815)zeripath2022-06-061-0/+16
| | | | | | | | | | | | | | | | | | | | | | | * Make AppDataPath absolute against the AppWorkPath if it is not There are multiple repeated issues whereby a non-absolute provided APP_DATA_PATH causes strange issues. This PR simply absolutes the APP_DATA_PATH against the AppWorkPath if its not so. It also ensures that AppWorkPath is also always absolute. Ref #19367 Signed-off-by: Andrew Thornton <art27@cantab.net> * Add logging Signed-off-by: Andrew Thornton <art27@cantab.net> * absolute workpath against pwd instead of app path first Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Move some repository related code into sub package (#19711)Lunny Xiao2022-06-0676-1673/+1755
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move some repository related code into sub package * Move more repository functions out of models * Fix lint * Some performance optimization for webhooks and others * some refactors * Fix lint * Fix * Update modules/repository/delete.go Co-authored-by: delvh <dev.lh@web.de> * Fix test * Merge * Fix test * Fix test * Fix test * Fix test Co-authored-by: delvh <dev.lh@web.de>
* A minimal change to replace data calls with attr as per guidelines (#19900)André Jaenisch2022-06-061-1/+1
| | | | | | | | | This affects the manage topics on a repository. Namely the done button once changes are made. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Modernize JS build scripts (#19824)silverwind2022-06-065-51/+48
| | | | | | | | | | - Remove __dirname, use file URLs instead - Upgrade fabric dependency - Use fs/promises syntax, this breaks node 12 but we require 14 already The change in public/img/favicon.svg is not caused by the fabric upgrade, but it seems it was not properly generated when introduced. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinWim2022-06-0620-20/+0
|
* Update MAINTAINERS (#19896)Wim2022-06-051-0/+1
| | | | Added myself as maintainer [List of PRs](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3A42wim+is%3Aclosed)
* Add alt text to logo (#19892)André Jaenisch2022-06-052-1/+2
| | | | | | | | | | | | | | | The recommended way is to use the name of the organisation followed by "logo". however, since this is my first contribution, I am not entirely sure, whether this is the best approach here. The organisation is different from the organisation you can create as part of the application. Instead, it is more related to the site hosting the instance. Plus, I don't know how to best handle it when the logo image is swapped out. Therefore, I use plain "Logo" and hope that the person visiting the site has enough context. Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Limit max-height of CodeMirror editors for issue comment and wiki (#18271)Martijn de Boer2022-06-052-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make the wiki editor bar sticky for longer wiki edits On codeberg community it was requested to make the wiki editor toolbar sticky for longer wiki posts, so one wouldn't have to scroll to the top to use it. (Reference; https://codeberg.org/Codeberg/Community/issues/533). In order to make this happen, the .editor-toolbar class needs to become position: sticky, and we need to fix it's transparent background and border-bottom. Because the bottom disappears, we add it. This makes the border become a double border, because the CodeMirror area defines borders for all. As such I've added a border-top: none, on the wiki write tab for the CodeMirror class. * Make the issue bar in the issue view sticky for issue #10675 In issue #10675 it's requested to make the issue bar sticky upon scrolling in the issue view. The proposed change changes inline html, which is not desirable. As such I've added the position sticky option to it's container, and fix the background upon scrolling. * Make linter happy on _repository.less Fix 0px -> 0 to make the linter happy. * Make linter happy on _editor.less Fix 0px -> 0 to make the linter happy. * Change z-index to the lowest boundary of 1 As per review of @silverwind change the z-index to it's lowest requirement of 1. * Change z-index to the lowest boundary of 1 As per review of @silverwind change the z-index to it's lowest requirement of 1. * Revert changes made to wiki editor (unsticky) and add max-height Fixes the max-height to 85vh, on the proposed 90vh it just came out just slightly too large. Unstickies the changes from the sticky commits. * Revert changes for the sticky title editor Removes the changes as done by the sticky title editor. * Add max-height definition to CodeMirror-scroll Add the max-height definition for the CodeMirror-scroll class in order to generalize the changes spoken about in PR #18271 * Remove CodeMirror-scroll definition Remove the max-height in CodeMirror-scroll definition, in order to generalize it in the CodeMirror less file. As per discussion in #18271. * fine tune CodeMirror min-height/max-height Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Implement http signatures support for the API (#17565)Wim2022-06-0511-1/+365
| | | | | | | | | | | | | | | | Fixes #12338 This allows use to talk to the API with our ssh certificate (and/or ssh-agent) without needing to fetch an API key or tokens. It will just automatically work when users have added their ssh principal in gitea. This needs client code in tea Update: also support normal pubkeys ref: https://tools.ietf.org/html/draft-cavage-http-signatures Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net>
* Increment tests time out from 40m to 50m because sometimes the machine is ↵Lunny Xiao2022-06-051-3/+3
| | | | slow (#19887)
* fix(CI/CD): correct CI variable. (#19886)Bo-Yi Wu2022-06-051-4/+4
| | | | | | | | | default value is true for CI variable see https://docs.drone.io/pipeline/environment/reference/ci/ Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix typo (#19889)Gusted2022-06-042-2/+2
|
* Fixing wrong paging when filtering on the issue dashboard (#19801)Mai-Lapyst2022-06-041-0/+6
| | | | | Fixes #19791 by adding an check if filtering after any repo; if yes, simply set the total count for the pageing to the sum of the issue count for each selected repo by utilize `issueCountByRepo`. Fix #19791