]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agoEnsure isSSH is set whenever DISABLE_HTTP_GIT is set (#19028)
wxiaoguang [Wed, 9 Mar 2022 04:42:29 +0000 (12:42 +0800)]
Ensure isSSH is set whenever DISABLE_HTTP_GIT is set (#19028)

When DISABLE_HTTP_GIT is set we should always show the SSH button

2 years agoAdd button for issue deletion (#19032)
Otto Richter (fnetX) [Wed, 9 Mar 2022 00:38:11 +0000 (01:38 +0100)]
Add button for issue deletion (#19032)

Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix script compatiable with OpenWrt (#19000)
YISH [Tue, 8 Mar 2022 22:58:14 +0000 (06:58 +0800)]
Fix script compatiable with OpenWrt (#19000)

* Fix compatibility of upgrade.sh in openwrt and add service init script for openwrt.

* Apply suggestions from code review

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: zeripath <art27@cantab.net>
* Update contrib/upgrade.sh

Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoAllow users to self-request a PR review (#19030)
Norwin [Tue, 8 Mar 2022 21:48:47 +0000 (22:48 +0100)]
Allow users to self-request a PR review (#19030)

The review request feature was added in https://github.com/go-gitea/gitea/pull/10756,
where the doer got explicitly excluded from available reviewers. I don't see a
functionality or security related reason to forbid this case.

As shown by GitHubs implementation, it may be useful to self-request a review,
to be reminded oneselves about reviewing, while communicating to team mates that a
review is missing.

Co-authored-by: delvh <dev.lh@web.de>
2 years agoFix wrong scopes caused by empty scope input (#19029)
wxiaoguang [Tue, 8 Mar 2022 18:56:40 +0000 (02:56 +0800)]
Fix wrong scopes caused by empty scope input (#19029)

2 years agoFeature: show issue assignee on project board (#15232)
Roger Luo [Tue, 8 Mar 2022 16:42:28 +0000 (00:42 +0800)]
Feature: show issue assignee on project board (#15232)

* Show assignees in project boards.

2 years agobump go deps (#19021)
techknowlogick [Tue, 8 Mar 2022 11:15:30 +0000 (06:15 -0500)]
bump go deps (#19021)

* update gitea.com/go-chi/binding

* update gitea.com/go-chi/cache

* update github.com/42wim/sshsig

* update github.com/PuerkitoBio/goquery

* update github.com/blevesearch/bleve/v2

* update github.com/caddyserver/certmagic

* update github.com/denisenkom/go-mssqldb

* update github.com/duo-labs/webauthn

* update github.com/dustin/go-humanize

* update github.com/editorconfig/editorconfig-core-go/v2

* update github.com/ethantkoenig/rupture

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

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

* update github.com/go-ldap/ldap/v3

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

* update github.com/go-swagger/go-swagger

* update github.com/gogs/chardet

* update github.com/golang-jwt/jwt/v4

* update github.com/hashicorp/go-version

* update github.com/jaytaylor/html2text

* update github.com/klauspost/compress

* update github.com/lib/pq

* update github.com/markbates/goth

* update github.com/mattn/go-sqlite3

* update github.com/mholt/archiver/v3

* update github.com/microcosm-cc/bluemonday

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

* update github.com/msteinert/pam

* update github.com/niklasfasching/go-org

* update github.com/olivere/elastic/v7

* update github.com/prometheus/client_golang

* update github.com/quasoft/websspi

* update github.com/stretchr/testify

* update github.com/unknwon/i18n

* update github.com/unrolled/render

* update github.com/xanzy/go-gitlab

* update github.com/yuin/goldmark

* update github.com/yuin/goldmark-highlighting

* update github.com/yuin/goldmark-meta

* post make vendor

Signed-off-by: Andrew Thornton <art27@cantab.net>
* add make vendor back into update_dependencies.sh

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update update_dependencies.sh

* Update contrib/update_dependencies.sh

Co-authored-by: zeripath <art27@cantab.net>
* update mvdan.cc/xurls/v2

Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoDon't show context cancelled errors in attribute reader (#19006)
zeripath [Tue, 8 Mar 2022 08:30:14 +0000 (08:30 +0000)]
Don't show context cancelled errors in attribute reader (#19006)

Fix #18997

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoSet `rel="nofollow noindex"` on new issue links (#19023)
zeripath [Mon, 7 Mar 2022 22:08:05 +0000 (22:08 +0000)]
Set `rel="nofollow noindex"` on new issue links (#19023)

Fix #19018

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoupdate to correct stable version
techknowlogick [Mon, 7 Mar 2022 07:03:06 +0000 (02:03 -0500)]
update to correct stable version

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 7 Mar 2022 00:11:49 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd Index to comment for migrations and mirroring (#18806)
singuliere [Sun, 6 Mar 2022 19:00:41 +0000 (20:00 +0100)]
Add Index to comment for migrations and mirroring (#18806)

Comments have an id (see Gitea[0], GitLab[1], GitHub[2], etc.), and the
comment migration format must represent it during migrations so that
it can be used during mirroring or incremental migrations.

[0] https://try.gitea.io/api/swagger#/issue/issueGetComment
[1] https://docs.gitlab.com/ee/api/discussions.html#get-single-issue-discussion-item
[2] https://docs.github.com/en/rest/reference/issues#get-an-issue-comment

Signed-off-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: Loïc Dachary <loic@dachary.org>
2 years agoSupport ignore all santize for external renderer (#18984)
Lunny Xiao [Sun, 6 Mar 2022 08:41:54 +0000 (16:41 +0800)]
Support ignore all santize for external renderer (#18984)

* Support ignore all santize for external renderer

* Update docs

* Apply suggestions from code review

Co-authored-by: silverwind <me@silverwind.io>
* Fix doc

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix EasyMDE error when input Enter (#19004)
wxiaoguang [Sat, 5 Mar 2022 17:53:34 +0000 (01:53 +0800)]
Fix EasyMDE error when input Enter (#19004)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix update hint bug (#18996)
Lunny Xiao [Fri, 4 Mar 2022 20:59:29 +0000 (04:59 +0800)]
Fix update hint bug (#18996)

2 years agoFix the editor height in review box (#19003)
wxiaoguang [Fri, 4 Mar 2022 20:57:26 +0000 (04:57 +0800)]
Fix the editor height in review box (#19003)

Fix the height problem in  https://github.com/go-gitea/gitea/pull/18862#issuecomment-1059329539

I have tested this fix.

# Screenshots

### Min-height

<img width="1138" alt="image" src="https://user-images.githubusercontent.com/2114189/156811831-93d4d31a-1b0a-4c4c-a7b4-fafc706133d6.png">

### Max-height

<img width="1126" alt="image" src="https://user-images.githubusercontent.com/2114189/156811889-10ae41de-c63b-45e7-9d89-21a1ed29e58b.png">

2 years agoAdd a "admin user generate-access-token" subcommand (#17722)
mscherer [Fri, 4 Mar 2022 19:53:35 +0000 (20:53 +0100)]
Add a "admin user generate-access-token" subcommand (#17722)

* Add a "admin user generate-access-token" subcommand

Fixes #17721

* Update cmd/admin.go

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update cmd/admin.go

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix code to match new interfaces

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoFix potential assignee query for repo (#18994)
Otto Richter (fnetX) [Fri, 4 Mar 2022 18:29:12 +0000 (19:29 +0100)]
Fix potential assignee query for repo (#18994)

* Fix potential assignee query for repo

* Add tests for `GetRepoAssignees`

- As per https://github.com/go-gitea/gitea/pull/18994#issuecomment-1058506640

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd config option to disable "Update branch by rebase" (#18745)
Jimmy Praet [Fri, 4 Mar 2022 08:30:49 +0000 (09:30 +0100)]
Add config option to disable "Update branch by rebase" (#18745)

2 years agoUpdate `go-enry` to v2.8.0 (#18993)
Gusted [Fri, 4 Mar 2022 00:56:31 +0000 (00:56 +0000)]
Update `go-enry` to v2.8.0 (#18993)

- It was reported in the Matrix channel that Chroma [has support](https://github.com/alecthomas/chroma/commit/d40210297631298bde98a8fcfd52c3d2555cc367)
for the Fennel language, go-enry only added detection support for this
[in v2.7.2](https://github.com/go-enry/go-enry/commit/0affa3ccca37cd781600760956581c5f94ef8a3c).

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agohomebrew updates via cron
techknowlogick [Thu, 3 Mar 2022 20:59:26 +0000 (15:59 -0500)]
homebrew updates via cron

2 years agoignore missing comment for user notifications (#18954)
eladyn [Thu, 3 Mar 2022 15:18:26 +0000 (16:18 +0100)]
ignore missing comment for user notifications (#18954)

* ignore missing comment for user notifications

* instead fix bug in notifications model

* use local variable instead

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoallow overwrite artifacts for github releases (#18987)
6543 [Thu, 3 Mar 2022 14:28:41 +0000 (15:28 +0100)]
allow overwrite artifacts for github releases (#18987)

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>