]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agofix & refactor (#18973)
6543 [Thu, 3 Mar 2022 11:51:13 +0000 (12:51 +0100)]
fix & refactor (#18973)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoDon't clean up hardcoded `tmp` (#18983)
KN4CK3R [Wed, 2 Mar 2022 22:50:29 +0000 (23:50 +0100)]
Don't clean up hardcoded `tmp` (#18983)

* Don't clean up hardcoded `tmp`.

* Fixed import.

2 years agogit backend ignore replace objects (#18979)
6543 [Wed, 2 Mar 2022 20:13:19 +0000 (21:13 +0100)]
git backend ignore replace objects (#18979)

* git backend ignore replace objects

* comment

2 years agoImprove the deletion of issue (#18945)
Lunny Xiao [Wed, 2 Mar 2022 17:38:56 +0000 (01:38 +0800)]
Improve the deletion of issue (#18945)

Co-authored-by: 6543 <6543@obermui.de>
2 years agoAdd note to GPG key response if user has no keys (#18961)
KN4CK3R [Wed, 2 Mar 2022 16:32:18 +0000 (17:32 +0100)]
Add note to GPG key response if user has no keys (#18961)

* Prevent invalid key response.

* Display note instead of 404 response.

* Fixed test.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoadds restore docs for docker based instances (#18844)
Marco Blessing [Wed, 2 Mar 2022 16:20:00 +0000 (17:20 +0100)]
adds restore docs for docker based instances (#18844)

* adds docke restore section

* fix typo

* Update docs/content/doc/usage/backup-and-restore.en-us.md

Co-authored-by: Gusted <williamzijl7@hotmail.com>
* fix container id placeholder

* adds restore help for docker-rootless

* restore yml autoformater quotes

Co-authored-by: Marco Blessing <marco.blessing@komm.one>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoRefactor admin user filter query parameters (#18965)
wxiaoguang [Wed, 2 Mar 2022 15:30:14 +0000 (23:30 +0800)]
Refactor admin user filter query parameters (#18965)

Only pass `status_filter` on admin page
Use a more general method to pass query parameters, remove hard-coded keys

2 years agoRefactor mirror code & fix `StartToMirror` (#18904)
Gusted [Wed, 2 Mar 2022 07:43:11 +0000 (07:43 +0000)]
Refactor mirror code & fix `StartToMirror` (#18904)

* Use MirrorID instead of RepoID

- Use the MirrorID as index(SQL uses `id` column not the `repo_id`).
Passes the Mirror ID's into the Sync functions.

* Check for MirrorID == 0

* Fix `StartToMirror` + refactor

* Update services/mirror/mirror.go

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoSend 404 on `/{org}.gpg` (#18959)
Gusted [Wed, 2 Mar 2022 01:37:32 +0000 (01:37 +0000)]
Send 404 on `/{org}.gpg` (#18959)

2 years agoAccounts with WebAuthn only (no TOTP) now exist ... fix code to handle that case...
6543 [Wed, 2 Mar 2022 00:24:31 +0000 (01:24 +0100)]
Accounts with WebAuthn only (no TOTP) now exist ... fix code to handle that case (#18897)

2 years agoFix lfs management setting (#18946)
Lunny Xiao [Tue, 1 Mar 2022 23:14:27 +0000 (07:14 +0800)]
Fix lfs management setting (#18946)

Fix #18782

2 years agoFix admin user list pagination (#18957)
Otto Richter (fnetX) [Tue, 1 Mar 2022 19:21:37 +0000 (20:21 +0100)]
Fix admin user list pagination (#18957)

2 years ago[API] Allow removing issues (#18879)
Otto Richter (fnetX) [Tue, 1 Mar 2022 00:20:15 +0000 (01:20 +0100)]
[API] Allow removing issues (#18879)

Add new feature to delete issues and pulls via API

Co-authored-by: fnetx <git@fralix.ovh>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoRefactor SecToTime() function (#18863)
René Schaar [Mon, 28 Feb 2022 22:57:20 +0000 (23:57 +0100)]
Refactor SecToTime() function (#18863)

- Add helper method to reduce redundancy
- Expand the scope from displaying days to years
- Reduce irrelevance by not displaying small units (hours, minutes, seconds) when bigger ones apply (years)

2 years agoImprove mirror iterator (#18928)
Lunny Xiao [Mon, 28 Feb 2022 19:41:06 +0000 (03:41 +0800)]
Improve mirror iterator (#18928)

* Improve mirror iterator

* fix test

2 years agoFix login with email panic when email is not exist (#18941)
Lunny Xiao [Mon, 28 Feb 2022 17:33:33 +0000 (01:33 +0800)]
Fix login with email panic when email is not exist (#18941)

2 years agoAdjust error for already locked db and prevent level db lock on malformed connstr...
zeripath [Sun, 27 Feb 2022 19:45:06 +0000 (19:45 +0000)]
Adjust error for already locked db and prevent level db lock on malformed connstr (#18923)

This PR adjusts the error returned when there is failure to lock the level db, and
permits a connections to the same leveldb where there is a different connection string.

Reference #18921
Reference #18917

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAvoid database lookups for `DescriptionHTML` (#18924)
Gusted [Sun, 27 Feb 2022 17:51:34 +0000 (17:51 +0000)]
Avoid database lookups for `DescriptionHTML` (#18924)

* Avoid database lookups for `DescriptionHTML`

- Don't Compose meta's for DescriptionHTML, they are only needed in
order to correctly format and show issue's but it's highly unlikely that
a repository description will refer to a local issue.

Using 125 Connections for 5 seconds: on `/explore/repos`(which is the most
noticeable usage by this function's database lookups):

Before:

Statistics        Avg      Stdev        Max
  Reqs/sec       569.41     506.05    2715.00
  Latency      214.27ms    16.60ms   294.84ms
  HTTP codes:
    1xx - 0, 2xx - 2974, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:    27.17MB/s

After:

Statistics        Avg      Stdev        Max
  Reqs/sec      1585.04     789.84    4144.56
  Latency       78.89ms    15.89ms   206.94ms
  HTTP codes:
    1xx - 0, 2xx - 7975, 3xx - 0, 4xx - 0, 5xx - 0
    others - 0
  Throughput:    73.85MB/s

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoUpdate go-org to v1.6.1 (#18932)
Gusted [Sun, 27 Feb 2022 16:56:44 +0000 (16:56 +0000)]
Update go-org to v1.6.1 (#18932)

- v1.6.0 has a inconsistency with the proxy and github's tagged version,
updating to v1.6.1 should fix this issue.
- Resolves #18864

2 years agoFix trace log to show value instead of pointers (#18926)
Gusted [Sun, 27 Feb 2022 15:49:22 +0000 (15:49 +0000)]
Fix trace log to show value instead of pointers (#18926)

- Fixes a issue with a trace of repo.Units whereby it would show the pointers.

Before:
![image](https://user-images.githubusercontent.com/25481501/155876811-036bf40e-db89-4e09-ac00-0c78ce3f5bef.png)

After:
![image](https://user-images.githubusercontent.com/25481501/155885102-16c9cf29-314b-4f32-bcee-80e332f63dec.png)

2 years agoAdd announcement steps to release-howto (#18896)
Norwin [Sun, 27 Feb 2022 15:48:09 +0000 (16:48 +0100)]
Add announcement steps to release-howto (#18896)

* add announcements steps to release-howto

* Also add homebrew update

2 years agoFix `<strong>` html in translation (#18929)
Gusted [Sun, 27 Feb 2022 15:46:45 +0000 (15:46 +0000)]
Fix `<strong>` html in translation (#18929)

2 years agoFix page and missing return on unadopted repos API (#18848)
qwerty287 [Sun, 27 Feb 2022 12:17:42 +0000 (13:17 +0100)]
Fix page and missing return on unadopted repos API (#18848)

* Fix page and missing return on unadopted repos API

Page must be 1 if it's not specified and it should return after sending an internal server error.

* Allow ignore pages

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 27 Feb 2022 00:16:04 +0000 (00:16 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoAllow adminstrator teams members to see other teams (#18918)
Gusted [Sat, 26 Feb 2022 20:12:01 +0000 (20:12 +0000)]
Allow adminstrator teams members to see other teams (#18918)

* Allow adminstrator teams to see other teams

- Allow team members with adminstrator access, to view other teams.
- Resolves #18885

2 years agoUpdate nginx reverse proxy docs (#18922)
JonRB [Sat, 26 Feb 2022 18:32:09 +0000 (18:32 +0000)]
Update nginx reverse proxy docs (#18922)

Add additional config lines for the set_header to forward additional information (eg the IP)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoDon't treat BOM escape sequence as hidden character. (#18909)
Gusted [Sat, 26 Feb 2022 16:48:23 +0000 (16:48 +0000)]
Don't treat BOM escape sequence as hidden character. (#18909)

* Don't treat BOM escape sequence as hidden character.

- BOM sequence is a common non-harmfull escape sequence, it shouldn't be
shown as hidden character.
- Follows GitHub's behavior.
- Resolves #18837

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoRemove CodeMirror dependencies (#18911)
silverwind [Sat, 26 Feb 2022 15:47:52 +0000 (16:47 +0100)]
Remove CodeMirror dependencies (#18911)

EasyMDE already loads all the modes and plugins it needs, so there is no reason for neither the webpack dependency nor the vendored copy

2 years agoUncapitalize errors (#18915)
Gusted [Sat, 26 Feb 2022 12:15:32 +0000 (12:15 +0000)]
Uncapitalize errors (#18915)

- See: https://github.com/golang/go/wiki/CodeReviewComments#error-strings

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoDisable service worker by default (#18914)
silverwind [Sat, 26 Feb 2022 10:14:23 +0000 (11:14 +0100)]
Disable service worker by default (#18914)

The service worker causes a lot of issues with JS errors after instance
upgrades while not bringing any real performance gain over regular HTTP
caching.

Disable it by default for this reason. Maybe later we can remove it
completely, as I simply see no benefit in having it.

2 years agoSet is_empty in fixtures (#18869)
KN4CK3R [Sat, 26 Feb 2022 06:15:25 +0000 (07:15 +0100)]
Set is_empty in fixtures (#18869)

2 years agoDon't update email for organisation (#18905)
Gusted [Sat, 26 Feb 2022 02:38:08 +0000 (02:38 +0000)]
Don't update email for organisation (#18905)

- Fix regression caused by: f1b1472632e36c3bb5df73f184a6efeef47f5d01
- Don't try to insert a email for Organisation(as they don't have one).
- Resolves #18891

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoCorrectly link URLs to users/repos with dashes, dots or underscores (#18890)
Alexander Neumann [Fri, 25 Feb 2022 23:26:43 +0000 (00:26 +0100)]
Correctly link URLs to users/repos with dashes, dots or underscores (#18890)

* Add tests for references with dashes

This commit adds tests for full URLs referencing repos names and user
names containing a dash.

* Extend regex to match URLs to repos/users with dashes

2 years agoSet is_private in fixtures. (#18868)
KN4CK3R [Fri, 25 Feb 2022 21:22:20 +0000 (22:22 +0100)]
Set is_private in fixtures. (#18868)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix team management UI (#18886)
Lunny Xiao [Fri, 25 Feb 2022 21:19:54 +0000 (05:19 +0800)]
Fix team management UI (#18886)

Co-authored-by: 6543 <6543@obermui.de>
2 years agoUpdate JS dependencies (#18898)
silverwind [Fri, 25 Feb 2022 20:08:35 +0000 (21:08 +0100)]
Update JS dependencies (#18898)

- Updated all JS dependencies minus Vue (update 2 to 3 requires a ton of
  work and is probably blocked by dependencies)
- Tested editor, swagger-ui

2 years agoFix migration v210 (#18892)
Lunny Xiao [Fri, 25 Feb 2022 14:04:59 +0000 (22:04 +0800)]
Fix migration v210 (#18892)

2 years agomigrations: add test for importing pull requests in gitea uploader (#18752)
singuliere [Fri, 25 Feb 2022 09:20:50 +0000 (10:20 +0100)]
migrations: add test for importing pull requests in gitea uploader (#18752)

* logs: add the buffer logger to inspect logs during testing

Signed-off-by: Loïc Dachary <loic@dachary.org>
* migrations: add test for importing pull requests in gitea uploader

Signed-off-by: Loïc Dachary <loic@dachary.org>
* for each git.OpenRepositoryCtx, call Close

* Content is expected to return the content of the log

* test for errors before defer

Co-authored-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoBeforeSourcePath should point to base commit (#18799)
Jimmy Praet [Fri, 25 Feb 2022 06:46:15 +0000 (07:46 +0100)]
BeforeSourcePath should point to base commit (#18799)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoPrevent Stats Indexer reporting error if repo dir missing (#18870)
zeripath [Fri, 25 Feb 2022 04:22:09 +0000 (04:22 +0000)]
Prevent Stats Indexer reporting error if repo dir missing (#18870)

Repositories missing their directory should not report an error from the stats
indexer.

Close #18847

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 25 Feb 2022 00:16:08 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix update user (#18878)
Lunny Xiao [Thu, 24 Feb 2022 18:29:10 +0000 (02:29 +0800)]
Fix update user (#18878)

2 years agoFix ldap user sync missed email in email_address table (#18786)
Lunny Xiao [Thu, 24 Feb 2022 06:13:59 +0000 (14:13 +0800)]
Fix ldap user sync missed email in email_address table (#18786)

* Fix ldap user sync missed email in email_address table

* Fix test

2 years agoUpdate assignees check to include any writing team and change org sidebar (#18680)
zeripath [Wed, 23 Feb 2022 22:07:05 +0000 (22:07 +0000)]
Update assignees check to include any writing team and change org sidebar (#18680)

Following the merging of #17811 teams can now have differing write and readonly permissions, however the assignee list will not include teams which have mixed perms.

Further the org sidebar is no longer helpful as it can't describe these mixed permissions situations.

Fix #18572

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoSet max text height to prevent overflow (#18862)
Kyle D [Wed, 23 Feb 2022 20:17:14 +0000 (13:17 -0700)]
Set max text height to prevent overflow (#18862)

Sets a max height for review text boxes to prevent a very annoying bug where users cannot access the "submit" button.

Before:
![image](https://user-images.githubusercontent.com/12700993/155253001-e1dab086-aaf3-4338-889d-6a861728274a.png)

After:
![image](https://user-images.githubusercontent.com/12700993/155253144-5b9a3547-9582-412f-867f-41a45a14a0fe.png)

Interestingly, I don't see this bug on Firefox.

2 years agoLock gofumpt to v0.3.0 and run it (#18866)
silverwind [Wed, 23 Feb 2022 20:16:07 +0000 (21:16 +0100)]
Lock gofumpt to v0.3.0 and run it (#18866)

We can't depend on `latest` version of gofumpt because the output will
not be stable across versions. Lock it down to the latest version
released yesterday and run it again.

2 years agoFix ldap edit bug (#18856)
Lunny Xiao [Tue, 22 Feb 2022 22:07:04 +0000 (06:07 +0800)]
Fix ldap edit bug (#18856)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoFix behavior or checkbox submission. (#18851)
Gusted [Tue, 22 Feb 2022 19:43:11 +0000 (19:43 +0000)]
Fix behavior or checkbox submission. (#18851)

2 years agoDon't report signal: killed errors in serviceRPC (#18850)
zeripath [Tue, 22 Feb 2022 08:32:25 +0000 (08:32 +0000)]
Don't report signal: killed errors in serviceRPC (#18850)

Fix #18849

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix bug for get user by email (#18833)
Lunny Xiao [Mon, 21 Feb 2022 14:20:34 +0000 (22:20 +0800)]
Fix bug for get user by email (#18833)

Co-authored-by: zeripath <art27@cantab.net>
2 years agomigrations: remove dead code in gitea uploader (#18725)
singuliere [Mon, 21 Feb 2022 13:00:05 +0000 (14:00 +0100)]
migrations: remove dead code in gitea uploader (#18725)

When migrating, g.issues is a map with all issues created during the
migration. If an issue is not found in g.issues when inserting a
comment or a review, it cannot exist in the database and trying to get
it via GetIssueByIndex() will always fail and return an error.

Signed-off-by: singuliere <singuliere@autistici.org>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 21 Feb 2022 00:15:46 +0000 (00:15 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoShow fullname on issue edits and gpg/ssh signing info (#18827)
Wim [Sun, 20 Feb 2022 19:50:11 +0000 (20:50 +0100)]
Show fullname on issue edits and gpg/ssh signing info (#18827)

Show missing full names when configured to do so

Co-authored-by: zeripath <art27@cantab.net>
2 years agoUpdate go-org to 1.6.0 (#18824)
zeripath [Sun, 20 Feb 2022 13:01:35 +0000 (13:01 +0000)]
Update go-org to 1.6.0 (#18824)

Fix #14074

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix login with email for ldap users (#18800)
Lunny Xiao [Sun, 20 Feb 2022 10:28:58 +0000 (18:28 +0800)]
Fix login with email for ldap users (#18800)

`authenticator.Authenticate` has assume the login name is not an email, but `username` maybe an email. So when we find the user via email address, we should use `user.LoginName` instead of `username` which is an email address.

2 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 20 Feb 2022 00:16:03 +0000 (00:16 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoImmediately Hammer if second kill is sent (#18823)
zeripath [Sat, 19 Feb 2022 16:36:25 +0000 (16:36 +0000)]
Immediately Hammer if second kill is sent (#18823)

Currently Gitea will wait for HammerTime or nice shutdown if kill -1 or kill -2
is sent. We should just immediately hammer if there is a second kill.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix panic in EscapeReader (#18820)
zeripath [Sat, 19 Feb 2022 15:25:31 +0000 (15:25 +0000)]
Fix panic in EscapeReader (#18820)

There is a potential panic due to a mistaken resetting of the length parameter when
multibyte characters go over a read boundary.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPut buttons back in org dashboard (#18817)
Lunny Xiao [Sat, 19 Feb 2022 12:08:12 +0000 (20:08 +0800)]
Put buttons back in org dashboard (#18817)

Fix #18523

2 years agoGenerate coverage with sqlite. (#18813)
KN4CK3R [Sat, 19 Feb 2022 02:28:43 +0000 (03:28 +0100)]
Generate coverage with sqlite. (#18813)

2 years agoUpdate on-cloud-provider.md (#18807)
Nicolas Ferrari [Fri, 18 Feb 2022 15:26:00 +0000 (16:26 +0100)]
Update on-cloud-provider.md (#18807)

2 years agoFix ldap loginname (#18789)
Johan Van de Wauw [Fri, 18 Feb 2022 09:33:00 +0000 (10:33 +0100)]
Fix ldap loginname (#18789)

* Use email_address table to check user's email when login with email adress

* Update services/auth/signin.go

* Fix test

* Fix test

* Fix logging in with ldap username != loginname

* Fix if user does not exist yet

* Make more clear this is loginName

* Fix formatting

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoReplace deprecated String.prototype.substr() with String.prototype.slice() (#18796)
CommanderRoot [Fri, 18 Feb 2022 06:50:36 +0000 (07:50 +0100)]
Replace deprecated String.prototype.substr() with String.prototype.slice() (#18796)

String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with the slice() method which works similarily but isn't deprecated.

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix problem when self-assign notification (#18797)
Lunny Xiao [Fri, 18 Feb 2022 06:06:57 +0000 (14:06 +0800)]
Fix problem when self-assign notification (#18797)

2 years agoMove editorconfig-checker to lint-backend and remove JS wrapper (#18793)
silverwind [Fri, 18 Feb 2022 04:33:58 +0000 (05:33 +0100)]
Move editorconfig-checker to lint-backend and remove JS wrapper (#18793)

* Move editorconfig-checker to lint-backend

It makes more sense there as templates are considered backend code.

* User golang version of the tool

* remove dependency

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 18 Feb 2022 00:16:14 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix redirect when using lowercase reponame (#18775)
Ghanem [Thu, 17 Feb 2022 16:11:27 +0000 (18:11 +0200)]
Fix redirect when using lowercase reponame (#18775)

* Previously,  `GET {username}/{reponame}/raw///file-path` (the middle two slashes are blank to get the default branch) when the repo name has uppercase letters, e.g., https://try.gitea.io/AbdulrhmnGhanem/CH330_Hardware, using a lowercase version of the name redirected to the correct URL
* In other words both
   * `GET https://try.gitea.io/AbdulrhmnGhanem/CH330_Hardware/raw///images/back.png`
   * `GET https://try.gitea.io/AbdulrhmnGhanem/ch330_hardware/raw///images/back.png`
were redirecting to ` GET https://try.gitea.io/AbdulrhmnGhanem/CH330_Hardware/raw/branch/master/images/back.png`
This isn't the case after  #17551. Specifically because of this [line](https://github.com/zeripath/gitea/blob/cbd5eecd148dfca5fcb1a3da469e491a84f6b32b/modules/context/repo.go#L860).

2 years agoMove deletebeans into models/db (#18781)
Lunny Xiao [Thu, 17 Feb 2022 08:37:48 +0000 (16:37 +0800)]
Move deletebeans into models/db (#18781)

2 years agoAllow mermaid render error to wrap (#18790)
silverwind [Thu, 17 Feb 2022 07:42:43 +0000 (08:42 +0100)]
Allow mermaid render error to wrap (#18790)

2 years agoAttempt to fix the webauthn migration again - part 3 (#18770)
zeripath [Wed, 16 Feb 2022 21:03:58 +0000 (21:03 +0000)]
Attempt to fix the webauthn migration again - part 3 (#18770)

v208.go is seriously broken as it misses an ID() check. We need to no-op and remigrate all of the u2f keys.

See #18756

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix template bug of LFS lock (#18784)
Lunny Xiao [Wed, 16 Feb 2022 16:22:25 +0000 (00:22 +0800)]
Fix template bug of LFS lock (#18784)

2 years agoVarious Mermaid improvements (#18776)
silverwind [Wed, 16 Feb 2022 03:28:29 +0000 (04:28 +0100)]
Various Mermaid improvements (#18776)

* Various Mermaid improvments

- Render into iframe for improved security
- Use built-in dark theme instead of color inversion
- Remove flexbox attributes, resulting in more consistent size rendering
- Update API usage and update to latest version

* restart ci

* misc tweaks

* remove unneccesary declaration

* make it work without allow-same-origin, add loading=lazy

* remove loading attribute, does not seem to work

* rename variable

* skip roundtrip to DOM for rendering

* don't guess chart height

* update comment to make it clear it's intentional

* tweak

* replace deprecated 'scrolling' property

* remove unused css file

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 16 Feb 2022 00:16:06 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix display time of milestones (#18753)
René Schaar [Tue, 15 Feb 2022 16:50:10 +0000 (17:50 +0100)]
Fix display time of milestones (#18753)

* Fix display time of milestones

* Move the SecToTime function

From the models/issue_stopwatch.go file to the modules/util package

* Rename the sec_to_time file

* Updated formatting

* Include copyright notice in sec_to_time.go

* Apply PR review suggestions

- Update copyright notice dates to 2022
- Change `1 day 3h 5min 7s` to `1d 3h 5m 7s`

* Rename hrs var and combine conditions

* Update unit tests to match new time pattern

Changed `1min` to `1m`

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 15 Feb 2022 00:15:56 +0000 (00:15 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoPrevent dangling GetAttribute calls (#18754)
zeripath [Mon, 14 Feb 2022 17:03:56 +0000 (17:03 +0000)]
Prevent dangling GetAttribute calls (#18754)

It appears possible that there could be a hang due to unread data from the
repo-attribute command pipes. This PR simply closes these during the defer.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoAdd example to render html files (#18736)
Lunny Xiao [Mon, 14 Feb 2022 13:56:17 +0000 (21:56 +0800)]
Add example to render html files (#18736)

* Add example to render html files

* Use class in example

Co-authored-by: zeripath <art27@cantab.net>
2 years agoFix a broken link in `commits_list_small.tmpl` (#18763)
wxiaoguang [Mon, 14 Feb 2022 11:19:07 +0000 (19:19 +0800)]
Fix a broken link in `commits_list_small.tmpl` (#18763)

2 years agoFix broken cancel button link on patch page (#18718)
Lunny Xiao [Mon, 14 Feb 2022 09:18:55 +0000 (17:18 +0800)]
Fix broken cancel button link on patch page (#18718)

* Fix broken cacnel button link on patch page

* remove treepath="patch" elsewhere too

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoIgnore the migrate if u2f_registration is not exist (#18760)
Lunny Xiao [Mon, 14 Feb 2022 08:13:17 +0000 (16:13 +0800)]
Ignore the migrate if u2f_registration is not exist (#18760)

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 14 Feb 2022 00:16:00 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoIncrease the size of the webauthn_credential credential_id field (#18739)
zeripath [Sun, 13 Feb 2022 21:19:12 +0000 (21:19 +0000)]
Increase the size of the webauthn_credential credential_id field (#18739)

Unfortunately credentialIDs in u2f are 255 bytes long which with base32 encoding
becomes 408 bytes. The default size of a xorm string field is only a VARCHAR(255)

This problem is not apparent on SQLite because strings get mapped to TEXT there.

Fix #18727

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix isempty detection of git repository (#18746)
Lunny Xiao [Sun, 13 Feb 2022 16:01:23 +0000 (00:01 +0800)]
Fix isempty detection of git repository (#18746)

* Fix isempty detection of git repository

* Fix IsEmpty check

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 13 Feb 2022 00:16:01 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoSend mail to issue/pr assignee/reviewer also when OnMention is set (#18707)
flozzone [Sat, 12 Feb 2022 07:17:34 +0000 (08:17 +0100)]
Send mail to issue/pr assignee/reviewer also when OnMention is set (#18707)

I want to address #17892, where emails notifications are not sent to assignees (issue and PR) and reviewers (PR) when they have the email setting Only email on mention enabled.

From the user experience perspective, when a user gets a issue/PR assigned or a PR review request, he/she would expect to be implicitly mentioned since the assignment or request is personal and targeting a single person only. Thus I see #17892 as a bug. Could we therefore mark this ticket as such?

The changed code just explicitly checks for the EmailNotificationsOnMention setting beside the existing EmailNotificationsEnabled check. Too rude?

@lunny mentioned a mock mail server for tests, is there something ready. How could I make use of it?

#12774 (comment)

Fix #17892

2 years agoReduce CI go module downloads, add make targets (#18708)
silverwind [Sat, 12 Feb 2022 07:08:53 +0000 (08:08 +0100)]
Reduce CI go module downloads, add make targets (#18708)

The CI currently downloads all go modules in each pipeline step because
go modules reside outside the project directory. Fix this by introducing
a volume for the `/go` directory [1] so modules are only downloaded once per
pipeline using a new `deps-backend` make target.

For completeness, I also included new `deps` and `deps-frontend` targets
and the frontend one is also triggered explicitly on CI where needed.

[1] https://docs.drone.io/pipeline/kubernetes/examples/language/golang/#dependencies

2 years agoAdd number in queue status to monitor page (#18712)
zeripath [Sat, 12 Feb 2022 05:31:26 +0000 (05:31 +0000)]
Add number in queue status to monitor page (#18712)

Add number in queue status to the monitor page so that administrators can
assess how much work is left to be done in the queues.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix source code line highlighting (#18729)
Jimmy Praet [Sat, 12 Feb 2022 05:00:24 +0000 (06:00 +0100)]
Fix source code line highlighting (#18729)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix forked repositories missed tags (#18719)
Lunny Xiao [Sat, 12 Feb 2022 03:18:06 +0000 (11:18 +0800)]
Fix forked repositories missed tags (#18719)

* Fix forked repositories missed tags

* Add missed close

* Use ctx

Co-authored-by: 6543 <6543@obermui.de>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 12 Feb 2022 00:16:01 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix release typo (#18728)
Lunny Xiao [Fri, 11 Feb 2022 19:08:17 +0000 (03:08 +0800)]
Fix release typo (#18728)

2 years agoDisplay template path of current page in dev mode (#18717)
Lunny Xiao [Fri, 11 Feb 2022 17:08:22 +0000 (01:08 +0800)]
Display template path of current page in dev mode (#18717)

* Display template path of current page in dev mode

* improve code

* Update templates/base/footer_content.tmpl

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2 years agoSeparate the details links of commit-statuses in headers (#18661)
zeripath [Fri, 11 Feb 2022 15:29:58 +0000 (15:29 +0000)]
Separate the details links of commit-statuses in headers (#18661)

2 years agoAdd LDAP group sync to Teams, fixes #1395 (#16299)
Sven Seeberg [Fri, 11 Feb 2022 14:24:58 +0000 (15:24 +0100)]
Add LDAP group sync to Teams, fixes #1395 (#16299)

* Add setting for a JSON that maps LDAP groups to Org Teams.
* Add log when removing or adding team members.
* Sync is being run on login and periodically.
* Existing group filter settings are reused.
* Adding and removing team members.
* Sync not existing LDAP group.
* Login with broken group map JSON.

2 years agoChange git.cmd to RunWithContext (#18693)
Martin Scholz [Fri, 11 Feb 2022 12:47:22 +0000 (13:47 +0100)]
Change git.cmd to RunWithContext (#18693)

Change all `cmd...Pipeline` commands to `cmd.RunWithContext`.

#18553

Co-authored-by: Martin Scholz <martin.scholz@versasec.com>
2 years agoAlways set PullRequestWorkInProgressPrefixes in PrepareViewPullInfo (#18713)
zeripath [Fri, 11 Feb 2022 08:02:53 +0000 (08:02 +0000)]
Always set PullRequestWorkInProgressPrefixes in PrepareViewPullInfo (#18713)

Move setting PullRequestWorkInProgressPrefixes to the start of PrepareViewPullInfo.

Fix #18706

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoPrevent double encoding of branch names in delete branch (#18714)
zeripath [Fri, 11 Feb 2022 05:02:04 +0000 (05:02 +0000)]
Prevent double encoding of branch names in delete branch (#18714)

* Prevent double encoding of branch names in delete branch

There is a double encoding issue in branch template whereby the branch name
ends up double encoded.

Fix #18709

Signed-off-by: Andrew Thornton <art27@cantab.net>
* and tag name

Signed-off-by: Andrew Thornton <art27@cantab.net>
* And fix #18704

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 11 Feb 2022 00:16:26 +0000 (00:16 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAttempt to improve docs (yet again) (#18687)
zeripath [Thu, 10 Feb 2022 19:20:06 +0000 (19:20 +0000)]
Attempt to improve docs (yet again) (#18687)

* Attempt to improve docs (yet again)

Attempt to make the passthrough docs clearer.
Add some more faq entries

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

* Apply suggestions from code review

Co-authored-by: Gusted <williamzijl7@hotmail.com>
* Update docs/content/doc/installation/with-docker.en-us.md

* Update docs/content/doc/installation/with-docker.en-us.md

Co-authored-by: Gusted <williamzijl7@hotmail.com>
2 years agoMake the proformas clearer that we need DEBUG logs (#18700)
zeripath [Thu, 10 Feb 2022 17:11:58 +0000 (17:11 +0000)]
Make the proformas clearer that we need DEBUG logs (#18700)

It is ridiculous how few of our bug reporter are giving us DEBUG level logs.
This has to change and I think the proforma is not making it clear enough that
they have to give us these logs.

This PR changes the issue proformas to tell people to give us these logs.

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