]> source.dussan.org Git - gitea.git/log
gitea.git
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 19 Jan 2022 18:28:18 +0000 (18:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoChangelog for 1.16.0-rc1 (#18309)
techknowlogick [Wed, 19 Jan 2022 17:08:23 +0000 (12:08 -0500)]
Changelog for 1.16.0-rc1 (#18309)

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoRestore propagation of ErrDependenciesLeft (#18325)
zeripath [Tue, 18 Jan 2022 23:26:42 +0000 (23:26 +0000)]
Restore propagation of ErrDependenciesLeft (#18325)

Unfortunately #17643 prevented all propagation of ErrDependenciesLeft meaning
that dependency errors that prevent closing of issues get swallowed.

This PR restores propagation of the error but instead swallows the error in the
places where it needs to be swallowed.

Fix #18223

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix PR comments UI (#18323)
wxiaoguang [Tue, 18 Jan 2022 17:28:38 +0000 (01:28 +0800)]
Fix PR comments UI (#18323)

Closes:
* Review comment cannot be edited #17768
* Changing PR Comment Resolved State Disables Further Changes #18315

2 years agoMake the height of the editor in Review Box smaller (4 lines as GitHub) (#18319)
wxiaoguang [Tue, 18 Jan 2022 16:57:57 +0000 (00:57 +0800)]
Make the height of the editor in Review Box smaller (4 lines as GitHub) (#18319)

And shrink the height of Dropzone.

2 years agoFix commit links on compare page (#18310)
Gusted [Tue, 18 Jan 2022 16:12:10 +0000 (16:12 +0000)]
Fix commit links on compare page (#18310)

* Fix commit links on compare page

- Use the correct repo link for each commit(the headrepo). As for
compare pages were baserepo != headrepo, it wouldn't have the correct
link.

Co-authored-by: zeripath <art27@cantab.net>
2 years agoUpdate JS dependencies, remove eslint-plugin-github (#18317)
silverwind [Tue, 18 Jan 2022 15:01:36 +0000 (07:01 -0800)]
Update JS dependencies, remove eslint-plugin-github (#18317)

- Update all JS dependencies
- Add new lint rules
- Regenerate SVGs
- Tested Monaco and Mermaid
* Remove eslint-plugin-github

2 years agoAdd MirrorUpdated field to Repository API type (#18267)
Peter Gardfjäll [Tue, 18 Jan 2022 13:18:30 +0000 (14:18 +0100)]
Add MirrorUpdated field to Repository API type (#18267)

Add the last update time to the repository api type.

Close #18266

2 years agoreplace satori/go.uuid with gofrs/uuid (#18311)
zeripath [Tue, 18 Jan 2022 11:04:24 +0000 (11:04 +0000)]
replace satori/go.uuid with gofrs/uuid (#18311)

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPlace inline diff comment dialogs in the 4th column. (#18321)
JonRB [Tue, 18 Jan 2022 10:28:45 +0000 (10:28 +0000)]
Place inline diff comment dialogs in the 4th column. (#18321)

Comment dialogs for inline comments should appear in 4th column (not 3rd column), this PR changes the column that the inline review comment is associated with.

This problem has occurred due to an unrecognised conflict between #17562 and #17315.

Fix as zeripath suggested in #18320

Fix #18320

Co-authored-by: zeripath <art27@cantab.net>
2 years agoUse indirect comparison when showing pull requests (#18313)
zeripath [Tue, 18 Jan 2022 07:45:43 +0000 (07:45 +0000)]
Use indirect comparison when showing pull requests (#18313)

When generating the commits list and number of files changed for PRs and
compare we should use "..." always not "..".

Fix #18303

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPrevent ambiguous column error in organizations page (#18314)
zeripath [Tue, 18 Jan 2022 07:45:14 +0000 (07:45 +0000)]
Prevent ambiguous column error in organizations page (#18314)

Explicitly set the table for the org_id column queries on the organizations pages.

Fix #18229

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoCorrectly upload LFS files (#18316)
zeripath [Tue, 18 Jan 2022 07:44:30 +0000 (07:44 +0000)]
Correctly upload LFS files (#18316)

We need to use the cached .gitattributes file for checking if a file
should be stored in the lfs.

Fix #18297

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 18 Jan 2022 00:31:56 +0000 (00:31 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoupdate description about vendoring in CONTRIBUTING.md (#18280)
a1012112796 [Mon, 17 Jan 2022 18:39:07 +0000 (02:39 +0800)]
update description about vendoring in CONTRIBUTING.md (#18280)

* update description about vendoring in CONTRIBUTING.md

follow #18277

Signed-off-by: a1012112796 <1012112796@qq.com>
* Update CONTRIBUTING.md

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* fix and readd test-vendor step

* remove vendor from .gitattributes @silverwind

* simplify go mod check

Signed-off-by: a1012112796 <1012112796@qq.com>
* Revert "remove vendor from .gitattributes @silverwind"

This reverts commit 4789e704cb7a2c80934e4a4cd31efb161e6c8666.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix CheckRepoStats and reuse it during migration (#18264)
Aravinth Manivannan [Mon, 17 Jan 2022 18:31:58 +0000 (18:31 +0000)]
Fix CheckRepoStats and reuse it during migration (#18264)

The CheckRepoStats function missed the following counters:

- label num_closed_issues & num_closed_pulls
- milestone num_closed_issues & num_closed_pulls

The update SQL statements for updating the repository
num_closed_issues & num_closed_pulls fields were repeated in three
functions (repo.CheckRepoStats, migrate.insertIssues and
models.Issue.updateClosedNum) and were moved to a single helper.

The UpdateRepoStats is implemented and called in the Finish migration method so that it happens immediately instead of wating for the
CheckRepoStats to run.

Signed-off-by: Loïc Dachary loic@dachary.org
---
[source](https://lab.forgefriends.org/forgefriends/forgefriends/-/merge_requests/34)

2 years agoMinor tweak to tag list (#18295)
silverwind [Mon, 17 Jan 2022 13:26:35 +0000 (05:26 -0800)]
Minor tweak to tag list (#18295)

Slightly reduce the font size and padding in the tags table, it seemed a bit too big to me.

2 years agoshow pull link for agit pull request also (#18235)
a1012112796 [Mon, 17 Jan 2022 05:56:43 +0000 (13:56 +0800)]
show pull link for agit pull request also (#18235)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 17 Jan 2022 00:28:33 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd some .ignore entries (#18296)
silverwind [Sun, 16 Jan 2022 17:26:15 +0000 (09:26 -0800)]
Add some .ignore entries (#18296)

Exclude node_modules and minified files from search tools like `rg` and `ag`.

2 years agoRemove unneeded debug messages to stdout. (#18298)
Ben Niemann [Sun, 16 Jan 2022 15:42:06 +0000 (16:42 +0100)]
Remove unneeded debug messages to stdout. (#18298)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoHandle missing default branch better in owner/repo/branches page (#18290)
zeripath [Sun, 16 Jan 2022 14:59:16 +0000 (14:59 +0000)]
Handle missing default branch better in owner/repo/branches page (#18290)

This PR more nicely handles a missing default branch in owner/repo/branches

Fix #18265

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoRevert "Prevent possible XSS when using jQuery (#18289)" (#18293)
wxiaoguang [Sun, 16 Jan 2022 11:19:26 +0000 (19:19 +0800)]
Revert "Prevent possible XSS when using jQuery (#18289)" (#18293)

This reverts commit 661d3d28e97bb49bef075c0314edad5879148aaa.

2 years agonot show double error response in git hook (#18292)
a1012112796 [Sun, 16 Jan 2022 09:32:32 +0000 (17:32 +0800)]
not show double error response in git hook (#18292)

if return a error message to cli, it will print it
to stderr which is duplicate with our code (line 82
in same file). so user will see two line same
error message in git output. I think it's not mecessary,
so suggerst not return error message to cli. Thanks.

Signed-off-by: a1012112796 <1012112796@qq.com>
2 years agoRemove accidental debugging in blob_excerpt.tmpl (#18287)
zeripath [Sun, 16 Jan 2022 09:31:41 +0000 (09:31 +0000)]
Remove accidental debugging in blob_excerpt.tmpl (#18287)

* Remove accidental debugging in blob_excerpt.tmpl

Unfortunately it appears that a small bit of debugging code was left in blob_excerpt.tmpl
This breaks diff expansion causing #18281.

Fix #18281

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoPrevent possible XSS when using jQuery (#18289)
Gusted [Sun, 16 Jan 2022 05:14:32 +0000 (05:14 +0000)]
Prevent possible XSS when using jQuery (#18289)

In the case of misuse or misunderstanding from a developer whereby,
if `sel` can receive user-controlled data, jQuery `$(sel)` can lead to the
creation of a new element. Current usage is using hard-coded selectors
in the templates, but nobody prevents that from expanding to
user-controlled somehow.

2 years agoReturn nicer error if trying to pull from non-existent user (#18288)
zeripath [Sun, 16 Jan 2022 03:44:11 +0000 (03:44 +0000)]
Return nicer error if trying to pull from non-existent user (#18288)

* Return nicer error if trying to pull from non-existent user

Gitea serv will currently return an 500 if we try to pull from a repository where
the owner does not exist.

This PR checks for the UserNotExist Error when checking for the user and will
return a NotFound error instead.

Fix #18225

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 16 Jan 2022 00:28:39 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agodocs: mention client_max_body_size affects LFS (#18291)
Jan Tojnar [Sat, 15 Jan 2022 22:26:01 +0000 (23:26 +0100)]
docs: mention client_max_body_size affects LFS (#18291)

2 years agoAdd lockfile-check (#18285)
silverwind [Sat, 15 Jan 2022 20:06:29 +0000 (12:06 -0800)]
Add lockfile-check (#18285)

* Add lockfile-check

This check runs `npm install` which will rewrite the lockfile in case it
is inconsistent with package.json. This check detects this and will fail
the CI in such a case.

2 years agoWebauthn nits (#18284)
zeripath [Sat, 15 Jan 2022 16:52:56 +0000 (16:52 +0000)]
Webauthn nits (#18284)

This contains some additional fixes and small nits related to #17957

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoUpdate `package-lock.json` (#18283)
Gusted [Sat, 15 Jan 2022 14:25:25 +0000 (14:25 +0000)]
Update `package-lock.json` (#18283)

- NPM didn't like that package-lock.json was out-of-sync, webpack
throwed some errors as well with building.
- Follow-up for: #18278

2 years agoUpgrade EasyMDE to 2.16.1 (#18278)
wxiaoguang [Sat, 15 Jan 2022 10:20:47 +0000 (18:20 +0800)]
Upgrade EasyMDE to 2.16.1 (#18278)

2 years agoRemove golang vendored directory (#18277)
techknowlogick [Fri, 14 Jan 2022 23:16:05 +0000 (18:16 -0500)]
Remove golang vendored directory (#18277)

* rm go vendor

* fix drone yaml

* add to gitignore

2 years agoChangelog for 1.15.10 (#18274) (#18276)
zeripath [Fri, 14 Jan 2022 20:02:37 +0000 (20:02 +0000)]
Changelog for 1.15.10 (#18274) (#18276)

* Changelog for 1.15.10 (#18274)

[1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14

* BUGFIXES
  * Fix inconsistent PR comment counts (#18260) (#18261)
  * Fix release link broken (#18252) (#18253)
  * Fix update user from site administration page bug (#18250) (#18251)
  * Set HeadCommit when creating tags (#18116) (#18173)
  * Use correct translation key for error messages due to max repo limits (#18135 & #18153) (#18152)
  * Fix purple color in suggested label colors (#18241) (#18242)
* SECURITY
  * Bump mermaid from 8.10.1 to 8.13.8 (#18198) (#18206)

* update docs/config.yaml

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Richard Mahn <richmahn@users.noreply.github.com>
2 years agoSupport webauthn (#17957)
Lunny Xiao [Fri, 14 Jan 2022 15:03:31 +0000 (23:03 +0800)]
Support webauthn (#17957)

Migrate from U2F to Webauthn

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 14 Jan 2022 00:29:34 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoImprove the comment for 2FA filter in admin panel (#18017)
Gusted [Thu, 13 Jan 2022 20:32:28 +0000 (20:32 +0000)]
Improve the comment for 2FA filter in admin panel (#18017)

Replace TODO with explanation

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agofix regression from #16075 (#18260)
Norwin [Thu, 13 Jan 2022 16:50:43 +0000 (17:50 +0100)]
fix regression from #16075 (#18260)

we don't want reviews to count towards comments, as this needs changes
in other components as well (eg repo stats cron job, etc).

Co-authored-by: 6543 <6543@obermui.de>
2 years agoPrevent underline hover on cards (#18259)
silverwind [Thu, 13 Jan 2022 14:33:04 +0000 (06:33 -0800)]
Prevent underline hover on cards (#18259)

Prevent a undesired underline effect on hovered cards.

This was regressed by #17898.

2 years agoFix release link broken (#18252)
Lunny Xiao [Thu, 13 Jan 2022 13:14:53 +0000 (21:14 +0800)]
Fix release link broken (#18252)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agomigrations: a deadline at January 1st, 1970 is valid (#18237)
Aravinth Manivannan [Thu, 13 Jan 2022 06:03:30 +0000 (06:03 +0000)]
migrations: a deadline at January 1st, 1970 is valid (#18237)

* migrations: a deadline at January 1st, 1970 is valid

Do not change the deadline value if it is set to January 1st, 1970.

Setting the deadline to year 9999 when it is zero (which is equal to
January 1st, 1970) modifies a deadline set to January 1st, 1970 which
is a valid date. In addition, setting a date in year 9999 will be
converted to a null date in some cases.

Signed-off-by: Loïc Dachary <loic@dachary.org>
* tests: set milestone.deadline_unix in fixtures

The value of deadline_unix must be set to 253370764800 (i.e. 9999-01-01) in
fixtures, otherwise it will be inserted as null which leads to
unexpected errors. For instance, DumpRepository will store a null
deadline_unix as 0 (i.e. 1970-01-01) and RestoreRepository will change
it to 9999-01-01.

Signed-off-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix documents for development and bug report (#18249)
wxiaoguang [Thu, 13 Jan 2022 02:58:46 +0000 (10:58 +0800)]
Fix documents for development and bug report (#18249)

2 years agoAdd/update SMTP auth providers via cli (#18197)
Zoran Peričić [Wed, 12 Jan 2022 22:54:53 +0000 (23:54 +0100)]
Add/update SMTP auth providers via cli (#18197)

Allow adding/updating SMTP authentication source via CLI using:
- gitea admin  auth add-smtp
- gitea admin  auth update-smtp

Signed-off-by: Zoran Peričić <zpericic@netst.org>
2 years agoFix NPE on try to get tag reference via API (#18245)
6543 [Wed, 12 Jan 2022 20:37:46 +0000 (21:37 +0100)]
Fix NPE on try to get tag reference via API (#18245)

* fix npe

* rm gitRepo from Tag

2 years agoFix update user bug (#18250)
Lunny Xiao [Wed, 12 Jan 2022 13:58:09 +0000 (21:58 +0800)]
Fix update user bug (#18250)

2 years ago[doc] https-setup: explain relative paths for {CERT,KEY}_FILE fields. (#18244)
M. Zhou [Wed, 12 Jan 2022 04:18:28 +0000 (23:18 -0500)]
[doc] https-setup: explain relative paths for {CERT,KEY}_FILE fields. (#18244)

Closes: https://github.com/go-gitea/gitea/issues/14401
2 years agochore: remove unnecessary section (#18209)
Bo-Yi Wu [Tue, 11 Jan 2022 23:27:32 +0000 (07:27 +0800)]
chore: remove unnecessary section (#18209)

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix purple color in suggested label colors (#18241)
silverwind [Tue, 11 Jan 2022 18:11:40 +0000 (10:11 -0800)]
Fix purple color in suggested label colors (#18241)

This looks like a typo that was introduced when these colors were added,
causing what is supposed to be purple show up as green.

2 years agoPrevent NPE when viewing non-rendered files (#18234)
zeripath [Tue, 11 Jan 2022 17:18:52 +0000 (17:18 +0000)]
Prevent NPE when viewing non-rendered files (#18234)

Fix #18231

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix collobration template (#18232)
Lunny Xiao [Tue, 11 Jan 2022 12:33:47 +0000 (20:33 +0800)]
Fix collobration template (#18232)

2 years agoFix identation typo in doc installation with Docker (#18233)
Andrey Esin [Tue, 11 Jan 2022 11:33:42 +0000 (14:33 +0300)]
Fix identation typo in doc installation with Docker (#18233)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 11 Jan 2022 00:28:42 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix source typos (#18227)
luzpaz [Mon, 10 Jan 2022 15:46:26 +0000 (10:46 -0500)]
Fix source typos (#18227)

Follow-up to #18219

2 years agoFix various typos (#18219)
luzpaz [Mon, 10 Jan 2022 09:32:37 +0000 (04:32 -0500)]
Fix various typos (#18219)

Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby,te,unknwon`

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoRemove `ioutil` (#18222)
Gusted [Mon, 10 Jan 2022 01:48:13 +0000 (01:48 +0000)]
Remove `ioutil` (#18222)

- Don't use `ioutil` package anymore as it doesn't anything special
anymore since Go 1.16:

```
// As of Go 1.16, the same functionality is now provided
// by package io or package os, and those implementations
// should be preferred in new code.
```

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 10 Jan 2022 00:28:05 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix typos in docs/content (#18215)
Greg Myers [Sun, 9 Jan 2022 11:53:03 +0000 (04:53 -0700)]
Fix typos in docs/content (#18215)

2 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 9 Jan 2022 00:28:45 +0000 (00:28 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoIn the Organization member page, 2fa column is too narrow for Simplified Chinese...
capvor [Sat, 8 Jan 2022 16:21:10 +0000 (00:21 +0800)]
In the Organization member page, 2fa column is too narrow for Simplified Chinese and Chinese Traditional. (#18213)

Expand 2fa column and Narrow the last column.

2 years agoFix new team (#18212)
Lunny Xiao [Sat, 8 Jan 2022 15:19:36 +0000 (23:19 +0800)]
Fix new team (#18212)

fix regression from #17811

2 years agoFix EasyMDE image paste bug during refactoring (#18207)
wxiaoguang [Sat, 8 Jan 2022 13:33:32 +0000 (21:33 +0800)]
Fix EasyMDE image paste bug during refactoring (#18207)

2 years agoSort locales according to their names (#18211)
delvh [Sat, 8 Jan 2022 12:18:39 +0000 (13:18 +0100)]
Sort locales according to their names (#18211)

* Sort locales according to their names

* Fix documentation and sort case insensitive

2 years agoRestore setting of ctx.Repo.Mirror (#18205)
zeripath [Sat, 8 Jan 2022 02:03:51 +0000 (02:03 +0000)]
Restore setting of ctx.Repo.Mirror (#18205)

In #17933 repoAssignment no longer sets the ctx.Repo.Mirror field meaning that
attempting change mirror settings results in an NPE. This PR simply restores this.

Either we should remove this field or, we should set it. At present it seems simplest
to set it instead of going looking in the Data for the value although converting the
context to a bag of things may be the correct approach in the future.

Fix #18204

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 8 Jan 2022 00:28:35 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoShow OAuth callback error message (#18185)
KN4CK3R [Fri, 7 Jan 2022 21:02:09 +0000 (22:02 +0100)]
Show OAuth callback error message (#18185)

* Show callback error message.

* lint

* Use error code to display a message.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix CSS specificity issue with easymde's css (#18201)
silverwind [Fri, 7 Jan 2022 08:41:31 +0000 (00:41 -0800)]
Fix CSS specificity issue with easymde's css (#18201)

* Fix CSS specificity issue with easymde's css

PR #18069 introduced a regression in certain overwritten editor styles
because the dynamic loading of easymde.min.css causes its's style to
apply after our supposed override styles.

Solve this by bundling the styles into index.css. We should later aim to
completely replace easymde.min.css completely with our own styles so there
are no more conflicts.

* Update web_src/js/features/comp/EasyMDE.js

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix mermaid rendering in milestone dashboard (#18202)
silverwind [Fri, 7 Jan 2022 03:49:27 +0000 (19:49 -0800)]
Fix mermaid rendering in milestone dashboard (#18202)

Fixes: https://github.com/go-gitea/gitea/issues/18200
2 years agoDon't store assets modified time into generated files (#18193)
Lunny Xiao [Fri, 7 Jan 2022 02:33:17 +0000 (10:33 +0800)]
Don't store assets modified time into generated files (#18193)

2 years agoAdd warning for BIDI characters in page renders and in diffs (#17562)
zeripath [Fri, 7 Jan 2022 01:18:52 +0000 (01:18 +0000)]
Add warning for BIDI characters in page renders and in diffs (#17562)

Fix #17514

Given the comments I've adjusted this somewhat. The numbers of characters detected are increased and include things like the use of U+300 to make à instead of à and non-breaking spaces.

There is a button which can be used to escape the content to show it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Gwyneth Morgan <gwymor@tilde.club>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 7 Jan 2022 00:28:31 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoBump mermaid from 8.13.4 to 8.13.8 (#18198)
dependabot[bot] [Thu, 6 Jan 2022 20:17:27 +0000 (15:17 -0500)]
Bump mermaid from 8.13.4 to 8.13.8 (#18198)

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

---
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 agofix location for custom/options/license (#18194)
yearski [Thu, 6 Jan 2022 06:29:53 +0000 (23:29 -0700)]
fix location for custom/options/license (#18194)

2 years agoEnable partial clone by default (#18195)
Gusted [Thu, 6 Jan 2022 05:38:38 +0000 (05:38 +0000)]
Enable partial clone by default (#18195)

- Enable partial clones(which are by default disabled from git) by
default, unless configured otherwise.
- Resolves #18190

2 years agoAdd option to convert CRLF to LF line endings for sendmail (#18075)
zeripath [Thu, 6 Jan 2022 00:43:45 +0000 (00:43 +0000)]
Add option to convert CRLF to LF line endings for sendmail (#18075)

It appears that several versions of sendmail require that the mail is sent to them with
LF line endings instead of CRLF endings - which of course they will then convert back
to CRLF line endings to comply with the SMTP standard.

This PR adds another setting SENDMAIL_CONVERT_CRLF which will pass the message writer
through a filter. This will filter out and convert CRLFs to LFs before writing them
out to sendmail.

Fix #18024

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAdd replay of webhooks. (#18191)
KN4CK3R [Wed, 5 Jan 2022 21:00:20 +0000 (22:00 +0100)]
Add replay of webhooks. (#18191)

2 years agoLoad EasyMDE/CodeMirror dynamically, remove RequireEasyMDE (#18069)
wxiaoguang [Wed, 5 Jan 2022 12:17:25 +0000 (20:17 +0800)]
Load EasyMDE/CodeMirror dynamically, remove RequireEasyMDE (#18069)

This PR makes frontend load EasyMDE/CodeMirror dynamically, and removes `RequireEasyMDE`.

2 years agorefactoring nits (#18188)
6543 [Wed, 5 Jan 2022 06:27:53 +0000 (07:27 +0100)]
refactoring nits (#18188)

* no octal for time values

* rm artifact from refactoring

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoslight optimization for default avatar (#18187)
Lunny Xiao [Wed, 5 Jan 2022 06:00:32 +0000 (14:00 +0800)]
slight optimization for default avatar (#18187)

* slight optimization

* Update comment

Co-authored-by: 6543 <6543@obermui.de>
2 years agocode.gitea.io/sdk/gitea v0.14.0 -> v0.15.1 (#18186)
6543 [Wed, 5 Jan 2022 04:51:12 +0000 (05:51 +0100)]
code.gitea.io/sdk/gitea v0.14.0 -> v0.15.1 (#18186)

2 years agoTeam permission allow different unit has different permission (#17811)
Lunny Xiao [Wed, 5 Jan 2022 03:37:00 +0000 (11:37 +0800)]
Team permission allow different unit has different permission (#17811)

* Team permission allow different unit has different permission

* Finish the interface and the logic

* Fix lint

* Fix translation

* align center for table cell content

* Fix fixture

* merge

* Fix test

* Add deprecated

* Improve code

* Add tooltip

* Fix swagger

* Fix newline

* Fix tests

* Fix tests

* Fix test

* Fix test

* Max permission of external wiki and issues should be read

* Move team units with limited max level below units table

* Update label and column names

* Some improvements

* Fix lint

* Some improvements

* Fix template variables

* Add permission docs

* improve doc

* Fix fixture

* Fix bug

* Fix some bug

* fix

* gofumpt

* Integration test for migration (#18124)

integrations: basic test for Gitea {dump,restore}-repo
This is a first step for integration testing of DumpRepository and
RestoreRepository. It:

runs a Gitea server,
dumps a repo via DumpRepository to the filesystem,
restores the repo via RestoreRepository from the filesystem,
dumps the restored repository to the filesystem,
compares the first and second dump and expects them to be identical

The verification is trivial and the goal is to add more tests for each
topic of the dump.

Signed-off-by: Loïc Dachary <loic@dachary.org>
* Team permission allow different unit has different permission

* Finish the interface and the logic

* Fix lint

* Fix translation

* align center for table cell content

* Fix fixture

* merge

* Fix test

* Add deprecated

* Improve code

* Add tooltip

* Fix swagger

* Fix newline

* Fix tests

* Fix tests

* Fix test

* Fix test

* Max permission of external wiki and issues should be read

* Move team units with limited max level below units table

* Update label and column names

* Some improvements

* Fix lint

* Some improvements

* Fix template variables

* Add permission docs

* improve doc

* Fix fixture

* Fix bug

* Fix some bug

* Fix bug

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
2 years agoIntegration test for migration (#18124)
Aravinth Manivannan [Tue, 4 Jan 2022 19:24:27 +0000 (19:24 +0000)]
Integration test for migration (#18124)

integrations: basic test for Gitea {dump,restore}-repo
This is a first step for integration testing of DumpRepository and
RestoreRepository. It:

runs a Gitea server,
dumps a repo via DumpRepository to the filesystem,
restores the repo via RestoreRepository from the filesystem,
dumps the restored repository to the filesystem,
compares the first and second dump and expects them to be identical

The verification is trivial and the goal is to add more tests for each
topic of the dump.

Signed-off-by: Loïc Dachary <loic@dachary.org>
2 years agoUpdate `TODOs` badge to reflect new default branch (#18182)
Patrick DeVivo [Tue, 4 Jan 2022 16:46:32 +0000 (11:46 -0500)]
Update `TODOs` badge to reflect new default branch (#18182)

* Update `TODOs` badge to reflect `main` as default branch

* update `README_ZH.md` as well

2 years agoIncrease Salt randomness (#18179)
Gusted [Tue, 4 Jan 2022 15:13:52 +0000 (15:13 +0000)]
Increase Salt randomness  (#18179)

- The current implementation of `RandomString` doesn't give you a most-possible unique randomness. It gives you 6*`length` instead of the possible 8*`length` bits(or as `length`x bytes) randomness. This is because `RandomString` is being limited to a max value of 63, this in order to represent the random byte as a letter/digit.
- The recommendation of pbkdf2 is to use 64+ bit salt, which the `RandomString` doesn't give with a length of 10, instead of increasing 10 to a higher number, this patch adds a new function called `RandomBytes` which does give you the guarentee of 8*`length` randomness and thus corresponding of `length`x bytes randomness.
- Use hexadecimal to store the bytes value in the database, as mentioned, it doesn't play nice in order to convert it to a string. This will always be a length of 32(with `length` being 16).
- When we detect on `Authenticate`(source: db) that a user has the old format of salt, re-hash the password such that the user will have it's password hashed with increased salt.

Thanks to @zeripath for working out the rouge edges from my first commit 😄.

Co-authored-by: lafriks <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoAdd MP4 as default allowed attachment type (#18170)
Gusted [Tue, 4 Jan 2022 03:36:47 +0000 (03:36 +0000)]
Add MP4 as default allowed attachment type (#18170)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 4 Jan 2022 00:28:34 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoInclude folders into size cost (#18158)
Gusted [Mon, 3 Jan 2022 23:24:12 +0000 (23:24 +0000)]
Include folders into size cost (#18158)

- Include folders for the disk consumption size, they should be included
as they are also saved on the disk :)
- Have a more accurate picture of the size of a repo.
- Mostly they are the size of the file system's block size. E.g. 4Kb on
Linux.

2 years agoDon't delete branch if other PRs with this branch are open (#18164)
a1012112796 [Mon, 3 Jan 2022 19:45:58 +0000 (03:45 +0800)]
Don't delete branch if other PRs with this branch are open (#18164)

fix #18149

Signed-off-by: a1012112796 <1012112796@qq.com>
2 years agoRemove unused route "/tasks/trigger" (#18160)
Gusted [Mon, 3 Jan 2022 17:23:43 +0000 (17:23 +0000)]
Remove unused route "/tasks/trigger" (#18160)

ref: https://github.com/go-gitea/gitea/pull/18160#issuecomment-1004091325

2 years agoFix EasyMDE validation (#18161)
wxiaoguang [Mon, 3 Jan 2022 16:53:53 +0000 (00:53 +0800)]
Fix EasyMDE validation (#18161)

2 years agoFix bug (#18168)
Lunny Xiao [Mon, 3 Jan 2022 16:06:46 +0000 (00:06 +0800)]
Fix bug (#18168)

2 years agotests: add coverage for models migration helpers (#18162)
Aravinth Manivannan [Mon, 3 Jan 2022 15:35:01 +0000 (15:35 +0000)]
tests: add coverage for models migration helpers  (#18162)

They were previously not covered at all, either by integration tests or unit tests.

This PR also fixes a bug where the `num_comments` field was incorrectly set to include all types of comments.

It sets num_closed_issues: 0 as default in milestone unit test fixtures. If they are not set, Incr("num_closed_issues") will be a noop because the field is null.

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 3 Jan 2022 00:28:34 +0000 (00:28 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRequire codereview to have content (#18156)
Gusted [Sun, 2 Jan 2022 22:31:03 +0000 (22:31 +0000)]
Require codereview to have content (#18156)

- Report a validityError when the codeReview have no comment.
- Resolves #18151
- Refactor

2 years agochore(lint): use golangci-lint to call revive and misspell checker. (#18145)
Bo-Yi Wu [Sun, 2 Jan 2022 19:30:40 +0000 (03:30 +0800)]
chore(lint): use golangci-lint to call revive and misspell checker. (#18145)

replace revive and misspell with golangci-lint

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2 years agoUpdate owners for 2022 (#18155)
6543 [Sun, 2 Jan 2022 16:54:49 +0000 (17:54 +0100)]
Update owners for 2022 (#18155)

2 years agoRefactor auth package (#17962)
Lunny Xiao [Sun, 2 Jan 2022 13:12:35 +0000 (21:12 +0800)]
Refactor auth package (#17962)

2 years agoUnify and simplify TrN for i18n (#18141)
wxiaoguang [Sun, 2 Jan 2022 03:33:57 +0000 (11:33 +0800)]
Unify and simplify TrN for i18n (#18141)

Refer: https://github.com/go-gitea/gitea/pull/18135#issuecomment-1003246099

Now we have a unique and simple `TrN`, and make the fix of PR #18135 also use the better `TrN` logic.

2 years agoUse correct user when determining max repo limits for error messages (#18153)
Gusted [Sun, 2 Jan 2022 02:38:07 +0000 (02:38 +0000)]
Use correct user when determining max repo limits for error messages (#18153)

- Use the correct user(`owner` instead of `ctx.User`) to get the maxCreationLimit.

2 years agoAdd singuliere to MAINTAINERS (#18148)
singuliere [Sun, 2 Jan 2022 01:12:13 +0000 (02:12 +0100)]
Add singuliere to MAINTAINERS (#18148)

Signed-off-by: singuliere <singuliere@autistici.org>