]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agoSlightly simplify LastCommitCache (#20444) 20464/head
zeripath [Mon, 25 Jul 2022 15:39:42 +0000 (16:39 +0100)]
Slightly simplify LastCommitCache (#20444)

The LastCommitCache code is a little complex and there is unnecessary
duplication between the gogit and nogogit variants.

This PR adds the LastCommitCache as a field to the git.Repository and
pre-creates it in the ReferencesGit helpers etc. There has been some
simplification and unification of the variant code.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix Ruby package parsing by removed unused email field (#20470)
KN4CK3R [Mon, 25 Jul 2022 00:52:14 +0000 (02:52 +0200)]
Fix Ruby package parsing by removed unused email field (#20470)

2 years ago[skip ci] Updated translations via Crowdin
Tyrone Yeh [Mon, 25 Jul 2022 00:21:14 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd repository condition for issue count (#20454)
Tyrone Yeh [Sun, 24 Jul 2022 16:53:40 +0000 (00:53 +0800)]
Add repository condition for issue count (#20454)

* Add repository condition for issue count

* Update routers/web/user/home.go

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoPrepend commit message to template content (#20429)
Gusted [Sun, 24 Jul 2022 03:45:33 +0000 (05:45 +0200)]
Prepend commit message to template content (#20429)

- When a repository has a pull request template, it will always override
the current content. With this PR it will prepend content to the
template content when appropriate. This is similar how GitHub(and GitLab
I presume) does it and it saves developers time to not go open their
commit and copy paste their will written commit message.

2 years agoImprove pprof doc (#20463)
wxiaoguang [Sat, 23 Jul 2022 17:33:55 +0000 (01:33 +0800)]
Improve pprof doc (#20463)

2 years agoImprove code diff highlight, fix incorrect rendered diff result (#19958)
wxiaoguang [Sat, 23 Jul 2022 11:28:02 +0000 (19:28 +0800)]
Improve code diff highlight, fix incorrect rendered diff result (#19958)

Use Unicode placeholders to replace HTML tags and HTML entities first, then do diff, then recover the HTML tags and HTML entities. Now the code diff with highlight has stable behavior, and won't emit broken tags.

2 years agoAdd Cache-Control header to html and api responses, add no-transform (#20432)
silverwind [Sat, 23 Jul 2022 06:38:03 +0000 (08:38 +0200)]
Add Cache-Control header to html and api responses, add no-transform (#20432)

`no-transform` allegedly disables CloudFlare auto-minify and we did not
set caching headers on html or api requests, which seems good to have
regardless.

Transformation is still allowed for asset requests.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
Gergely Nagy [Sat, 23 Jul 2022 00:20:56 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAllow non-semver packages in the Conan package registry (#20412)
Gergely Nagy [Fri, 22 Jul 2022 21:54:02 +0000 (23:54 +0200)]
Allow non-semver packages in the Conan package registry (#20412)

A lot of existing packages do not conform to SemVer, yet, they should be allowed
in the Conan package registry as-is. To achieve this, remove the SemVer check
from `NewRecipeReference`, and replace it with a simple empty string check.

A unit test with a non-semver version is also included.

Fixes #20405.

Signed-off-by: Gergely Nagy <me@gergo.csillger.hu>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2 years agoUse body text color in repository files table links (#20386)
Lucas Azevedo [Fri, 22 Jul 2022 10:49:24 +0000 (07:49 -0300)]
Use body text color in repository files table links (#20386)

Use body text color in for links in the repository files table
Issue/PR links (`.ref-issue`) will not be affected, as seen in other git services.

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoCorrect code block in installation docs for Snap (#20440)
Andrew Imeson [Fri, 22 Jul 2022 10:12:27 +0000 (06:12 -0400)]
Correct code block in installation docs for Snap (#20440)

Without this, it was rendering on the site like: "sh snap install gitea", instead of: "snap install gitea"

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoDowngrade golangci-lint to 1.47.0 (#20445)
silverwind [Fri, 22 Jul 2022 02:22:44 +0000 (04:22 +0200)]
Downgrade golangci-lint to 1.47.0 (#20445)

This should fix some recently seen linter performance issues. There is some log spam, but it's definitely faster.

Ref: https://github.com/golangci/golangci-lint/issues/2997

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd eslint-plugin-sonarjs (#20431)
silverwind [Fri, 22 Jul 2022 01:10:22 +0000 (03:10 +0200)]
Add eslint-plugin-sonarjs (#20431)

We had this plugin before but it was removed as it became outdated, now
it was updated again, so it's compatible again.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix: Actor is required to get user repositories (#20443)
Dhruv Manilawala [Thu, 21 Jul 2022 21:31:22 +0000 (03:01 +0530)]
Fix: Actor is required to get user repositories (#20443)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
2 years agoAdd "X-Gitea-Object-Type" header for GET `/raw/` & `/media/` API (#20438)
6543 [Thu, 21 Jul 2022 19:18:41 +0000 (21:18 +0200)]
Add "X-Gitea-Object-Type" header for GET `/raw/` & `/media/` API (#20438)

2 years agoSimplify visibility checks (#20406)
KN4CK3R [Thu, 21 Jul 2022 10:41:50 +0000 (12:41 +0200)]
Simplify visibility checks (#20406)

Was looking into the visibility checks because I need them for something different and noticed the checks are more complicated than they have to be.

The rule is just: user/org is visible if
- The doer is a member of the org, regardless of the org visibility
- The doer is not restricted and the user/org is public or limited

2 years agoAdd Cloudflare auto-minify to FAQ (#20430)
John Olheiser [Thu, 21 Jul 2022 04:54:42 +0000 (23:54 -0500)]
Add Cloudflare auto-minify to FAQ (#20430)

2 years ago[skip ci] Updated translations via Crowdin
silverwind [Thu, 21 Jul 2022 00:20:58 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUpdate JS dependencies (#20423)
silverwind [Wed, 20 Jul 2022 15:48:06 +0000 (17:48 +0200)]
Update JS dependencies (#20423)

- Update all JS dependencies minus vue ones
- Remove workaround for case-insensitive attribute selector
- Add new linter rules and fix issues
- Tested SVG display and swagger

2 years agoUpdate all tool dependencies to their latest versions (#20409)
silverwind [Wed, 20 Jul 2022 07:53:58 +0000 (09:53 +0200)]
Update all tool dependencies to their latest versions (#20409)

2 years ago[skip ci] Updated translations via Crowdin
6543 [Wed, 20 Jul 2022 00:20:52 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoDismiss prior pull reviews if done via web in review dismiss (#20197)
6543 [Tue, 19 Jul 2022 13:20:28 +0000 (15:20 +0200)]
Dismiss prior pull reviews if done via web in review dismiss (#20197)

2 years agoFix modified due date message (#20388)
Lucas Azevedo [Tue, 19 Jul 2022 12:30:55 +0000 (09:30 -0300)]
Fix modified due date message (#20388)

2 years agoFix public org members displayed too many informations (#20403)
Lunny Xiao [Tue, 19 Jul 2022 10:22:38 +0000 (18:22 +0800)]
Fix public org members displayed too many informations (#20403)

2 years agoAdd two factor status to admin cmd display (#20401)
Tyrone Yeh [Tue, 19 Jul 2022 08:43:49 +0000 (16:43 +0800)]
Add two factor status to admin cmd display (#20401)

2 years agoUse tippy.js for context popup (#20393)
silverwind [Mon, 18 Jul 2022 22:33:34 +0000 (00:33 +0200)]
Use tippy.js for context popup (#20393)

By appending the tooltips to `document.body`, we can avoid any stacking context issues caused by surrounding element's CSS.

This uses [tippy.js](https://github.com/atomiks/tippyjs) instead of Fomantic popups. We should aim to replace all Fomantic popups with this eventually and then get rid of the Fomantic `popup` module completely.

2 years ago[skip ci] Updated licenses and gitignores
CLanguagePurist [Sun, 17 Jul 2022 00:20:41 +0000 (00:20 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoComment on PrivateUsers option for gitea.service (#20383)
CLanguagePurist [Sat, 16 Jul 2022 12:58:56 +0000 (06:58 -0600)]
Comment on PrivateUsers option for gitea.service (#20383)

* Comment on PrivateUsers option for gitea.service

A user happens to encounter an issue where PrivateUsers sandboxed Gitea.service and it effectively stop systemd from applying capabilities for that gitea.service. I am opening this PR to provide comments on PrivateUsers, effectively a tiny FAQ information for end-user.

2 years ago[skip ci] Updated translations via Crowdin
wxiaoguang [Sat, 16 Jul 2022 00:20:56 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRemove confusing TrimPrefix(... git.BranchPrefix) (#20369)
wxiaoguang [Sat, 16 Jul 2022 00:10:02 +0000 (08:10 +0800)]
Remove confusing TrimPrefix(... git.BranchPrefix) (#20369)

Make Repository.GetDefaultBranch return the real branch name, instead of the ref name. Then there is no need to do TrimPrefix for repo.DefaultBranch

2 years agoSet target on create release with existing tag (#20381)
Gusted [Fri, 15 Jul 2022 18:39:03 +0000 (18:39 +0000)]
Set target on create release with existing tag (#20381)

When you create a new release(e.g. via Tea) and specify a tag that already exists on
the repository, Gitea will instead use the `UpdateRelease`
functionality. However it currently doesn't set the Target field. This
PR fixes that.

2 years agoInitialize cron last (#20373)
zeripath [Fri, 15 Jul 2022 15:20:05 +0000 (16:20 +0100)]
Initialize cron last (#20373)

Cron will try to run certain things at startup but these depend on multiple things
being set-up. Therefore we should initialize cron last.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAllow access to the Public Organization Member lists with minimal permissions (#20330)
a1012112796 [Fri, 15 Jul 2022 14:21:54 +0000 (22:21 +0800)]
Allow access to the Public Organization Member lists with minimal permissions (#20330)

Examining Organization membership should not necessarily require sign-in if the organization is public and the members are public. Therefore we should adjust `/org/{org}/members` to not require login.

Fix #7501

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoFix commit status icon when in subdirectory (#20285)
silverwind [Fri, 15 Jul 2022 13:01:32 +0000 (15:01 +0200)]
Fix commit status icon when in subdirectory (#20285)

When viewing a subdirectory and the latest commit to that directory in
the table, the commit status icon incorrectly showed the status of the
HEAD commit instead of the latest for that directory.

2 years agoFix eslint parsing errors, remove eslint-plugin-html (#20323)
silverwind [Fri, 15 Jul 2022 09:38:18 +0000 (11:38 +0200)]
Fix eslint parsing errors, remove eslint-plugin-html (#20323)

Introduce a separate .eslintrc in the Vue components folder to
selectively enable vue-eslint-parser there, so that the rest of the
files can use eslint's core parser which can deal with hashbangs.

The fact that the eslint-disable comments worked in HTML was a
unintended side-effect of the files being parsed via vue-eslint-parser,
so I had to disable the parsing of these files in .eslintrc.yaml to make
it work, and finally decided to remove eslint-plugin-html as it causes
more issues than it solves.

2 years agoInclude login_name in adminCreateUser response (#20283)
Baekjun Kim [Fri, 15 Jul 2022 08:52:11 +0000 (01:52 -0700)]
Include login_name in adminCreateUser response (#20283)

`login_name` (Authentication Sign-in Name) is not included in the response of `adminUserCreate` API.
This PR is to return user-specified `login_name` if there is one.

2 years agoAdd allow_rebase_update, default_delete_branch_after_merge to repository api response...
Bian Jiaping [Fri, 15 Jul 2022 08:00:01 +0000 (16:00 +0800)]
Add allow_rebase_update, default_delete_branch_after_merge to repository api response (#20079)

`PATCH /repos/{owner}/{repo}` API allows users to update `allow_rebase_update`, `default_delete_branch_after_merge`, but `GET /repos/{owner}/{repo}` API does not return these two options, and API users has no other ways to find the state of these two options.

This PR add `allow_rebase_update`, `default_delete_branch_after_merge` to repository query api response.

2 years agoAllow to specify colors for text in markup (#20363)
Gusted [Fri, 15 Jul 2022 06:38:10 +0000 (06:38 +0000)]
Allow to specify colors for text in markup (#20363)

`<span style="color: red">Hello World!</span>` will now be accepted by
Bluemonday, other properties are still disallowed by Bluemonday.

2 years ago[skip ci] Updated translations via Crowdin
6543 [Fri, 15 Jul 2022 00:20:57 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoupdate xorm.io/xorm v1.3.2-0.20220714055524-c3bce556200f (#20371)
6543 [Thu, 14 Jul 2022 18:40:30 +0000 (20:40 +0200)]
update xorm.io/xorm v1.3.2-0.20220714055524-c3bce556200f (#20371)

Xorm 1.3.2-0.20220714055524 contains a fix for interpreting db column sizes. Prior to this fix xorm would assume that the size of a column was within the range of an `int`. This is correct on 64bit machines where `int` is typical equivalent to `int64` however, on 32bit machines `int` tends to be `int32`.

Unfortunately the size of a LONGTEXT field is actually `max_uint32`, thus using `strconv.Atoi` on these fields will fail and thus #20161 occurs on 32 bit arm. Xorm 1.3.2-0.20220714055524 changes this field to use int64 instead.

Fix  #20161

2 years agoAdd order by for assignee no sort issue (#20053)
Tyrone Yeh [Thu, 14 Jul 2022 16:00:10 +0000 (00:00 +0800)]
Add order by for assignee no sort issue (#20053)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoMake sure `repo_dir` is an empty directory or doesn't exist before 'dump-repo' (...
a1012112796 [Thu, 14 Jul 2022 13:52:18 +0000 (21:52 +0800)]
Make sure `repo_dir` is an empty directory or doesn't exist before 'dump-repo' (#20205)

2 years agoFix English mistakes in some Markdown documents (#20274)
Jeremy [Thu, 14 Jul 2022 11:15:35 +0000 (23:15 +1200)]
Fix English mistakes in some Markdown documents (#20274)

2 years agoFix versions check for busybox `sh` (#20358)
silverwind [Thu, 14 Jul 2022 08:58:14 +0000 (10:58 +0200)]
Fix versions check for busybox `sh` (#20358)

`printf` in busybox emits a ugly 'invalid number' error when formatting
string variables are present. Avoid that by reducing the go version
check to just two digits, which ought to be enough as patch-level go
versions are meant to be compatible. Avoid error on node-check as well.

2 years agoUnbreak release pipeline (#20356)
silverwind [Thu, 14 Jul 2022 08:09:26 +0000 (10:09 +0200)]
Unbreak release pipeline (#20356)

Downgrade release pipeline to node 16 until xgo updates its base OS to a
version with a compatible glibc.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoAdd option to purge users (#18064)
zeripath [Thu, 14 Jul 2022 07:22:09 +0000 (08:22 +0100)]
Add option to purge users (#18064)

Add the ability to purge users when deleting them.

Close #15588

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix icon margin in user/settings/repos (#20281)
Baoshuo Ren [Thu, 14 Jul 2022 03:03:31 +0000 (11:03 +0800)]
Fix icon margin in user/settings/repos (#20281)

2 years agoFix org label open count, including close count issue (#20353)
Tyrone Yeh [Thu, 14 Jul 2022 02:09:03 +0000 (10:09 +0800)]
Fix org label open count, including close count issue (#20353)

Fixed using organization tags to see open issues in the tag list including closed issues count

2 years ago[skip ci] Updated translations via Crowdin
zeripath [Thu, 14 Jul 2022 00:21:35 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoPrevent context deadline error propagation in GetCommitsInfo (#20346)
zeripath [Wed, 13 Jul 2022 22:24:29 +0000 (23:24 +0100)]
Prevent context deadline error propagation in GetCommitsInfo (#20346)

* Prevent context deadline error propagation in GetCommitsInfo

Although `WalkGitLog` tries to test for `context.DeadlineExceededErr`
there is a small chance that the error will propagate to the reader
before it is recognised. This will cause the error to propagate up to
`renderDirectoryFiles` and cause a http status 500.

Here we check that the error passed is a `DeadlineExceededErr` via error.Is

Fix #20329

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAdd missing return for when topic isn't found (#20351)
Gusted [Wed, 13 Jul 2022 17:39:19 +0000 (17:39 +0000)]
Add missing return for when topic isn't found (#20351)

Add missing return to DeleteTopic API when the topic is not found.

2 years agoUpgrade to Node 18 on CI (#20340)
silverwind [Wed, 13 Jul 2022 15:45:08 +0000 (17:45 +0200)]
Upgrade to Node 18 on CI (#20340)

* Upgrade to Node 18 on CI

Should be pretty stable now.

* restart ci

Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix checks in PR for empty commits #19603 (#20290)
Ing. Jaroslav Šafka [Wed, 13 Jul 2022 08:22:51 +0000 (10:22 +0200)]
Fix checks in PR for empty commits #19603 (#20290)

* Fixes issue #19603 (Not able to merge commit in PR when branches content is same, but different commit id)
* fill HeadCommitID in PullRequest
* compare real commits ID as check for merging
* based on @zeripath patch in #19738

2 years agoUse default values when provided values are empty (#20318)
Gusted [Wed, 13 Jul 2022 05:33:31 +0000 (05:33 +0000)]
Use default values when provided values are empty (#20318)

* Use default values when provided values are empty

- When provided values are empty like `:3000` would imply that host is
empty, use the default value.
- Resolves #20316

* Update database.go

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoAdd tests for the host checking logic, clarify the behaviors (#20328)
wxiaoguang [Wed, 13 Jul 2022 01:07:16 +0000 (09:07 +0800)]
Add tests for the host checking logic, clarify the behaviors (#20328)

Before, the combination of AllowedDomains/BlockedDomains/AllowLocalNetworks is confusing.

This PR adds tests for the logic, clarify the behaviors.

2 years agoChangelog for 1.16.9 (update) (#20341) (#20343)
6543 [Tue, 12 Jul 2022 22:27:35 +0000 (00:27 +0200)]
Changelog for 1.16.9 (update) (#20341) (#20343)

* Changelog for 1.16.9 (update)

2 years agoFix various typos (#20338)
luzpaz [Tue, 12 Jul 2022 21:32:37 +0000 (17:32 -0400)]
Fix various typos (#20338)

* Fix various typos

Found via `codespell -q 3 -S ./options/locale,./options/license,./public/vendor -L actived,allways,attachements,ba,befores,commiter,pullrequest,pullrequests,readby,splitted,te,unknwon`

Co-authored-by: zeripath <art27@cantab.net>
2 years agoCorrectly handle draft releases without a tag (#20314)
Chongyi Zheng [Tue, 12 Jul 2022 12:57:38 +0000 (08:57 -0400)]
Correctly handle draft releases without a tag (#20314)

Fixes #20313.

`errors.Is(err, git.ErrNotExist{})` is not working

2 years agoAdd write check for creating Commit status (#20332)
Gusted [Tue, 12 Jul 2022 12:51:06 +0000 (12:51 +0000)]
Add write check for creating Commit status (#20332)

- Add write code checks for creating new commit status
- Regression #5314

Co-authored-by: zeripath <art27@cantab.net>
2 years agoRemove blue text on migrate page (#20273)
silverwind [Tue, 12 Jul 2022 09:04:15 +0000 (11:04 +0200)]
Remove blue text on migrate page (#20273)

* Remove blue text on migrate page

* remove Safe

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoUpdated dead link to Madeleine.js source (#20322)
BurritoVoid [Tue, 12 Jul 2022 03:51:14 +0000 (23:51 -0400)]
Updated dead link to Madeleine.js source (#20322)

2 years ago[skip ci] Updated translations via Crowdin
silverwind [Tue, 12 Jul 2022 00:10:13 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd spectral linter for Swagger (#20321)
silverwind [Mon, 11 Jul 2022 23:07:16 +0000 (01:07 +0200)]
Add spectral linter for Swagger (#20321)

[spectral](https://github.com/stoplightio/spectral) lints
openapi/swagger files for mistakes of which it has identified a few and
which I've fixed.

I had to put it into `lint-frontend` because it depends on node_modules
so can not run on Drone during the backend target. I plan to refactor
these targets later to `lint-js` and `lint-go` so that they are
categorized based on the tool dependencies.

2 years agoStore read access in access for team repo's (#20275)
Gusted [Mon, 11 Jul 2022 11:48:43 +0000 (11:48 +0000)]
Store read access in access for team repo's (#20275)

- Currently when a Team has read access to a organization's non-private
repository, their access won't be stored in the database. This caused
issue for code that rely on read access being stored. So from now-on if
we see that the repository is owned by a organization don't increase the
minMode to write permission.
- Resolves #20083

2 years ago[skip ci] Updated translations via Crowdin
Gusted [Mon, 11 Jul 2022 00:10:08 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoVertical align avatar at middle (#20302)
Gusted [Sun, 10 Jul 2022 18:49:13 +0000 (18:49 +0000)]
Vertical align avatar at middle (#20302)

- Currently the avatar in the navbar is being vertically aligned to the
top, this caused that the icon besides it isn't being at the middle of
the avatar. Use the `vm` helper class to force the `vertical-align` to
be `middle`.
- Resolves #20292

2 years agoChanged scroll to auto for some UI elements. (#20294)
KN4CK3R [Sun, 10 Jul 2022 12:58:26 +0000 (14:58 +0200)]
Changed scroll to auto for some UI elements. (#20294)

Addition to: Show scrollbar when necessary #20142
Fixes the "empty" scrollbars with Firefox.

2 years agoAdd hint to GNUPGHOME environment variable (#20134)
Steven Kriegler [Sun, 10 Jul 2022 09:04:46 +0000 (11:04 +0200)]
Add hint to GNUPGHOME environment variable (#20134)

* Add hint for GNUPGHOME environment variable

With #19732, the default location for the `.gnupg` folder has changed. To mitigate this breaking change, users can specify the home directory for gnupg via `$GNUPGHOME` environment variable to keep using their current location.

* Update docs/content/doc/advanced/signing.en-us.md

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoRefactor SSH init code, fix directory creation for TrustedUserCAKeys file (#20299)
wxiaoguang [Sun, 10 Jul 2022 06:50:26 +0000 (14:50 +0800)]
Refactor SSH init code, fix directory creation for TrustedUserCAKeys file (#20299)

* Refactor SSH init code, fix directory creation for TrustedUserCAKeys file

* Update modules/ssh/init.go

Co-authored-by: zeripath <art27@cantab.net>
* fix lint copyright

* Update modules/ssh/init.go

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
Gusted [Sun, 10 Jul 2022 00:10:33 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoUse dedicated draft PR icon when possible (#20303)
Gusted [Sat, 9 Jul 2022 22:17:04 +0000 (00:17 +0200)]
Use dedicated draft PR icon when possible (#20303)

* Use dedicated draft PR icon when possible

- Currently the generic pull-request icon is used for draft PR's. This
patch changes that by using the dedicated icon for this.
- Resolves #20296

* Use draft title

2 years agoUpdate goldmark (#20300)
Gusted [Sat, 9 Jul 2022 18:58:22 +0000 (20:58 +0200)]
Update goldmark (#20300)

Update goldmark to v1.4.13 to fix a issue with quotes after a empty
list item(See https://github.com/yuin/goldmark/issues/313) and
downstream issue https://codeberg.org/Codeberg/Community/issues/645

2 years agoDo not create empty ".ssh" directory when loading config (#20289)
wxiaoguang [Sat, 9 Jul 2022 14:32:18 +0000 (22:32 +0800)]
Do not create empty ".ssh" directory when loading config (#20289)

Creating the directory automatically is not correct.
In other places for ssh key writing (RewriteAllPrincipalKeys / appendAuthorizedKeysToFile, etc), the directory will still be created when updating the keys.
This PR will resolve the confusing and annoying problem: the dummy and empty ".ssh" directory in new git home.

2 years agoImplement sync push mirror on commit (#19411)
Chongyi Zheng [Fri, 8 Jul 2022 19:45:12 +0000 (15:45 -0400)]
Implement sync push mirror on commit (#19411)

Support synchronizing with the push mirrors whenever new commits are pushed or synced from pull mirror.

Related Issues: #18220

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoUse git.HOME_PATH for Git HOME directory (#20114)
wxiaoguang [Fri, 8 Jul 2022 08:09:07 +0000 (16:09 +0800)]
Use git.HOME_PATH for Git HOME directory (#20114)

* Add git.HOME_PATH

* add legacy file check

* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
* pass env GNUPGHOME to git command, move the existing .gitconfig to new home, make the fix for 1.17rc more clear.

* set git.HOME_PATH for docker images to default HOME

* Revert "set git.HOME_PATH for docker images to default HOME"

This reverts commit f120101ddc267cef74e4f4b92c783d5fc8e275a1.

* force Gitea to use a stable GNUPGHOME directory

* extra check to ensure only process dir or symlink for legacy files

* refactor variable name

* The legacy dir check (for 1.17-rc1) could be removed with 1.18 release, since users should have upgraded from 1.17-rc to 1.17-stable

* Update modules/git/git.go

Co-authored-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
* remove initFixGitHome117rc

* Update git.go

* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd tooltip to repo icons in explore page (#20241)
Baoshuo Ren [Thu, 7 Jul 2022 20:17:41 +0000 (04:17 +0800)]
Add tooltip to repo icons in explore page (#20241)

* Add label to repo icons in explore page

Co-authored-by: silverwind <me@silverwind.io>
2 years agoFix NPE when using non-numeric (#20277)
Gusted [Thu, 7 Jul 2022 15:46:49 +0000 (17:46 +0200)]
Fix NPE when using non-numeric (#20277)

- This code is only valid when `refNumeric` exist(otherwise we didn't find
such numeric PR and can skip that check) and give a free-pas to the  "BEFORE" check when
`ref` is nil.
- Resolves #20109

2 years agoModify milestone search keywords to be case insensitive (#20266)
Tyrone Yeh [Wed, 6 Jul 2022 21:05:12 +0000 (05:05 +0800)]
Modify milestone search keywords to be case insensitive (#20266)

Milestone search keywords are now sensitive, this modification is changed to insensitive

2 years agoFix toolip on mobile notification bell (#20270)
zeripath [Wed, 6 Jul 2022 21:03:52 +0000 (22:03 +0100)]
Fix toolip on mobile notification bell (#20270)

Unfortunately there is a bug in #20108 where the translation call was
not updated to use `.locale` from `.i18n`.

This PR updates the template to use `.locale`.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAllow RSA 2047 bit keys (#20272)
zeripath [Wed, 6 Jul 2022 20:49:27 +0000 (21:49 +0100)]
Allow RSA 2047 bit keys (#20272)

Unfortunately it appears that 2048 bit RSA keys can occasionally be created in such
a way that they appear to have 2047 bit length. This PR simply changes our defaults to
allow these.

Fix #20249

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoRefix notification bell placement (#20251)
zeripath [Wed, 6 Jul 2022 17:33:10 +0000 (18:33 +0100)]
Refix notification bell placement (#20251)

The use of `m-4 text black` for the notification bell results in this
icon being shifted upwards. Instead we should use the `item` class but
adjust `not-mobile` and `mobile-only` to make their `display: none`
settings `!important`.

(As an aside: This is probably one of the only times we should use
`!important` in our less files and the rest should be avoided or
removed.)

Ref #20069
Revert #20236

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoBump mermaid from 9.1.1 to 9.1.2 (#20256)
dependabot[bot] [Wed, 6 Jul 2022 01:41:54 +0000 (09:41 +0800)]
Bump mermaid from 9.1.1 to 9.1.2 (#20256)

Bumps [mermaid](https://github.com/knsv/mermaid) from 9.1.1 to 9.1.2.
- [Release notes](https://github.com/knsv/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/knsv/mermaid/compare/9.1.1...9.1.2)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2 years agoEscapeFilter the group dn membership (#20200)
zeripath [Tue, 5 Jul 2022 15:59:27 +0000 (16:59 +0100)]
EscapeFilter the group dn membership (#20200)

The uid provided to the group filter must be properly escaped using the provided
ldap.EscapeFilter function.

Fix #20181

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoOnly show Followers that current user can access (#20220)
zeripath [Tue, 5 Jul 2022 15:47:45 +0000 (16:47 +0100)]
Only show Followers that current user can access (#20220)

Users who are following or being followed by a user should only be
displayed if the viewing user can see them.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoInit popup for new code comment (#20234)
Gusted [Tue, 5 Jul 2022 12:28:31 +0000 (14:28 +0200)]
Init popup for new code comment (#20234)

- Initialize the popup for the tooltip inside the new code comment.
- This works and is good enough to have this issue fixed for 1.17

Fix #20068

2 years agoBypass Firefox (iOS) bug (#20244)
wxiaoguang [Tue, 5 Jul 2022 12:27:13 +0000 (20:27 +0800)]
Bypass Firefox (iOS) bug (#20244)

* https://github.com/go-gitea/gitea/issues/20240

At the moment, Firefox (iOS) (10x) has an engine bug. See https://github.com/go-gitea/gitea/issues/20240
If a script inserts a newly created (and content changed) element into DOM, there will be a nonsense error event reporting: Script error: line 0, col 0.

This PR ignores such nonsense error event.

Fix #20240

2 years agoAdjust max-widths for the repository file table (#20243)
zeripath [Tue, 5 Jul 2022 11:33:05 +0000 (12:33 +0100)]
Adjust max-widths for the repository file table (#20243)

Adjust the max-widths for the repository file table to allow for nicer
resizing of the names and commit messages.

Fix #20040

Signed-off-by: Andrew Thornton <art27@cantab.net>
## Screenshots

## MediaXL
![Screenshot from 2022-07-05 10-22-12](https://user-images.githubusercontent.com/1824502/177295867-7ba8cf60-8f61-4227-892f-e5a0477e4146.png)

## MediaLg
![Screenshot from 2022-07-05 10-24-37](https://user-images.githubusercontent.com/1824502/177296301-e066e206-10f7-4a15-a68b-0f772a95f369.png)

## MediaMd
![Screenshot from 2022-07-05 10-23-03](https://user-images.githubusercontent.com/1824502/177295965-69397649-16ca-456a-bc0c-ed507fcb7f44.png)

## MediaSm
![Screenshot from 2022-07-05 10-26-44](https://user-images.githubusercontent.com/1824502/177296700-ca2a853b-c47b-4592-baf4-4bc08a7e1c9c.png)

2 years agoDisplay full name (#20171)
Baekjun Kim [Tue, 5 Jul 2022 11:30:05 +0000 (06:30 -0500)]
Display full name (#20171)

The setting `DEFAULT_SHOW_FULL_NAME` promises to use the user's full name everywhere it can be used.

Unfortunately the function `*user_model.User.ShortName()` currently uses the `.Name` instead - but this should also use the `.FullName()`.

Therefore we should make `*user_model.User.ShortName()` base its pre-shortened name on the `.FullName()` function.

2 years agoAdjust class for mobile has the problem of double small bells (#20236)
Tyrone Yeh [Tue, 5 Jul 2022 06:12:53 +0000 (14:12 +0800)]
Adjust class for mobile has the problem of double small bells (#20236)

* Adjust class for mobile has the problem of double small bells

* Update templates/base/head_navbar.tmpl

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
2 years agoAdjust template for #20069 smallbell (#20108)
Tyrone Yeh [Mon, 4 Jul 2022 14:44:34 +0000 (22:44 +0800)]
Adjust template for #20069 smallbell (#20108)

* Adjust template for #20069 smallbell

* Adjust notification Unread Count variable to global and count bell position with mobile

* Adjust bell icon style

* Adjust smallbell to middle

* Avoid using inline styles

* move notificationUnreadCount to a general code block, reduce changed lines

* Solved conflicts

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoAdd integration tests for the Gitea migration form (#20121)
Aravinth Manivannan [Mon, 4 Jul 2022 12:36:24 +0000 (18:06 +0530)]
Add integration tests for the Gitea migration form (#20121)

* tests: integration tests for the Gitea migration form

* use a mix of ` and " instead of backslash

https://github.com/go-gitea/gitea/pull/20121#discussion_r906729415

Co-authored-by: Loïc Dachary <loic@dachary.org>
2 years agoAllow dev i18n to be more concurrent (#20159)
zeripath [Mon, 4 Jul 2022 10:17:09 +0000 (11:17 +0100)]
Allow dev i18n to be more concurrent (#20159)

The recent changes to add live-reloading to the i18n translation files made the i18n code totally non-concurrent when using dev. This will make discovering other concurrency related issues far more difficult. This PR fixes these, adds some more comments to the code and slightly restructures a few functions.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAllow enable LDAP source and disable user sync via CLI (#20206)
Steven Kriegler [Mon, 4 Jul 2022 09:21:14 +0000 (11:21 +0200)]
Allow enable LDAP source and disable user sync via CLI (#20206)

The current `admin auth` CLI for managing authentication source of type
LDAP via BindDN and Simple LDAP does not allow enabling the respective
source, once disabled via `--not-active`.
The same applies to `--synchronize-users` specifially for LDAP via
BindDN.

These changes add two new flags to LDAP related CLI commands:

- `--active` for both LDAP authentication source types
- `--disable-synchronize-users` for LDAP via BindDN

Signed-off-by: justusbunsi <61625851+justusbunsi@users.noreply.github.com>
2 years agoRemove `GO111MODULE` (#20221)
Gusted [Mon, 4 Jul 2022 03:33:55 +0000 (05:33 +0200)]
Remove `GO111MODULE` (#20221)

- Given we use go1.18 for this and don't rely on the Go 1.11 modules
behavior(we use the modern `go run` & `go get` which has the correct
behavior by-default).

2 years agoUpdate Bluemonday to v1.0.19 (#20199)
zeripath [Fri, 1 Jul 2022 18:50:06 +0000 (19:50 +0100)]
Update Bluemonday to v1.0.19 (#20199)

The current version of bluemonday is double escaping attributes.

This PR updates bluemonday to the version that fixes this.

(See: microcosm-cc/bluemonday#143 )

Fix #19860

Signed-off-by: Andrew Thornton art27@cantab.net
2 years agoRefix indices on actions table (#20158)
zeripath [Fri, 1 Jul 2022 16:04:01 +0000 (17:04 +0100)]
Refix indices on actions table (#20158)

Unforunately the previous PR #20035 created indices that were not helpful
for SQLite. This PR adjusts these after testing using the try.gitea.io db.

Fix #20129

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoUpdate default allowed attachment types (#20192)
silverwind [Fri, 1 Jul 2022 13:42:20 +0000 (15:42 +0200)]
Update default allowed attachment types (#20192)

Synced the list to what is allowed on GitHub currently.

2 years agoFix cli command restore-repo: "units" should be splitted to string slice, to match...
wxiaoguang [Fri, 1 Jul 2022 07:47:44 +0000 (15:47 +0800)]
Fix cli command restore-repo: "units" should be splitted to string slice, to match the old behavior and match the dump-repo's behavior (#20183)

2 years ago[skip ci] Updated translations via Crowdin
wxiaoguang [Fri, 1 Jul 2022 00:10:16 +0000 (00:10 +0000)]
[skip ci] Updated translations via Crowdin