aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Detect dark theme via css variable (#17800)ThetaDev2021-11-253-7/+6
| | | | | | | * detect dark theme via css variable * minor refactor, add documentation If your custom theme is considered a dark theme, set the global css variable `--is-dark-theme` to `true`. This allows gitea to adjust the Monaco code editor's theme accordingly.
* Allow forks to org if you can create repos (#17783)qwerty2872021-11-252-7/+7
|
* Use correct user on releases (#17806)Gusted2021-11-251-2/+2
| | | | | | | - Use the provided `doer` instead of `rel.Publisher`. The code will also run on edited releases and deleted ones, which isn't necessary done by `rel.Publisher`. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-11-253-149/+228
|
* Create menus for organization pages (#17802)Lunny Xiao2021-11-255-24/+39
| | | | | | | * Create menus for organization pages * Fix frontend lint * Fix frontend lint
* Preserve color when inverting emojis (#17797)silverwind2021-11-241-1/+1
| | | Fixes: https://github.com/go-gitea/gitea/issues/17795
* Move user related model into models/user (#17781)Lunny Xiao2021-11-24345-3812/+4229
| | | | | | | | | | | | | * Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge
* Use `*PushUpdateOptions` as receiver (#17724)Gusted2021-11-242-17/+17
|
* Move repofiles from modules/repofiles to services/repository/files (#17774)Lunny Xiao2021-11-2437-353/+277
| | | | | | | | | * Move repofiles from modules to services * rename services/repository/repofiles -> services/repository/files * Fix test Co-authored-by: 6543 <6543@obermui.de>
* Fix visibility of org avatars (#17789)qwerty2872021-11-241-7/+13
| | | | | | | * Fix visibility of org avatar * more clear syntax Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Use correct Sender on webhook change title (#17791)Gusted2021-11-241-1/+1
| | | As title, thanks to @mscherer for pointing out the incorrect code.
* [skip ci] Updated translations via CrowdinGiteaBot2021-11-244-18/+96
|
* Use new OneDev /milestones endpoint (#17782)KN4CK3R2021-11-231-2/+18
| | | OneDev changed the API which fails every build at the moment.
* Fix keys test (#17776)techknowlogick2021-11-231-1/+1
|
* Add `PULL_LIMIT` and `PUSH_LIMIT` to cron.update_mirror task (#17568)zeripath2021-11-226-17/+70
|
* Improve ellipsis buttons (#17773)silverwind2021-11-226-7/+18
| | | | | | | | | | | | * Improve ellipsis buttons - Remove icon font usage - Add aria-expanded attribute * rename function to match Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Harden authorized keys a bit more (#17772)mscherer2021-11-221-1/+1
| | | | | | | | | | | | sshd(8) list restrict as a future-proof way to restrict feature enabled in ssh. It is supported since OpenSSH 7.2, out since 2016-02-29. OpenSSH will ignore unknown options (see sshauthopt_parse in auth-options.c), so it should be safe to add the option and no-user-rc. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add copy Commit ID button in commits list (#17759)velengel2021-11-223-2/+10
| | | | | | | | | | | | | | | | | | | * fix: implement commit id copy to clipboard * fix: remove abundant attributes / consider edge-case * fix: locale_en fixed * fix: use ui button * tune copy button * fix: button size * Fix merge Co-authored-by: Ysmr-Ry <ryo.yossy@live.jp> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add documentation for backend development (#17512)Lunny Xiao2021-11-232-0/+128
| | | | | | | | | | | | | | | * Add documentation for backend development * Update backend guidline * More sections * Add modules/setting and modules/git * Uniform gitea as Gitea * some improvements * some improvements
* [skip ci] Updated translations via CrowdinGiteaBot2021-11-2314-28/+2
|
* More pleasantly handle broken or missing git repositories (#17747)zeripath2021-11-226-4/+63
| | | | | | | | | | | | | | | | | | | | | | * More pleasantly handle broken or missing git repositories In #17742 it was noted that there a completely invalid git repository underlying a repo on gitea.com. This happened due to a problem during a migration however, it is not beyond the realms of possibility that a corruption could occur to another user. This PR adds a check to RepoAssignment that will detect if a repository loading has failed due to an absent git repository. It will then show a page suggesting the user contacts the administrator or deletes the repository. Fix #17742 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update options/locale/locale_en-US.ini Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Remove unnecessary attributes of User struct (#17745)Lunny Xiao2021-11-2242-451/+279
| | | | | | | | | | | | | | | * Remove unnecessary functions of User struct * Move more database methods out of user struct * Move more database methods out of user struct * Fix template failure * Fix bug * Remove finished FIXME * remove unnecessary code
* Support pagination of organizations on user settings pages (#16083)Lunny Xiao2021-11-227-34/+108
| | | | | | * Add pagination for user setting orgs * Use FindOrgs instead of GetOrgsByUserID * Remove unnecessary functions and fix test * remove unnecessary code
* Make `bind` error more readable (#17750)Gusted2021-11-221-1/+2
| | | | | - Add the related fieldNames into the response JSON, such that the developer can figure out what's going on. - Related: https://github.com/go-gitea/gitea/issues/17126#issuecomment-937848295
* Improvements to content history (#17746)Jimmy Praet2021-11-226-22/+64
| | | | | | | | | | | * Improvements to content history * initialize content history when making an edit to an old item created before the introduction of content history * show edit history for code comments on pull request files tab * Fix a flaw in keepLimitedContentHistory Fix a flaw in keepLimitedContentHistory, the first and the last should never be deleted * Remove obsolete eager initialization of content history
* Fix project board bug and improve documents (#17753)wxiaoguang2021-11-222-9/+38
| | | | * the project board was broken, this PR fixes it, and refactor the code, and we prevent the uncategorized column from being dragged. * improve the frontend guideline (as discussed in https://github.com/go-gitea/gitea/pull/17699)
* Fix navbar on project view (#17749)Gusted2021-11-221-1/+1
| | | - Shows that the project nav item is active when you're viewing a project.
* Exclude from watching tests (#17744)Gusted2021-11-221-0/+1
|
* Add user settings key/value DB table (#16834)techknowlogick2021-11-228-2/+198
|
* Add new JS linter rules (#17699)silverwind2021-11-2223-109/+845
| | | | | | | | | | | | | | | | | | | | * Add new JS linter rules Adds a few useful rules from eslint-plugin-github. Notable changes: - Forbid dataset usage, its camel-casing behaviour makes it hard to grep for attributes. - Forbid .then() and .catch(), we should generally prefer await for new code. For rare cases where they are useful, a eslint-disable-line directive can be set. - Add docs js to linting * also enable github/array-foreach * small tweak Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Use `f` variant to parse formatting (#17751)Gusted2021-11-221-1/+1
| | | | As title.
* [skip ci] Updated translations via CrowdinGiteaBot2021-11-223-0/+16
|
* Allow Loading of Diffs that are too large (#17739)zeripath2021-11-228-62/+146
| | | | | | | | | | | * Allow Loading of Diffs that are too large This PR allows the loading of diffs that are suppressed because the file is too large. It does not handle diffs of files which have lines which are too long. Fix #17738 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove NewSession method from db.Engine interface (#17577)Lunny Xiao2021-11-2144-570/+550
| | | | | | | | | | | | | * Remove NewSession method from db.Engine interface * Fix bug * Some improvements * Fix bug * Fix test * Use XXXBean instead of XXXExample
* Fix close issue but time watcher still running (#17643)Lunny Xiao2021-11-216-115/+156
| | | | | | | | | | | | | * Fix close issue but time watcher still running * refactor stopwatch codes * Fix test * Fix test * Fix typo * Fix test
* [skip ci] Updated licenses and gitignoresGiteaBot2021-11-213-2/+5
|
* Reset locale on login (#17734)zeripath2021-11-203-0/+10
| | | | | | | | | When logging in reset the user's locale to ensure that it matches their preferred locale. Fix #15612 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Extract constant names out for the ReverseProxy and Basic authentication ↵zeripath2021-11-205-5/+11
| | | | | | | | | methods (#17735) In order to reduce load on the GC extract out the constant names of the Basic and ReverseProxy methods. As mentioned in https://github.com/go-gitea/gitea/pull/15119#discussion_r730352176 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Enable show more files in diff for git <2.31 (#17733)zeripath2021-11-204-32/+253
| | | | | | | | | | | | | Unfortunately due to a misread on my behalf I missed that git diff only learned --skip-to in version 2.31.0. Thus this functionality was not working on older versions of git. This PR adds a handler that simply allows for us to skip reading the diffs until we find the correct file to skip to. Fix #17731 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make a.add-code-comment click handler an event handler (#17737)zeripath2021-11-201-1/+1
| | | | | | | | | Instead of directly attaching the add-code-comment on click handler to the a.add-code-comment elements - make this an event handler on the document instead. Fix #17736 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use `hostmatcher` to replace `matchlist`, improve security (#17605)wxiaoguang2021-11-2033-292/+376
| | | | | Use hostmacher to replace matchlist. And we introduce a better DialContext to do a full host/IP check, otherwise the attackers can still bypass the allow/block list by a 302 redirection.
* Make SSL cipher suite configurable (#17440)zeripath2021-11-209-54/+266
|
* Fix correct usage of teams (#17732)Gusted2021-11-202-2/+8
| | | | | | | - `.Teams` isn't a field on the User type, thus using the seperate loaded teams. - Add a space between `PathEscape` and argument. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-11-202-0/+55
|
* Better builtin avatar generator (#17707)wxiaoguang2021-11-2019-376/+417
| | | | | | | This PR fixes the builtin avatar generator. 1. The random background color makes some images very dirty. So now we only use white background for avatars. 2. We use left-right mirror avatars to satisfy #14799 3. Fix a small padding error in the algorithm
* Add settings to allow different SMTP envelope from address (#17479)zeripath2021-11-194-10/+43
| | | | | | | | | | | * Add settings to allow different SMTP envelope from address Sometimes it may be advisable to hide or alias the from address on an SMTP mail envelope. This PR adds two new options to the mailer to allow setting of an overriding from address. Fix #17477 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Allow Token API calls be authorized using the reverse-proxy header (#15119)Paweł Bogusławski2021-11-191-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * API calls authorized with HTTP header This mod allows API calls to be authorized with HTTP header when ENABLE_REVERSE_PROXY_AUTHENTICATION is enabled. Without it user authenticated by reverse proxy is able to access gitea UI but not API which is inconsistent. Author-Change-Id: IB#1107572 * Fixed API calls authorized with HTTP header Only reqBasicAuth is modified to allow reverse proxy auth as alternative and reqToken is left untouched. Fixes: dc952c063206d11504085ddea966f121e796a04c Author-Change-Id: IB#1107572 * Reverse proxy API auth separated in docs Related: https://github.com/go-gitea/gitea/pull/15119#discussion_r621322127 Author-Change-Id: IB#1107572 * Reverse proxy API auth separated in docs Related: https://github.com/go-gitea/gitea/pull/15119#discussion_r621322127 Author-Change-Id: IB#1107572 * Reverse proxy API auth separated Related: https://github.com/go-gitea/gitea/pull/15119#discussion_r621322127 Author-Change-Id: IB#1107572 * ReverseProxyAuth removed from swagger ReverseProxyAuth removed from swagger as in upstream's suggestion. Related: https://github.com/go-gitea/gitea/pull/15119#pullrequestreview-692180940 Author-Change-Id: IB#1107572 * ReverseProxyAuth API authorization fixed Related: https://github.com/go-gitea/gitea/pull/15119#issuecomment-868465099 Author-Change-Id: IB#1107572 * ReverseProxyAuth API authorization fixed Related: https://github.com/go-gitea/gitea/pull/15119#issuecomment-868465099 Author-Change-Id: IB#1107572
* Move attachment into models/repo/ (#17650)Lunny Xiao2021-11-1939-408/+471
| | | | | | | * Move attachment into models/repo/ * Fix test * Fix bug
* Use a standalone struct name for Organization (#17632)Lunny Xiao2021-11-1943-259/+335
| | | | | | | | | | | | | | | | | | | | | * Use a standalone struct name for Organization * recover unnecessary change * make the code readable * Fix template failure * Fix template failure * Move HasMemberWithUserID to org * Fix test * Remove unnecessary user type check * Fix test Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Prevent double sanitize (#16386)KN4CK3R2021-11-193-64/+48
| | | | | | | | * Prevent double sanitize. * Use SanitizeReaderToWriter. At the moment `actualRender` uses `SanitizeReader` to sanitize the output. But `SanitizeReader` gets called in `markup.render` too so the output gets sanitized twice. I moved the `SanitizeReader` call into `RenderRaw` because this method does not use `markup.render`. I would like to remove the `RenderRaw`/`RenderRawString` methods too because they are only called from tests, the fuzzer and the `/markup/raw` api endpoint. This endpoint is not in use so I think we could remove them. If we really in the future need a method to render markdown without PostProcessing we could achieve this with a more flexible `renderer.NeedPostProcess` method.