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

3 years agoShow direct match on top for user search (#17303)
Maximilian Weiler [Thu, 14 Oct 2021 23:48:47 +0000 (01:48 +0200)]
Show direct match on top for user search (#17303)

This PR makes sure that direct matches in the user search always show on top of the result list.

The following places were checked to follow the desired behavior now:
- Search when adding a user to a team
- Search when adding a user as a collaborator to a repository

Signed-off-by: Maximilian Weiler <16721506+maweil@users.noreply.github.com>
3 years agoDon't panic if we fail to parse U2FRegistration data (#17304)
David Jimenez [Thu, 14 Oct 2021 16:37:35 +0000 (17:37 +0100)]
Don't panic if we fail to parse U2FRegistration data (#17304)

* Don't panic if we fail to parse a U2FRegistration data

Downgrade logging statement from Fatal to Error so that errors parsing
U2FRegistration data does not panic; instead, the invalid key will be
skipped and we will attempt to parse the next one, if available.

Signed-off-by: David Jimenez <dvejmz@sgfault.com>
3 years agoUpgrade chi to v5 (#17298)
Lunny Xiao [Thu, 14 Oct 2021 02:50:23 +0000 (10:50 +0800)]
Upgrade chi to v5 (#17298)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 14 Oct 2021 00:25:07 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoEnsure that git daemon export ok is created for mirrors (#17243)
zeripath [Wed, 13 Oct 2021 19:47:02 +0000 (20:47 +0100)]
Ensure that git daemon export ok is created for mirrors (#17243)

* Ensure that git daemon export ok is created for mirrors

There is an issue with #16508 where it appears that create repo requires that the
repo does not exist. This causes #17241 where an error is reported because of this.

This PR fixes this and also runs update-server-info for mirrors and generated repos.

Fix #17241

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDisable core.protectNTFS (#17300)
zeripath [Wed, 13 Oct 2021 18:20:11 +0000 (19:20 +0100)]
Disable core.protectNTFS (#17300)

core.protectNTFS protects NTFS from files which may be difficult to remove or interact
with using the win32 api, however, it also appears to prevent such files from
being entered into the git indexes - fundamentally causing breakages with PRs that
affect these files. However, deliberately setting this to false may cause security
issues due to the remain sparse checkout of files in the merge pipeline.

The only sensible option therefore is to provide an optional setting which admins
could set which would forcibly switch this off if they are affected by this issue.

Fix #17092

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUse pointer for wrappedConn methods (#17295)
zeripath [Tue, 12 Oct 2021 20:55:18 +0000 (21:55 +0100)]
Use pointer for wrappedConn methods (#17295)

Fix #17294

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd user status filter to admin user management page (#16770)
wxiaoguang [Tue, 12 Oct 2021 18:11:35 +0000 (02:11 +0800)]
Add user status filter to admin user management page (#16770)

It makes Admin's life easier to filter users by various status.

* introduce window.config.PageData to pass template data to javascript module and small refactor

move legacy window.ActivityTopAuthors to window.config.PageData.ActivityTopAuthors
make HTML structure more IDE-friendly in footer.tmpl and head.tmpl
remove incorrect <style class="list-search-style"></style> in head.tmpl
use log.Error instead of log.Critical in admin user search

* use LEFT JOIN instead of SubQuery when admin filters users by 2fa. revert non-en locale.

* use OptionalBool instead of status map

* refactor SearchUserOptions.toConds to SearchUserOptions.toSearchQueryBase

* add unit test for user search

* only allow admin to use filters to search users

3 years ago[API] Add endpount to get user org permissions (#17232)
Romain [Tue, 12 Oct 2021 10:47:19 +0000 (12:47 +0200)]
[API] Add endpount to get user org permissions (#17232)

* Add endpoint

* Add swagger response + generate swagger

* Stop execution if user / org is not found

* Add tests

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 12 Oct 2021 00:25:09 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAutoRegistration is supposed to be working with disabled registration (#17219)
Viktor Kuzmin [Mon, 11 Oct 2021 16:23:59 +0000 (20:23 +0400)]
AutoRegistration is supposed to be working with disabled registration (#17219)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoOpen markdown image links in new window (#17287)
wxiaoguang [Mon, 11 Oct 2021 12:12:06 +0000 (20:12 +0800)]
Open markdown image links in new window (#17287)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 11 Oct 2021 00:25:06 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoSave and view issue/comment content history (#16909)
wxiaoguang [Sun, 10 Oct 2021 22:40:03 +0000 (06:40 +0800)]
Save and view issue/comment content history (#16909)

* issue content history

* Use timeutil.TimeStampNow() for content history time instead of issue/comment.UpdatedUnix (which are not updated in time)

* i18n for frontend

* refactor

* clean up

* fix refactor

* re-format

* temp refactor

* follow db refactor

* rename IssueContentHistory to ContentHistory, remove empty model tags

* fix html

* use avatar refactor to generate avatar url

* add unit test, keep at most 20 history revisions.

* re-format

* syntax nit

* Add issue content history table

* Update models/migrations/v197.go

Co-authored-by: 6543 <6543@obermui.de>
* fix merge

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 10 Oct 2021 00:25:11 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

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

3 years agochangelog for 1.15.4 (frontport) (#17273)
techknowlogick [Fri, 8 Oct 2021 21:51:57 +0000 (17:51 -0400)]
changelog for 1.15.4 (frontport) (#17273)

3 years agoAdd a simple way to rename branch like gh (#15870)
a1012112796 [Fri, 8 Oct 2021 17:03:04 +0000 (01:03 +0800)]
Add a simple way to rename branch like gh (#15870)

- Update default branch if needed
- Update protected branch if needed
- Update all not merged pull request base branch name
- Rename git branch
- Record this rename work and auto redirect for old branch on ui

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: delvh <dev.lh@web.de>
3 years agoMove add deploy key form before the list and add a cancel button (#17228)
qwerty287 [Fri, 8 Oct 2021 16:15:09 +0000 (18:15 +0200)]
Move add deploy key form before the list and add a cancel button (#17228)

3 years agoDefer Last Commit Info (#16467)
zeripath [Fri, 8 Oct 2021 13:08:22 +0000 (14:08 +0100)]
Defer Last Commit Info (#16467)

One of the biggest reasons for slow repository browsing is that we wait
until last commit information has been generated for all files in the
repository.

This PR proposes deferring this generation to a new POST endpoint that
does the look up outside of the main page request.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoRemove heads pointing to missing old refs (#17076)
99rgosse [Fri, 8 Oct 2021 09:59:35 +0000 (11:59 +0200)]
Remove heads pointing to missing old refs (#17076)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix incorrect repository count on organization tab of dashboard (#17256)
Jimmy Praet [Fri, 8 Oct 2021 06:49:20 +0000 (08:49 +0200)]
Fix incorrect repository count on organization tab of dashboard (#17256)

Fixes #17249

3 years agoAllow adding multiple issues to a project (#17226)
qwerty287 [Thu, 7 Oct 2021 22:00:02 +0000 (00:00 +0200)]
Allow adding multiple issues to a project  (#17226)

Adds an option like for adding multiple issues to a milestone.
Closes #17216

3 years agoFix unwanted team review request deletion (#17257)
Jimmy Praet [Thu, 7 Oct 2021 20:39:59 +0000 (22:39 +0200)]
Fix unwanted team review request deletion (#17257)

Add missing issue_id = ? to where clause
Fixes #17251

3 years agoHandle duplicate keys on GPG key ring (#17242)
zeripath [Thu, 7 Oct 2021 20:10:14 +0000 (21:10 +0100)]
Handle duplicate keys on GPG key ring (#17242)

It is possible that a keyring can contain duplicate keys on a keyring due to jpegs or
other layers. This currently leads to a confusing error for the user - where we report
a duplicate key insertion.

This PR simply coalesces keys into one key if there are duplicates.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix broken Activities link in team dashboard (#17255)
Jimmy Praet [Thu, 7 Oct 2021 18:27:38 +0000 (20:27 +0200)]
Fix broken Activities link in team dashboard (#17255)

Remove '/' suffix from organization dashboard link

Fixes #17250

3 years agoAdd protection to disable Gitea when run as root (#17168)
techknowlogick [Thu, 7 Oct 2021 08:52:08 +0000 (04:52 -0400)]
Add protection to disable Gitea when run as root (#17168)

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAPI pull's head/base have correct permission (#17214)
pricly-yellow [Thu, 7 Oct 2021 00:03:37 +0000 (07:03 +0700)]
API pull's head/base have correct permission (#17214)

close #17181

* for all pull requests API return permissions of caller
* for all webhook return empty permissions

Signed-off-by: Danila Kryukov <pricly_yellow@dismail.de>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix problem when database ID is not incremented as expected (#17229)
finga [Wed, 6 Oct 2021 20:36:24 +0000 (22:36 +0200)]
Fix problem when database ID is not incremented as expected (#17229)

Although #17124 fixed the same issue for the feed, some other parts
with the same issue were found.

Co-authored-by: finga <finga@onders.org>
3 years agofix navbar ui (#17235)
wxiaoguang [Wed, 6 Oct 2021 15:22:44 +0000 (23:22 +0800)]
fix navbar ui (#17235)

3 years agoCI: migrate from 'plugins/s3:1' to 'woodpeckerci/plugin-s3:latest' (#17234)
6543 [Wed, 6 Oct 2021 11:58:11 +0000 (13:58 +0200)]
CI: migrate from 'plugins/s3:1' to 'woodpeckerci/plugin-s3:latest' (#17234)

- this fixes the CI release upload issues, as the docker image for this is freshly built (unlike the mostly unmaintained "official" drone plugins), thus containing current CA certs needed for letsencrypt since 2021-09-31.
- woodpecker is a drone-ci fork maintained partially by @6543. it's API compatible with current drone plugins afaik

3 years agoAvatar refactor, move avatar code from `models` to `models.avatars`, remove duplicate...
wxiaoguang [Tue, 5 Oct 2021 23:25:46 +0000 (07:25 +0800)]
Avatar refactor, move avatar code from `models` to `models.avatars`, remove duplicated code (#17123)

Why this refactor

The goal is to move most files from `models` package to `models.xxx` package. Many models depend on avatar model, so just move this first.

And the existing logic is not clear, there are too many function like `AvatarLink`, `RelAvatarLink`, `SizedRelAvatarLink`, `SizedAvatarLink`, `MakeFinalAvatarURL`, `HashedAvatarLink`, etc. This refactor make everything clear:

* user.AvatarLink()
* user.AvatarLinkWithSize(size)
* avatars.GenerateEmailAvatarFastLink(email, size)
* avatars.GenerateEmailAvatarFinalLink(email, size)

And many duplicated code are deleted in route handler, the handler and the model share the same avatar logic now.

3 years agoRemove Dashboard/Home button from the navbar (#16844)
n [Tue, 5 Oct 2021 20:42:02 +0000 (05:42 +0900)]
Remove Dashboard/Home button from the navbar (#16844)

This removes the Dashboard/Home buttons and adds its text to the title of the logo.

Co-authored-by: Alexey 〒erentyev <axifnx@gmail.com>
3 years agoRedirect on project after issue created (#17211)
Romain [Tue, 5 Oct 2021 19:21:52 +0000 (21:21 +0200)]
Redirect on project after issue created (#17211)

close #17011

If user create an issue with button in project view, after issue is created the user is redirect to project view.

3 years agoAdd metrics to get issues by repository (#17225)
Romain [Tue, 5 Oct 2021 18:39:37 +0000 (20:39 +0200)]
Add metrics to get issues by repository (#17225)

3 years agoAdd specific event type to header (#17222)
John Olheiser [Tue, 5 Oct 2021 17:12:17 +0000 (12:12 -0500)]
Add specific event type to header (#17222)

* Add specific event type to header

Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Change single to type

3 years agoFix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223)
pricly-yellow [Tue, 5 Oct 2021 14:41:48 +0000 (21:41 +0700)]
Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223)

Fix GetPullRequestByIndex by validate index > 1

Signed-off-by: Danila Kryukov <pricly_yellow@dismail.de>
Co-authored-by: a1012112796 <1012112796@qq.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 5 Oct 2021 00:25:07 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 4 Oct 2021 00:25:03 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd metrics to get issues by label (#17201)
Romain [Sun, 3 Oct 2021 22:46:44 +0000 (00:46 +0200)]
Add metrics to get issues by label (#17201)

* Add metrics to get issues by label

* Add comment on IssueByLabelCount

* Code review - Unify "AS" in SQL (#17201)

* Code review - Remove useless join (#17201)

* Code review - Disable issue_by_label by default in settings (#17201)

* use e

* restore empty line

* update docs

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix typo in app.example.ini (#17213)
Petr Vaněk [Sun, 3 Oct 2021 22:46:20 +0000 (00:46 +0200)]
Fix typo in app.example.ini (#17213)

3 years agoAPI: don't allow merged PRs to be reopened (#17192)
Norwin [Sun, 3 Oct 2021 03:11:17 +0000 (05:11 +0200)]
API: don't allow merged PRs to be reopened (#17192)

* api: dont open merged PRs

* don't change base branch when already merged

* don't allow any state change

* also validate opening merged PRs in EditIssue

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoReference in new issue modal: dont pre-populate issue title (#17208)
Norwin [Sat, 2 Oct 2021 16:05:55 +0000 (18:05 +0200)]
Reference in new issue modal: dont pre-populate issue title (#17208)

* dont prepopulate issue title

* cleanup

3 years agoAdd option to copy line permalink (#17145)
qwerty287 [Sat, 2 Oct 2021 07:46:43 +0000 (09:46 +0200)]
Add option to copy line permalink (#17145)

* Add option to copy line permalink

* Fix lint

* Apply review suggestions

* Update code and fix lint

* Use features/clipboard.js framework

3 years agoAdd projects and project boards in exposed metrics (#17202)
Romain [Sat, 2 Oct 2021 01:32:15 +0000 (03:32 +0200)]
Add projects and project boards in exposed metrics (#17202)

* Add projects and project boards in exposed metrics

* Refactor db.GetEngine

Co-authored-by: delvh <dev.lh@web.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 2 Oct 2021 00:25:02 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAlways set a unique Message-ID header. (#17206)
KN4CK3R [Fri, 1 Oct 2021 15:24:43 +0000 (17:24 +0200)]
Always set a unique Message-ID header. (#17206)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 1 Oct 2021 00:25:01 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoPrevent NPE on invalid diff (#17197)
zeripath [Thu, 30 Sep 2021 19:31:02 +0000 (20:31 +0100)]
Prevent NPE on invalid diff (#17197)

* Prevent NPE on invalid diff

If ParseCompareInfo returns a nil compare info the defer function needs to ensure
that it does not attempt to close the HeadGitRepo.

Fix #17193

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

Co-authored-by: 6543 <6543@obermui.de>
3 years agoAPI: add html urls to notification subjects (#17178)
Norwin [Thu, 30 Sep 2021 04:17:39 +0000 (06:17 +0200)]
API: add html urls to notification subjects (#17178)

* API: add html urls to notification subjects

* add "Repository"

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, 30 Sep 2021 00:25:39 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix missing repo link in issue/pull assigned emails (#17183)
zeripath [Wed, 29 Sep 2021 23:20:18 +0000 (00:20 +0100)]
Fix missing repo link in issue/pull assigned emails (#17183)

There was a mistake in the template file: `templates/mail/issue/assigned.tmpl`
where the repourl was generated from a non-existent release instead of the issue.

This PR changes this to use the issue but also ensure that the issue repo is loaded.

It also slightly improves the English locale string.

Fix #17160

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
3 years agoKanban colored boards (#16647)
Romain [Wed, 29 Sep 2021 20:53:12 +0000 (22:53 +0200)]
Kanban colored boards (#16647)

Add a column Color in ProjectBoard and color picker in new / edit project board form.

3 years agoupgrade xorm to v1.2.5 (#17177)
Lunny Xiao [Wed, 29 Sep 2021 20:08:44 +0000 (04:08 +0800)]
upgrade xorm to v1.2.5 (#17177)

3 years agoFix wording in issue template (#17176)
silverwind [Wed, 29 Sep 2021 11:03:44 +0000 (13:03 +0200)]
Fix wording in issue template (#17176)

There was a typo `systemm` here. I opted to just remove the superfluos word altogether.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 29 Sep 2021 00:25:04 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoCreate pub/priv keypair for federation (#17071)
techknowlogick [Tue, 28 Sep 2021 19:19:22 +0000 (15:19 -0400)]
Create pub/priv keypair for federation (#17071)

* add logic for creating pub/priv keypair for federation

* Apply suggestions from code review

Co-authored-by: delvh <dev.lh@web.de>
* make fmt

* Update modules/activitypub/keypair.go

Co-authored-by: delvh <dev.lh@web.de>
* add tests

* fix revert

* more tests

* Apply suggestions from code review

Co-authored-by: delvh <dev.lh@web.de>
* make fmt

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix bug of get context user (#17169)
Lunny Xiao [Tue, 28 Sep 2021 13:13:04 +0000 (21:13 +0800)]
Fix bug of get context user (#17169)

Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd delvh to MAINTAINERS (#17170)
delvh [Tue, 28 Sep 2021 12:28:12 +0000 (14:28 +0200)]
Add delvh to MAINTAINERS (#17170)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 28 Sep 2021 00:05:15 +0000 (00:05 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd nodeinfo endpoint for federation purposes (#16953)
techknowlogick [Mon, 27 Sep 2021 23:38:06 +0000 (19:38 -0400)]
Add nodeinfo endpoint for federation purposes (#16953)

Nodeinfo is a way to expose certain metadata about a server for use of discovery regarding functionality of its federation capabilities.

Two endpoints are required:
1. `/.well-known/nodeinfo` which informs client where it can find the location of the location of its metadata (including which version of the schema is used)
2. the endpoint which exposes the metadata in json format according to schema.

Notes:
* `openRegistrations` is a required field, but I propose to set to false as default in case someone writes a crawler to discover "open" gitea instances
* to limit data leakage I also propose to not include the `usage` field (note it is required so it should be included, but left as empty).

More info:
https://github.com/jhass/nodeinfo
https://github.com/jhass/nodeinfo/tree/main/schemas/2.1
http://nodeinfo.diaspora.software/protocol.html

3 years agoDon't return binary file changes in raw PR diffs by default (#17158)
Norwin [Mon, 27 Sep 2021 21:09:49 +0000 (23:09 +0200)]
Don't return binary file changes in raw PR diffs by default (#17158)

* return diffs without binary file content change

* ?binary=true option to restore old behaviour

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoNicely handle missing user in collaborations (#17049)
zeripath [Mon, 27 Sep 2021 18:07:19 +0000 (19:07 +0100)]
Nicely handle missing user in collaborations (#17049)

* Nicely handle missing user in collaborations

It is possible to have a collaboration in a repository which refers to a no-longer
existing user. This causes the repository transfer to fail with an unusual error.

This PR makes `repo.getCollaborators()` nicely handle the missing user by ghosting
the collaboration but also adds consistency check. It also adds an
Access consistency check.

Fix #17044

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
3 years agoCreate doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6 (#17136)
zeripath [Mon, 27 Sep 2021 15:55:12 +0000 (16:55 +0100)]
Create doctor command to fix repo_units broken by dumps from 1.14.3-1.14.6 (#17136)

There was a serious issue with the `gitea dump` command in 1.14.3-1.14.6 which led to corruption of the `config` field of the `repo_unit` table.

This PR adds a doctor command to attempt to fix the broken repo_units. Users affected by #16961 should run:

```
gitea doctor --fix --run fix-broken-repo-units
```

Fix #16961

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUse light/dark theme based on system preference (#17051)
Gwyneth Morgan [Mon, 27 Sep 2021 14:47:44 +0000 (07:47 -0700)]
Use light/dark theme based on system preference (#17051)

Add a new default theme `auto`, which will automatically switch between
`gitea` (light) and `arc-green` (dark) themes depending on the user's
operating system settings.

Closes: #8183
3 years agodocs: explain where are settings for release files (#17161)
Forest Johnson [Mon, 27 Sep 2021 13:00:54 +0000 (08:00 -0500)]
docs: explain where are settings for release files (#17161)

Just a tiny change to save someone some time while reading the docs. I got lost in the angular code and npm packages trying to reverse engineer it  and figure out what setting controlled this file limit:

![image](https://user-images.githubusercontent.com/7119703/134829716-8f587878-21a3-413b-ba1e-c2bbe9391ad2.png)

Eventually I tracked it down from

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/options/locale/locale_en-US.ini#L2776

to

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/templates/repo/upload.tmpl#L11

to

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/web_src/js/index.js#L1043

to

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/web_src/js/features/dropzone.js#L3

to

https://www.npmjs.com/package/dropzone

and then I realized I can't read :sweat_smile:,  back  to

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/templates/repo/upload.tmpl#L8

and quickly solved it from there!!

https://github.com/go-gitea/gitea/blob/b74a0f9060d5fda341f5554ef529a2006308c6ab/modules/upload/upload.go#L81

Yes  I know this long path was 90% me failing to read code properly and going on a red herring journey...  but point is we should not have to do this in the first place to know how to  configure this file upload form :pleading_face: :point_right: :point_left:

3 years agoSupport direct comparison (git diff a..b) as well merge comparison (a...b) (#16635)
zeripath [Mon, 27 Sep 2021 12:19:34 +0000 (13:19 +0100)]
Support direct comparison (git diff a..b) as well merge comparison (a...b) (#16635)

This PR changes the compare page to make the "..." in the between branches a clickable
link. This changes the comparison type from "..." to "..". Similarly it makes the
initial compare icon clickable to switch the head and base branches.

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 agoAllow LDAP Sources to provide Avatars (#16851)
zeripath [Mon, 27 Sep 2021 02:39:36 +0000 (03:39 +0100)]
Allow LDAP Sources to provide Avatars (#16851)

* Allow LDAP Sources to provide Avatars

Add setting to LDAP source to allow it to provide an Avatar.

Currently this is required to point to the image bytes.

Fix #4144

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Rename as Avatar Attribute (drop JPEG)

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Always synchronize avatar if there is change

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Actually get the avatar from the ldap

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* use len()>0 rather than != ""

Signed-off-by: Andrew Thornton <art27@cantab.net>
* slight shortcut in IsUploadAvatarChanged

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd SkipLocal2FA option to pam and smtp sources (#17078)
zeripath [Mon, 27 Sep 2021 01:02:01 +0000 (02:02 +0100)]
Add SkipLocal2FA option to pam and smtp sources (#17078)

* Add SkipLocal2FA option to other pam and smtp sources

Extend #16954 to allow setting skip local 2fa on pam and SMTP authentication sources

Signed-off-by: Andrew Thornton <art27@cantab.net>
* make SkipLocal2FA omitempty

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 26 Sep 2021 00:05:01 +0000 (00:05 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix bundle creation (#17079)
Alexey 〒erentyev [Sat, 25 Sep 2021 21:29:25 +0000 (00:29 +0300)]
Fix bundle creation (#17079)

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Gwyneth Morgan <87623694+gwymor@users.noreply.github.com>
Co-authored-by: Gwyneth Morgan <gwymor@tilde.club>
3 years agoFix wrong i18n keys (#17150)
Lunny Xiao [Sat, 25 Sep 2021 14:27:01 +0000 (22:27 +0800)]
Fix wrong i18n keys (#17150)

Co-authored-by: 6543 <6543@obermui.de>
3 years agoMove twofactor to models/login (#17143)
Lunny Xiao [Sat, 25 Sep 2021 13:00:12 +0000 (21:00 +0800)]
Move twofactor to models/login (#17143)

3 years agoForce color-adjust for markdown checkboxes (#17146)
sebastian-sauer [Sat, 25 Sep 2021 06:45:55 +0000 (08:45 +0200)]
Force color-adjust for markdown checkboxes (#17146)

this forces browsers to render background correctly

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

3 years agoPrevent panic in Org mode HighlightCodeBlock (#17140)
zeripath [Fri, 24 Sep 2021 13:29:32 +0000 (14:29 +0100)]
Prevent panic in Org mode HighlightCodeBlock (#17140)

When rendering source in org mode there is a mistake in the highlight code that
causes a panic.

This PR fixes this.

Fix #17139

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoMove login related structs and functions to models/login (#17093)
Lunny Xiao [Fri, 24 Sep 2021 11:32:56 +0000 (19:32 +0800)]
Move login related structs and functions to models/login (#17093)

* Move login related structs and functions to models/login

* Fix test

* Fix lint

* Fix lint

* Fix lint of windows

* Fix lint

* Fix test

* Fix test

* Only load necessary fixtures when preparing unit tests envs

* Fix lint

* Fix test

* Fix test

* Fix error log

* Fix error log

* Fix error log

* remove unnecessary change

* fix error log

* merge main branch

3 years agoUnify issue and pr subtitles (#17133)
crapStone [Thu, 23 Sep 2021 16:57:52 +0000 (18:57 +0200)]
Unify issue and pr subtitles (#17133)

3 years agoDBContext is just a Context (#17100)
zeripath [Thu, 23 Sep 2021 15:45:36 +0000 (16:45 +0100)]
DBContext is just a Context (#17100)

* DBContext is just a Context

This PR removes some of the specialness from the DBContext and makes it context
This allows us to simplify the GetEngine code to wrap around any context in future
and means that we can change our loadRepo(e Engine) functions to simply take contexts.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix unit tests

Signed-off-by: Andrew Thornton <art27@cantab.net>
* another place that needs to set the initial context

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* change attachment error

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix typo skipping a migration (#17130)
delvh [Thu, 23 Sep 2021 12:42:42 +0000 (14:42 +0200)]
Fix typo skipping a migration (#17130)

3 years agoFix commit status index problem (#17061)
Lunny Xiao [Thu, 23 Sep 2021 10:50:06 +0000 (18:50 +0800)]
Fix commit status index problem (#17061)

* Fix commit status index problem

* remove unused functions

* Add fixture and test for migration

* Fix lint

* Fix fixture

* Fix lint

* Fix test

* Fix bug

* Fix bug

3 years agoFix problem when database id is not increment as expected (#17124)
Lunny Xiao [Wed, 22 Sep 2021 20:09:29 +0000 (04:09 +0800)]
Fix problem when database id is not increment as expected (#17124)

3 years agorefactor: move from io/ioutil to io and os package (#17109)
Eng Zer Jun [Wed, 22 Sep 2021 05:38:34 +0000 (13:38 +0800)]
refactor: move from io/ioutil to io and os package (#17109)

The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoupdate docs to 1.15.3
techknowlogick [Wed, 22 Sep 2021 01:38:04 +0000 (21:38 -0400)]
update docs to 1.15.3

3 years agoChangelog 1.15.3 (#17091) (#17113)
6543 [Wed, 22 Sep 2021 01:32:45 +0000 (03:32 +0200)]
Changelog 1.15.3 (#17091) (#17113)

## [1.15.3](https://github.com/go-gitea/gitea/releases/tag/v1.15.3) - 2021-09-19

* ENHANCEMENTS
  * Add fluid to ui container class to remove margin (#16396) (#16976)
  * Add caller to cat-file batch calls (#17082) (#17089)
* BUGFIXES
  * Render full plain readme. (#17083) (#17090)
  * Upgrade xorm to v1.2.4 (#17059)
  * Fix bug of migrate comments which only fetch one page (#17055) (#17058)
  * Do not show issue context popup on external issues (#17050) (#17054)
  * Decrement Fork Num when converting from Fork (#17035) (#17046)
  * Correctly rollback in ForkRepository (#17034) (#17045)
  * Fix missing close in WalkGitLog (#17008) (#17009)
  * Add prefix to SVG id/class attributes (#16997) (#17000)
  * Fix bug of migrated repository not index (#16991) (#16996)
  * Skip AllowedUserVisibilityModes validation on update user if it is an organisation (#16988) (#16990)
  * Fix storage Iterate bug and Add storage doctor to delete garbage attachments (#16971) (#16977)
  * Fix issue with issue default mail template (#16956) (#16975)
  * Ensure that rebase conflicts are handled in updates (#16952) (#16960)
  * Prevent panic on diff generation (#16950) (#16951)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoMerge endpoints for pull diff/patch (#17104)
qwerty287 [Tue, 21 Sep 2021 23:04:53 +0000 (01:04 +0200)]
Merge endpoints for pull diff/patch (#17104)

this merges the two API endpoints for the PR diff/patch in to one

3 years agoAdd Horizontal scrollbar to inner menu on Chrome (#17086)
zeripath [Tue, 21 Sep 2021 08:35:28 +0000 (09:35 +0100)]
Add Horizontal scrollbar to inner menu on Chrome (#17086)

There is a longstanding bug whereby the admin pages, in particular, have not had
a horizontal scrollbar on chrome when the page is narrow.

This PR simply adds overflow-x and adds a default height to the scrollbar to
match that of the vertical bar.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoIgnore Sync errors on pipes when doing `CheckAttributeReader.CheckPath`, fix the...
wxiaoguang [Mon, 20 Sep 2021 19:46:51 +0000 (03:46 +0800)]
Ignore Sync errors on pipes when doing `CheckAttributeReader.CheckPath`, fix the hang of `git cat-file` (#17096)

* Ignore Sync errors on pipes when doing `CheckAttributeReader.CheckPath`

* apply env patch

* Drop the Sync and fix a number of issues with the Close function

Signed-off-by: Andrew Thornton <art27@cantab.net>
* add logs for DBIndexer and CheckPath

* Fix some more closing bugs

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add test case for language_stats

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update modules/indexer/stats/db.go

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd API to get commit diff/patch (#17095)
qwerty287 [Mon, 20 Sep 2021 16:14:29 +0000 (18:14 +0200)]
Add API to get commit diff/patch (#17095)

* Add API to get commit diff/patch
* Add Tests

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 20 Sep 2021 00:04:38 +0000 (00:04 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoMove db related basic functions to models/db (#17075)
Lunny Xiao [Sun, 19 Sep 2021 11:49:59 +0000 (19:49 +0800)]
Move db related basic functions to models/db (#17075)

* Move db related basic functions to models/db

* Fix lint

* Fix lint

* Fix test

* Fix lint

* Fix lint

* revert unnecessary change

* Fix test

* Fix wrong replace string

* Use *Context

* Correct committer spelling and fix wrong replaced words

Co-authored-by: zeripath <art27@cantab.net>
3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 19 Sep 2021 00:05:00 +0000 (00:05 +0000)]
[skip ci] Updated licenses and gitignores

3 years agoOpen the DingTalk link in browser (#17084)
wxiaoguang [Sat, 18 Sep 2021 19:35:23 +0000 (03:35 +0800)]
Open the DingTalk link in browser (#17084)

https://developers.dingtalk.com/document/app/message-link-description

To open the link in browser, we should use this URL: `"dingtalk://dingtalkclient/page/link?pc_slide=false&url=" + url.QueryEscape(singleURL)`

Otherwise the page is displayed inside DingTalk client, it makes users very difficult to visit non-public URLs in DingTalk webhook messages.

3 years agoAdd left padding for chunk header of split diff view (#13397)
Bagas Sanjaya [Sat, 18 Sep 2021 17:59:21 +0000 (00:59 +0700)]
Add left padding for chunk header of split diff view (#13397)

This commit adds 10px padding-left on chunk header element
(which is `<span>`).

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoSwitch migration icon to svg (#15954)
silverwind [Sat, 18 Sep 2021 16:22:51 +0000 (18:22 +0200)]
Switch migration icon to svg (#15954)

Followup on https://github.com/go-gitea/gitea/pull/15952, use SVG for migration icon.

<img width="541" alt="Screen Shot 2021-05-23 at 00 26 12" src="https://user-images.githubusercontent.com/115237/119242417-c1a37600-bb5d-11eb-9f97-a80aa89741ee.png">
<img width="540" alt="Screen Shot 2021-05-23 at 00 25 39" src="https://user-images.githubusercontent.com/115237/119242419-c2d4a300-bb5d-11eb-9792-1e6e4092c9f9.png">

3 years agoFixed issue where creating a reference of an issue would create a tag with the full...
Jelle Hulter [Sat, 18 Sep 2021 15:44:45 +0000 (17:44 +0200)]
Fixed issue where creating a reference of an issue would create a tag with the full name instead of the username if this is the default in the .ini file (#17074)

Adds an extra attribute to every issue comment containing the actual username, such that it can be used to tag the original author when clicking on "Reference in new issue" (#17073)

Fix #17073

3 years agoRender full plain readme. (#17083)
KN4CK3R [Sat, 18 Sep 2021 02:46:57 +0000 (04:46 +0200)]
Render full plain readme. (#17083)

3 years agoOpenAPI: correct documentation of issue listing parameters (#17060)
Norwin [Sat, 18 Sep 2021 01:01:50 +0000 (03:01 +0200)]
OpenAPI: correct documentation of issue listing parameters (#17060)

* correct documentation of issue listing parameters

* make generate-swagger

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd caller to cat-file batch calls (#17082)
zeripath [Sat, 18 Sep 2021 00:54:15 +0000 (01:54 +0100)]
Add caller to cat-file batch calls (#17082)

Some people still appear to report unclosed cat-files. This PR simply adds the caller
to the process descriptor for the CatFileBatch and CatFileBatchCheck calls.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>