]> source.dussan.org Git - gitea.git/log
gitea.git
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 7 Dec 2021 00:25:13 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAllow default branch to be inferred on compare page (#17908)
John Olheiser [Mon, 6 Dec 2021 17:04:07 +0000 (11:04 -0600)]
Allow default branch to be inferred on compare page (#17908)

* Allow default branch to be inferred

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Add test for inferred default branch

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoApply CSS Variables to all message elements (#17920)
silverwind [Mon, 6 Dec 2021 15:49:30 +0000 (07:49 -0800)]
Apply CSS Variables to all message elements (#17920)

Fixes #17918. Applies color variables to all ui message on both themes.
The colorization on .segment is a customization not present in fomantic
ui, only used on user/repo/org delete pages.

2 years agoMove repo archiver to models/repo (#17913)
Lunny Xiao [Mon, 6 Dec 2021 07:19:28 +0000 (15:19 +0800)]
Move repo archiver to models/repo (#17913)

* Move repo archiver to models/repo

* Move archiver service into services/repository/

* Fix imports

* Fix test

* Fix test

2 years agoReplace "unix" by "http+unix" for PROTOCOL (#17771)
mscherer [Mon, 6 Dec 2021 04:46:11 +0000 (05:46 +0100)]
Replace "unix" by "http+unix" for PROTOCOL (#17771)

2 years agoFix loading content history on show more (#17819)
Gusted [Mon, 6 Dec 2021 03:57:51 +0000 (04:57 +0100)]
Fix loading content history on show more (#17819)

* Fix loading content history on show more

- Call `initRepoIssueContentHistory` so that the newly loaded issues
also get their content history.
- Resolves #17767

* apply history to show diff too

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoupdate xgo to use 1.17 (#17915)
techknowlogick [Mon, 6 Dec 2021 00:48:38 +0000 (19:48 -0500)]
update xgo to use 1.17 (#17915)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 6 Dec 2021 00:24:54 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoTest cache during init (#17852)
wxiaoguang [Sun, 5 Dec 2021 16:24:57 +0000 (00:24 +0800)]
Test cache during init (#17852)

2 years agoDisplay issue/comment role even if repo archived (#17907)
Lunny Xiao [Sun, 5 Dec 2021 15:04:02 +0000 (23:04 +0800)]
Display issue/comment role even if repo archived (#17907)

2 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 5 Dec 2021 00:25:15 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

2 years agofix i18n (#17906)
wxiaoguang [Sat, 4 Dec 2021 15:24:10 +0000 (23:24 +0800)]
fix i18n (#17906)

2 years agoFix svg colors in file list table (#17903)
silverwind [Sat, 4 Dec 2021 13:17:22 +0000 (05:17 -0800)]
Fix svg colors in file list table (#17903)

* Fix svg colors in file list table

Turns out this can be fixed by just removing rules. Directory and file
icons have other rules that still make them color correctly.

* tweak color on file icons

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoUpdate JS dependencies, adjust eslint config (#17904)
silverwind [Sat, 4 Dec 2021 06:43:14 +0000 (22:43 -0800)]
Update JS dependencies, adjust eslint config (#17904)

- Update all JS dependencies to latest versions
- Add new lint rules, enable es2022 eslint parser features
- Disable github/no-then, I feel the rule was too restricting

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 4 Dec 2021 00:26:13 +0000 (00:26 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix the bug: no wiki page can be created if the repo didn't have any page yet. (...
wxiaoguang [Fri, 3 Dec 2021 19:46:11 +0000 (03:46 +0800)]
Fix the bug: no wiki page can be created if the repo didn't have any page yet. (#17894)

2 years agotests: more integration tests for notifications (#17845)
singuliere [Fri, 3 Dec 2021 19:20:41 +0000 (20:20 +0100)]
tests: more integration tests for notifications (#17845)

Verify that multiple status-types are taken into account as expected.

Refs: https://github.com/go-gitea/gitea/issues/16796

2 years agoRender issue references in file table (#17897)
silverwind [Fri, 3 Dec 2021 16:15:53 +0000 (08:15 -0800)]
Render issue references in file table (#17897)

Fixes #17887

2 years agoImprove seek-help documents (#17895)
wxiaoguang [Fri, 3 Dec 2021 13:04:32 +0000 (21:04 +0800)]
Improve seek-help documents (#17895)

* Add pprof information to seek-help documents
* Improve zh-cn and zh-tw documents

2 years agoAdd hints for special Wiki pages (#17283)
n [Fri, 3 Dec 2021 07:28:54 +0000 (16:28 +0900)]
Add hints for special Wiki pages (#17283)

* Add UI hints to create a Wiki sidebar and footer

2 years agoRemoved SizeFmt. (#17890)
KN4CK3R [Fri, 3 Dec 2021 03:33:34 +0000 (04:33 +0100)]
Removed SizeFmt. (#17890)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoChangelog for v1.15.7 (#17871) (#17889)
6543 [Fri, 3 Dec 2021 01:49:59 +0000 (02:49 +0100)]
Changelog for v1.15.7 (#17871) (#17889)

* Changelog for v1.15.7 (#17871)

* Changelog for v1.15.7

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
* update version in docs

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 3 Dec 2021 00:25:09 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd migrate from Codebase (#16768)
KN4CK3R [Thu, 2 Dec 2021 22:24:02 +0000 (23:24 +0100)]
Add migrate from Codebase (#16768)

This PR adds [Codebase](https://www.codebasehq.com/) as migration source.

Supported:
- Milestones
- Issues
- Pull Requests
- Comments
- Labels

2 years agoUpdate chi/middleware to chi/v5/middleware (#17888)
zeripath [Thu, 2 Dec 2021 20:58:08 +0000 (20:58 +0000)]
Update chi/middleware to chi/v5/middleware (#17888)

Fix #17880

Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoUse fmt.Sprintf correctly (#17886)
delvh [Thu, 2 Dec 2021 19:36:50 +0000 (20:36 +0100)]
Use fmt.Sprintf correctly (#17886)

2 years agoAdded missing `data-` prefix. (#17884)
KN4CK3R [Thu, 2 Dec 2021 16:36:00 +0000 (17:36 +0100)]
Added missing `data-` prefix. (#17884)

2 years agoCheck if column exist before rename if exist, just return with no error (#17870)
Lunny Xiao [Thu, 2 Dec 2021 13:17:24 +0000 (21:17 +0800)]
Check if column exist before rename if exist, just return with no error (#17870)

* Check if column exist before rename if exist, just return with no error

* Also check if errors column exist

* Add comment for migration

* Fix sqlite test

2 years agoRefactor various strings (#17784)
mscherer [Thu, 2 Dec 2021 07:28:08 +0000 (08:28 +0100)]
Refactor various strings (#17784)

Fixes #16478

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agofix 500 error while use a reserved name in org rename (#17878)
a1012112796 [Thu, 2 Dec 2021 02:43:43 +0000 (10:43 +0800)]
fix 500 error while use a reserved name in org rename (#17878)

fix #17876

Signed-off-by: a1012112796 <1012112796@qq.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 2 Dec 2021 00:25:09 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUse shadowing script for docker (#17846)
zeripath [Wed, 1 Dec 2021 18:08:27 +0000 (18:08 +0000)]
Use shadowing script for docker (#17846)

Too many docker users are caught out by the default location for the
app.ini file being environment dependent so that when they docker exec
into the container the gitea commands do not work properly and require
additional -c arguments to correctly pick up the configuration.

This PR simply shadows the gitea binary using variants of the FHS
compatible script to make the command gitea have the default locations
by default.

Fix #14468
Reference #17497
Reference #12082
Reference #8941
... amongst others ...
Replace #17501

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoImprove install code to avoid low-level mistakes. (#17779)
wxiaoguang [Wed, 1 Dec 2021 07:50:01 +0000 (15:50 +0800)]
Improve install code to avoid low-level mistakes. (#17779)

* Improve install code to avoid low-level mistakes.

If a user tries to do a re-install in a Gitea database, they gets a warning and double check.
When Gitea runs, it never create empty app.ini automatically.

Also some small (related) refactoring:

* Refactor db.InitEngine related logic make it more clean (especially for the install code)
* Move some i18n strings out from setting.go to make the setting.go can be easily maintained.
* Show errors in CLI code if an incorrect app.ini is used.
* APP_DATA_PATH is created when installing, and checked when starting (no empty directory is created any more).

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 1 Dec 2021 00:25:14 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRework commit page header (#17849)
silverwind [Tue, 30 Nov 2021 23:40:17 +0000 (15:40 -0800)]
Rework commit page header (#17849)

- Remove blue background and use regular header styling
- Use flexbox on author and signature segments
- Add shield-type icons besides gpg key, replacing icon font icons
- Ensure author and signature line are same height
- Remove erronous green background on arc-green signature line
- Turn signing colors into CSS variables
- Consolidate the two warning states into one

Co-authored-by: zeripath <art27@cantab.net>
2 years agoMake Requests Processes and create process hierarchy. Associate OpenRepository with...
zeripath [Tue, 30 Nov 2021 20:06:32 +0000 (20:06 +0000)]
Make Requests Processes and create process hierarchy. Associate OpenRepository with context. (#17125)

This PR registers requests with the process manager and manages hierarchy within the processes.

Git repos are then associated with a context, (usually the request's context) - with sub commands using this context as their base context.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix position of label color picker colors (#17866)
silverwind [Tue, 30 Nov 2021 17:54:00 +0000 (09:54 -0800)]
Fix position of label color picker colors (#17866)

2 years agodocs: modules do not rely on models, services do (#17861)
singuliere [Tue, 30 Nov 2021 11:56:12 +0000 (12:56 +0100)]
docs: modules do not rely on models, services do (#17861)

services: provide some services for users, usually use
database (models) modules: provide some basic functions without
database, eg: code parser, etc The major difference is services use
database, while modules don’t.

Signed-off-by: singuliere <singuliere@autistici.org>
2 years agoRefactor commit graph styling to use css variables (#17860)
silverwind [Tue, 30 Nov 2021 02:47:18 +0000 (18:47 -0800)]
Refactor commit graph styling to use css variables (#17860)

- Use common variables for colors and font
- Alter graph color 5 to provide enough contrast on both themes

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 30 Nov 2021 00:25:14 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRemove whitespace inside rendered code `<td>` (#17859)
silverwind [Mon, 29 Nov 2021 22:01:56 +0000 (14:01 -0800)]
Remove whitespace inside rendered code `<td>` (#17859)

This extra whitespace caused isses in Firefox where it would copy a
extra space character at the start and the end. Additionally, in Chrome,
the text selection indicated a spaced on the end of the selection where
there was none. Both issues are fixed with the removal of whitespace.

2 years agoSwitch archive URL code back to href attributes (#17796)
fnetX (aka fralix) [Mon, 29 Nov 2021 13:50:43 +0000 (14:50 +0100)]
Switch archive URL code back to href attributes (#17796)

* Add fallback href link
* Switch async archive generation to use href links
* Edit all templates to use href instead of data-url for archives
* Add consistent rel="nofollow" as per wxiaoguang

2 years agoMake Co-committed-by and co-authored-by trailers optional (#17848)
zeripath [Mon, 29 Nov 2021 07:09:55 +0000 (07:09 +0000)]
Make Co-committed-by and co-authored-by trailers optional (#17848)

This PR adds another option to app.ini make co-committed-by and co-authored-by trailers
optional on a per server basis.

Fix #17194

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix various typos in docs (#17844)
qwerty287 [Sun, 28 Nov 2021 23:43:18 +0000 (00:43 +0100)]
Fix various typos in docs (#17844)

2 years agoMove more model into models/user (#17826)
Lunny Xiao [Sun, 28 Nov 2021 14:11:58 +0000 (22:11 +0800)]
Move more model into models/user (#17826)

* Move more model into models/user

* Remove unnecessary comment

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoDocs: replace `gitea` with `Gitea` (#17838)
qwerty287 [Sun, 28 Nov 2021 13:28:30 +0000 (14:28 +0100)]
Docs: replace `gitea` with `Gitea` (#17838)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoMove accessmode into models/perm (#17828)
Lunny Xiao [Sun, 28 Nov 2021 11:58:28 +0000 (19:58 +0800)]
Move accessmode into models/perm (#17828)

2 years agoDisable ref selection dropdown if you don't have permissions to use it (#17837)
qwerty287 [Sun, 28 Nov 2021 04:13:13 +0000 (05:13 +0100)]
Disable ref selection dropdown if you don't have permissions to use it (#17837)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix value of User.IsRestricted to default setting when oauth2 user auto registration...
Galen Suen [Sun, 28 Nov 2021 03:27:48 +0000 (11:27 +0800)]
Fix value of User.IsRestricted to default setting when oauth2 user auto registration; (#17839)

2 years agoHandle relative unix socket paths (#17836)
zeripath [Sat, 27 Nov 2021 20:22:03 +0000 (20:22 +0000)]
Handle relative unix socket paths (#17836)

Make relative unix sockets absolute by making them absolute against the AppWorkPath

Fix #17833

## :warning: BREAKING :warning:

Prior to this PR relative unix sockets would have been asserted to be relative to the current working directory that gitea, gitea serv, hook and manager etc were running in. Hooks and Serv would have failed to work properly under this situation so we expect that although this is a technically breaking change the previous situation was already broken.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix code formating (#17830)
mscherer [Sat, 27 Nov 2021 11:59:51 +0000 (12:59 +0100)]
Fix code formating (#17830)

* fix formatter, format imports first, then go fmt

2 years agoReplace regex usage for MIME parsing (#17831)
Gabriel Vasile [Sat, 27 Nov 2021 11:12:43 +0000 (13:12 +0200)]
Replace regex usage for MIME parsing (#17831)

MIME types can have multiple optional parameters, eg:
    video/webm; codecs="w/e codec"; charset="binary"
This commit replaces the usage of regex for getting the "type/subtype"
with mime.ParseMediaType.

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 27 Nov 2021 00:25:11 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoImplement Well-Known URL for password change (#17777)
mscherer [Fri, 26 Nov 2021 14:55:11 +0000 (15:55 +0100)]
Implement Well-Known URL for password change (#17777)

* Implement Well-Known URL for password change

Fixes #11804

2 years agoAdd archived label for code search results in archived repo's (#17817)
Jimmy Praet [Fri, 26 Nov 2021 08:49:31 +0000 (09:49 +0100)]
Add archived label for code search results in archived repo's (#17817)

* Add archived label for code search results in archived repo's

* Remove trailing whitespace

Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoFix database inconsistent when admin change user email (#17549)
Lunny Xiao [Fri, 26 Nov 2021 01:56:16 +0000 (09:56 +0800)]
Fix database inconsistent when admin change user email (#17549)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 26 Nov 2021 00:25:09 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoorg settings -> webhook/labels/deletion should also active the menu (#17809)
Lunny Xiao [Thu, 25 Nov 2021 15:15:58 +0000 (23:15 +0800)]
org settings -> webhook/labels/deletion should also active the menu (#17809)

2 years agoFixed org styles. (#17807)
KN4CK3R [Thu, 25 Nov 2021 13:05:04 +0000 (14:05 +0100)]
Fixed org styles. (#17807)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix org webchatwork webhook (#17810)
wxiaoguang [Thu, 25 Nov 2021 09:25:25 +0000 (17:25 +0800)]
Fix org webchatwork webhook (#17810)

2 years agoDetect dark theme via css variable (#17800)
ThetaDev [Thu, 25 Nov 2021 07:14:48 +0000 (08:14 +0100)]
Detect dark theme via css variable (#17800)

* 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.

2 years agoAllow forks to org if you can create repos (#17783)
qwerty287 [Thu, 25 Nov 2021 05:03:03 +0000 (06:03 +0100)]
Allow forks to org if you can create repos (#17783)

2 years agoUse correct user on releases (#17806)
Gusted [Thu, 25 Nov 2021 04:17:16 +0000 (04:17 +0000)]
Use correct user on releases (#17806)

- 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>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 25 Nov 2021 00:25:19 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoCreate menus for organization pages (#17802)
Lunny Xiao [Wed, 24 Nov 2021 16:12:54 +0000 (00:12 +0800)]
Create menus for organization pages (#17802)

* Create menus for organization pages

* Fix frontend lint

* Fix frontend lint

2 years agoPreserve color when inverting emojis (#17797)
silverwind [Wed, 24 Nov 2021 12:42:03 +0000 (04:42 -0800)]
Preserve color when inverting emojis (#17797)

Fixes: https://github.com/go-gitea/gitea/issues/17795
2 years agoMove user related model into models/user (#17781)
Lunny Xiao [Wed, 24 Nov 2021 09:49:20 +0000 (17:49 +0800)]
Move user related model into models/user (#17781)

* Move user related model into models/user

* Fix lint for windows

* Fix windows lint

* Fix windows lint

* Move some tests in models

* Merge

2 years agoUse `*PushUpdateOptions` as receiver (#17724)
Gusted [Wed, 24 Nov 2021 09:08:13 +0000 (09:08 +0000)]
Use `*PushUpdateOptions` as receiver (#17724)

2 years agoMove repofiles from modules/repofiles to services/repository/files (#17774)
Lunny Xiao [Wed, 24 Nov 2021 07:56:24 +0000 (15:56 +0800)]
Move repofiles from modules/repofiles to services/repository/files (#17774)

* Move repofiles from modules to services

* rename services/repository/repofiles -> services/repository/files

* Fix test

Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix visibility of org avatars (#17789)
qwerty287 [Wed, 24 Nov 2021 03:51:08 +0000 (04:51 +0100)]
Fix visibility of org avatars (#17789)

* Fix visibility of org avatar

* more clear syntax

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoUse correct Sender on webhook change title (#17791)
Gusted [Wed, 24 Nov 2021 02:47:03 +0000 (02:47 +0000)]
Use correct Sender on webhook change title (#17791)

As title, thanks to @mscherer for pointing out the incorrect code.

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 24 Nov 2021 00:25:19 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUse new OneDev /milestones endpoint (#17782)
KN4CK3R [Tue, 23 Nov 2021 19:28:06 +0000 (20:28 +0100)]
Use new OneDev /milestones endpoint (#17782)

OneDev changed the API which fails every build at the moment.

2 years agoFix keys test (#17776)
techknowlogick [Tue, 23 Nov 2021 08:12:02 +0000 (03:12 -0500)]
Fix keys test (#17776)

2 years agoAdd `PULL_LIMIT` and `PUSH_LIMIT` to cron.update_mirror task (#17568)
zeripath [Tue, 23 Nov 2021 03:09:35 +0000 (03:09 +0000)]
Add `PULL_LIMIT` and `PUSH_LIMIT` to cron.update_mirror task (#17568)

2 years agoImprove ellipsis buttons (#17773)
silverwind [Tue, 23 Nov 2021 02:44:38 +0000 (03:44 +0100)]
Improve ellipsis buttons (#17773)

* 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>
2 years agoHarden authorized keys a bit more (#17772)
mscherer [Tue, 23 Nov 2021 02:44:26 +0000 (03:44 +0100)]
Harden authorized keys a bit more (#17772)

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>
2 years agoAdd copy Commit ID button in commits list (#17759)
velengel [Tue, 23 Nov 2021 02:44:10 +0000 (11:44 +0900)]
Add copy Commit ID button in commits list (#17759)

* 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>
2 years agoAdd documentation for backend development (#17512)
Lunny Xiao [Tue, 23 Nov 2021 02:10:18 +0000 (10:10 +0800)]
Add documentation for backend development (#17512)

* Add documentation for backend development

* Update backend guidline

* More sections

* Add modules/setting and modules/git

* Uniform gitea as Gitea

* some improvements

* some improvements

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 23 Nov 2021 00:31:08 +0000 (00:31 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoMore pleasantly handle broken or missing git repositories (#17747)
zeripath [Mon, 22 Nov 2021 22:32:16 +0000 (22:32 +0000)]
More pleasantly handle broken or missing git repositories (#17747)

* 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>
2 years agoRemove unnecessary attributes of User struct (#17745)
Lunny Xiao [Mon, 22 Nov 2021 15:21:55 +0000 (23:21 +0800)]
Remove unnecessary attributes of User struct (#17745)

* 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

2 years agoSupport pagination of organizations on user settings pages (#16083)
Lunny Xiao [Mon, 22 Nov 2021 13:51:45 +0000 (21:51 +0800)]
Support pagination of organizations on user settings pages (#16083)

* Add pagination for user setting orgs
* Use FindOrgs instead of GetOrgsByUserID
* Remove unnecessary functions and fix test
* remove unnecessary code

2 years agoMake `bind` error more readable (#17750)
Gusted [Mon, 22 Nov 2021 13:05:29 +0000 (13:05 +0000)]
Make `bind` error more readable (#17750)

- 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

2 years agoImprovements to content history (#17746)
Jimmy Praet [Mon, 22 Nov 2021 12:20:16 +0000 (13:20 +0100)]
Improvements to content history (#17746)

* 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

2 years agoFix project board bug and improve documents (#17753)
wxiaoguang [Mon, 22 Nov 2021 11:40:17 +0000 (19:40 +0800)]
Fix project board bug and improve documents (#17753)

* 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)

2 years agoFix navbar on project view (#17749)
Gusted [Mon, 22 Nov 2021 10:57:05 +0000 (10:57 +0000)]
Fix navbar on project view (#17749)

- Shows that the project nav item is active when you're viewing a project.

2 years agoExclude from watching tests (#17744)
Gusted [Mon, 22 Nov 2021 10:17:21 +0000 (10:17 +0000)]
Exclude from watching tests (#17744)

2 years agoAdd user settings key/value DB table (#16834)
techknowlogick [Mon, 22 Nov 2021 09:47:23 +0000 (04:47 -0500)]
Add user settings key/value DB table (#16834)

2 years agoAdd new JS linter rules (#17699)
silverwind [Mon, 22 Nov 2021 08:19:01 +0000 (09:19 +0100)]
Add new JS linter rules (#17699)

* 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>
2 years agoUse `f` variant to parse formatting (#17751)
Gusted [Mon, 22 Nov 2021 06:18:31 +0000 (06:18 +0000)]
Use `f` variant to parse formatting (#17751)

As title.

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 22 Nov 2021 00:24:56 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAllow Loading of Diffs that are too large (#17739)
zeripath [Sun, 21 Nov 2021 16:51:08 +0000 (16:51 +0000)]
Allow Loading of Diffs that are too large (#17739)

* 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>
2 years agoRemove NewSession method from db.Engine interface (#17577)
Lunny Xiao [Sun, 21 Nov 2021 15:41:00 +0000 (23:41 +0800)]
Remove NewSession method from db.Engine interface (#17577)

* Remove NewSession method from db.Engine interface

* Fix bug

* Some improvements

* Fix bug

* Fix test

* Use XXXBean instead of XXXExample

2 years agoFix close issue but time watcher still running (#17643)
Lunny Xiao [Sun, 21 Nov 2021 09:11:48 +0000 (17:11 +0800)]
Fix close issue but time watcher still running (#17643)

* Fix close issue but time watcher still running

* refactor stopwatch codes

* Fix test

* Fix test

* Fix typo

* Fix test

2 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 21 Nov 2021 00:25:17 +0000 (00:25 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoReset locale on login (#17734)
zeripath [Sat, 20 Nov 2021 21:32:37 +0000 (21:32 +0000)]
Reset locale on login (#17734)

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>
2 years agoExtract constant names out for the ReverseProxy and Basic authentication methods...
zeripath [Sat, 20 Nov 2021 15:33:18 +0000 (15:33 +0000)]
Extract constant names out for the ReverseProxy and Basic authentication 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>
2 years agoEnable show more files in diff for git <2.31 (#17733)
zeripath [Sat, 20 Nov 2021 13:50:00 +0000 (13:50 +0000)]
Enable show more files in diff for git <2.31 (#17733)

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>
2 years agoMake a.add-code-comment click handler an event handler (#17737)
zeripath [Sat, 20 Nov 2021 12:12:59 +0000 (12:12 +0000)]
Make a.add-code-comment click handler an event handler (#17737)

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>