11864 Commits

Author SHA1 Message Date
67ceb61fe3 Changelog 1.15.2 ()
## [1.15.2](https://github.com/go-gitea/gitea/releases/tag/v1.15.2) - 2021-09-03

* BUGFIXES
  * Add unique constraint back into issue_index ()
  * Close storage objects before cleaning () ()

Signed-off-by: Andrew Thornton <art27@cantab.net>
v1.15.2
2021-09-03 12:50:32 +01:00
5cb5101720 Close storage objects before cleaning () ()
Backport 

Storage.Iterate provides the path and an open object. On windows using
local storage means that the objects will be locked thus preventing clean
from deleting them.

This PR simply closes the objects early.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-09-03 12:17:07 +01:00
6f261fdf47 Add unique constraint back into issue_index ()
There is a flaw in  where it was missed that although xorm will
not add a primary key to a table during syncing, it will remove an
unique constraint.

Users upgrading from 1.15.0 to 1.15.1 will therefore lose the unique
constraint that makes this table work unless they run `gitea doctor
recreate-table issue_index`.  Postgres helpfully warns about this
situation but MySQL does not.

Main/1.16-dev is not affected by this issue as there is a migration that
does the above recreation by default. Users moving directly to 1.15.1
from 1.14.x or lower are also not affected.

Whilst we could force all users who ran 1.15.0 to do the above
recreate-table call, this PR proposes an alternative: Just add the
unique constraint back in for 1.15.x. This won't have any long term
effects - just some wasted space for the unnecessary index.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-09-03 17:35:18 +08:00
3365611f06 Changelog 1.15.1 ()
## [1.15.1](https://github.com/go-gitea/gitea/releases/tag/v1.15.1) - 2021-09-02

