]> source.dussan.org Git - gitea.git/log
gitea.git
2 years ago[skip ci] Updated translations via Crowdin v1.19.0-dev
techknowlogick [Wed, 26 Oct 2022 00:20:58 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRevert "Do not send notifications for draft releases (#21451)" (#21594) v1.18.0-rc0
techknowlogick [Tue, 25 Oct 2022 22:00:00 +0000 (18:00 -0400)]
Revert "Do not send notifications for draft releases (#21451)" (#21594)

This reverts commit a37e8b275d19c0daf160cc540d981ec4f3025a5a / #21451

Temporarily revert this PR to be able to continue discussion, and
potentially get it into 1.19.0

2 years agoChange `commits-table` column width (#21564)
KN4CK3R [Tue, 25 Oct 2022 17:00:37 +0000 (19:00 +0200)]
Change `commits-table` column width (#21564)

Fixes #21561

Before

![image](https://user-images.githubusercontent.com/20903656/197388658-0ea1d941-8bc7-4f10-b5db-4ece8602b13a.png)

After

![image](https://user-images.githubusercontent.com/20903656/197388665-78fb8421-105d-408d-84cf-a86b1cc61e2e.png)

2 years agoFix issues count bug (#21557)
Lunny Xiao [Tue, 25 Oct 2022 12:47:46 +0000 (20:47 +0800)]
Fix issues count bug (#21557)

fix #19349 , #19505

Co-authored-by: delvh <dev.lh@web.de>
2 years agoImprove code comment review on mobile (#21461)
Gusted [Tue, 25 Oct 2022 11:11:49 +0000 (11:11 +0000)]
Improve code comment review on mobile (#21461)

- Fix placement of avatar image, this was not placed in the
`comment-header-left` and add CSS to cover the limiting of width+height
of avatar for code-review comment on "Files changed" page. This fixes
the big noticeable avatar issue.
- Apply `margin-bottom` to the "next" button, so it's consistent with
the "previous" button.
- Make sure the "next"/"previous" start at `flex-start` on mobile and
not off-screen at `flex-end`. As well force them to have `flex: 1` so
they won't overflow on x-asis. This also requires the `width: 100%` for
the `.ui.buttons` div.
- Resolves #20074

### Before
<details><img width="512"
src="https://user-images.githubusercontent.com/25481501/195952930-09560cad-419f-43a3-a8a4-a4166c117994.jpg"></details>

### After
<details><img width="512"
src="https://user-images.githubusercontent.com/25481501/197340081-0365dfa8-4344-46b4-8702-a40c778c073f.jpg"></details>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2 years agoConsolidate remaining colors into variables (#21582)
silverwind [Tue, 25 Oct 2022 04:08:54 +0000 (06:08 +0200)]
Consolidate remaining colors into variables (#21582)

Remove remaining non-color variables in arc-green, so the theme is now
100% defined from variables (excluding inverts). Adjusted red/green to
match previous overwritten colors.

`--color-gold-light` is removed, it was unused and is not part of
fomantic colors.

<img width="772" alt="Screen Shot 2022-10-24 at 20 22 25"
src="https://user-images.githubusercontent.com/115237/197599339-1d1bf6e3-aa90-4f38-9753-24effd4b178d.png">
<img width="275" alt="Screen Shot 2022-10-24 at 20 25 52"
src="https://user-images.githubusercontent.com/115237/197599344-79c1d3ac-c709-4e30-a60b-4738af672c12.png">
<img width="446" alt="Screen Shot 2022-10-24 at 20 26 46"
src="https://user-images.githubusercontent.com/115237/197599346-f2ef6449-7efd-4f81-bbb6-e7bee4528f50.png">

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
Yarden Shoham [Tue, 25 Oct 2022 00:20:58 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd sqlite vscode extension to Gitpod configuration (#21552)
Yarden Shoham [Mon, 24 Oct 2022 20:55:59 +0000 (23:55 +0300)]
Add sqlite vscode extension to Gitpod configuration (#21552)

It allows for quick database inspections in the IDE.

![image](https://user-images.githubusercontent.com/20454870/197355299-222f5027-aba8-4fe2-b1d4-fff93d5ccb3c.png)

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
2 years agoReplace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551)
delvh [Mon, 24 Oct 2022 19:29:17 +0000 (21:29 +0200)]
Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) (#21551)

Found using
`find . -type f -name '*.go' -print -exec vim {} -c
':%s/fmt\.Errorf(\(.*\)%v\(.*\)err/fmt.Errorf(\1%w\2err/g' -c ':wq' \;`

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix package access for admins and inactive users (#21580)
KN4CK3R [Mon, 24 Oct 2022 19:23:25 +0000 (21:23 +0200)]
Fix package access for admins and inactive users (#21580)

I noticed an admin is not allowed to upload packages for other users
because `ctx.IsSigned` was not set.
I added a check for `user.IsActive` and `user.ProhibitLogin` too because
both was not checked. Tests enforce this now.

Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoAllow for resolution of NPM registry paths that match upstream (#21568)
Wayne Starr [Mon, 24 Oct 2022 13:50:22 +0000 (08:50 -0500)]
Allow for resolution of NPM registry paths that match upstream (#21568)

This PR fixes issue #21567 allowing for package tarball URLs to match
the upstream registry (and GitLab/JFrog Artifactory URLs). It uses a
regex to parse the filename (which contains the NPM version) and does a
fuzzy search to pull it out. The regex was built/expanded from
http://json.schemastore.org/package,
https://github.com/Masterminds/semver, and
https://docs.npmjs.com/cli/v6/using-npm/semver and is testable here:
https://regex101.com/r/OydBJq/5

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdded missing headers on user packages page (#21172)
Vladimir Yakovlev [Mon, 24 Oct 2022 12:01:05 +0000 (15:01 +0300)]
Added missing headers on user packages page (#21172)

User packages page had missing tabs.

![packages-2](https://user-images.githubusercontent.com/183965/190411160-c8138a8c-dbc4-4cf1-af2c-52497a10cee8.png)

![packages-1](https://user-images.githubusercontent.com/183965/190411155-af2cb398-c9a0-4fcc-adcd-1711aaa28345.png)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoRecord OAuth client type at registration (#21316)
M Hickford [Mon, 24 Oct 2022 07:59:24 +0000 (09:59 +0200)]
Record OAuth client type at registration (#21316)

The OAuth spec [defines two types of
client](https://datatracker.ietf.org/doc/html/rfc6749#section-2.1),
confidential and public. Previously Gitea assumed all clients to be
confidential.

> OAuth defines two client types, based on their ability to authenticate
securely with the authorization server (i.e., ability to
>   maintain the confidentiality of their client credentials):
>
>   confidential
> Clients capable of maintaining the confidentiality of their
credentials (e.g., client implemented on a secure server with
> restricted access to the client credentials), or capable of secure
client authentication using other means.
>
>   **public
> Clients incapable of maintaining the confidentiality of their
credentials (e.g., clients executing on the device used by the resource
owner, such as an installed native application or a web browser-based
application), and incapable of secure client authentication via any
other means.**
>
> The client type designation is based on the authorization server's
definition of secure authentication and its acceptable exposure levels
of client credentials. The authorization server SHOULD NOT make
assumptions about the client type.

 https://datatracker.ietf.org/doc/html/rfc8252#section-8.4

> Authorization servers MUST record the client type in the client
registration details in order to identify and process requests
accordingly.

Require PKCE for public clients:
https://datatracker.ietf.org/doc/html/rfc8252#section-8.1

> Authorization servers SHOULD reject authorization requests from native
apps that don't use PKCE by returning an error message

Fixes #21299

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoadapt README_{Country}.md stype name in localizedExtensions (#21486)
a1012112796 [Mon, 24 Oct 2022 06:12:15 +0000 (14:12 +0800)]
adapt README_{Country}.md stype name in localizedExtensions (#21486)

This stype name is also used in many repos, example:
[``README_ZH.md``](https://github.com/go-gitea/gitea/blob/main/README_ZH.md)

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years agodump: Add option to skip index dirs (#21501)
Johan Van de Wauw [Mon, 24 Oct 2022 03:19:21 +0000 (05:19 +0200)]
dump: Add option to skip index dirs (#21501)

closes #20683

Add an option to gitea dump to skip the bleve indexes, which can become
quite large (in my case the same size as the repo's) and can be
regenerated after restore.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoUse recommended vscode configuration in gitpod environments (#21537)
Yarden Shoham [Mon, 24 Oct 2022 01:24:33 +0000 (04:24 +0300)]
Use recommended vscode configuration in gitpod environments (#21537)

To make go tests run in gitpod, the vscode settings.json must be in the
correct place in the filesystem

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
2 years agoExpand "Go to File" button again, fix 'Add File' margin (#21543)
silverwind [Mon, 24 Oct 2022 01:23:04 +0000 (03:23 +0200)]
Expand "Go to File" button again, fix 'Add File' margin (#21543)

With https://github.com/go-gitea/gitea/pull/21428 we gained some space
so we are again able to show the "Go to File" button as text instead of
icon-only (the old icon was not particularily fitting anyways).

Before:
<img width="328" alt="image"
src="https://user-images.githubusercontent.com/115237/197334423-07731d9d-bf26-4aeb-95fa-490d9d0bf2a2.png">

After:
<img width="339" alt="Screen Shot 2022-10-22 at 12 28 01"
src="https://user-images.githubusercontent.com/115237/197334383-467c4107-09c9-4881-b75f-7f403eab7f3a.png">
<img width="413" alt="Screen Shot 2022-10-22 at 12 28 16"
src="https://user-images.githubusercontent.com/115237/197334384-f7d1fdda-a011-4138-ad1e-b52fc987501f.png">

2 years agoAdd yardenshoham to maintainers (#21566)
Yarden Shoham [Sun, 23 Oct 2022 16:09:21 +0000 (19:09 +0300)]
Add yardenshoham to maintainers (#21566)

[List of merged
PRs](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3Ayardenshoham+is%3Amerged)
(with many more on the way!)

Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoRefactor git command arguments and make all arguments to be safe to be used (#21535)
wxiaoguang [Sun, 23 Oct 2022 14:44:45 +0000 (22:44 +0800)]
Refactor git command arguments and make all arguments to be safe to be used (#21535)

Follow #21464

Make all git command arguments strictly safe. Most changes are one-to-one replacing, keep all existing logic.

2 years agoUpdate binding to fix bugs (#21556)
Lunny Xiao [Sun, 23 Oct 2022 10:50:48 +0000 (18:50 +0800)]
Update binding to fix bugs (#21556)

Fix #19698

2 years agoLink mentioned user in markdown only if they are visible to viewer (#21554)
Yarden Shoham [Sun, 23 Oct 2022 09:13:52 +0000 (12:13 +0300)]
Link mentioned user in markdown only if they are visible to viewer (#21554)

We need to make sure a user can't confirm the existence of a user with
private visibility

* Follow up on #21533

### Before
#### User

![image](https://user-images.githubusercontent.com/20454870/197357580-340911d7-1659-4fc9-a9f6-7ed6bc3476b4.png)

#### Admin

![image](https://user-images.githubusercontent.com/20454870/197357676-a8f0ae63-8f80-4221-a9b5-b6311552910a.png)

### After
#### User

![image](https://user-images.githubusercontent.com/20454870/197357536-05616edb-7821-469d-8e51-6f8cb84c1362.png)

#### Admin

![image](https://user-images.githubusercontent.com/20454870/197357703-071fe984-de79-43aa-a77c-a85b046292a4.png)

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoRequire authentication for OAuth token refresh (#21421)
M Hickford [Sun, 23 Oct 2022 05:28:46 +0000 (07:28 +0200)]
Require authentication for OAuth token refresh (#21421)

According to the OAuth spec
https://datatracker.ietf.org/doc/html/rfc6749#section-6 when "Refreshing
an Access Token"

> The authorization server MUST ... require client authentication for
confidential clients

Fixes #21418

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoCSS color enhancements (#21534)
silverwind [Sun, 23 Oct 2022 04:05:20 +0000 (06:05 +0200)]
CSS color enhancements (#21534)

- Add
[`accent-color`](https://developer.mozilla.org/en-US/docs/Web/CSS/accent-color)
which will change the color of various native HTML elements from
OS-color to specified one. Affects unstyled checkbox, radio, range and
progress
- Change `--color-accent` to `--color-primary-light-1`
- Change progress bar color to `--color-accent`
- Add new `--color-primary-contrast` meant to contrast over primary
- Avoid layout shift on clicking `.viewed-file-form`
- Add styles for `input[type=file]` upload button

<img width="301" alt="Screen Shot 2022-10-21 at 18 05 35"
src="https://user-images.githubusercontent.com/115237/197246896-7b3b5591-2934-4436-bf37-6aebcdfecb13.png">
<img width="98" alt="Screen Shot 2022-10-21 at 19 41 27"
src="https://user-images.githubusercontent.com/115237/197256892-c8fc6a0a-5d2f-4757-a98b-a79f9b7fcbc5.png">
<img width="93" alt="image"
src="https://user-images.githubusercontent.com/115237/197257029-293c02e9-ebf9-448a-a58f-ca418cf36953.png">
<img width="204" alt="Screen Shot 2022-10-21 at 18 21 24"
src="https://user-images.githubusercontent.com/115237/197246957-a99f5178-bbd5-4204-bd32-7a6977026f76.png">
<img width="449" alt="Screen Shot 2022-10-21 at 18 56 59"
src="https://user-images.githubusercontent.com/115237/197249305-d481abb7-9f16-4b48-936a-c75ed29f5b04.png">
<img width="449" alt="Screen Shot 2022-10-21 at 18 57 09"
src="https://user-images.githubusercontent.com/115237/197249309-7ab70c3b-325e-41bc-a4ba-07402c6826b6.png">

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAllow package version sorting (#21453)
KN4CK3R [Sun, 23 Oct 2022 01:18:15 +0000 (03:18 +0200)]
Allow package version sorting (#21453)

2 years agoAdd link to user profile in markdown mention only if user exists (#21533)
Yarden Shoham [Sat, 22 Oct 2022 17:15:52 +0000 (20:15 +0300)]
Add link to user profile in markdown mention only if user exists (#21533)

Previously mentioning a user would link to its profile, regardless of
whether the user existed. This change tests if the user exists and only
if it does - a link to its profile is added.

* Fixes #3444

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoUpdate milestone counters when issue is deleted (#21459)
Ashley Nelson [Sat, 22 Oct 2022 15:08:10 +0000 (10:08 -0500)]
Update milestone counters when issue is deleted (#21459)

When actions besides "delete" are performed on issues, the milestone
counter is updated. However, since deleting issues goes through a
different code path, the associated milestone's count wasn't being
updated, resulting in inaccurate counts until another issue in the same
milestone had a non-delete action performed on it.

I verified this change fixes the inaccurate counts using a local docker
build.

Fixes #21254

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoPrevent Authorization header for presigned LFS urls (#21531)
KN4CK3R [Sat, 22 Oct 2022 13:36:44 +0000 (15:36 +0200)]
Prevent Authorization header for presigned LFS urls (#21531)

Fixes #21525

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoRemove deleted repos from searchresult (#21512)
Raymond [Sat, 22 Oct 2022 09:23:20 +0000 (11:23 +0200)]
Remove deleted repos from searchresult (#21512)

This prevents a 500 response, because null pointer exceptions in
rendering the template.
This happends bc the repoId is not in the repoMap because it is delete

fix #19076

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoRemove unnecessary debug log (#21536)
Yarden Shoham [Sat, 22 Oct 2022 07:25:34 +0000 (10:25 +0300)]
Remove unnecessary debug log (#21536)

It distractingly shows up on unit tests

* Looks like a leftover from #20571

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdded check for disabled Packages (#21540)
rock2dust [Sat, 22 Oct 2022 03:24:09 +0000 (11:24 +0800)]
Added check for disabled Packages (#21540)

At the moment, If admin disable Packages, still show the Packages on the
admin dashboard

This patch added a check to hide the Packages entry

Signed-off-by: baronbunny <its@baronbunny.cn>
Signed-off-by: baronbunny <its@baronbunny.cn>
2 years agoDecouple HookTask from Repository (#17940)
KN4CK3R [Fri, 21 Oct 2022 16:21:56 +0000 (18:21 +0200)]
Decouple HookTask from Repository (#17940)

At the moment a repository reference is needed for webhooks. With the
upcoming package PR we need to send webhooks without a repository
reference. For example a package is uploaded to an organization. In
theory this enables the usage of webhooks for future user actions.

This PR removes the repository id from `HookTask` and changes how the
hooks are processed (see `services/webhook/deliver.go`). In a follow up
PR I want to remove the usage of the `UniqueQueue´ and replace it with a
normal queue because there is no reason to be unique.

Co-authored-by: 6543 <6543@obermui.de>
2 years agoAdd color previews in markdown (#21474)
Yarden Shoham [Fri, 21 Oct 2022 12:00:53 +0000 (15:00 +0300)]
Add color previews in markdown (#21474)

* Resolves #3047

Every time a color code will be in \`backticks`, a cute little color
preview will pop up

[Inspiration](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#supported-color-models)

#### Before

![image](https://user-images.githubusercontent.com/20454870/196631524-298afbbf-d2c8-4018-92a5-0393a693d850.png)

#### After

![image](https://user-images.githubusercontent.com/20454870/196631397-36c561e4-08f5-465a-a36e-76084e30b08a.png)

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoFix generating compare link (#21519)
Lunny Xiao [Fri, 21 Oct 2022 08:39:26 +0000 (16:39 +0800)]
Fix generating compare link (#21519)

Fix #6318

Co-authored-by: zeripath <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
Vladimir Yakovlev [Fri, 21 Oct 2022 00:21:01 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoCheck for valid user token in integration tests (#21520)
Vladimir Yakovlev [Thu, 20 Oct 2022 18:20:01 +0000 (21:20 +0300)]
Check for valid user token in integration tests (#21520)

Added checks for logged user token.

Some builds fail at unrelated tests, due to missing token.

Example:
https://drone.gitea.io/go-gitea/gitea/62011/2/14

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoIgnore error when retrieving changed PR review files (#21487)
delvh [Thu, 20 Oct 2022 08:29:40 +0000 (10:29 +0200)]
Ignore error when retrieving changed PR review files (#21487)

When a PR reviewer reviewed a file on a commit that was later gc'ed,
they would always get a `500` response from then on when loading the PR.
This PR simply ignores that error and instead marks all files as
unchanged.
This approach was chosen as the only feasible option without diving into
**a lot** of error handling.

Fixes #21392

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agomove invite by mail to services package (#21513)
6543 [Thu, 20 Oct 2022 03:23:31 +0000 (05:23 +0200)]
move invite by mail to services package (#21513)

followup  #20307
close #21511

-> make it easy to also add API equivalent later ...

2 years agoEnable Monaco automaticLayout (#21515)
silverwind [Thu, 20 Oct 2022 01:54:18 +0000 (03:54 +0200)]
Enable Monaco automaticLayout (#21515)

Enable
[`automaticLayout`](https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.IDiffEditorOptions.html#automaticLayout)
for monaco so it can reflow itself.

Fixes: https://github.com/go-gitea/gitea/issues/21508
2 years agoUpdate macOS install command (#21507)
RainboWu [Thu, 20 Oct 2022 01:30:21 +0000 (09:30 +0800)]
Update macOS install command (#21507)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
KN4CK3R [Thu, 20 Oct 2022 00:20:58 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoSuppress `ExternalLoginUserNotExist` error (#21504)
KN4CK3R [Wed, 19 Oct 2022 19:07:21 +0000 (21:07 +0200)]
Suppress `ExternalLoginUserNotExist` error (#21504)

Fixes #21202
Closes #21276

An `ExternalLoginUser` is not mandatory if the current user account was
created with/by the external login source.

2 years agoRevert increased width on pull pages (#21470)
Gusted [Wed, 19 Oct 2022 14:48:29 +0000 (14:48 +0000)]
Revert increased width on pull pages (#21470)

- Revert a behavior from #21012, which liberally added `fluid padded` to
non-split style pull pages, this caused it to take up the whole
screen(such in split-style pull pages) on pull pages where the diff was
shown.
- Resolves #21460

### Before

![image](https://user-images.githubusercontent.com/25481501/196005545-bb8370c1-330d-4d47-be52-6d0c93e61583.png)

![image](https://user-images.githubusercontent.com/25481501/196005546-0022198e-6ef7-45d1-958c-77a042e5f80b.png)

### After

![image](https://user-images.githubusercontent.com/25481501/196005572-76a38309-9a41-412a-854f-24eae2b9ae4f.png)

![image](https://user-images.githubusercontent.com/25481501/196005551-2495b93d-ad08-4f59-abba-c327dadcc915.png)

2 years agoAdd team member invite by email (#20307)
KN4CK3R [Wed, 19 Oct 2022 12:40:28 +0000 (14:40 +0200)]
Add team member invite by email (#20307)

Allows to add (not registered) team members by email.

related #5353

Invite by mail:

![grafik](https://user-images.githubusercontent.com/1666336/178154779-adcc547f-c0b7-4a2a-a131-4e41a3d9d3ad.png)

Pending invitations:

![grafik](https://user-images.githubusercontent.com/1666336/178154882-9d739bb8-2b04-46c1-a025-c1f4be26af98.png)

Email:

![grafik](https://user-images.githubusercontent.com/1666336/178164716-f2f90893-7ba6-4a5e-a3db-42538a660258.png)

Join form:

![grafik](https://user-images.githubusercontent.com/1666336/178154840-aaab983a-d922-4414-b01a-9b1a19c5cef7.png)

Co-authored-by: Jack Hay <jjphay@gmail.com>
2 years agoDisable the 'Add File' button when not able to edit repo (#21503)
silverwind [Wed, 19 Oct 2022 08:08:33 +0000 (10:08 +0200)]
Disable the 'Add File' button when not able to edit repo (#21503)

Previously, the button would render a dropdown with zero items when
`.CanEnableEditor` was false (for example on a mirror repo). Now it
disables the button instead which is better UX.

<img width="310" alt="image"
src="https://user-images.githubusercontent.com/115237/196546655-7262070d-dd8f-4fbe-ad5c-ecb443a9caef.png">
<img width="292" alt="image"
src="https://user-images.githubusercontent.com/115237/196546694-51ef5792-16d4-463d-aae8-7ef22dba6bb4.png">

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoRemove vitest globals (#21505)
silverwind [Wed, 19 Oct 2022 06:50:19 +0000 (08:50 +0200)]
Remove vitest globals (#21505)

Explicitly import them instead which is cleaner and enables better
editor integration.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix branch dropdown shifting on page load (#21428)
silverwind [Wed, 19 Oct 2022 05:39:55 +0000 (07:39 +0200)]
Fix branch dropdown shifting on page load (#21428)

Removed the "tag/branch" prefix and did some misc tweaks like changing to `<button>` for a11y and adding a bit of margin besides repo path.

2 years ago[skip ci] Updated translations via Crowdin
wxiaoguang [Wed, 19 Oct 2022 00:21:12 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRemove unnecessary misspell ignore pattern (#21475)
wxiaoguang [Tue, 18 Oct 2022 16:52:25 +0000 (00:52 +0800)]
Remove unnecessary misspell ignore pattern (#21475)

It doesn't make sense to ignore the pattern again and again.

2 years agoFix read system configuration bug when installing (#21489)
Lunny Xiao [Tue, 18 Oct 2022 15:16:58 +0000 (23:16 +0800)]
Fix read system configuration bug when installing (#21489)

Fix https://github.com/go-gitea/gitea/pull/18058#issuecomment-1280944311

Co-authored-by: 6543 <6543@obermui.de>
2 years agoFix viewing user subscriptions (#21482)
zenofile [Tue, 18 Oct 2022 08:01:02 +0000 (10:01 +0200)]
Fix viewing user subscriptions (#21482)

Fix enumeration of user subscriptions. `watch.mode` is not a boolean but
a smallint.

Fixes #21447
Regression of #17156

2 years agoMake every not exist error unwrappable to a fs.ErrNotExist (#20891)
zeripath [Tue, 18 Oct 2022 05:50:37 +0000 (06:50 +0100)]
Make every not exist error unwrappable to a fs.ErrNotExist (#20891)

A lot of our code is repeatedly testing if individual errors are
specific types of Not Exist errors. This is repetitative and unnecesary.
`Unwrap() error` provides a common way of labelling an error as a
NotExist error and we can/should use this.

This PR has chosen to use the common `io/fs` errors e.g.
`fs.ErrNotExist` for our errors. This is in some ways not completely
correct as these are not filesystem errors but it seems like a
reasonable thing to do and would allow us to simplify a lot of our code
to `errors.Is(err, fs.ErrNotExist)` instead of
`package.IsErr...NotExist(err)`

I am open to suggestions to use a different base error - perhaps
`models/db.ErrNotExist` if that would be felt to be better.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
2 years agoinline gitpod image (#21494)
techknowlogick [Tue, 18 Oct 2022 01:55:57 +0000 (21:55 -0400)]
inline gitpod image (#21494)

fix #21492

Co-authored-by: 6543 <6543@obermui.de>
2 years ago[skip ci] Updated translations via Crowdin
KN4CK3R [Tue, 18 Oct 2022 00:21:08 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoDo not send notifications for draft releases (#21451)
KN4CK3R [Mon, 17 Oct 2022 21:33:27 +0000 (23:33 +0200)]
Do not send notifications for draft releases (#21451)

Fixes #21448

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoUpdate reverse-proxies.zh-cn.md (#21484)
rock2dust [Mon, 17 Oct 2022 21:30:30 +0000 (05:30 +0800)]
Update reverse-proxies.zh-cn.md (#21484)

add proxy header to nginx config example
```
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
```
Signed-off-by: rock2dust <its@baronbunny.cn>
Signed-off-by: rock2dust <its@baronbunny.cn>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoDocs: Update the feature comparison to other Git Hosting Services (#20933)
delvh [Mon, 17 Oct 2022 21:29:57 +0000 (23:29 +0200)]
Docs: Update the feature comparison to other Git Hosting Services (#20933)

This was drastically outdated recently.

2 years agoAdd some api integration tests (#18872)
KN4CK3R [Mon, 17 Oct 2022 16:23:27 +0000 (18:23 +0200)]
Add some api integration tests (#18872)

depends on #18871

Added some api integration tests to help testing of #18798.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoprobe if sha before exec git (#21467)
6543 [Mon, 17 Oct 2022 14:40:37 +0000 (16:40 +0200)]
probe if sha before exec git (#21467)

2 years agoFix incorrect notification commit url (#21479)
wxiaoguang [Mon, 17 Oct 2022 04:58:20 +0000 (12:58 +0800)]
Fix incorrect notification commit url (#21479)

For normal commits the notification url was wrong because oldCommitID is received from the shrinked commits list.

This PR moves the commits list shrinking after the oldCommitID assignment.

2 years agoLocalize all timestamps (#21440)
Yarden Shoham [Mon, 17 Oct 2022 04:08:21 +0000 (07:08 +0300)]
Localize all timestamps (#21440)

Following
* #21410

We are now able to localize all timestamps. Some examples:

`short-date` format, French, user profile page:

![image](https://user-images.githubusercontent.com/20454870/195622461-aa0d5b93-f8df-42ad-881c-9c16606bf387.png)

`date-time` format, Portuguese, mirror repository settings page:

![image](https://user-images.githubusercontent.com/20454870/195623191-7a37d77c-4a02-4140-846d-f290a65ea21d.png)

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
Lunny Xiao [Mon, 17 Oct 2022 00:20:53 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAdd system setting table with cache and also add cache supports for user setting...
Lunny Xiao [Sun, 16 Oct 2022 23:29:26 +0000 (07:29 +0800)]
Add system setting table with cache and also add cache supports for user setting (#18058)

2 years agoReturn 404 when user is not found on avatar (#21476)
Gusted [Sun, 16 Oct 2022 18:48:17 +0000 (18:48 +0000)]
Return 404 when user is not found on avatar (#21476)

- Instead of returning a 500 Internal Server when the user wasn't found,
return 404 Not found

2 years agoEnforce grouped NuGet search results (#21442)
KN4CK3R [Sun, 16 Oct 2022 17:18:09 +0000 (19:18 +0200)]
Enforce grouped NuGet search results (#21442)

Fixes #21434

Added tests to enforce this behaviour.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoDisplay total commit count in hook message (#21400)
KN4CK3R [Sun, 16 Oct 2022 16:22:34 +0000 (18:22 +0200)]
Display total commit count in hook message (#21400)

Fixes #21379

The commits are capped by `setting.UI.FeedMaxCommitNum` so
`len(commits)` is not the correct number. So this PR adds a new
`TotalCommits` field.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoRefactor GetNextResourceIndex to make it work properly with transaction (#21469)
wxiaoguang [Sun, 16 Oct 2022 10:44:16 +0000 (18:44 +0800)]
Refactor GetNextResourceIndex to make it work properly with transaction (#21469)

Related:
* #21362

This PR uses a general and stable method to generate resource index (eg:
Issue Index, PR Index)

If the code looks good, I can add more tests

ps: please skip the diff, only have a look at the new code. It's
entirely re-written.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoSimplify fmt-check (#21458)
silverwind [Sun, 16 Oct 2022 08:11:17 +0000 (10:11 +0200)]
Simplify fmt-check (#21458)

`fmt-check` now simply does `fmt` before and relies on `git diff` like
other checks like 'tidy-check' already do, so we can remove the argument
in the tool that handles printing changed files.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoupdate current stable version
techknowlogick [Sun, 16 Oct 2022 02:04:25 +0000 (22:04 -0400)]
update current stable version

2 years ago1.17.3 changelog
techknowlogick [Sun, 16 Oct 2022 02:03:59 +0000 (22:03 -0400)]
1.17.3 changelog

2 years ago[skip ci] Updated translations via Crowdin
silverwind [Sun, 16 Oct 2022 00:20:58 +0000 (00:20 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix mermaid-related bugs (#21431)
silverwind [Sat, 15 Oct 2022 22:04:00 +0000 (00:04 +0200)]
Fix mermaid-related bugs (#21431)

2 years agoUpdate OpenRC startup script (#21436)
Lauris BH [Sat, 15 Oct 2022 21:59:52 +0000 (00:59 +0300)]
Update OpenRC startup script (#21436)

2 years agoUse own Go version instead of hardcoded 1.17 for `make fmt` (#21457)
Yarden Shoham [Sat, 15 Oct 2022 20:10:25 +0000 (23:10 +0300)]
Use own Go version instead of hardcoded 1.17 for `make fmt` (#21457)

We should make sure we're using the same version across the codebase.
* We upgraded in #19918 but forgot about the following line
https://github.com/go-gitea/gitea/blob/6bb6a108e0c03b323402b452fc05c6845f7d00df/build/code-batch-process.go#L273

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoAdd `code` highlighting in issue titles (#21432)
Yarden Shoham [Sat, 15 Oct 2022 18:24:41 +0000 (21:24 +0300)]
Add `code` highlighting in issue titles (#21432)

This changes the rendering logic of issue titles. If a substring in an
issue title is enclosed with a pair of backticks, it'll be rendered with
a monospace font (HTML `code` tag).

* Closes #20887

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoAdd wording about keeping PRs up-to-date in CONTRIBUTING.md (#21468)
Yarden Shoham [Sat, 15 Oct 2022 16:41:24 +0000 (19:41 +0300)]
Add wording about keeping PRs up-to-date in CONTRIBUTING.md (#21468)

Following a discord discussion from today I've written the policy
explained to me about keeping PRs up-to-date.

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years ago[refactor] Use const for wiki DefaultBranch (#21466)
6543 [Sat, 15 Oct 2022 14:40:32 +0000 (16:40 +0200)]
[refactor] Use const for wiki DefaultBranch (#21466)

just a nit, that will make it easier to change things and we now have a
single source of truth

2 years agoFollow improve code quality (#21465)
wxiaoguang [Sat, 15 Oct 2022 12:18:31 +0000 (20:18 +0800)]
Follow improve code quality (#21465)

After some discussion, introduce a new slice `brokenArgs` to make
`gitCmd.Run()` return errors if any dynamic argument is invalid.

Co-authored-by: delvh <dev.lh@web.de>
2 years agoalternative to PR "improve code quality" (#21464)
wxiaoguang [Sat, 15 Oct 2022 10:49:26 +0000 (18:49 +0800)]
alternative to PR "improve code quality" (#21464)

This PR doesn't require new git version, and can be backported easily.

Co-authored-by: 6543 <6543@obermui.de>
2 years ago[skip ci] Updated translations via Crowdin
Yarden Shoham [Sat, 15 Oct 2022 00:21:30 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix Drone pushing commits with wrong author info (#21450)
Yarden Shoham [Fri, 14 Oct 2022 19:09:04 +0000 (22:09 +0300)]
Fix Drone pushing commits with wrong author info (#21450)

I don't know how to test this so I'll explain my thought process:

After a discussion with @techknowlogick in
https://github.com/go-gitea/gitea/commit/cda2c38f4a61ef7f448be3efab5420d9974c8474
I saw the CI config has this block:

https://github.com/go-gitea/gitea/blob/cda2c38f4a61ef7f448be3efab5420d9974c8474/.drone.yml#L618-L630

I don't know much about Drone but after looking at
[appleboy/drone-git-push](https://github.com/appleboy/drone-git-push)'s
source code, I think each setting becomes an environment variable (e.g.
`remote` to `PLUGIN_REMOTE`, `commit_message` to `PLUGIN_COMMIT_MESSAGE`
etc...). Take a look at the code block loading the author info:

https://github.com/appleboy/drone-git-push/blob/a69878c00665277c53fb38d6c5980221cb687935/main.go#L32-L42

Two environment variables are listed for each setting. This PR forces
both to have the same value.

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
2 years agoAdd vitest tests to Gitpod (#21449)
Yarden Shoham [Fri, 14 Oct 2022 15:22:57 +0000 (18:22 +0300)]
Add vitest tests to Gitpod (#21449)

The vitest PR is merged, we can now add vitest to Gitpod's testing pane
* #21444

We couldn't use jest in the same manner because we had to customize
`NODE_OPTIONS`.

Screenshot (look at all the cool stuff circled in red):

![image](https://user-images.githubusercontent.com/20454870/195728971-9a2eaa80-8d91-4e4f-899b-a068edb9ff30.png)

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
2 years agoSwitch from jest to vitest (#21444)
silverwind [Fri, 14 Oct 2022 13:36:16 +0000 (15:36 +0200)]
Switch from jest to vitest (#21444)

Even if we are not bundling with `vite` yet, we can use `vitest` in
place of Jest which brings a few benefits like not requiring to use
`NODE_OPTIONS` to run and having sane module resolution.

It's possible to also use `jest-extended` with vitest, but I opted to
not do so for now because it brings heavyweight dependencies and it was
trivial to just rewrite the affected matchers to be compatible.

This PR also removes 153 JS dependencies, which is certainly nice.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoDiff file tree tweaks (#21446)
silverwind [Fri, 14 Oct 2022 09:43:25 +0000 (11:43 +0200)]
Diff file tree tweaks (#21446)

- Left-align the diff stat line again like previously.
- Default the file tree to collapsed view, which means the tree will
rendered initially collapsed and it may "pop in" via JS if enabled. I
think this is more desirable than having the empty space for the tree
"pop out" like it currently does.
- Mute the icon, removing color unless hovered.
- Increase icon size and vertically center it.

Before:
<img width="1271" alt="image"
src="https://user-images.githubusercontent.com/115237/195666451-55771595-0525-42b8-be1b-d03cc1cb2961.png">

After:
<img width="1280" alt="image"
src="https://user-images.githubusercontent.com/115237/195666385-c91fd0de-6dcc-4d9c-89ff-7581828fcf14.png">

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoAdd cynkra bronze sponsor (#21325)
Patrick Schratz [Fri, 14 Oct 2022 01:44:04 +0000 (03:44 +0200)]
Add cynkra bronze sponsor (#21325)

@techknowlogick

Only added a placeholder, the index is possibly wrong. But I think you
need to do/finalize that as the opencollective holder :)

You can take the logo of the opencollective account. LMK if I can help
more!

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
2 years agoRun `make fmt` (#21437)
Yarden Shoham [Fri, 14 Oct 2022 01:33:54 +0000 (04:33 +0300)]
Run `make fmt` (#21437)

The only change is what `make fmt` did, I am merely a vessel for its
glorious function

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
2 years agoRemove useless `appVer` from JS `window.config` (#21445)
wxiaoguang [Thu, 13 Oct 2022 17:16:27 +0000 (01:16 +0800)]
Remove useless `appVer` from JS `window.config` (#21445)

The only usage of `appVer` was in serviceworker.js, while indeed it
needs the asset version.

2 years agoAdd support for Chocolatey/NuGet v2 API (#21393)
KN4CK3R [Thu, 13 Oct 2022 10:19:39 +0000 (12:19 +0200)]
Add support for Chocolatey/NuGet v2 API (#21393)

Fixes #21294

This PR adds support for NuGet v2 API.

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix #21406: Hide repo information from file view/blame mode (#21420)
Neel [Thu, 13 Oct 2022 08:31:10 +0000 (14:01 +0530)]
Fix #21406: Hide repo information from file view/blame mode (#21420)

# Summary

The repo information such as description, stats and topics are getting
displayed in the top-bar when viewing a file. This has been fixed to
display the repo information only while navigating the repo and not
while viewing or blaming a file from the repo

## Before fix

Screenshot from the issue

![image](https://user-images.githubusercontent.com/47709856/195278543-9afbb735-7bd3-4f42-b3ba-da514c6989d2.png)

## After the fix

- **Repo homepage**

The repo description, topics and summary will be displayed

![image](https://user-images.githubusercontent.com/47709856/195443913-2ca967cd-6694-4a97-98d0-4d0750692b5d.png)

- **When opening a file**

The repo description, topic and summary has been conditionally hidden
from the view

<img width="1311" alt="image"
src="https://user-images.githubusercontent.com/47709856/195278964-9479231c-62ad-4c0e-b438-2018f22289db.png">

- **When running blame on a file**

> This was originally not part of the issue #21406. However the fix
seems relevant for the blame view as well.

<img width="1312" alt="image"
src="https://user-images.githubusercontent.com/47709856/195279619-02010775-aec3-4c8d-a184-d2d838c797e8.png">

- **From within a directory**

The repo description, topics and summary will not be displayed

![image](https://user-images.githubusercontent.com/47709856/195444080-ff5b2def-7e0f-47d7-b54a-7e9df5f9edd8.png)

Supporting integration tests have also been added.

2 years ago[skip ci] Updated translations via Crowdin
Yarden Shoham [Thu, 13 Oct 2022 00:21:26 +0000 (00:21 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoRespect user's locale when rendering the date range in the repo activity page (#21410)
Yarden Shoham [Wed, 12 Oct 2022 21:14:14 +0000 (00:14 +0300)]
Respect user's locale when rendering the date range in the repo activity page (#21410)

# Description
Previously, to make the date range understood by all, we used the format
"2006-01-02" for the dates as it's locale-generic.

This commit changes the rendering logic. Instead of rendering the date
on the server, we send a formatted computer-readable timestamp. The
client's javascript then renders it according to the user's locale.

This approach is reusable across the codebase, any `<time></time>` tag
with the data-format="date" attribute would get rendered according to
the user's chosen locale.

## Previous View

![image](https://user-images.githubusercontent.com/20454870/195099143-e1c5df86-282a-42f1-898f-a36bb5fe7c2f.png)

## New View

### English

![image](https://user-images.githubusercontent.com/20454870/195099301-5cda4eab-4012-49d5-97e5-b1f9cada9c06.png)

### French

![image](https://user-images.githubusercontent.com/20454870/195099434-ce23e394-8d65-4c4c-8ac8-8b96bc9044f3.png)

### Portuguese

![image](https://user-images.githubusercontent.com/20454870/195099559-9a7aed28-944a-45ec-bedb-64403e3faede.png)

### Italian

![image](https://user-images.githubusercontent.com/20454870/195099661-17758d55-3fe0-4797-879b-d45de0ee8ba3.png)

# References
* #21380
* #21387
* #21396

Inspiration:

I think either differentiating by class, or probably better by a custom
attribute such as `data-format` or similar, is the best course of
action.

_Originally posted by @delvh in
https://github.com/go-gitea/gitea/issues/21396#issuecomment-1274424788_

Resolves #21380

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2 years agoConsolidate more CSS colors into variables (#21402)
silverwind [Wed, 12 Oct 2022 16:26:27 +0000 (18:26 +0200)]
Consolidate more CSS colors into variables (#21402)

Move more colors into variables. The only real notable change is the dot
in the release timeline. Also, made the variable comments a bit more
clear.

<img width="279" alt="Screen Shot 2022-10-10 at 21 10 23"
src="https://user-images.githubusercontent.com/115237/194938496-e5a21056-67c4-4219-9c68-134b0edf0e61.png">

<img width="88" alt="Screen Shot 2022-10-10 at 21 31 53"
src="https://user-images.githubusercontent.com/115237/194939712-f666c43e-fb1a-4045-be52-1176391bd8ea.png">

<img width="90" alt="Screen Shot 2022-10-10 at 21 31 44"
src="https://user-images.githubusercontent.com/115237/194939710-2e620c06-75a9-41b7-a3e1-18eab7a57614.png">

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoAdd HEAD fix to gitea doctor (#21352)
Clar Fon [Wed, 12 Oct 2022 16:17:55 +0000 (12:17 -0400)]
Add HEAD fix to gitea doctor (#21352)

Due to a bug in presumably an older version of Gitea, multiple of my
repositories still have their HEADs pointing to a `master` branch while
the default branch on the UI is listed as `main`. This adds a `gitea
doctor` command that will fix all of the HEAD references for repos when
they're not synchronized with the default branch in the DB.

This will help with cloning to ensure that git automatically checks out
the right branch, instead of a nonexistent one.

Note: I'm not sure if I actually need to do more other than add a file
here. Will try testing this out on my server soon.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoContribution guidelines (#21425)
KN4CK3R [Wed, 12 Oct 2022 16:17:28 +0000 (18:17 +0200)]
Contribution guidelines (#21425)

Some changes to the contribution guidelines.

- I removed the `Large Character Comments` part because I think they are
bad design. They are used in big files to group sections of code. This
code should be organized into individual files.
- Updated some paths.
- Added `Documentation` because our documentation is not good at the
moment. We should enforce documentation of newly added features to help
our users.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoRefactor Gitpod configuration to improve quick spin up of automated dev environments...
Yarden Shoham [Wed, 12 Oct 2022 16:17:04 +0000 (19:17 +0300)]
Refactor Gitpod configuration to improve quick spin up of automated dev environments (#21411)

This commit instructs Gitpod to run `docs` in watch mode in fresh
development environments so any dev could start hacking in seconds.

Also included some vscode extensions for Vue, Go, and Docker.

Try it here:

[![Open in
Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/yardenshoham/gitea/tree/gitpod)

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
Co-authored-by: Gusted <williamzijl7@hotmail.com>
2 years agoSupport instance-wide OAuth2 applications (#21335)
qwerty287 [Wed, 12 Oct 2022 14:08:29 +0000 (16:08 +0200)]
Support instance-wide OAuth2 applications (#21335)

Support OAuth2 applications created by admins on the admin panel, they
aren't owned by anybody.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
2 years agoCase-insensitive NuGet symbol file GUID (#21409)
Hubert Wawrzyńczyk [Wed, 12 Oct 2022 06:53:56 +0000 (08:53 +0200)]
Case-insensitive NuGet symbol file GUID (#21409)

NuGet symbol file lookup returned 404 on Visual Studio 2019 due to
case-sensitive api router. The api router should accept case-insensitive GUID.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoAdd generic set type (#21408)
KN4CK3R [Wed, 12 Oct 2022 05:18:26 +0000 (07:18 +0200)]
Add generic set type (#21408)

This PR adds a generic set type to get rid of maps used as sets.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoImprove OAuth integration tests (#21390)
M Hickford [Wed, 12 Oct 2022 04:22:43 +0000 (05:22 +0100)]
Improve OAuth integration tests (#21390)

In particular, test explicit error responses.

No change to behaviour.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoMake e-mail sanity check more precise (#20991)
Andreas Fischer [Wed, 12 Oct 2022 02:44:09 +0000 (04:44 +0200)]
Make e-mail sanity check more precise (#20991)

For security reasons, all e-mail addresses starting with
non-alphanumeric characters were rejected. This is too broad and rejects
perfectly valid e-mail addresses. Only leading hyphens should be
rejected -- in all other cases e-mail address specification should
follow RFC 5322.

Co-authored-by: Andreas Fischer <_@ndreas.de>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoFix broken link to frontend guidelines in hacking guidelines (#21382)
Yarden Shoham [Wed, 12 Oct 2022 01:23:21 +0000 (04:23 +0300)]
Fix broken link to frontend guidelines in hacking guidelines (#21382)