]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agorevert to use alpine 3.13 (#16451)
techknowlogick [Fri, 16 Jul 2021 01:54:39 +0000 (21:54 -0400)]
revert to use alpine 3.13 (#16451)

Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix crash following ldap authentication update (#16447)
zeripath [Fri, 16 Jul 2021 00:17:51 +0000 (01:17 +0100)]
Fix crash following ldap authentication update (#16447)

Unfortunately #16268 contained a terrible error, whereby there was a double
indirection taken when unmarshalling the source data. This fatally breaks
authentication configuration reading.

Fix #16342

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 16 Jul 2021 00:07:52 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agocleanup code `issueFullPattern` in modules/markup (#16419)
Josef Fröhle [Thu, 15 Jul 2021 20:33:56 +0000 (22:33 +0200)]
cleanup code `issueFullPattern` in modules/markup (#16419)

fix #16415

3 years agoUpdate documentation to reflect #15219 (#16442)
zeripath [Thu, 15 Jul 2021 19:49:12 +0000 (20:49 +0100)]
Update documentation to reflect #15219 (#16442)

The move to render custom/public as within /assets in #15219 missed updating
several documentation pages.

This PR updates this documentation.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoadd configuration option to restrict users by default (#16256)
Richard Nienaber [Thu, 15 Jul 2021 19:19:48 +0000 (20:19 +0100)]
add configuration option to restrict users by default (#16256)

* add configuration option to restrict users by default

* default IsRestricted permission only set on sign up

setting this in the model messes with other workflows (e.g. syncing LDAP users) where the IsRestricted permission needs to be explicitly set and not overridden by a config value

* fix formatting

* Apply suggestions from code review

* ensure newly created user is set to restricted

* ensure imports are in the correct order

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoCheck user instead of organization when creating a repo from a template via API ...
Ion Jaureguialzo Sarasola [Thu, 15 Jul 2021 18:19:39 +0000 (20:19 +0200)]
Check user instead of organization when creating a repo from a template via API (#16346)

* Check user instead of organization

* Enforce that only admins can copy a repo to another user

3 years agomicrobadger is no more, rm from readme (#16440)
techknowlogick [Thu, 15 Jul 2021 17:08:20 +0000 (13:08 -0400)]
microbadger is no more, rm from readme (#16440)

* microbadger is no more, rm from readme

* Update README_ZH.md

3 years agoChange @every 24h default schedules to @midnight (#16431) v1.16.0-dev
Jimmy Praet [Thu, 15 Jul 2021 15:55:48 +0000 (17:55 +0200)]
Change @every 24h default schedules to @midnight (#16431)

3 years agoChangelog for v1.15.0-rc1 (#16422) v1.15.0-rc1
6543 [Thu, 15 Jul 2021 15:47:57 +0000 (17:47 +0200)]
Changelog for v1.15.0-rc1 (#16422)

* changelog -m 1.15.0 generate

* enhance changelog

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: techknowlogick <matti@mdranta.net>
* move SECURITY before FEATURES

* move ENHANCEMENTS above BUGFIXES

* as per techknowlogick

* more

* node16

* Apply suggestions from code review

Co-authored-by: Kyle D. <kdumontnu@gmail.com>
* next

* Apply suggestions from code review

* Update CHANGELOG.md

Co-authored-by: Norwin <noerw@users.noreply.github.com>
* Update CHANGELOG.md

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Kyle D. <kdumontnu@gmail.com>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoRetry rename on lock induced failures (#16435)
zeripath [Thu, 15 Jul 2021 15:46:07 +0000 (16:46 +0100)]
Retry rename on lock induced failures (#16435)

* Retry rename on lock induced failures

Due to external locking on Windows it is possible for an
os.Rename to fail if the files or directories are being
used elsewhere.

This PR simply suggests retrying the rename again similar
to how we handle the os.Remove problems.

Fix #16427

Signed-off-by: Andrew Thornton <art27@cantab.net>
* resolve CI fail

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 15 Jul 2021 15:07:57 +0000 (15:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 15 Jul 2021 10:07:52 +0000 (10:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 15 Jul 2021 09:08:09 +0000 (09:08 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoadd note about minimum required version of git installed (#16433)
techknowlogick [Thu, 15 Jul 2021 03:28:49 +0000 (23:28 -0400)]
add note about minimum required version of git installed (#16433)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Jul 2021 20:07:55 +0000 (20:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoChange the release cycle to match actual situations (#16430)
Lunny Xiao [Wed, 14 Jul 2021 18:03:00 +0000 (02:03 +0800)]
Change the release cycle to match actual situations (#16430)

* Change the release cycle to match actual situations

* Update CONTRIBUTING.md

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoChange docker tag logic (#16421)
techknowlogick [Wed, 14 Jul 2021 17:08:43 +0000 (13:08 -0400)]
Change docker tag logic (#16421)

* Change docker logic

* Apply suggestions from code review

Co-authored-by: Kyle D. <kdumontnu@gmail.com>
* docs

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Kyle D. <kdumontnu@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Jul 2021 15:07:54 +0000 (15:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoSecond attempt at preventing zombies (#16326)
zeripath [Wed, 14 Jul 2021 14:43:13 +0000 (15:43 +0100)]
Second attempt at preventing zombies (#16326)

* Second attempt at preventing zombies

* Ensure that the pipes are closed in ssh.go
* Ensure that a cancellable context is passed up in cmd/* http requests
* Make cmd.fail return properly so defers are obeyed
* Ensure that something is sent to stdout in case of blocks here

Signed-off-by: Andrew Thornton <art27@cantab.net>
* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
* placate lint 2

Signed-off-by: Andrew Thornton <art27@cantab.net>
* placate lint 3

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fixup

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Apply suggestions from code review

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Jul 2021 14:07:52 +0000 (14:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Jul 2021 13:08:17 +0000 (13:08 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUse TrN helper for email templates (#16425)
6543 [Wed, 14 Jul 2021 13:06:09 +0000 (15:06 +0200)]
Use TrN helper for email templates (#16425)

* Add TrN helper

* use TrN

* a nit

3 years agoMake gpg resource string more readable (#16423)
delvh [Wed, 14 Jul 2021 10:50:39 +0000 (12:50 +0200)]
Make gpg resource string more readable (#16423)

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

3 years agoFix activation of primary email addresses (#16385)
Meano [Tue, 13 Jul 2021 20:59:27 +0000 (04:59 +0800)]
Fix activation of primary email addresses (#16385)

* fix: primary email cannot be activated

* Primary email should be activated together with user account when
'RegisterEmailConfirm' is enabled.

* To fix the existing error state. When 'RegisterEmailConfirm' is enabled, the
admin should have permission to modify the activations status of user email.
And the user should be allowed to send activation to primary email.

* Only judge whether email is primary from email_address table.

* Improve logging and refactor isEmailActive

Co-authored-by: zeripath <art27@cantab.net>
3 years agoReturn updated repository when changing repository using API (#16420)
6543 [Tue, 13 Jul 2021 19:31:59 +0000 (21:31 +0200)]
Return updated repository when changing repository using API (#16420)

3 years agoLoad issue/PR context popup data only when needed (#15955)
Lauris BH [Tue, 13 Jul 2021 18:09:19 +0000 (21:09 +0300)]
Load issue/PR context popup data only when needed (#15955)

* Load issue/PR context popup data only when needed

* Add SVG icon Vue component

* Remove unneeded check

3 years agoSupport HTTP/2 in Let's Encrypt (#16371)
Stanley Hu [Tue, 13 Jul 2021 17:17:46 +0000 (01:17 +0800)]
Support HTTP/2 in Let's Encrypt (#16371)

Modify the tlsConfig.NextProtos for Let's Encrypt and built-in HTTPS server in order to support HTTP/2.

Co-authored-by: 6543 <6543@obermui.de>
3 years agofix calculation for finalPage in repo-search component (#16382)
6543 [Tue, 13 Jul 2021 14:05:27 +0000 (16:05 +0200)]
fix calculation for finalPage in repo-search component (#16382)

Co-authored-by: Jan Naahs <jan.naahs@naahstea.de>
3 years agoAdd option to provide signature for a token to verify key ownership (#14054)
zeripath [Tue, 13 Jul 2021 13:28:07 +0000 (14:28 +0100)]
Add option to provide signature for a token to verify key ownership (#14054)

* Add option to provide signed token to verify key ownership

Currently we will only allow a key to be matched to a user if it matches
an activated email address. This PR provides a different mechanism - if
the user provides a signature for automatically generated token (based
on the timestamp, user creation time, user ID, username and primary
email.

* Ensure verified keys can act for all active emails for the user

* Add code to mark keys as verified

* Slight UI adjustments

* Slight UI adjustments 2

* Simplify signature verification slightly

* fix postgres test

* add api routes

* handle swapped primary-keys

* Verify the no-reply address for verified keys

* Only add email addresses that are activated to keys

* Fix committer shortcut properly

* Restructure gpg_keys.go

* Use common Verification Token code

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix archive error when rename repo or user (#16399)
Lunny Xiao [Tue, 13 Jul 2021 12:16:31 +0000 (20:16 +0800)]
Fix archive error when rename repo or user (#16399)

Use repo id instead of full name to generate archive path

3 years agoLet branch/tag name be a valid ref to get CI status (#16400)
6543 [Tue, 13 Jul 2021 07:14:14 +0000 (09:14 +0200)]
Let branch/tag name be a valid ref to get CI status (#16400)

* fix #16384#

* refactor: move shared helper func to utils package

* extend Tests

* use ctx.Repo.GitRepo if not nil

3 years agoDetect encoding changes while parsing diff (#16330)
Jimmy Praet [Tue, 13 Jul 2021 01:13:52 +0000 (03:13 +0200)]
Detect encoding changes while parsing diff (#16330)

* Detect encoding changes while parsing diff

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 13 Jul 2021 00:07:51 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd checkbox to delete pull branch after successful merge (#16049)
Jimmy Praet [Mon, 12 Jul 2021 23:26:25 +0000 (01:26 +0200)]
Add checkbox to delete pull branch after successful merge (#16049)

* Add checkbox to delete pull branch after successful merge

* Omit DeleteBranchAfterMerge field in json

* Log a warning instead of error when PR head branch deleted

* Add DefaultDeleteBranchAfterMerge to PullRequestConfig

* Add support for delete_branch_after_merge via API

* Fix for API: the branch should be deleted from the HEAD repo

If head and base repo are the same, reuse the already opened ctx.Repo.GitRepo

* Don't delegate to CleanupBranch, only reuse branch deletion code

CleanupBranch contains too much logic that has already been performed by the Merge

* Reuse gitrepo in MergePullRequest

Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoFix external renderer (#16401)
6543 [Mon, 12 Jul 2021 21:13:59 +0000 (23:13 +0200)]
Fix external renderer (#16401)

* fix external renderer

* use GBackground context as fallback

* no fallback, return error

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoValidate Issue Index before querying DB (#16406)
Norwin [Mon, 12 Jul 2021 20:22:27 +0000 (20:22 +0000)]
Validate Issue Index before querying DB (#16406)

3 years agodocs: rewrite email setup (#16404)
Bagas Sanjaya [Mon, 12 Jul 2021 20:05:40 +0000 (03:05 +0700)]
docs: rewrite email setup (#16404)

* Add intro for both the docs page and mailer methods
  * Fix numbering level in SMTP section
  * Recommends implicit TLS

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
3 years agoReplace `plugins/docker` with `techknowlogick/drone-docker`in ci (#16407)
6543 [Mon, 12 Jul 2021 19:20:44 +0000 (21:20 +0200)]
Replace `plugins/docker` with `techknowlogick/drone-docker`in ci (#16407)

* plugins/docker -> techknowlogick/drone-docker

* It is multi-arch

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 12 Jul 2021 00:24:54 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd LRU mem cache implementation (#16226)
zeripath [Sat, 10 Jul 2021 21:54:15 +0000 (22:54 +0100)]
Add LRU mem cache implementation (#16226)

The current default memory cache implementation is unbounded in size and number of
objects cached. This is hardly ideal.

This PR proposes creating a TwoQueue LRU cache as the underlying cache for Gitea.
The cache is limited by the number of objects stored in the cache (rather than size)
for simplicity. The default number of objects is 50000 - which is perhaps too small
as most of our objects cached are going to be much less than 1kB.

It may be worth considering using a different LRU implementation that actively limits
sizes or avoids GC - however, this is just a beginning implementation.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix invalid params and typo of email templates (#16394)
Meano [Sat, 10 Jul 2021 17:40:14 +0000 (01:40 +0800)]
Fix invalid params and typo of email templates (#16394)

Signed-off-by: Meano <meanocat@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 10 Jul 2021 00:24:52 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdded documentation about 413 errors with an nginx solution (#15313)
Avahe Kellenberger [Sat, 10 Jul 2021 00:16:07 +0000 (20:16 -0400)]
Added documentation about 413 errors with an nginx solution (#15313)

* Added documentation about 413 errors with an nginx solution.

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix #16387 - rootless Docker user (#16388)
Jonathan Hult [Fri, 9 Jul 2021 14:08:22 +0000 (09:08 -0500)]
Fix #16387 - rootless Docker user (#16388)

Move comment to top of USER instruction

3 years agoUpdate bluemonday to v1.0.15 (#16379)
6543 [Fri, 9 Jul 2021 01:30:31 +0000 (03:30 +0200)]
Update bluemonday to v1.0.15 (#16379)

* update github.com/microcosm-cc/bluemonday

* add exec flag to contrib/update_dependencies.sh

* Fix TESTS

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 9 Jul 2021 00:25:09 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agospecify user in rootless container numerically (#16361)
Tobias Florek [Thu, 8 Jul 2021 19:30:09 +0000 (19:30 +0000)]
specify user in rootless container numerically (#16361)

* specify user in rootless container numerically

With kubernetes' PodSecurityPolicy set to runAsNonRoot it will not allow starting the container.  The error message is
```
Error: container has runAsNonRoot and image has non-numeric user (git), cannot verify user is non-root
```
The `USER` directive has to be numerical for that to work.

* mention the name of the uid/gid

Co-authored-by: 6543 <6543@obermui.de>
3 years agoRedirect on bad CSRF instead of presenting bad page (#14937)
zeripath [Thu, 8 Jul 2021 13:57:24 +0000 (14:57 +0100)]
Redirect on bad CSRF instead of presenting bad page (#14937)

The current CSRF handler is a bit harsh with bad CSRF tokens on webpages
I think we can be a little kinder and redirect to base page with a flash error

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix source typos (#16374)
luzpaz [Thu, 8 Jul 2021 12:55:09 +0000 (08:55 -0400)]
Fix source typos (#16374)

* Fix source typos

Follow up to e0296b6a6
Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby`

* rm "ignore destory on `make misspell-check`"

Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix various documentation, user-facing, and source comment typos (#16367)
luzpaz [Thu, 8 Jul 2021 11:38:13 +0000 (07:38 -0400)]
Fix various documentation, user-facing, and source comment typos (#16367)

* Fix various doc, user-facing, and source comment typos

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

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