]> source.dussan.org Git - gitea.git/log
gitea.git
3 years ago[skip ci] Updated translations via Crowdin 16373/head
GiteaBot [Thu, 8 Jul 2021 00:24:51 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

3 years agofix: not able to update local created non-urlencoded wiki pages (#16139)
Gary Wang [Wed, 7 Jul 2021 23:23:09 +0000 (07:23 +0800)]
fix: not able to update local created non-urlencoded wiki pages (#16139)

* fix: not able to update local created non-urlencoded wiki pages

* tidy code

* as per suggestion

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Don't replace space to dash for unescaped wiki filename

Co-authored-by: zeripath <art27@cantab.net>
* Remove incorrect comment

* Remove NameToUnescapedFilename()

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAlpine 3.14 released (#16170)
techknowlogick [Wed, 7 Jul 2021 19:43:00 +0000 (15:43 -0400)]
Alpine 3.14 released (#16170)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoUpdate vendor 20210707 (#16366)
techknowlogick [Wed, 7 Jul 2021 19:41:05 +0000 (15:41 -0400)]
Update vendor 20210707 (#16366)

* update gitea.com/go-chi/binding

* update github.com/blevesearch/bleve/v2

* update github.com/caddyserver/certmagic

* update github.com/go-git/go-git/v5

* update github.com/lafriks/xormstore

* update github.com/yuin/goldmark

* Revert "update gitea.com/go-chi/binding"

This reverts commit dea2f292b116114f9316fab95c5fd124174da404.

3 years agoFix typo in customizing-gitea.en-us.md (#16362)
冯天书 [Wed, 7 Jul 2021 15:25:42 +0000 (23:25 +0800)]
Fix typo in customizing-gitea.en-us.md (#16362)

Fixed a type in a URL in PlantUML code example in `customizing-gitea.en-us.md`.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 7 Jul 2021 00:14:50 +0000 (00:14 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoChangelog for v1.14.4 (#16348) (#16351)
6543 [Tue, 6 Jul 2021 15:41:07 +0000 (17:41 +0200)]
Changelog for v1.14.4 (#16348) (#16351)

* Changelog for v1.14.4 (#16348)

* docs: bump version

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 6 Jul 2021 00:14:50 +0000 (00:14 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoCreating a repo from a template repo via API (#15958)
a1012112796 [Mon, 5 Jul 2021 15:29:08 +0000 (23:29 +0800)]
Creating a repo from a template repo via API (#15958)

* Creating a repo from a template repo via API

fix #15934
ref:
https://docs.github.com/en/rest/reference/repos#create-a-repository-using-a-template

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoFix docs assets link (#16337)
Lunny Xiao [Sun, 4 Jul 2021 13:56:40 +0000 (21:56 +0800)]
Fix docs assets link (#16337)

3 years agoUpgrade xorm to v1.1.1 (#16339)
Lunny Xiao [Sun, 4 Jul 2021 13:10:46 +0000 (21:10 +0800)]
Upgrade xorm to v1.1.1 (#16339)

3 years agoFix relative links in postprocessed images (#16334)
zeripath [Sun, 4 Jul 2021 09:26:04 +0000 (10:26 +0100)]
Fix relative links in postprocessed images (#16334)

If a pre-post-processed file contains relative img tags these need to be updated
and joined correctly with the prefix. Finally, the node attributes need to be updated.

Fix #16308

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoUpdate Vendor (#16325)
6543 [Sun, 4 Jul 2021 02:06:10 +0000 (04:06 +0200)]
Update Vendor (#16325)

* Add Dependencie Update Script

* update gitea.com/lunny/levelqueue

* update github.com/PuerkitoBio/goquery

* update github.com/alecthomas/chroma

* update github.com/blevesearch/bleve/v2

* update github.com/caddyserver/certmagic

* update github.com/go-enry/go-enry/v2

* update github.com/go-redis/redis/v8

* update github.com/hashicorp/golang-lru

* update github.com/klauspost/compress

* update github.com/markbates/goth

* update github.com/mholt/archiver/v3

* update github.com/microcosm-cc/bluemonday

* update github.com/minio/minio-go/v7

* update github.com/olivere/elastic/v7

* update github.com/xanzy/go-gitlab

* update github.com/yuin/goldmark

3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 4 Jul 2021 00:14:37 +0000 (00:14 +0000)]
[skip ci] Updated licenses and gitignores

3 years agodocs: Fix broken anchors in links to awesome-gitea (#16331)
Val Lorentz [Sat, 3 Jul 2021 20:42:33 +0000 (22:42 +0200)]
docs: Fix broken anchors in links to awesome-gitea (#16331)

3 years agoFix U2F error reasons always hidden (#16327)
Stephen Holdaway [Sat, 3 Jul 2021 08:19:38 +0000 (20:19 +1200)]
Fix U2F error reasons always hidden (#16327)

This strict equality check in `u2fError` was causing the error
description to hide immediately after showing. `Object.keys`
always returns strings, but `errorType` argument is usually a
number type.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 3 Jul 2021 00:14:49 +0000 (00:14 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix modified files list in webhooks when there is a space (#16288)
zeripath [Fri, 2 Jul 2021 19:23:37 +0000 (20:23 +0100)]
Fix modified files list in webhooks when there is a space (#16288)

* Fix modified files list in webhooks when there is a space

There is an unfortunate bug with GetCommitFileStatus where files with
spaces are misparsed and split at the space.

There is a second bug because modern gits detect renames meaning that
this function no longer works correctly.

There is a third bug in that merge commits don't have their modified
files detected correctly.

Fix #15865

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd forge emojies (#16296)
6543 [Fri, 2 Jul 2021 14:04:57 +0000 (16:04 +0200)]
Add forge emojies (#16296)

* codeberg :codeberg:
* gitlab :gitlab:
* git :git:
* github :github:
* gogs :gogs:

3 years agoAdd API to get commits of PR (#16300)
sebastian-sauer [Fri, 2 Jul 2021 12:19:57 +0000 (14:19 +0200)]
Add API to get commits of PR (#16300)

* Add API to get commits of PR

fixes #10918

Co-authored-by: Andrew Bezold <andrew.bezold@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoWrap around for previous/next buttons (#16319)
Jimmy Praet [Thu, 1 Jul 2021 22:02:48 +0000 (00:02 +0200)]
Wrap around for previous/next buttons (#16319)

Fixes #16317

Wrap around from last to first comment when clicking "Next" on last comment.
Wrap around from first to last comment when clicking "Previous" on first comment.

3 years agoReserve user/repo pattern for rss feature (#16323)
6543 [Thu, 1 Jul 2021 15:13:20 +0000 (17:13 +0200)]
Reserve user/repo pattern for rss feature (#16323)

3 years agoClarify GPG binary check (#14832)
Norwin [Thu, 1 Jul 2021 14:14:09 +0000 (14:14 +0000)]
Clarify GPG binary check (#14832)

fixes #14817

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoIntroduce NotifySubjectType (#16320)
6543 [Thu, 1 Jul 2021 10:51:24 +0000 (12:51 +0200)]
Introduce NotifySubjectType (#16320)

* Introduce NotifySubjectType

* update swagger docs

3 years agoSupport custom mime type mapping for text files (#16304)
Jimmy Praet [Wed, 30 Jun 2021 21:31:54 +0000 (23:31 +0200)]
Support custom mime type mapping for text files (#16304)

* Support custom mime type mapping for text files

* Apply suggested change to routers/common/repo.go

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
3 years agoUpdate Go-Git to take advantage of LargeObjectThreshold (#16316)
zeripath [Wed, 30 Jun 2021 20:58:45 +0000 (21:58 +0100)]
Update Go-Git to take advantage of LargeObjectThreshold (#16316)

Following the merging of https://github.com/go-git/go-git/pull/330 we
can now add a setting to avoid go-git reading and caching large objects.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoup current stable version in docs (#16318)
techknowlogick [Wed, 30 Jun 2021 20:27:09 +0000 (16:27 -0400)]
up current stable version in docs (#16318)

3 years agoPrevent zombie processes (#16314)
zeripath [Wed, 30 Jun 2021 20:07:23 +0000 (21:07 +0100)]
Prevent zombie processes (#16314)

Unfortunately go doesn't always ensure that execd processes are completely
waited for. On linux this means that zombie processes can occur.

This PR ensures that these are waited for by using signal notifier in serv and
passing a context elsewhere.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd button to delete undeleted repositories from failed migrations (#16197)
zeripath [Wed, 30 Jun 2021 19:14:53 +0000 (20:14 +0100)]
Add button to delete undeleted repositories from failed migrations (#16197)

This PR adds a button to delete failed repositories if there has been a
failure during migration and for whatever reason the repository doesn't
get deleted automatically.

Fix #16154

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix default push instructions on empty repos (#16302)
zeripath [Wed, 30 Jun 2021 18:40:51 +0000 (19:40 +0100)]
Fix default push instructions on empty repos (#16302)

* Fix default push instructions on empty repos

Use script block like in `repo/clone_buttons.tmpl` to set default instructions
for pushing to empty repos.

Fix #16295

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix webhook commits wrong hash on HEAD reset (#16283)
KN4CK3R [Wed, 30 Jun 2021 17:49:06 +0000 (19:49 +0200)]
Fix webhook commits wrong hash on HEAD reset (#16283)

Use `..` instead of `...` with `rev-list`. In combination with #16282 the receiver can get the correct commit. The behaviour is now like Github.

fixes #11802

3 years agoEscape reference to `user` table in models.SearchEmails (#16313)
Adyanth H [Wed, 30 Jun 2021 16:37:20 +0000 (22:07 +0530)]
Escape reference to `user` table in models.SearchEmails (#16313)

Fix #16312

Signed-off-by: Adyanth H <adyanthh@gmail.com>
3 years agoMake the github migration less rate limit waiting to get comment per page from reposi...
Lunny Xiao [Wed, 30 Jun 2021 07:23:49 +0000 (15:23 +0800)]
Make the github migration less rate limit waiting to get comment per page from repository but not per issue (#16070)

* Make the github migration less rate limit waiting to get comment per page from repository but not per issue

* Fix lint

* adjust Downloader interface

* Fix missed reviews

* Fix test

* Remove unused struct

3 years agoFix list_options GetStartEnd (#16303)
sebastian-sauer [Tue, 29 Jun 2021 21:42:23 +0000 (23:42 +0200)]
Fix list_options GetStartEnd (#16303)

end is start + pageSize and not start + page

3 years agojust add some unit tests (#16291)
6543 [Tue, 29 Jun 2021 21:00:02 +0000 (23:00 +0200)]
just add some unit tests (#16291)

* code.gitea.io/gitea/routers/utils coverage: 100.0%

* code.gitea.io/gitea/routers/install 0% -> 5.0%

* ConvertUtf8ToUtf8mb4: make sure DBType is mysql

3 years agoFix panic in recursive cache (#16298)
zeripath [Tue, 29 Jun 2021 20:12:43 +0000 (21:12 +0100)]
Fix panic in recursive cache (#16298)

There is a bug with last commit cache recursive cache where the last
commit information that refers to the current tree itself will cause a
panic due to its path ("") not being included in the expected tree entry
paths.

This PR fixes this by skipping the missing entry.

Fix #16290

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd Vultr and DO Marketplace links (#16297)
6543 [Tue, 29 Jun 2021 19:42:47 +0000 (21:42 +0200)]
Add Vultr and DO Marketplace links (#16297)

* fix emoji img path

* move cloudron

* Add Vultr and DO

3 years agoAdd custom emoji support (#16004)
6543 [Tue, 29 Jun 2021 14:28:38 +0000 (16:28 +0200)]
Add custom emoji support (#16004)

3 years agoImplemented head_commit for webhooks (#16282)
KN4CK3R [Tue, 29 Jun 2021 13:34:03 +0000 (15:34 +0200)]
Implemented head_commit for webhooks (#16282)

* Removed Len field.

* Added head_commit webhook field.

* Added comment for returns.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 29 Jun 2021 00:29:44 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUpdate fail2ban documentation (#16286)
zeripath [Mon, 28 Jun 2021 23:26:40 +0000 (00:26 +0100)]
Update fail2ban documentation (#16286)

Following the merge of #16278 we need to update the fail2ban
documentation to take account of the availability of the new
sshConnectionFailed failed authentication attempt log message.

Also add a deprecation notice regarding the previous publicKeyHandler
messages, as these may be a source of false positives.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix previous/next button size (#16284)
Jimmy Praet [Mon, 28 Jun 2021 19:36:09 +0000 (21:36 +0200)]
Fix previous/next button size (#16284)

3 years agoUpgrade Gliderlabs SSH to 0.3.3 and add FailedConnectionCallback (#16278)
zeripath [Mon, 28 Jun 2021 17:05:27 +0000 (18:05 +0100)]
Upgrade Gliderlabs SSH to 0.3.3 and add FailedConnectionCallback (#16278)

* Upgrade Gliderlabs SSH to 0.3.3 and add FailedConnectionCallback

Following the merging of https://github.com/gliderlabs/ssh/pull/143 we
can now report connections to the ssh server that have failed before
public key exchange has completed using the standard fail2ban message.

This PR updates Gliderlabs SSH and adds a callback that will provide this
logging.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* move the callback to its own function to make the logging appear little nicer

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoCounterwork seemingly unclickable repo button labels (#15064)
Mike L [Mon, 28 Jun 2021 08:21:43 +0000 (10:21 +0200)]
Counterwork seemingly unclickable repo button labels (#15064)

As title, the change counter-works the effect from #14926 that links seem unclickable (especially in the default gitea theme), while maintaining some sort of visual harmony.

Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 28 Jun 2021 00:29:35 +0000 (00:29 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoLink to previous blames in file blame page (#16259)
Norwin [Sun, 27 Jun 2021 23:13:20 +0000 (01:13 +0200)]
Link to previous blames in file blame page (#16259)

Adds a link to each blame hunk, to view the blame of an earlier version of the file, similar to GitHub. Also refactors the blame render from fmtstring based to template based.

* Fix blame bottom line and add blame prior button

* Jump to previous parent commit from the commit.

* Fix previous commit link

* Fix previous blame link

* Fix the given file not exist in the previous commit.

* Fix blameRow struct not export

* fix theming issues, rename template var

* remove unused LastCommit fetch

* fix location of blame-hunk divider

* rewrite previous commit checks

* remove duplicate commit lookup

its already resolved and stored in ctx.Repo.Commit!

* split out blamePart processing into function

Co-authored-by: rogerluo410 <rogerluo410@gmail.com>
3 years agoFix API to return author for author on commits(#16276)
6543 [Sun, 27 Jun 2021 22:15:42 +0000 (00:15 +0200)]
Fix API to return author for author on commits(#16276)

3 years agoHandle misencoding of login_source cfg in mssql (#16268)
zeripath [Sun, 27 Jun 2021 20:21:16 +0000 (21:21 +0100)]
Handle misencoding of login_source cfg in mssql (#16268)

* Handle misencoding of login_source cfg in mssql

Unfortunately due a bug in xorm (see https://gitea.com/xorm/xorm/pulls/1957) updating
loginsources on MSSQL causes them to become corrupted. (#16252)

Whilst waiting for the referenced PR to be merged and to handle the corrupted
loginsources correctly we need to add a wrapper to the `FromDB()` methods to look
for and ignore the misplaced BOMs that have been added.

Fix #16252

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update models/login_source.go

3 years agoAdd previous/next buttons to review comments (#16273)
Jimmy Praet [Sun, 27 Jun 2021 19:57:01 +0000 (21:57 +0200)]
Add previous/next buttons to review comments (#16273)

Co-authored-by: Norwin <noerw@users.noreply.github.com>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoRefactor Webhook + Add X-Hub-Signature (#16176)
KN4CK3R [Sun, 27 Jun 2021 19:21:09 +0000 (21:21 +0200)]
Refactor Webhook + Add X-Hub-Signature (#16176)

This PR removes multiple unneeded fields from the `HookTask` struct and adds the two headers `X-Hub-Signature` and `X-Hub-Signature-256`.

## :warning: BREAKING :warning:

* The `Secret` field is no longer passed as part of the payload.
* "Breaking" change (or fix?): The webhook history shows the real called url and not the url registered in the webhook (`deliver.go`@129).

Close #16115
Fixes #7788
Fixes #11755

Co-authored-by: zeripath <art27@cantab.net>
3 years agoMake allowed Visiblity modes configurable for Users (#16271)
6543 [Sun, 27 Jun 2021 18:47:35 +0000 (20:47 +0200)]
Make allowed Visiblity modes configurable for Users (#16271)

Now that #16069 is merged, some sites may wish to enforce that users are all public, limited or private, and/or disallow users from becoming private.

This PR adds functionality and settings to constrain a user's ability to change their visibility.

Co-authored-by: zeripath <art27@cantab.net>
3 years agoAdd jpraet to MAINTAINERS (#16274)
Jimmy Praet [Sun, 27 Jun 2021 17:35:31 +0000 (19:35 +0200)]
Add jpraet to MAINTAINERS (#16274)

3 years agoreview comments: break-word for long file names (#16272)
Norwin [Sun, 27 Jun 2021 15:21:19 +0000 (17:21 +0200)]
review comments: break-word for long file names (#16272)

* review comments: break-word for long file names

fixes #16248

Co-authored-by: zeripath <art27@cantab.net>
3 years agoAdd scroll-margin-top to account for sticky header (#16269)
Jimmy Praet [Sun, 27 Jun 2021 14:36:49 +0000 (16:36 +0200)]
Add scroll-margin-top to account for sticky header (#16269)

Fixes #16263

Co-authored-by: zeripath <art27@cantab.net>
3 years agoMake app.ini more restrictive on new installations (#16266)
Steven [Sun, 27 Jun 2021 10:07:36 +0000 (12:07 +0200)]
Make app.ini more restrictive on new installations (#16266)

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
3 years agoAdd --quiet and --verbose to gitea web to control initial logging (#16260)
zeripath [Sun, 27 Jun 2021 00:56:58 +0000 (01:56 +0100)]
Add --quiet and --verbose to gitea web to control initial logging (#16260)

One of the repeatedly reported issues has been that gitea produces too much console
logging during set up even if the console logger is turned off.

Fundamentally this is due to some otherwise very helpful logging that has to occur
before logging is set up. This has come to a head with the merging of #16243 where
otherwise potentially helpful Trace logging in the git module now appears on the
console.

This PR proposes three things:

1. Change the initial default logger to Info not Trace.
2. Change the logging for the AppPath things to Info in recompense.
3. Add two new command line options to gitea web: --quiet and --verbose

`gitea web -q` or `gitea web --quiet` will only log Fatal level initially.
`gitea web -verbose` will log at Trace.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 27 Jun 2021 00:29:32 +0000 (00:29 +0000)]
[skip ci] Updated licenses and gitignores

3 years agoAdd Visible modes function from Organisation to Users too (#16069)
Sergey Dryabzhinsky [Sat, 26 Jun 2021 19:53:14 +0000 (22:53 +0300)]
Add Visible modes function from Organisation to Users too (#16069)

You can limit or hide organisations. This pull make it also posible for users

- new strings to translte
- add checkbox to user profile form
- add checkbox to admin user.edit form
- filter explore page user search
- filter api admin and public user searches
- allow admins view "hidden" users
- add app option DEFAULT_USER_VISIBILITY
- rewrite many files to use Visibility field
- check for teams intersection
- fix context output
- right fake 404 if not visible

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoLimit stdout tracelog to actual stdout (#16258)
zeripath [Sat, 26 Jun 2021 12:47:56 +0000 (13:47 +0100)]
Limit stdout tracelog to actual stdout (#16258)

Related #16243

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoLet package git depend on setting but not opposite (#15241)
Lunny Xiao [Sat, 26 Jun 2021 11:28:55 +0000 (19:28 +0800)]
Let package git depend on setting but not opposite (#15241)

* Let package git depend on setting but not opposite

* private some package variables

3 years agoFixed issues not updated by commits (#16254)
KN4CK3R [Sat, 26 Jun 2021 09:13:51 +0000 (11:13 +0200)]
Fixed issues not updated by commits (#16254)

`UpdateIssuesCommit` may get called with fewer commits because of `FeedMaxCommitNum` and therefore may miss some commands.

3 years agoAdd better errors for disabled account recovery (#15117)
John Olheiser [Sat, 26 Jun 2021 04:16:36 +0000 (23:16 -0500)]
Add better errors for disabled account recovery (#15117)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoImprove efficiency in FindRenderizableReferenceNumeric and getReferences (#16251)
zeripath [Fri, 25 Jun 2021 23:11:33 +0000 (00:11 +0100)]
Improve efficiency in FindRenderizableReferenceNumeric and getReferences (#16251)

* Fuzzer finds an NPE due to incorrect URLPrefix

The Fuzzer is running on a non-repo urlprefix which is incorrect for RenderRaw

* Make FindRenderizableReferenceNumeric and getReferences more efficient

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdded support for gopher URLs. (#14749)
ayb [Fri, 25 Jun 2021 22:38:27 +0000 (00:38 +0200)]
Added support for gopher URLs. (#14749)

* Added support for gopher URLs.

* Add setting and make this user settable instead

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoFuzzer finds an NPE due to incorrect URLPrefix (#16249)
zeripath [Fri, 25 Jun 2021 18:14:49 +0000 (19:14 +0100)]
Fuzzer finds an NPE due to incorrect URLPrefix (#16249)

The Fuzzer is running on a non-repo urlprefix which is incorrect for RenderRaw

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAppend to existing trailers in generated squash commit message (#15980)
Jimmy Praet [Fri, 25 Jun 2021 17:01:43 +0000 (19:01 +0200)]
Append to existing trailers in generated squash commit message (#15980)

* Remove superfluous newline before Co-authored-by trailers

* Append to existing PR description trailer section

If the existing PR description message already contains a trailer section (e.g. Signed-off-by: ),
append to it instead of creating a new trailer section.

* Reuse compiled regexp

* Simplify regex and deal with trailing \n in PR description

* Add tests for CommitMessageTrailersPattern

- add support for Key:Value (no space after colon)
- add support for whitespace "folding"

* Update services/pull/pull_test.go

Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoPrevent webhook action buttons from shifting (#16087)
Steven [Fri, 25 Jun 2021 17:00:09 +0000 (19:00 +0200)]
Prevent webhook action buttons from shifting (#16087)

On long webhook urls the action buttons (edit, delete) have been shifted
by the url text.

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix heatmap activity (#15252)
siddweiker [Fri, 25 Jun 2021 16:59:25 +0000 (12:59 -0400)]
Fix heatmap activity (#15252)

* Group heatmap actions by 15 minute intervals

Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Add multi-contribution test for user heatmap

Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Add timezone aware summation for activity heatmap

Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Fix api user heatmap test

Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Update variable declaration style

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUse gitea logging module for git module (#16243)
6543 [Fri, 25 Jun 2021 16:54:08 +0000 (18:54 +0200)]
Use gitea logging module for git module (#16243)

remove log() func from gogs times and switch to proper logging

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd tag protection (#15629)
KN4CK3R [Fri, 25 Jun 2021 14:28:55 +0000 (16:28 +0200)]
Add tag protection (#15629)

* Added tag protection in hook.

* Prevent UI tag creation if protected.

* Added settings page.

* Added tests.

* Added suggestions.

* Moved tests.

* Use individual errors.

* Removed unneeded methods.

* Switched delete selector.

* Changed method names.

* No reason to be unique.

* Allow editing of protected tags.

* Removed unique key from migration.

* Added docs page.

* Changed date.

* Respond with 404 to not found tags.

* Replaced glob with regex pattern.

* Added support for glob and regex pattern.

* Updated documentation.

* Changed white* to allow*.

* Fixed edit button link.

* Added cancel button.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agofix IIS reverse proxy doc (#16246)
Martin Strob [Fri, 25 Jun 2021 12:38:41 +0000 (14:38 +0200)]
fix IIS reverse proxy doc (#16246)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 25 Jun 2021 00:11:36 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAPI: Allow COMMENT reviews to not specify a body (#16229)
sebastian-sauer [Thu, 24 Jun 2021 22:05:51 +0000 (00:05 +0200)]
API: Allow COMMENT reviews to not specify a body (#16229)

* Allow COMMENT reviews to not specify a body

when using web ui there is no need to specify a body.
so we don't need to specify a body if adding a COMMENT-review
via our api.

* Ensure comments or Body is provided

and add some integration tests for reviewtype COMMENT.

Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
3 years agoReplace ARCCache with TwoQueueCache to avoid patent issue (#16240)
Mura Li [Thu, 24 Jun 2021 18:37:07 +0000 (02:37 +0800)]
Replace ARCCache with TwoQueueCache to avoid patent issue (#16240)

Co-authored-by: Mura Li <typeless@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix diff expansion is missing final line in a file (#16222)
KN4CK3R [Thu, 24 Jun 2021 15:47:46 +0000 (17:47 +0200)]
Fix diff expansion is missing final line in a file (#16222)

* Fixed down offset.

* Fixed wrong line count result.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 24 Jun 2021 00:11:37 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoDo not show No match found for tribute (#16231)
zeripath [Wed, 23 Jun 2021 23:02:23 +0000 (00:02 +0100)]
Do not show No match found for tribute (#16231)

Tribute.js will show an untranslated no match found if no emoji or mentions.

Further the mentions should really require a preceding space.

This PR fixes both of these.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDon't WARN log UserNotExist errors on ExternalUserLogin failure (#16238)
zeripath [Wed, 23 Jun 2021 21:41:39 +0000 (22:41 +0100)]
Don't WARN log UserNotExist errors on ExternalUserLogin failure (#16238)

Instead log these at debug - with warn logging for other errors.

Fix #16235

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoRework repository archive (#14723)
Lunny Xiao [Wed, 23 Jun 2021 21:12:38 +0000 (05:12 +0800)]
Rework repository archive (#14723)

* Use storage to store archive files

* Fix backend lint

* Add archiver table on database

* Finish archive download

* Fix test

* Add database migrations

* Add status for archiver

* Fix lint

* Add queue

* Add doctor to check and delete old archives

* Improve archive queue

* Fix tests

* improve archive storage

* Delete repo archives

* Add missing fixture

* fix fixture

* Fix fixture

* Fix test

* Fix archiver cleaning

* Fix bug

* Add docs for repository archive storage

* remove repo-archive configuration

* Fix test

* Fix test

* Fix lint

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd sanitizer rules per renderer (#16110)
KN4CK3R [Wed, 23 Jun 2021 21:09:51 +0000 (23:09 +0200)]
Add sanitizer rules per renderer (#16110)

* Added sanitizer rules per renderer.

* Updated documentation.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[API] Add repoGetTag (#16166)
6543 [Wed, 23 Jun 2021 21:08:47 +0000 (23:08 +0200)]
[API] Add repoGetTag (#16166)

* GetTag -> GetAnnotatedTag

* API: Add repoGetTag

* fix swagger docs

* support "/" as tag name char

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix 500 Error with branch and tag sharing the same name #15592 (#16040)
Viktor Yakovchuk [Wed, 23 Jun 2021 21:08:26 +0000 (00:08 +0300)]
Fix 500 Error with branch and tag sharing the same name #15592 (#16040)

* Fix 500 Error with branch and tag sharing the same name #15592

Fixed 500 error while create Pull request when there are more
than one sources (branch, tag) with the same name

Fix #15592

Signed-off-by: Viktor Yakovchuk <viktor@yakovchuk.net>
* fix logging

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd code block highlight to orgmode back (#14222)
Lunny Xiao [Wed, 23 Jun 2021 20:45:47 +0000 (04:45 +0800)]
Add code block highlight to orgmode back (#14222)

Fix missed orgmode code block hightlight

Co-authored-by: zeripath <art27@cantab.net>
3 years ago[API] GET / SET User Settings (#16169)
6543 [Wed, 23 Jun 2021 19:58:44 +0000 (21:58 +0200)]
[API] GET / SET User Settings (#16169)

* API: GET/SET User Settings

* linter

* Apply suggestions from code review

* Update modules/structs/user.go

* lint

* fix swagger

* move User2UserSettings to convert

* as per @zeripath "preferences" -> "settings"

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd docs for windows env vars (#16236)
techknowlogick [Wed, 23 Jun 2021 19:57:56 +0000 (15:57 -0400)]
Add docs for windows env vars (#16236)

* Add docs for windows env vars

Fix #16213

* Fix docs/content/doc/developers/hacking-on-gitea.en-us.md

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
3 years agoSmall refactoring of modules/private (#15947)
KN4CK3R [Wed, 23 Jun 2021 19:38:19 +0000 (21:38 +0200)]
Small refactoring of modules/private (#15947)

* Use correct variable name.

* doer is never nil here.

* Use status code constants.

* Replaced generic map with concrete struct.

* Fixed windows lint.

* Removed unused method.

* Changed error codes.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix Nits (#16234)
6543 [Wed, 23 Jun 2021 17:43:33 +0000 (19:43 +0200)]
Fix Nits (#16234)

* template fix

* nits

* add doer to "created issue/pull"

3 years agoUse data path instead of config path (#16227)
KN4CK3R [Wed, 23 Jun 2021 14:56:25 +0000 (16:56 +0200)]
Use data path instead of config path (#16227)

3 years agoLocalize Email Templates (#16200)
6543 [Wed, 23 Jun 2021 12:33:21 +0000 (14:33 +0200)]
Localize Email Templates (#16200)

close #14822

3 years agoRun compliance on amd64 infra (#16232)
techknowlogick [Wed, 23 Jun 2021 05:36:27 +0000 (01:36 -0400)]
Run compliance on amd64 infra (#16232)

* Run compliance on amd64 infra

* Update .drone.yml

3 years agoImprove notifications for WIP draft PR's (#14663)
Jimmy Praet [Wed, 23 Jun 2021 04:14:22 +0000 (06:14 +0200)]
Improve notifications for WIP draft PR's (#14663)

* #14559 Reduce amount of email notifications for WIP draft PR's

don't notify repo watchers of WIP draft PR's

* #13190 Notification when WIP Pull Request is ready for review

* Send email notification to repo watchers when WIP PR is created

* Send ui notification to repo watchers when WIP PR is created

* send specific email notification when PR is marked ready for review

instead of reusing the CreatePullRequest action

* Fix lint error

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUse pulls url if issue is a pull request (#16230)
sebastian-sauer [Tue, 22 Jun 2021 20:13:31 +0000 (22:13 +0200)]
Use pulls url if issue is a pull request (#16230)

if a pull request is displayed use the /pulls path
if a pull requests diff is displayed use the /pulls/{id}/files url
if an issue is displayed use the issues url

Fixes #16102

Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
3 years agoUse html.Parse rather than html.ParseFragment (#16223)
zeripath [Mon, 21 Jun 2021 22:12:22 +0000 (23:12 +0100)]
Use html.Parse rather than html.ParseFragment (#16223)

* Use html.Parse rather than html.ParseFragment
  There have been a few issues with html.ParseFragment - just use html.Parse instead.

* Skip document node

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUpdate milestone counters on new issue. (#16183)
KN4CK3R [Mon, 21 Jun 2021 18:34:58 +0000 (20:34 +0200)]
Update milestone counters on new issue. (#16183)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoUpdate documentation for Implicit TLS (#16220)
zeripath [Mon, 21 Jun 2021 18:34:37 +0000 (19:34 +0100)]
Update documentation for Implicit TLS (#16220)

As per RFC 8314, it is now recommended to prefer TLS over STARTTLS.

Fix #16160

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoreqOrgMembership calls need to be preceded by reqToken (#16198)
zeripath [Mon, 21 Jun 2021 13:01:44 +0000 (14:01 +0100)]
reqOrgMembership calls need to be preceded by reqToken (#16198)

ReqOrgMembership calls need to be preceded by reqToken

Fix #16192

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd tests for all webhooks (#16214)
KN4CK3R [Mon, 21 Jun 2021 02:12:19 +0000 (04:12 +0200)]
Add tests for all webhooks (#16214)

* Added tests for MS Teams.

* Added tests for Dingtalk.

* Added tests for Telegram.

* Added tests for Feishu.

* Added tests for Discord.

* Added tests for closed issue and pullrequest comment.

* Added tests for Matrix.

* Trim all spaces.

* Added tests for Slack.

* Added JSONPayload tests.

* Added general tests.

* Replaced duplicated code.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 21 Jun 2021 00:11:34 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoMore efficiently parse shas for shaPostProcessor (#16101)
zeripath [Sun, 20 Jun 2021 22:39:12 +0000 (23:39 +0100)]
More efficiently parse shas for shaPostProcessor (#16101)

* More efficiently parse shas for shaPostProcessor

The shaPostProcessor currently repeatedly calls git rev-parse --verify on both backends
which is fine if there is only one thing that matches a sha - however if there are
multiple things then this becomes wildly inefficient.

This PR provides functions for both backends which are much faster to use.

Fix #16092

* Add ShaExistCache to RenderContext

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoUse git log name-status in get last commit (#16059)
zeripath [Sun, 20 Jun 2021 22:00:46 +0000 (23:00 +0100)]
Use git log name-status in get last commit (#16059)

* Improve get last commit using git log --name-status

git log --name-status -c provides information about the diff between a
commit and its parents. Using this and adjusting the algorithm to use
the first change to a path allows for a much faster generation of commit
info.

There is a subtle change in the results generated but this will cause
the results to more closely match those from elsewhere.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>