summaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* chore: use octicon-mirror for feeds display (#13928)Gary Wang2020-12-101-1/+1
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix avatar template error on repo collaborator page (#13924)silverwind2020-12-101-4/+12
| | | | | | | Fixes error `template: repo/settings/collaboration:16:16: executing "repo/settings/collaboration" at <.>: wrong type for value; expected *models.User; got *models.Collaborator` seen on repo collaborator page. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix broken migration on webhook (#13911)Lunny Xiao2020-12-091-2/+2
| | | | | | | * Fix broken migration on webhook * Fix lint Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Fix action avatar loading (#13909)silverwind2020-12-091-5/+12
| | | | | Fixes #13883 Co-authored-by: 6543 <6543@obermui.de>
* Fix frontpage avatars (#13853)silverwind2020-12-093-13/+19
| | | | | | | | | | 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
* Log IP on SSH authentication failure for Built-in SSH server (#13150)Eric Lesiuta2020-12-081-1/+1
| | | | | | | | | | | | | | | | | | * Log IP on SSH authentication failure fixes https://github.com/go-gitea/gitea/issues/13094 * include string 'Failed authentication attempt' in error * update fail2ban docs also match failed authentication over command line * better logging of authentication errors with IP addresses * format ... Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: 6543 <6543@obermui.de>
* Move webhook type from int to string (#13664)Lunny Xiao2020-12-0821-3666/+38
| | | | | | | | | | | | | | * 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>
* Repo avatar fixes (#13891)silverwind2020-12-071-13/+16
| | | | | | | | | - Split up avatar rendering helpers for performance - Fix showing repo SVG icon when no avatar is set - Make repo SVG and avatar same size at 32px - Fix fork line by adding vertical flexbox on repo title Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Refactor push update (#13381)Lunny Xiao2020-12-081-0/+69
| | | | | | | * Refactor Push update * Remove the push_test since the function has been removed. * Use default branch setting instead master
* issue #12450: return original URL in `original_url` JSON field (#13885)Eric Belhomme2020-12-071-0/+1
| | | Co-authored-by: Gitea <gitea@fake.local>
* User Settings: Ignore empty language codes & validate (#13755)65432020-12-041-1/+1
|
* Fix crash in short link processor (#13839)mrsdizzie2020-12-041-10/+12
| | | Fixes #13819
* Direct avatar rendering (#13649)silverwind2020-12-035-139/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-032-7/+22
|
* Expose default theme in meta and API (#13809)John Olheiser2020-12-031-0/+1
| | | | | Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Clickable links in pull request (and issue) titles (#13695)Jimmy Praet2020-12-032-0/+30
| | | | | | | | | * clickable links in pull request (and issue) titles #13658 reuses the existing logic to render clickable links in commit messages * dedicated RenderIssueTitle function applied patch from @mrsdizzie
* When reinitialising DBConfig reset the database use flags (#13796)zeripath2020-12-021-0/+5
| | | | | | | | | | | | | | One perennial issue is users running the install page, changing the database dialect and then suffering with issues This PR simply resets all of the database.Use flags on initDBConfig. This should prevent this issue from occuring. Fix #13788 Fix #5480 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Move Repo APIFormat to convert package (#13787)65432020-12-025-40/+177
| | | | | * Move Repo APIFormat to convert package * tweek
* Migrations: Use Process Manager to create own Context (#13792)65432020-12-025-13/+31
|
* move notification APIFormat (#13783)65432020-12-021-0/+69
|
* Refactor doctor (#12264)zeripath2020-12-027-0/+751
| | | | | | | | | | | | | | | | | | | | | | | | * Refactor Logger Refactor Logger to make a logger interface and make it possible to wrap loggers for specific purposes. * Refactor Doctor Move the gitea doctor functions into its own module. Use a logger for its messages instead of returning a results string[] Signed-off-by: Andrew Thornton <art27@cantab.net> * Update modules/doctor/misc.go Co-authored-by: 6543 <6543@obermui.de> * Update modules/doctor/misc.go Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Set RUN_MODE prod by default (#13765)silverwind2020-11-301-1/+1
| | | | | | | I think it's a bad default to have "dev" as the default run mode which enables debugging and now also disables HTTP caching. It's better to just default to a value suitable for general deployments. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix label styles affecting shabox (#13734)silverwind2020-11-281-5/+4
| | | | | | | | | | | | | | * Fix label styles affecting shabox Add common parent .labels-list to issue labels lists to prevent affecting other elements. Fixes: https://github.com/go-gitea/gitea/issues/13704 * Update templates/shared/issuelist.tmpl * Update templates/shared/issuelist.tmpl Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add Allow-/Block-List for Migrate & Mirrors (#13610)65432020-11-284-3/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add black list and white list support for migrating repositories * fix fmt * fix lint * fix vendor * fix modules.txt * clean diff * specify log message * use blocklist/allowlist * allways use lowercase to match url * Apply allow/block * Settings: use existing "migrations" section * convert domains lower case * dont store unused value * Block private addresses for migration by default * fix lint * use proposed-upstream func to detect private IP addr * a nit * add own error for blocked migration, add tests, imprufe api * fix test * fix-if-localhost-is-ipv4 * rename error & error message * rename setting options * Apply suggestions from code review Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Push HEAD instead of master when initialising repositories (#13719)zeripath2020-11-281-2/+2
| | | | | | | | | | | | | | | | | | * Push HEAD instead of master when initialising repositories It is possible on modern gits to change the initial branch to something other than master. This breaks initialising repositories because we assume that the initial branch is going to be master unless specifically changed. This PR simply bypasses this issue by pushing the HEAD rather than the master branch. Signed-off-by: Andrew Thornton <art27@cantab.net> * Update modules/repository/init.go Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add block on official review requests branch protection (#13705)a10121127962020-11-283-100/+105
| | | | | Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix review request notification issue link when external issue tracker is ↵Jimmy Praet2020-11-281-1/+1
| | | | | enabled (#13723) The issue.HTMLURL() automatically gets converted to the expected #issue format by the post processors
* Handle and propagate errors when checking if paths are Dirs, Files or Exist ↵zeripath2020-11-2716-42/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | (#13186) * Ensure errors from IsDir propagate * Handle errors when checking IsFile * Handle and propagate errors from IsExist * Update modules/templates/static.go * Update modules/templates/static.go * Return after ctx.ServerError * Apply suggestions from code review * Fix tests The previous merge managed to break repo_form.go Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Support shortened commit SHAs in URLs (#13686)Lauris BH2020-11-251-4/+13
| | | | | | | | | | | * Support shortened commit SHAs in URLs and API * Add test case for short sha * Fix format * Revert API support * Add canonical link headers for short commit ID URLs
* Issue and Pulls lists rework (#13594)silverwind2020-11-252-17/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Issue and Pulls lists rework Reorganized and restyled the issue and pull request lists. * color and layout tweaks * use new issue list on dashboard as well * move pagination into template * misc tweaks * fix label hover * fix milestone list * fix discrepancies between issue and milestone list, add new 'merge' helper * fmt * simplify merge helper * remove whitespace * fix startIndex * further simplify dict merging * rename helper to 'mergeinto' for clarity * allow bottom-row to wrap Co-authored-by: Lauris BH <lauris@nix.lv>
* Send error message when CSRF token is missing (#13676)Kevin Zúñiga2020-11-231-1/+1
|
* API: Admin EditUser: Make FullName, Email, Website & Location optional (#13562)65432020-11-191-15/+16
| | | | | | | | | * API: Admin EditUser: Make FullName, Email, Website & Location optional * update swagger docs * add Tests Co-authored-by: Lauris BH <lauris@nix.lv>
* finaly fix gitlab migration with subdir 2.0 (#13646)65432020-11-201-2/+6
| | | | | | | | | * final fix 2.0? * ignore Approvals for pulls if not found * CI.restart() Co-authored-by: Lauris BH <lauris@nix.lv>
* finaly fix gitlab migration with subdir (#13629)65432020-11-191-2/+9
| | | | | * finaly fix #13535 * add logging
* HTTP cache rework and enable caching for storage assets (#13569)silverwind2020-11-173-23/+67
| | | | | | | | | | This enabled HTTP time-based cache for storage assets, primarily avatars. I have not observed If-Modified-Since from browsers during tests but I guess it's good to support regardless. It introduces a new generic httpcache module that can handle both time-based and etag-based caching. Additionally, manifest.json and robots.txt are now also cachable.
* Migration: Gitlab: Support Subdirectory (#13563)65432020-11-161-0/+18
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Render diff stats server-side (#13579)silverwind2020-11-151-0/+3
| | | Eliminates a flash on page load on the diff stat bars.
* [API] Only Return Json (#13511)65432020-11-142-2/+59
| | | | | | | | | | | | | | | | | * Let Branch and Raw Endpoint return json error if not found * Revert "RM RepoRefByTypeForAPI and move needed parts into GetRawFile directly" This reverts commit d826d08577b23765cb3c257e7a861191d1aa9a04. * more similar to RepoRefByType * dedub-code * API should just speak JSON * nice name Co-authored-by: zeripath <art27@cantab.net>
* missing quotes in default value slice (#13550)Patrick Aljord2020-11-131-1/+1
| | | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Use existing analyzer module for language detection for highlighting (#13522)mrsdizzie2020-11-131-2/+5
| | | | | | | | | | | | | * Use existing analyzer module for language detction for highlighting Thanks @lafriks for pointing out we can reuse existing code for more reliable language detection here. * Update modules/highlight/highlight.go Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add missed sync branch/tag webhook (#13538)Lunny Xiao2020-11-131-0/+8
| | | | Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Introduce go chi web framework as frontend of macaron, so that we can move ↵Lunny Xiao2020-11-133-43/+42
| | | | | | | | | routes from macaron to chi step by step (#7420) * When route cannot be found on chi, go to macaron * Stick chi version to 1.5.0 * Follow router log setting
* Disallow urlencoded new lines in git protocol paths if there is a port (#13521)zeripath2020-11-111-0/+3
| | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent panic on git blame by limiting lines to 4096 bytes at most (#13470)zeripath2020-11-091-10/+32
| | | | | | | | Fix #12440 Closes #13192 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix panic bug in handling multiple references in commit (#13486)zeripath2020-11-102-29/+95
| | | | | | | | | | | | | | | | | | | | | | * Fix panic bug in handling multiple references in commit The issue lay in determining the position of matches on a second run round a commit message in FindAllIssueReferences. Fix #13483 Signed-off-by: Andrew Thornton <art27@cantab.net> * Extract function and make testable Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix the comment Signed-off-by: Andrew Thornton <art27@cantab.net> * cleaning up the comments a bit more Signed-off-by: Andrew Thornton <art27@cantab.net>
* Multiple GitGraph improvements: Exclude PR heads, Add branch/PR links, Show ↵zeripath2020-11-0810-42/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | only certain branches, (#12766) * Multiple GitGraph improvements. Add backend support for excluding PRs, selecting branches and files. Fix #10327 Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * Only show refs in dropdown we display on the graph Signed-off-by: Andrew Thornton <art27@cantab.net> * as per @silverwind Signed-off-by: Andrew Thornton <art27@cantab.net> * use flexbox for ui header Signed-off-by: Andrew Thornton <art27@cantab.net> * Move Hide Pull Request button to the dropdown Signed-off-by: Andrew Thornton <art27@cantab.net> * Add SHA and user pictures Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test 2 Signed-off-by: Andrew Thornton <art27@cantab.net> * fixes * async * more tweaks * use tabs in tmpl Signed-off-by: Andrew Thornton <art27@cantab.net> * remove commented thing Signed-off-by: Andrew Thornton <art27@cantab.net> * fix linting Signed-off-by: Andrew Thornton <art27@cantab.net> * Update web_src/js/features/gitgraph.js Co-authored-by: silverwind <me@silverwind.io> * graph tweaks * more tweaks * add title Signed-off-by: Andrew Thornton <art27@cantab.net> * fix loading indicator z-index and position Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
* Tags cleanup (#13428)John Olheiser2020-11-051-3/+7
| | | | | | | | | * Tags cleanup Signed-off-by: jolheiser <john.olheiser@gmail.com> * fmt Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fixed git args duplication (#13411)Viktor Suprun2020-11-031-0/+3
| | | | | | Because newGit() invoked twice (inside PreInstallInit() and GlobalInit()) and git parameters is global object, all git commands call with duplicated args `-c credential.helper= -c protocol.version=2`
* Fix typo (#13380)Lunny Xiao2020-10-311-1/+1
|
* Storage configuration support `[storage]` (#13314)Lunny Xiao2020-10-313-7/+30
| | | | | | | | | | | * Fix minio bug * Add tests for storage configuration * Change the Seek flag to keep compitable minio? * Fix test when first-byte-pos of all ranges is greater than the resource length Co-authored-by: techknowlogick <techknowlogick@gitea.io>