* BUGFIXES
  * Allow BASIC authentication access to /:owner/:repo/releases/download/* () ()
  * Prevent leave changes dialogs due to autofill fields () ()
  * Ignore review comment when ref commit is missed () ()
  * Fix wrong attachment removal () ()
  * Gitlab Migrator: dont ignore reactions of last request () ()
  * Correctly return the number of Repositories for Organizations () ()
  * Test if LFS object is accessible () ()
  * Fix git.Blob.DataAsync(): close pipe since we return a NopCloser () ()
  * Fix dump and restore respository () ()
  * Repare and Improve GetDiffRangeWithWhitespaceBehavior () ()
  * Fix wiki raw commit diff/patch view () ()
  * Ensure wiki repos are all closed () ()
  * List limited and private orgs if authenticated on API () ()
  * Simplify split diff view generation and remove JS dependency () ()
  * Ensure that the default visibility is set on the user create page () ()
  * In Render tolerate not being passed a context () ()
  * Upgrade xorm to v1.2.2 () & Add test to ensure that dumping of login sources remains correct () ()
  * Report the correct number of pushes on the feeds () ()
  * Add primary_key to issue_index () ()
  * Prevent NPE on empty commit () ()
  * Fix branch pagination error () ()
  * Add missing return to handleSettingRemoteAddrError () ()
  * Remove spurious / from issues.opened_by ()
  * Ensure that template compilation panics are sent to the logs () ()
  * Update caddyserver/certmagic () ()

Signed-off-by: Andrew Thornton <art27@cantab.net>
v1.15.1
2021-09-02 18:23:40 +01:00
ceae89c8c7 Allow BASIC authentication access to /:owner/:repo/releases/download/* () ()
Backport 

Duplicate  to allow access to releases download through BASIC authentication.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-09-02 12:34:49 -04:00
8f300781ad Prevent leave changes dialogs due to autofill fields () ()
Backport 

Add ignore-dirty to /user/settings/account
Add autocomplete="off" to push_mirror_address form on /:owner/:repo/settings

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-09-02 17:00:20 +01:00
8b132bdec6 Ignore review comment when ref commit is missed () ()
backport 
2021-09-02 11:51:32 +01:00
e70b679d21 Fix wrong attachment removal () ()
Backport 
2021-09-02 06:50:11 +01:00
02de43236a Gitlab Migrator: dont ignore reactions of last request () ()
Backport 

Fix bug related to early breaking when migrating reactions.

Co-authored-by: 6543 <6543@obermui.de>
2021-09-01 17:52:38 -04:00
f949f9e9c5 Correctly return the number of Repositories for Organizations () ()
Backport 

Calculate and return the number of Repositories on the dashboard
Organization list.

This PR restores some of the logic that was removed in  to
calculate the number of repos on the dashboard orgs list.

Fix 
Replaces 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-09-01 19:20:35 +02:00
cbe3ca5d0b Test if LFS object is accessible () ()
* Test if object is accessible.

* Added more logging.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2021-08-31 17:58:39 +02:00
3ac1f35349 List limited and private orgs if authenticated on API () () 2021-08-31 12:49:02 +02:00
af1fd56d8a Fix dump and restore respository () ()
* Fix dump and restore
* return different error message for get commit
* Fix missing delete release attachment when deleting repository
* Fix ci and add some comments

back port 

Co-authored-by: zeripath <art27@cantab.net>
2021-08-31 10:44:14 +01:00
0274933c22 Fix git.Blob.DataAsync(): close pipe since we return a NopCloser () ()
* make sure headGitRepo is closed on err too
* refactor
* Fix git.Blob.DataAsync(): exec cancel since we already read all bytes (close pipe since we return a NopCloser)

Co-authored-by: zeripath <art27@cantab.net>
2021-08-31 16:06:01 +08:00
67776372d6 Fix wiki raw commit diff/patch view () () 2021-08-31 14:13:08 +08:00
c54639b8ee Repare and Improve GetDiffRangeWithWhitespaceBehavior () ()
fix pipe leak
2021-08-31 05:02:27 +02:00
49a71a6461 Ensure wiki repos are all closed () ()
There are multiple places where wiki git repositories are not properly closed.

This PR ensures they are closed.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
2021-08-30 23:00:45 +02:00
58f4a4114e Simplify split diff view generation and remove JS dependency () ()
Backport 

Gitea has relied on some slow JS code to match up added and deleted lines on the
diff pages. This can cause a considerable slow down on large diff pages.

This PR makes a small change meaning that the matching up can occur much more simply.

Partial fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-08-30 16:43:06 +01:00
b31307c41c Ensure that the default visibility is set on the user create page () ()
Backport 

Set the default visibility on the user create page.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-08-29 17:33:13 +02:00
c5193a8481 In Render tolerate not being passed a context () ()
* In Render tolerate not being passed a context

It is possible for RenderString to be passed to an external renderer if markdown
is set to be rendered by an external renderer. No context is currently sent to these
meaning that this will error out.

Fix 

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

* Add Context to Repo calls for RenderString

All calls from routers can easily add the context - so add it.

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

Co-authored-by: zeripath <art27@cantab.net>
2021-08-29 15:25:45 +01:00
1790f01dd9 Upgrade xorm to v1.2.2 () & Add test to ensure that dumping of login sources remains correct () ()
* Upgrade xorm to v1.2.2 ()

Backport 

Fix 

* Add test to ensure that dumping of login sources remains correct ()

 has occurred because of a missed regression. This PR adds a simple test to
try to prevent this occuring again.

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

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-08-28 13:16:19 +02:00
0c7927fe48 Report the correct number of pushes on the feeds () ()
* Report the correct number of pushes on the feeds

Since the number of commits in the Action table has been limited to 5
the number of commits reported on the feeds page is now incorrectly also
limited to 5. The correct number is available as the Len and this PR
changes this to report this.

Fix 

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

* Update templates/user/dashboard/feeds.tmpl

Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: zeripath <art27@cantab.net>
2021-08-26 02:30:13 -04:00
695e8ae81d Add primary_key to issue_index () ()
Backport 

Make the group_id a primary key in issue_index. This already has an
unique index and therefore is a good candidate for becoming a primary
key.

This PR also changes all other uses of this table to add the group_id as
the primary key.

The migration v192 from  has not been backported but Xorm will
work fine with non-primary keyed tables. If a user on 1.15 wishes to
have the correct schema sooner than 1.16 - they can use gitea doctor
recreate-table issue_index and gitea will recreate the table with the
primary key.

Fix 

Signed-off-by: Andrew Thornton art27@cantab.net
2021-08-25 18:10:15 -04:00
2148b27bfa Prevent NPE on empty commit () ()
Backport 

Handle completely empty commit as the first commit to a repository.

Fix 

Signed-off-by: Andrew Thornton art27@cantab.net
2021-08-25 13:22:48 +01:00
ab7e36e3a5 Fix branch pagination error () ()
Backport 

Fix 

Even if default branch is removed from the current page, but the total branches number should be still kept. So that the pagination calculation will be correct.
2021-08-25 11:11:54 +01:00
63178b5654 Ensure that template compilation panics are sent to the logs () ()
Backport 

Although panics within the rendering pipeline are caught and dealt with,
panics that occur before that starts are unprotected and will kill Gitea
without being sent to the logs.

This PR adds a basic recovery handler to catch panics that occur after
the logger is initialised and ensure that they're sent to the logger.

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-08-23 19:50:04 -04:00
2d15126de6 Remove spurious / from issues.opened_by ()
Fix 

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-08-23 18:24:30 -04:00
31e4e8205a Add missing return to handleSettingRemoteAddrError () ()
Backport 

There is a missing return in handleSettingRemoteAddrError which means
that the error page for repo settings is duplicately rendered.

Fix 

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-08-23 18:09:28 -04:00
37e4cdbbe6 Update only certmagic ()
Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: jolheiser <john.olheiser@gmail.com>
2021-08-23 18:07:44 -04:00
f7e7477c45 changelog for 1.15.0 ()
* changelog for 1.15.0

* Slight rename of GPG feature

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

* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
v1.15.0
2021-08-21 20:38:22 -04:00
0840a508b4 Keep attachments on tasklist update () ()
* Send attachments too.

* Use tasklist flag.

* use action="ignoreAttachments" instead of "tasklist"

* Use boolean parameter.

* when the update request doesn't intend to update attachments (eg: change checkbox state), ignore attachment updates ()

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2021-08-21 20:10:04 +01:00
5ceff8fda2 Recreate Tables should Recreate indexes on MySQL () ()
The MySQL indexes are not being renamed at the same time as RENAME table despite the
CASCADE. Therefore it is probably better to just recreate the indexes instead.

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-08-20 22:47:37 -04:00
778a0bf758 Fix dependency translations ()
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-08-20 13:11:26 -04:00
f19ccd8f6a Do not use thin scrollbars on Firefox () ()
In , thin scrollbars were added in Arc Green theme. It got moved
in base theme in .

This PR removes the use of thin scrollbars which causes an
accessibility issue. The scrollbars become too thin to be dragged.

Signed-off-by: Elouan Martinet <exa@elou.world>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-08-20 06:19:22 +01:00
b6e4688874 Fix wrong user in OpenID response () ()
* Fix wrong user in OpenID response ()

* Fixed usage of wrong user.

* Added tests.

* Fixed wrong import.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-08-20 00:26:44 +03:00
25437672bf Restore functionality for pushing non-standard refs (Partial ) ()
Partial Backport 

There was an inadvertent breaking change in  meaning that notes refs and other
git extension refs will be automatically rejected.

This PR removes this incorrect forced rejection of non-standard refs.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-08-17 10:24:47 +02:00
0dc808212b release/v1.15: set min go version to min upstream supported go1.16 ()
* release/v1.15: set min go version to min upstream supported 1.16

* update drone
2021-08-17 10:09:44 +03:00
b6508b872b Upgrade levelqueue 0.4.1 () () 2021-08-16 10:37:27 +03:00
d89029ebac Ensure empty lines are copiable and final new line too () ()
Backport 

When files are highlighted the newline character needs to be added in a whitespace
compliant mode. Also ensure the final empty newline is rendered.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-08-15 05:39:23 +02:00
62315ea731 If PatchURL is empty, skip pull patch download when migrating (Partial ) ()
Partial backport 

Whilst looking at adding migration support for onedev it has become apparent that gitea would attempt to pull patches on other migration targets even if that PatchURL was empty.
2021-08-13 18:26:19 +02:00
86861ee135 Update issue_index to finish migration () ()
* update issue_index to finish migration

* One Func to RecalculateIssueIndexForRepo
2021-08-13 15:13:03 +01:00
d2d99a25b7 Fix NPE in fuzzer () ()
The fuzzer found an issue with the issue pattern processor where there is a spurious
path.Clean which does not need to be there. This PR also sets the default AppURL for
the fuzzer too.

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

Co-authored-by: zeripath <art27@cantab.net>
2021-08-13 08:51:13 +03:00
e483ec8b0d Change the implementation of the go-git version of GetNote to mirror the non go-git version when passed a non-existent commit () ()
Backport 

Fixes 
2021-08-09 20:24:31 +01:00
46d62ad896 Fix direct creation of external users on admin page ()
From  it was noticed that when creating new external users directly it was not
possible to set their username correctly. This PR restores this ability.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-08-09 14:18:40 +02:00
428d58f8da Restore compatibility with SQLServer 2008 R2 in migrations ()
This fixes two problems with MSSQL:

* `ALTER TABLE DROP ... IF EXISTS ...` is only supported in SQL Server >16.

The `IF EXISTS` here is a belt-and-braces and does not need to be present. Therefore
can be dropped. Also stop attempting to drop the indexes as constraints as they're indexes!

* System tables like: `sys.indexes` should be lowercase not uppercase because of collation issues.

Fix 

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

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2021-08-08 13:32:07 +03:00
1a2256bf44 Changelog for 1.15.0-rc3 ()
* Changelog for 1.15.0-rc3

 ## [1.15.0-rc3](https://github.com/go-gitea/gitea/releases/tag/v1.15.0-rc3) - 2021-08-04

* BREAKING
  * Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 () ()
* SECURITY
  * Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 () ()
  * Switch to maintained jwt lib () ()
  * Correctly create of git-daemon-export-ok files () ()
  * Don't show private user's repo in explore view () ()
* API
  * Swagger AccessToken fixes () ()
  * Set AllowedHeaders on API CORS handler () ()
* BUGFIXES
  * Restore Accessibility for Dropdown () ()
  * Pass down SignedUserName down to AccessLogger context () ()
  * Fix table alignment in markdown () ()
  * Fix 500 on first wiki page () ()
  * Lock goth/gothic and Re-attempt OAuth2 registration on login if registration failed at startup () ()
  * Upgrade levelqueue to v0.4.0 () ()
  * Handle too long PR titles correctly () ()
  * Fix data race in bleve indexer () ()
  * Restore CORS on git smart http protocol () ()
  * Fix race in log () ()
  * Fix prepareWikiFileName to respect existing unescaped files () ()
  * Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end () ()
  * Update notification table with only latest data () ()
  * Revert to use alpine 3.13 () ()
  * Fix crash following ldap authentication update () ()
  * Fix direct creation of external users on admin page (partial ) ()

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

* Update CHANGELOG.md

Co-authored-by: techknowlogick <techknowlogick@gitea.io>

* Update CHANGELOG.md

Co-authored-by: zeripath <art27@cantab.net>

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
v1.15.0-rc3
2021-08-06 16:08:13 -04:00
20601f8463 Prevent 500 on draft releases without tag () ()
It is possible to create draft releases prior to creating a tag. This will cause a
500 on the releases page due to compare page failing.

This PR only shows the compare button if there is a SHA1 present.

Fix 

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

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
2021-08-06 11:09:33 +03:00
619e6d6400 Frontport changelog for v1.14.6 ()
* Frontport changelog for v1.14.6

Frontport 

Changelog frontported to below v1.15.0-rc1.

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

* Update config.yaml

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-08-06 01:17:44 +03:00
f438b6f33b Update node tar dependency to 6.1.6 () ()
Backport 

Forcibly update dev dependency on tar to 6.1.6

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

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2021-08-05 00:40:25 -04:00
c47065cc29 Set AllowedHeaders on API CORS handler () ()
Backport 

Set AllowedHeaders on API CORS handler and add missing Access-Control-Expose-Headers
to pull API.

Fix 

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-08-04 21:57:59 +02:00