]> source.dussan.org Git - gitea.git/log
gitea.git
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 27 Aug 2021 00:04:45 +0000 (00:04 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoEnable race detector for CI (#1441)
Mura Li [Thu, 26 Aug 2021 08:50:04 +0000 (16:50 +0800)]
Enable race detector for CI (#1441)

* Enable race detector by default

Set RACE_ENABLED=0 to disable it when release

* Disable race detector for release builds

* use `true`

* fix

* debug issue

* fix

* verbose

* clean

* Fix wrong merge

* Fix coverage merge

Co-authored-by: Mura Li <typeless@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 26 Aug 2021 00:04:46 +0000 (00:04 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoReport the correct number of pushes on the feeds (#16811)
zeripath [Wed, 25 Aug 2021 23:04:58 +0000 (00:04 +0100)]
Report the correct number of pushes on the feeds (#16811)

* 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 #16804

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update templates/user/dashboard/feeds.tmpl

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd EdDSA JWT signing algorithm (#16786)
Aliaksandr Mianzhynski [Wed, 25 Aug 2021 20:50:38 +0000 (23:50 +0300)]
Add EdDSA JWT signing algorithm (#16786)

* Add EdDSA signing algorithm

* Fix typo

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoActually compute proper foreground color for labels (#16729)
Clar Fon [Wed, 25 Aug 2021 17:55:47 +0000 (13:55 -0400)]
Actually compute proper foreground color for labels (#16729)

3 years agoUnify migration descriptions (#16781)
delvh [Wed, 25 Aug 2021 13:47:05 +0000 (15:47 +0200)]
Unify migration descriptions (#16781)

* Unify migration descriptions

* Clarify that pure Git migration differs from other migrations

Co-authored-by: Norwin <noerw@users.noreply.github.com>
* Use Pull Requests for Gitea migration

Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoUse a common quote to instead of check database type (#16817)
Lunny Xiao [Wed, 25 Aug 2021 12:23:34 +0000 (20:23 +0800)]
Use a common quote to instead of check database type (#16817)

`` ` `` will be converted to different database quote by xorm. So check database type is unnecessary.

3 years agoAdd primary_key to issue_index (#16813)
zeripath [Wed, 25 Aug 2021 08:42:51 +0000 (09:42 +0100)]
Add primary_key to issue_index (#16813)

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.

Fix #16802

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoPrevent NPE on empty commit (#16812)
zeripath [Tue, 24 Aug 2021 23:33:23 +0000 (00:33 +0100)]
Prevent NPE on empty commit (#16812)

3 years agoFix branch pagination error (#16805)
Lunny Xiao [Tue, 24 Aug 2021 22:15:07 +0000 (06:15 +0800)]
Fix branch pagination error (#16805)

Fix #16801

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.

3 years agoAdd information for migrate failure (#16803)
Lunny Xiao [Tue, 24 Aug 2021 17:46:55 +0000 (01:46 +0800)]
Add information for migrate failure (#16803)

Improve the reporting of errors when there is a migration failure

3 years agoAdd bundle download for repository (#14538)
John Olheiser [Tue, 24 Aug 2021 16:47:09 +0000 (11:47 -0500)]
Add bundle download for repository (#14538)

* Add bundle download

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix fmt

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Fix build tags

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Download specific commit

Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 24 Aug 2021 00:04:47 +0000 (00:04 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd missing return to handleSettingRemoteAddrError (#16794)
zeripath [Mon, 23 Aug 2021 22:09:25 +0000 (23:09 +0100)]
Add missing return to handleSettingRemoteAddrError (#16794)

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

Fix #16771

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUpdate caddyserver/certmagic (#16789)
zeripath [Mon, 23 Aug 2021 22:07:40 +0000 (23:07 +0100)]
Update caddyserver/certmagic (#16789)

Fixes issue with windows users & letsencrypt

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoJust use a slice when rendering file (#16774)
zeripath [Mon, 23 Aug 2021 21:23:39 +0000 (22:23 +0100)]
Just use a slice when rendering file (#16774)

Highlight currently uses a map which is memory inefficient. Switch to use a slice instead.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoEnsure that template compilation panics are sent to the logs (#16788)
zeripath [Mon, 23 Aug 2021 19:40:59 +0000 (20:40 +0100)]
Ensure that template compilation panics are sent to the logs (#16788)

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>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 23 Aug 2021 00:04:31 +0000 (00:04 +0000)]
[skip ci] Updated translations via Crowdin

3 years agofrontport: 1.15.0 changelog (#16772)
techknowlogick [Sun, 22 Aug 2021 19:29:51 +0000 (15:29 -0400)]
frontport: 1.15.0 changelog (#16772)

* frontport: 1.15.0 changelog

* Update config.yaml

3 years agoAlter issue/comment table TEXT fields to LONGTEXT (#16765)
wxiaoguang [Sun, 22 Aug 2021 15:33:05 +0000 (23:33 +0800)]
Alter issue/comment table TEXT fields to LONGTEXT (#16765)

* Alter issue/comment table TEXT fields to LONGTEXT

* Use If not Switch

Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix openidConnect source regression from #16544 (#16759)
zeripath [Sun, 22 Aug 2021 09:17:05 +0000 (10:17 +0100)]
Fix openidConnect source regression from #16544 (#16759)

Unfortunately there is bug in #16544 meaning that openid connects aren't
being matched properly as the capitalisation in that PR is incorrect.

This PR changes the capitalisation back to what is expected.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 22 Aug 2021 00:06:14 +0000 (00:06 +0000)]
[skip ci] Updated licenses and gitignores

3 years agoAdd migrate from OneDev (#16356)
KN4CK3R [Sat, 21 Aug 2021 22:47:45 +0000 (00:47 +0200)]
Add migrate from OneDev (#16356)

* Use context to simplify logic.

* Added migration from OneDev.
This PR adds [OneDev](https://code.onedev.io/) as migration source.

Supported:
- [x] Milestones
- [x] Issues
- [x] Pull Requests
- [x] Comments
- [x] Reviews
- [x] Labels

3 years agoUpgrade go.mod go version to 1.16 (#16764)
wxiaoguang [Sat, 21 Aug 2021 19:04:17 +0000 (03:04 +0800)]
Upgrade go.mod go version to 1.16 (#16764)

3 years agoDownload lfs in git and web workflow from minio/s3 directly (#16731)
Abner [Sat, 21 Aug 2021 18:22:06 +0000 (02:22 +0800)]
Download lfs in git and web workflow from minio/s3 directly (#16731)

3 years agowhen the update request doesn't intend to update attachments (eg: change checkbox...
wxiaoguang [Sat, 21 Aug 2021 13:04:47 +0000 (21:04 +0800)]
when the update request doesn't intend to update attachments (eg: change checkbox state), ignore attachment updates (#16762)

3 years agoAdded introspection endpoint. (#16752)
KN4CK3R [Sat, 21 Aug 2021 02:16:45 +0000 (04:16 +0200)]
Added introspection endpoint. (#16752)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoFix dependency link rendering in PR sidebar (#16754)
Steven [Sat, 21 Aug 2021 00:02:47 +0000 (02:02 +0200)]
Fix dependency link rendering in PR sidebar (#16754)

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix dependency translations (#16753)
Steven [Fri, 20 Aug 2021 23:13:45 +0000 (01:13 +0200)]
Fix dependency translations (#16753)

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
3 years agoKeep attachments on tasklist update (#16750)
KN4CK3R [Fri, 20 Aug 2021 19:26:19 +0000 (21:26 +0200)]
Keep attachments on tasklist update (#16750)

* Send attachments too.

* Use tasklist flag.

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

* Use boolean parameter.

Co-authored-by: zeripath <art27@cantab.net>
3 years agoDo not use thin scrollbars on Firefox (#16738)
Elouan Martinet [Thu, 19 Aug 2021 21:31:47 +0000 (23:31 +0200)]
Do not use thin scrollbars on Firefox (#16738)

In #7269, thin scrollbars were added in Arc Green theme. It got moved
in base theme in #13361.

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>
3 years agoReturn nil proxy function if proxy not enabled (#16742)
zeripath [Thu, 19 Aug 2021 20:41:20 +0000 (21:41 +0100)]
Return nil proxy function if proxy not enabled (#16742)

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix wrong user in OpenID response (#16736)
KN4CK3R [Thu, 19 Aug 2021 16:11:30 +0000 (18:11 +0200)]
Fix wrong user in OpenID response (#16736)

* Fixed usage of wrong user.

* Added tests.

3 years agoRecreate Tables should Recreate indexes on MySQL (#16718)
zeripath [Thu, 19 Aug 2021 04:11:36 +0000 (05:11 +0100)]
Recreate Tables should Recreate indexes on MySQL (#16718)

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: 6543 <6543@obermui.de>
3 years agoAdd edit button to wiki sidebar and footer (#16719)
n [Wed, 18 Aug 2021 18:14:08 +0000 (03:14 +0900)]
Add edit button to wiki sidebar and footer (#16719)

* Add edit button to wiki sidebar and footer

* Make edit button transparent

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix migration svg color (#16715)
KN4CK3R [Wed, 18 Aug 2021 16:07:52 +0000 (18:07 +0200)]
Fix migration svg color (#16715)

* Fixed svg color.

* Use --color-text.

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoAdd proxy settings and support for migration and webhook (#16704)
Lunny Xiao [Wed, 18 Aug 2021 13:10:39 +0000 (21:10 +0800)]
Add proxy settings and support for migration and webhook (#16704)

* Add proxy settings and support for migration and webhook

* Fix default value

* Add newline for example ini

* Add lfs proxy support

* Fix lint

* Follow @zeripath's review

* Fix git clone

* Fix test

* missgin http requests for proxy

* use empty

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoRefactored and fixed migration tests. (#16714)
KN4CK3R [Wed, 18 Aug 2021 00:47:18 +0000 (02:47 +0200)]
Refactored and fixed migration tests. (#16714)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 18 Aug 2021 00:04:48 +0000 (00:04 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd API Token Cache (#16547)
zeripath [Tue, 17 Aug 2021 18:30:42 +0000 (19:30 +0100)]
Add API Token Cache (#16547)

One of the issues holding back performance of the API is the problem of hashing.
Whilst banning BASIC authentication with passwords will help, the API Token scheme
still requires a PBKDF2 hash - which means that heavy API use (using Tokens) can
still cause enormous numbers of hash computations.

A slight solution to this whilst we consider moving to using JWT based tokens and/or
a session orientated solution is to simply cache the successful tokens. This has some
security issues but this should be balanced by the security issues of load from
hashing.

Related #14668

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agobuild with go1.17 (#16707)
techknowlogick [Tue, 17 Aug 2021 12:31:28 +0000 (08:31 -0400)]
build with go1.17 (#16707)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoUse github token URL when fetching oauth token (#16709)
techknowlogick [Tue, 17 Aug 2021 08:07:52 +0000 (04:07 -0400)]
Use github token URL when fetching oauth token (#16709)

Fixes regression from #16544

3 years agoUpdate JS dependencies (#16708)
silverwind [Tue, 17 Aug 2021 05:32:48 +0000 (07:32 +0200)]
Update JS dependencies (#16708)

* Update JS dependencies

- Update all JS dependencies
- Adapt to recent webpack changes
- Add new lint rules and fix issues
- Regenerate SVGs and update svgo api usage

Fixes: https://github.com/go-gitea/gitea/pull/16492
* adapt jest config and sort keys

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

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 16 Aug 2021 00:07:41 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUpgrade levelqueue 0.4.1 (#16696)
Lunny Xiao [Sun, 15 Aug 2021 20:52:26 +0000 (04:52 +0800)]
Upgrade levelqueue 0.4.1 (#16696)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 15 Aug 2021 00:07:47 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoImprove resource string (#16691)
delvh [Sat, 14 Aug 2021 14:10:39 +0000 (16:10 +0200)]
Improve resource string (#16691)

* Improve resource string

Co-authored-by: zeripath <art27@cantab.net>
3 years ago Fix spelling of HookProcReceiveResult (#16690)
Lunny Xiao [Sat, 14 Aug 2021 11:17:10 +0000 (19:17 +0800)]
 Fix spelling of HookProcReceiveResult (#16690)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 14 Aug 2021 00:07:48 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoEnsure empty lines are copiable and final new line too (#16678)
zeripath [Fri, 13 Aug 2021 23:16:56 +0000 (00:16 +0100)]
Ensure empty lines are copiable and final new line too (#16678)

* Ensure empty lines are copiable and final new line too

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 #16434

* Add test and ensure spans closed

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd filter by owner and team to issue/pulls search endpoint (#16662)
Jimmy Praet [Fri, 13 Aug 2021 20:47:25 +0000 (22:47 +0200)]
Add filter by owner and team to issue/pulls search endpoint (#16662)

* Filter by owner and team in API issue/pulls search

* Add integration test

3 years agoUpdate issue_index to finish migration (#16685)
6543 [Fri, 13 Aug 2021 13:06:18 +0000 (15:06 +0200)]
Update issue_index to finish migration (#16685)

* update issue_index to finish migration

* One Func to RecalculateIssueIndexForRepo

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 13 Aug 2021 00:07:45 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUpgrade xorm to v1.2.2 (#16663)
Lunny Xiao [Thu, 12 Aug 2021 23:11:42 +0000 (07:11 +0800)]
Upgrade xorm to v1.2.2 (#16663)

* Upgrade xorm to v1.2.2

* Change the Engine interface to match xorm v1.2.2

3 years agoFix NPE in fuzzer (#16680)
zeripath [Thu, 12 Aug 2021 22:22:05 +0000 (23:22 +0100)]
Fix NPE in fuzzer (#16680)

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>
3 years ago[API] generalize list header (#16551)
6543 [Thu, 12 Aug 2021 12:43:08 +0000 (14:43 +0200)]
[API] generalize list header (#16551)

* Add info about list endpoints to CONTRIBUTING.md

* Let all list endpoints return X-Total-Count header

* Add TODOs for GetCombinedCommitStatusByRef

* Fix models/issue_stopwatch.go

* Rrefactor models.ListDeployKeys

* Introduce helper func and use them for SetLinkHeader related func

3 years agoAdd link to vscode to repo header (#16664)
a1012112796 [Thu, 12 Aug 2021 12:21:34 +0000 (20:21 +0800)]
Add link to vscode to repo header (#16664)

add link to vscode to repo header

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoSend registration email on user autoregistration (#16523)
zeripath [Thu, 12 Aug 2021 07:26:33 +0000 (08:26 +0100)]
Send registration email on user autoregistration (#16523)

When users login and are autoregistered send email notification.

Fix #16178

* Protect public functions within the mailer by testing if the mailer is configured

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoImprove SMTP authentication and Fix user creation bugs (#16612)
zeripath [Wed, 11 Aug 2021 20:42:58 +0000 (21:42 +0100)]
Improve SMTP authentication and Fix user creation bugs  (#16612)

* Improve SMTP authentication, Fix user creation bugs and add LDAP cert/key options

This PR has two parts:

Improvements for SMTP authentication:

* Default to use SMTPS if port is 465, and allow setting of force SMTPS.
* Always use STARTTLS if available
* Provide CRAM-MD5 mechanism
* Add options for HELO hostname disabling
* Add options for providing certificates and keys
* Handle application specific password response as a failed user login
instead of as a 500.

Close #16104

Fix creation of new users:

* A bug was introduced when allowing users to change usernames which
prevents the creation of external users.
* The LoginSource refactor also broke this page.

Close #16104

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoRelated refactors to ctx.FormX functions (#16567)
6543 [Wed, 11 Aug 2021 15:08:52 +0000 (17:08 +0200)]
Related refactors to ctx.FormX functions (#16567)

* use FormTrim if posible

* speedup goGet

* only convert if nessesary

3 years agoAdd an api endpoint to fetch git notes (#15373) (#16649)
nitul1991 [Wed, 11 Aug 2021 01:01:40 +0000 (06:31 +0530)]
Add an api endpoint to fetch git notes (#15373) (#16649)

close #15373

3 years agoRename ctx.Form() to ctx.FormString() and move code into own file (#16571)
6543 [Wed, 11 Aug 2021 00:31:13 +0000 (02:31 +0200)]
Rename ctx.Form() to ctx.FormString() and move code into own file (#16571)

Followup from #16562 prepare for #16567

* Rename ctx.Form() to ctx.FormString()
* Reimplement FormX func to need less code and cpu cycles
* Move code into own file

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 11 Aug 2021 00:07:40 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUpgrade github.com/google/go-github v32.1.0 -> v37.0.0 (#16661)
6543 [Tue, 10 Aug 2021 09:49:43 +0000 (11:49 +0200)]
Upgrade github.com/google/go-github v32.1.0 -> v37.0.0 (#16661)

* Upgrade github.com/google/go-github vv32.1.0 -> v37.0.0

* refactor: use GetX() func to reduce code

3 years agoReplace `list.List` with slices (#16311)
KN4CK3R [Mon, 9 Aug 2021 18:08:51 +0000 (20:08 +0200)]
Replace `list.List` with slices (#16311)

* Replaced list with slice.

* Fixed usage of pointer to temporary variable.

* Replaced LIFO list with slice.

* Lint

* Removed type check.

* Removed duplicated code.

* Lint

* Fixed merge.

Co-authored-by: 6543 <6543@obermui.de>
3 years agoChange the implementation of the go-git version of GetNote to mirror the non go-git...
nitul1991 [Mon, 9 Aug 2021 15:24:34 +0000 (20:54 +0530)]
Change the implementation of the go-git version of GetNote to mirror the non go-git version when passed a non-existent commit (#16658)

Fixes #16657

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 9 Aug 2021 00:07:47 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd Version info to migrations.go (#16653)
6543 [Sun, 8 Aug 2021 17:34:42 +0000 (19:34 +0200)]
Add Version info to migrations.go (#16653)

Gitea migrations of 1.15.0 ends at v189

3 years agoRestore compatibility with SQLServer 2008 R2 in migrations (#16627)
zeripath [Sun, 8 Aug 2021 10:34:24 +0000 (11:34 +0100)]
Restore compatibility with SQLServer 2008 R2 in migrations (#16627)

* Restore compatibility with SQLServer 2008 R2 in migrations

`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.

We need to figure out some way of restricting our SQL syntax against the minimum
version of SQL Server we will support.

My suspicion is that `ALTER DATABASE database_name SET COMPATIBILITY_LEVEL = 100` may
do that but there may be other side-effects so I am not whether to do that.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* try just dropping the index only

Signed-off-by: Andrew Thornton <art27@cantab.net>
* use lowercase for system tables

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 8 Aug 2021 00:07:46 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoChangelog for 1.15.0-rc3 (#16621) (#16645)
zeripath [Sat, 7 Aug 2021 17:27:49 +0000 (18:27 +0100)]
Changelog for 1.15.0-rc3 (#16621) (#16645)

Frontport #16621

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

* BREAKING
  * Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606)
* SECURITY
  * Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606)
  * Correctly create of git-daemon-export-ok files (#16508) (#16514)
  * Don't show private user's repo in explore view (#16550) (#16554)
  * Update node tar dependency to 6.1.6 (#16622) (#16623)
* API
  * Swagger AccessToken fixes (#16574) (#16597)
  * Set AllowedHeaders on API CORS handler (#16524) (#16618)
* BUGFIXES
  * Restore Accessibility for Dropdown (#16576) (#16617)
  * Pass down SignedUserName down to AccessLogger context (#16605) (#16616)
  * Fix table alignment in markdown (#16596) (#16602)
  * Fix 500 on first wiki page (#16586) (#16598)
  * Lock goth/gothic and Re-attempt OAuth2 registration on login if registration failed at startup (#16564) (#16570)
  * Upgrade levelqueue to v0.4.0 (#16560) (#16561)
  * Handle too long PR titles correctly (#16517) (#16549)
  * Fix data race in bleve indexer (#16474) (#16509)
  * Restore CORS on git smart http protocol (#16496) (#16506)
  * Fix race in log (#16490) (#16505)
  * Fix prepareWikiFileName to respect existing unescaped files (#16487) (#16498)
  * Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16480)
  * Update notification table with only latest data (#16445) (#16469)
  * Revert to use alpine 3.13 (#16451) (#16452)
  * Fix crash following ldap authentication update (#16447) (#16448)
  * Fix direct creation of external users on admin page (partial #16612) (#16613)
  * Prevent 500 on draft releases without tag (#16634) (#16636)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoSeparate open and closed issue in metrics (#16637)
Romain [Sat, 7 Aug 2021 09:43:50 +0000 (11:43 +0200)]
Separate open and closed issue in metrics (#16637)

* Get the issue counts in one query

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd note about build-time flags for PAM support (#16641)
techknowlogick [Sat, 7 Aug 2021 05:22:30 +0000 (01:22 -0400)]
Add note about build-time flags for PAM support (#16641)

Fix #16639

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 7 Aug 2021 00:07:42 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAllow setting X-FRAME-OPTIONS (#16643)
zeripath [Fri, 6 Aug 2021 20:47:10 +0000 (21:47 +0100)]
Allow setting X-FRAME-OPTIONS (#16643)

* Allow setting X-FRAME-OPTIONS

This PR provides a mechanism to set the X-FRAME-OPTIONS header.

Fix #7951

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update docs/content/doc/advanced/config-cheat-sheet.en-us.md

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
3 years agoPrevent 500 on draft releases without tag (#16634)
zeripath [Fri, 6 Aug 2021 01:13:16 +0000 (02:13 +0100)]
Prevent 500 on draft releases without tag (#16634)

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 #16610

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd microsoft oauth2 providers (#16544)
zeripath [Fri, 6 Aug 2021 01:11:08 +0000 (02:11 +0100)]
Add microsoft oauth2 providers (#16544)

* Clean up oauth2 providers

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add AzureAD, AzureADv2, MicrosoftOnline OAuth2 providers

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

* remove unused Scopes

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, 6 Aug 2021 00:08:10 +0000 (00:08 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFrontport changelog for v1.14.6 (#16632)
zeripath [Fri, 6 Aug 2021 00:05:20 +0000 (01:05 +0100)]
Frontport changelog for v1.14.6 (#16632)

* Frontport changelog for v1.14.6

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>
3 years agoRestore Accessibility for Dropdown (#16576)
zeripath [Thu, 5 Aug 2021 22:16:24 +0000 (23:16 +0100)]
Restore Accessibility for Dropdown (#16576)

* Restore #10096/#8638 and re-fix #15172

This PR restores the vendored and patched dropdow from #8638. It
however, abandons the calls to `click()` using instead the default
dropdown click calls instead. This prevents the issue of the dropdown
grabbing focus permanently however, this may have negative effects on
the effect of focus on the dropdowns.

Of note, the behaviour of the template selector dropdown on the repo
creation page is slightly odd - I don't believe that this odd behaviour
is caused by this PR but rather by the feed source for this. I suspect
that the dropdown should be adding a delete button to its selection.

Fix #15172
References: #7057

Signed-off-by: Andrew Thornton <art27@cantab.net>
* leverage fomantic-build instead

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per jookia

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFixes #16557 - duplicate csv import (#16631)
Richard Mahn [Thu, 5 Aug 2021 16:56:11 +0000 (10:56 -0600)]
Fixes #16557 - duplicate csv import (#16631)

Remove the unnecessary duplicate package import for `encoding/csv` in `modules/csv/csv.go`

Fix #16557

3 years agoUpdate node tar dependency to 6.1.6 (#16622)
zeripath [Thu, 5 Aug 2021 04:14:27 +0000 (05:14 +0100)]
Update node tar dependency to 6.1.6 (#16622)

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>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoSwitch back to node 16 (#16624)
zeripath [Wed, 4 Aug 2021 23:46:19 +0000 (00:46 +0100)]
Switch back to node 16 (#16624)

Now that node 16.6.1 is out we can (if desired) switch back to node 16.

This PR proposes changing drone to run node:16

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoSet AllowedHeaders on API CORS handler (#16524)
zeripath [Wed, 4 Aug 2021 19:56:49 +0000 (20:56 +0100)]
Set AllowedHeaders on API CORS handler (#16524)

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

Fix #16100

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoPass down SignedUserName down to AccessLogger context (#16605)
zeripath [Wed, 4 Aug 2021 17:26:30 +0000 (18:26 +0100)]
Pass down SignedUserName down to AccessLogger context (#16605)

* Pass down SignedUserName down to AccessLogger context

Unfortunately when the AccessLogger was moved back before the contexters the
SignedUserName reporting was lost. This is due to Request.WithContext leading to a
shallow copy of the Request and the modules/context/Context being within that request.

This PR adds a new context variable of a string pointer which is set and handled
in the contexters.

Fix #16600

Signed-off-by: Andrew Thornton <art27@cantab.net>
* handle nil ptr issue

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 4 Aug 2021 00:07:39 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUpgrade to golang-jwt 3.2.2 (#16590)
zeripath [Tue, 3 Aug 2021 18:32:01 +0000 (19:32 +0100)]
Upgrade to golang-jwt 3.2.2 (#16590)

* Upgrade to golang-jwt 3.2.2

Upgrade to the latest version of golang-jwt

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Forcibly replace the 3.2.1 version of golang-jwt/jwt and increase minimum Go version

Using go.mod we can forcibly replace the 3.2.1 version used by goth to 3.2.2.

Further given golang-jwt/jwts stated policy of only supporting supported go versions
we should just raise our minimal version of go to 1.16 for 1.16 as by time of release
1.15 will be out of support.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* update minimal go required

Signed-off-by: Andrew Thornton <art27@cantab.net>
* update config.yaml

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoClarify where server.LFS_CONTENT_PATH was moved to (#16601)
Clar Fon [Tue, 3 Aug 2021 08:03:04 +0000 (04:03 -0400)]
Clarify where server.LFS_CONTENT_PATH was moved to (#16601)

Signed-off-by: ltdk <usr@ltdk.xyz>
3 years agoMake PR merge options more intuitive (#5863) (#16582)
Albert ARIBAUD [Mon, 2 Aug 2021 19:23:57 +0000 (21:23 +0200)]
Make PR merge options more intuitive (#5863) (#16582)

Reword options making clear whether the PRed branch is rebased or not, and which type of commit will be created if any.

3 years agoFix table alignment in markdown (#16596)
zeripath [Mon, 2 Aug 2021 16:11:18 +0000 (17:11 +0100)]
Fix table alignment in markdown (#16596)

Set the TableOptions in markdown to allow alignment of the tables to work correctly

Fix #15959

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[CI] Use node v14 instead of node v16 untill it will pass again (#16595)
6543 [Mon, 2 Aug 2021 01:47:29 +0000 (03:47 +0200)]
[CI] Use node v14 instead of node v16 untill it will pass again (#16595)

* for CI release: use node 14 (lts) to build until 16 do fail

* all in for node v14.x

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 2 Aug 2021 00:07:40 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoSwagger AccessToken fixes (#16574)
zeripath [Sun, 1 Aug 2021 20:44:15 +0000 (21:44 +0100)]
Swagger AccessToken fixes (#16574)

There is a subtle problem with the Swagger definition for AccessTokens which causes
autogeneration of APIs for these endpoints to fail.

This PR corrects these errors.

Ref: https://github.com/zeripath/java-gitea-api/issues/4
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix 500 on first wiki page (#16586)
zeripath [Sun, 1 Aug 2021 17:04:32 +0000 (18:04 +0100)]
Fix 500 on first wiki page (#16586)

* Fix 500 on first wiki page

There is a mistake in #16319 and #16487 which means that the first time
a wiki page is created a 500 is reported because the `master` branch is
not in existence in that wiki yet.

This PR simply checks for this error and returns not found.

Fix #16584

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix swagger doc by rename repoAddTopíc to repoAddTopic (#16580)
Lars Hvam [Sun, 1 Aug 2021 16:28:05 +0000 (18:28 +0200)]
Fix swagger doc by rename repoAddTopíc to repoAddTopic (#16580)

* Swagger API: rename repoAddTopíc to repoAddTopic

This changes the operationId to only contain 7 bit ascii, note "í" instead of "i"

3 years agoUse node:16.5 for frontend instead of node:16 (#16591)
zeripath [Sun, 1 Aug 2021 14:33:02 +0000 (15:33 +0100)]
Use node:16.5 for frontend  instead of node:16 (#16591)

* Disable frontend testing

Jest does not appear to work on the latest node 16.6.0 and fails with an inscrutable
message.

I have been unable to work out what the problem is. This PR simply disables the
test-frontend part in the makefile.

Another alternative would be to drop node to node 14 - which is the LTS for node.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* actually just tell on 16.5 instead

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Use node 16.5 instead of 16

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 1 Aug 2021 00:07:51 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 31 Jul 2021 00:07:42 +0000 (00:07 +0000)]
[skip ci] Updated translations via Crowdin