]> source.dussan.org Git - gitea.git/log
gitea.git
20 months agoImprove error report when user passes a private key (#22726)
zeripath [Thu, 2 Feb 2023 18:25:54 +0000 (18:25 +0000)]
Improve error report when user passes a private key (#22726)

The error reported when a user passes a private ssh key as their ssh
public key is not very nice.

This PR improves this slightly.

Ref #22693

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
20 months agoAdd some comments for recent code (#22725)
wxiaoguang [Thu, 2 Feb 2023 17:39:38 +0000 (01:39 +0800)]
Add some comments for recent code (#22725)

When using the main branch, I found that some changed code didn't have
comments.

This PR adds some comments.

20 months agoFix actions workflow branches match bug (#22724)
Lunny Xiao [Thu, 2 Feb 2023 12:40:08 +0000 (20:40 +0800)]
Fix actions workflow branches match bug (#22724)

caused by #22680

`pushPayload.Ref` and `prPayload.PullRequest.Base.Ref` have the format
like `refs/heads/<branch_name>`, so we need to trim the prefix before
comparing.

20 months agoFix group filter for ldap source sync (#22506)
Pavel Ezhov [Thu, 2 Feb 2023 07:45:00 +0000 (10:45 +0300)]
Fix group filter for ldap source sync (#22506)

There are 2 separate flows of creating a user: authentication and source
sync.
When a group filter is defined, source sync ignores group filter, while
authentication respects it.
With this PR I've fixed this behavior, so both flows now apply this
filter when searching users in LDAP in a unified way.

- Unified LDAP group membership lookup for authentication and source
sync flows
- Replaced custom group membership lookup (used for authentication flow)
with an existing listLdapGroupMemberships method (used for source sync
flow)
- Modified listLdapGroupMemberships and getUserAttributeListedInGroup in
a way group lookup could be called separately
- Added user filtering based on a group membership for a source sync
- Added tests to cover this logic

Co-authored-by: Pavel Ezhov <paejov@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoset user dashboard org visibility to basic (#22706)
yp05327 [Thu, 2 Feb 2023 06:53:14 +0000 (15:53 +0900)]
set user dashboard org visibility to basic (#22706)

Same to https://github.com/go-gitea/gitea/pull/22674 and
https://github.com/go-gitea/gitea/pull/22605

Sorry to create 3 PR to fix this.
I checked all span with class `org-visibility`, i think this is the last
one :)

And I found that private/limited user has no private/limited tag in
dashboard. but org does.
If it is ok i will add this feature in another pr.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoFix diff UI for unexpandable items (#22700)
wxiaoguang [Thu, 2 Feb 2023 05:39:55 +0000 (13:39 +0800)]
Fix diff UI for unexpandable items (#22700)

Follows #21094

Before:

There are 2 problems:

1. Sometimes, the header starts with a number, sometimes, it starts with
an icon button. It makes the UI look like misaligned.
2. The second item's bottom border is too thick (actually, that's an
empty element with border, which should be hidden as well)
3. (An old problem) the number is not mono-font

![image](https://user-images.githubusercontent.com/2114189/215935944-003fe2d3-69bf-413c-bbae-0a4668a508c3.png)

After:

Fix above problems.

![image](https://user-images.githubusercontent.com/2114189/215944811-b867a20c-110c-47a2-aa52-572a8162a44d.png)

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
20 months agoFix line spacing for plaintext previews (#22699)
crystal [Thu, 2 Feb 2023 04:51:02 +0000 (21:51 -0700)]
Fix line spacing for plaintext previews (#22699)

Adding `<br>` between each line is not necessary since the entire file
is rendered inside a `<pre>`

fixes https://codeberg.org/Codeberg/Community/issues/915

20 months agoSmall refactor for loading PRs (#22652)
Lunny Xiao [Thu, 2 Feb 2023 03:49:28 +0000 (11:49 +0800)]
Small refactor for loading PRs (#22652)

20 months agoAllow setting access token scope by CLI (#22648)
Lukas [Thu, 2 Feb 2023 03:10:37 +0000 (04:10 +0100)]
Allow setting access token scope by CLI (#22648)

Followup for #20908 to allow setting the scopes when creating new access
token via CLI.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
20 months agoAdd main landmark to templates and adjust titles (#22670)
Felipe Leopoldo Sologuren Gutiérrez [Wed, 1 Feb 2023 22:56:10 +0000 (19:56 -0300)]
Add main landmark to templates and adjust titles (#22670)

* Add main aria landmark to templates
 * Adjust some titles to improve understanding of location in navigation

Contributed by @Forgejo

20 months agoFix cache-control header clearing comment text when editing issue (#22604)
Brecht Van Lommel [Wed, 1 Feb 2023 21:28:06 +0000 (22:28 +0100)]
Fix cache-control header clearing comment text when editing issue (#22604)

The `no-store` cache control added in #20432 is causing form input to be
cleared unnecessarily on page reload. Instead use
`max-age=0,private,must-revalidate` which avoids this.

This was particularly a problem when typing a long comment for an issue
and then for example changing the label. The page would be reloaded and
lose the unsubmitted comment.

Fixes #22603

20 months agoEnable `@<user>`- completion popup on the release description textarea (#22359)
delvh [Wed, 1 Feb 2023 19:14:40 +0000 (20:14 +0100)]
Enable `@<user>`- completion popup on the release description textarea (#22359)

For some unknown reason, this was previously disabled.
Additionally removed an unused return value.

20 months agoAdd Conda package registry (#22262)
KN4CK3R [Wed, 1 Feb 2023 18:30:39 +0000 (19:30 +0100)]
Add Conda package registry (#22262)

This PR adds a [Conda](https://conda.io/) package registry.

20 months agoAdd user secrets (#22191)
KN4CK3R [Wed, 1 Feb 2023 12:53:04 +0000 (13:53 +0100)]
Add user secrets (#22191)

Fixes #22183
Replaces #22187

This PR adds secrets for users. I refactored the files for organizations
and repos to use the same logic and templates. I splitted the secrets
from deploy keys again and reverted the fix from #22187.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoAdd missing close bracket in imagediff (#22710)
zeripath [Wed, 1 Feb 2023 11:48:35 +0000 (11:48 +0000)]
Add missing close bracket in imagediff (#22710)

There was a missing `]` in imagediff.js:

```
const $range = $container.find("input[type='range'");
```

This PR simply adds this.

Fix #22702

20 months agoExplain that the no-access team unit does not affect public repositories (#22661)
yp05327 [Wed, 1 Feb 2023 08:14:40 +0000 (17:14 +0900)]
Explain that the no-access team unit does not affect public repositories (#22661)

Fixes https://github.com/go-gitea/gitea/issues/22600

Add explanations to team unit access control.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
20 months agoFix bugs with WebAuthn preventing sign in and registration. (#22651)
zeripath [Wed, 1 Feb 2023 07:24:10 +0000 (07:24 +0000)]
Fix bugs with WebAuthn preventing sign in and registration. (#22651)

This PR fixes two bugs with Webauthn support:

* There was a longstanding bug within webauthn due to the backend using
URLEncodedBase64 but the javascript using decoding using plain base64.
This causes intermittent issues with users reporting decoding errors.
* Following the recent upgrade to webauthn there was a change in the way
the library expects RPOrigins to be configured. This leads to the
Relying Party Origin not being configured and prevents registration.

Fix #22507

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
20 months agoAdd more events details supports for actions (#22680)
Lunny Xiao [Wed, 1 Feb 2023 05:32:46 +0000 (13:32 +0800)]
Add more events details supports for actions (#22680)

#21937 implemented only basic events based on name because of `act`'s
limitation. So I sent a PR to parse all possible events details in
https://gitea.com/gitea/act/pulls/11 and it merged. The ref
documentation is
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows

This PR depends on that and make more detail responses for `push` events
and `pull_request` events. And it lefts more events there for future
PRs.

---------

Co-authored-by: Jason Song <i@wolfogre.com>
20 months agoImprove checkbox accessibility a bit by adding the title attribute (#22593)
Felipe Leopoldo Sologuren Gutiérrez [Wed, 1 Feb 2023 01:43:06 +0000 (22:43 -0300)]
Improve checkbox accessibility a bit by adding the title attribute (#22593)

EDIT: The main change of this PR was resolved by #22599. This
complements that PR for some cases without label and complicated layout
to be added.

NOTE: Contributed by @Forgejo.

20 months agoAdd repository setting to enable/disable releases unit (#22671)
Brecht Van Lommel [Wed, 1 Feb 2023 01:31:19 +0000 (02:31 +0100)]
Add repository setting to enable/disable releases unit (#22671)

To go along with similar settings for issues, pulls, projects, packages.

20 months agoUse relative url in actions view (#22675)
Jason Song [Tue, 31 Jan 2023 22:46:10 +0000 (06:46 +0800)]
Use relative url in actions view (#22675)

Use relative url in actions view.

20 months agoFix ref to trigger Actions (#22679)
Jason Song [Tue, 31 Jan 2023 22:45:25 +0000 (06:45 +0800)]
Fix ref to trigger Actions (#22679)

If triggered by PR, the ref should be `pull/<index>/head` instead of
`repo.DefaultBranch`.

And improve UI:

<img width="493" alt="image"
src="https://user-images.githubusercontent.com/9418365/215731280-312564f2-2450-45d0-b986-1accb0670976.png">

Related to #21937.

20 months agoRootless Docker - Mistake with the repo-avatars parent folder name (#22637)
Melroy van den Berg [Tue, 31 Jan 2023 22:42:48 +0000 (23:42 +0100)]
Rootless Docker - Mistake with the repo-avatars parent folder name (#22637)

There was a mistake when choosing the structure for the repo avatars parent folder and it added a spurious /gitea.

The `data` directory should contain folders like:

  - `attachments/`
  - `avatars/`
  - `log/`
  - `repo-avatars/`

20 months agoFix missing title and filter in issue sidebar project menu (#22557)
Brecht Van Lommel [Tue, 31 Jan 2023 22:40:38 +0000 (23:40 +0100)]
Fix missing title and filter in issue sidebar project menu (#22557)

These exist in the new issue form but were seemingly forgotten here.

20 months agoFix wrong hint when deleting a branch successfully from pull request UI (#22673)
Lunny Xiao [Tue, 31 Jan 2023 22:11:48 +0000 (06:11 +0800)]
Fix wrong hint when deleting a branch successfully from pull request UI (#22673)

Fix #18785

20 months agoAdd Contributed backport command (#22643)
zeripath [Tue, 31 Jan 2023 22:10:54 +0000 (22:10 +0000)]
Add Contributed backport command (#22643)

This PR provides a contributed backport command to help create backports
for Gitea.

It represents a significant improvement on my previously described
shell-script.

It can be installed using `go install contrib/backport/backport.go`.

Signed-off-by: Andrew Thornton <art27@cantab.net>
20 months agoFix typo in command-line.en-us.md (#22681)
Ivan Maximov [Tue, 31 Jan 2023 21:43:39 +0000 (00:43 +0300)]
Fix typo in command-line.en-us.md (#22681)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoFix typo in linked-references.en-us.md (#22682)
Ivan Maximov [Tue, 31 Jan 2023 21:43:27 +0000 (00:43 +0300)]
Fix typo in linked-references.en-us.md (#22682)

20 months agoFix typo in guidelines-backend.en-us.md (#22690)
Ivan Maximov [Tue, 31 Jan 2023 21:43:12 +0000 (00:43 +0300)]
Fix typo in guidelines-backend.en-us.md (#22690)

20 months agoFix typo in storage.en-us.md (#22694)
Ivan Maximov [Tue, 31 Jan 2023 21:42:41 +0000 (00:42 +0300)]
Fix typo in storage.en-us.md (#22694)

20 months agoHide collapse icon in diff with no lines (#21094)
JakobDev [Tue, 31 Jan 2023 17:40:22 +0000 (18:40 +0100)]
Hide collapse icon in diff with no lines (#21094)

Sometimes (e.g. renaming a file) nothing of the content is changed. In
this case, it makes no sense to show the collapse icon in a diff.

20 months agoFixes accessibility behavior of Watching, Staring and Fork buttons (#22634)
Felipe Leopoldo Sologuren Gutiérrez [Tue, 31 Jan 2023 15:28:43 +0000 (12:28 -0300)]
Fixes accessibility behavior of Watching, Staring and Fork buttons (#22634)

Add tabindex to buttons of repository views.

20 months agoDisable test for incoming email (#22686)
KN4CK3R [Tue, 31 Jan 2023 13:56:22 +0000 (14:56 +0100)]
Disable test for incoming email (#22686)

Disable this test for the moment because the used imap container image
seems unstable which results in many failed CI builds.

Co-authored-by: Jason Song <i@wolfogre.com>
20 months agoRemove label color from global issue filters (#22660)
Francesco Siddi [Tue, 31 Jan 2023 12:58:34 +0000 (13:58 +0100)]
Remove label color from global issue filters (#22660)

The use of ui colors (red, green, etc) should be limited to actionable
or dismissable entries. Before this commit, a green/red label was used
to display issues count on each repository. This did not add any
meaningful information to the list.

Removing the label reduces ambiguity and makes the list easier to scan
visually.

![label_compare](https://user-images.githubusercontent.com/451841/215360696-a881b765-207d-4ffa-8bec-398f8e5dab1e.jpg)

---------

Co-authored-by: delvh <dev.lh@web.de>
20 months agoUse correct captured group range when parsing cross-reference (#22672)
wxiaoguang [Tue, 31 Jan 2023 09:08:05 +0000 (17:08 +0800)]
Use correct captured group range when parsing cross-reference (#22672)

Fixes #22666 (Replace #22668)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: zeripath <art27@cantab.net>
20 months agoset user visibility class to basic (#22674)
yp05327 [Tue, 31 Jan 2023 07:05:25 +0000 (16:05 +0900)]
set user visibility class to basic (#22674)

Same to https://github.com/go-gitea/gitea/pull/22605

![user
package](https://user-images.githubusercontent.com/18380374/215669905-71fe01c3-c011-4867-97a6-3df5f940a6bf.PNG)
![user
projects](https://user-images.githubusercontent.com/18380374/215669909-1a4f74f1-bbde-4913-9ba5-51c44cc63862.PNG)

These two page are both used at user and org, so if i fixed the org
page, the user page will be also be fixed.

20 months agoFix README TOC links (#22577)
crystal [Tue, 31 Jan 2023 05:21:29 +0000 (22:21 -0700)]
Fix README TOC links (#22577)

Fixes anchored markup links by adding `user-content-` (which is
prepended to IDs)

Closes https://codeberg.org/Codeberg/Community/issues/894

20 months agoImplement actions (#21937)
Jason Song [Tue, 31 Jan 2023 01:45:19 +0000 (09:45 +0800)]
Implement actions (#21937)

Close #13539.

Co-authored by: @lunny @appleboy @fuxiaohei and others.

Related projects:
- https://gitea.com/gitea/actions-proto-def
- https://gitea.com/gitea/actions-proto-go
- https://gitea.com/gitea/act
- https://gitea.com/gitea/act_runner

### Summary

The target of this PR is to bring a basic implementation of "Actions",
an internal CI/CD system of Gitea. That means even though it has been
merged, the state of the feature is **EXPERIMENTAL**, and please note
that:

- It is disabled by default;
- It shouldn't be used in a production environment currently;
- It shouldn't be used in a public Gitea instance currently;
- Breaking changes may be made before it's stable.

**Please comment on #13539 if you have any different product design
ideas**, all decisions reached there will be adopted here. But in this
PR, we don't talk about **naming, feature-creep or alternatives**.

### ⚠️ Breaking

`gitea-actions` will become a reserved user name. If a user with the
name already exists in the database, it is recommended to rename it.

### Some important reviews

- What is `DEFAULT_ACTIONS_URL` in `app.ini` for?
  - https://github.com/go-gitea/gitea/pull/21937#discussion_r1055954954
- Why the api for runners is not under the normal `/api/v1` prefix?
  - https://github.com/go-gitea/gitea/pull/21937#discussion_r1061173592
- Why DBFS?
  - https://github.com/go-gitea/gitea/pull/21937#discussion_r1061301178
- Why ignore events triggered by `gitea-actions` bot?
  - https://github.com/go-gitea/gitea/pull/21937#discussion_r1063254103
- Why there's no permission control for actions?
  - https://github.com/go-gitea/gitea/pull/21937#discussion_r1090229868

### What it looks like

<details>

#### Manage runners

<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205870657-c72f590e-2e08-4cd4-be7f-2e0abb299bbf.png">

#### List runs

<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205872794-50fde990-2b45-48c1-a178-908e4ec5b627.png">

#### View logs

<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205872501-9b7b9000-9542-4991-8f55-18ccdada77c3.png">

</details>

### How to try it

<details>

#### 1. Start Gitea

Clone this branch and [install from
source](https://docs.gitea.io/en-us/install-from-source).

Add additional configurations in `app.ini` to enable Actions:

```ini
[actions]
ENABLED = true
```

Start it.

If all is well, you'll see the management page of runners:

<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205877365-8e30a780-9b10-4154-b3e8-ee6c3cb35a59.png">

#### 2. Start runner

Clone the [act_runner](https://gitea.com/gitea/act_runner), and follow
the
[README](https://gitea.com/gitea/act_runner/src/branch/main/README.md)
to start it.

If all is well, you'll see a new runner has been added:

<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205878000-216f5937-e696-470d-b66c-8473987d91c3.png">

#### 3. Enable actions for a repo

Create a new repo or open an existing one, check the `Actions` checkbox
in settings and submit.

<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205879705-53e09208-73c0-4b3e-a123-2dcf9aba4b9c.png">
<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205879383-23f3d08f-1a85-41dd-a8b3-54e2ee6453e8.png">

If all is well, you'll see a new tab "Actions":

<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205881648-a8072d8c-5803-4d76-b8a8-9b2fb49516c1.png">

#### 4. Upload workflow files

Upload some workflow files to `.gitea/workflows/xxx.yaml`, you can
follow the [quickstart](https://docs.github.com/en/actions/quickstart)
of GitHub Actions. Yes, Gitea Actions is compatible with GitHub Actions
in most cases, you can use the same demo:

```yaml
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
  Explore-GitHub-Actions:
    runs-on: ubuntu-latest
    steps:
      - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
      - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
      - name: Check out repository code
        uses: actions/checkout@v3
      - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
      - run: echo "🖥️ The workflow is now ready to test your code on the runner."
      - name: List files in the repository
        run: |
          ls ${{ github.workspace }}
      - run: echo "🍏 This job's status is ${{ job.status }}."
```

If all is well, you'll see a new run in `Actions` tab:

<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205884473-79a874bc-171b-4aaf-acd5-0241a45c3b53.png">

#### 5. Check the logs of jobs

Click a run and you'll see the logs:

<img width="1792" alt="image"
src="https://user-images.githubusercontent.com/9418365/205884800-994b0374-67f7-48ff-be9a-4c53f3141547.png">

#### 6. Go on

You can try more examples in [the
documents](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions)
of GitHub Actions, then you might find a lot of bugs.

Come on, PRs are welcome.

</details>

See also: [Feature Preview: Gitea
Actions](https://blog.gitea.io/2022/12/feature-preview-gitea-actions/)

---------

Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: ChristopherHX <christopher.homberger@web.de>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
20 months agoPull request yaml template support for including commit body in a field (#22629)
Brecht Van Lommel [Mon, 30 Jan 2023 14:39:07 +0000 (15:39 +0100)]
Pull request yaml template support for including commit body in a field (#22629)

When using a markdown template the commit body is prepended to text in
the description. This adds the same functionality for yaml templates,
adding the commit message in a field with id "body".

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoDon't return duplicated users who can create org repo (#22560)
Gusted [Mon, 30 Jan 2023 10:12:45 +0000 (11:12 +0100)]
Don't return duplicated users who can create org repo (#22560)

- Currently the function `GetUsersWhoCanCreateOrgRepo` uses a query that
is able to have duplicated users in the result, this is can happen under
the condition that a user is in team that either is the owner team or
has permission to create organization repositories.
- Add test code to simulate the above condition for user 3,
[`TestGetUsersWhoCanCreateOrgRepo`](https://github.com/go-gitea/gitea/blob/a1fcb1cfb84fd6b36c8fe9fd56588119fa4377bc/models/organization/org_test.go#L435)
is the test function that tests for this.
- The fix is quite trivial use a map keyed by user id in order to drop
duplicates.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoFix poor alignment of organization description on organization home page (#22656)
Brecht Van Lommel [Mon, 30 Jan 2023 08:16:12 +0000 (09:16 +0100)]
Fix poor alignment of organization description on organization home page (#22656)

Don't generate nested `<p>`, use `<div>` like description on the user
profile page.

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoIssues: support setting issue template field values with query (#22545)
techknowlogick [Mon, 30 Jan 2023 04:36:04 +0000 (23:36 -0500)]
Issues: support setting issue template field values with query (#22545)

20 months agoAdd support for commit cross references (#22645)
KN4CK3R [Mon, 30 Jan 2023 01:50:01 +0000 (02:50 +0100)]
Add support for commit cross references (#22645)

Fixes #22628

This PR adds cross references for commits by using the format
`owner/repo@commit` . References are rendered like
[go-gitea/lgtm@6fe88302](#dummy).

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoFix missing message in git hook when pull requests disabled on fork (#22625)
Brecht Van Lommel [Sun, 29 Jan 2023 21:00:10 +0000 (22:00 +0100)]
Fix missing message in git hook when pull requests disabled on fork (#22625)

And also the other way around, it would show an non-working URL in the
message when pull requests are disabled on the base repository but
enabled on the fork.

20 months agoCheck quota limits for container uploads (#22450)
KN4CK3R [Sun, 29 Jan 2023 17:34:29 +0000 (18:34 +0100)]
Check quota limits for container uploads (#22450)

The test coverage has revealed that container packages were not checked
against the quota limits.

20 months agoConsume hcaptcha and pwn deps (#22610)
John Olheiser [Sun, 29 Jan 2023 15:49:51 +0000 (09:49 -0600)]
Consume hcaptcha and pwn deps (#22610)

This PR just consumes the
[hcaptcha](https://gitea.com/jolheiser/hcaptcha) and
[haveibeenpwned](https://gitea.com/jolheiser/pwn) modules directly into
Gitea.

Also let this serve as a notice that I'm fine with transferring my
license (which was already MIT) from my own name to "The Gitea Authors".

Signed-off-by: jolheiser <john.olheiser@gmail.com>
20 months agoIssues: add Project filter to issues list and search (#22544)
techknowlogick [Sun, 29 Jan 2023 03:45:29 +0000 (22:45 -0500)]
Issues: add Project filter to issues list and search (#22544)

Currently only a single project like milestone, not multiple like
labels.

Implements #14298

Code by @brechtvl

---------

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
20 months agoImprove accessibility of navigation bar and footer (#22635)
Felipe Leopoldo Sologuren Gutiérrez [Sun, 29 Jan 2023 01:29:10 +0000 (22:29 -0300)]
Improve accessibility of navigation bar and footer (#22635)

Added ARIA navigation landmark to navigation bar and aria label for both
nav bar and footer.

Contributed by @forgejo.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoSupport system hook API (#14537)
Lunny Xiao [Sat, 28 Jan 2023 18:12:10 +0000 (02:12 +0800)]
Support system hook API (#14537)

This add system hook API

20 months agoImprove checkIfPRContentChanged (#22611)
zeripath [Sat, 28 Jan 2023 15:54:40 +0000 (15:54 +0000)]
Improve checkIfPRContentChanged (#22611)

The code for checking if a commit has caused a change in a PR is
extremely inefficient and affects the head repository instead of using a
temporary repository.

This PR therefore makes several significant improvements:

* A temporary repo like that used in merging.
* The diff code is then significant improved to use a three-way diff
instead of comparing diffs (possibly binary) line-by-line - in memory...

Ref #22578

Signed-off-by: Andrew Thornton <art27@cantab.net>
20 months agoLink issue and pull requests status change in UI notifications directly to their...
Felipe Leopoldo Sologuren Gutiérrez [Sat, 28 Jan 2023 11:16:46 +0000 (08:16 -0300)]
Link issue and pull requests status change in UI notifications directly to their event in the timelined view. (#22627)

Adding the related comment to the issue and pull request status change
in the UI notifications allows to navigate directly to the specific
event in its dedicated view, easing the reading of last comments and to
the editor for additional comments if desired.

20 months agofix permission check for creating comment while mail (#22524)
a1012112796 [Sat, 28 Jan 2023 09:28:55 +0000 (17:28 +0800)]
fix permission check for creating comment while mail (#22524)

only creating comment on locked issue request write permission,
for others, read permission is enough.

related to https://github.com/go-gitea/gitea/pull/22056

/cc @KN4CK3R

---------

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoFix error on account activation with wrong passwd (#22609)
Otto Richter (fnetX) [Sat, 28 Jan 2023 07:59:46 +0000 (08:59 +0100)]
Fix error on account activation with wrong passwd (#22609)

On activating local accounts, the error message didn't differentiate
between using a wrong or expired token, or a wrong password. The result
could already be obtained from the behaviour (different screens were
presented), but the error message was misleading and lead to confusion
for new users on Codeberg with Forgejo.

Now, entering a wrong password for a valid token prints a different
error message.

The problem was introduced in 0f14f69e6070c9aca09f57c419e7d6007d0e520b.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoFixes accessibility of empty repository commit status (#22632)
Felipe Leopoldo Sologuren Gutiérrez [Fri, 27 Jan 2023 22:40:17 +0000 (19:40 -0300)]
Fixes accessibility of empty repository commit status (#22632)

Avoid empty labelled anchor in repo without commits.

Contributed by @forgejo.

<!--

Please check the following:

1. Make sure you are targeting the `main` branch, pull requests on
release branches are only allowed for bug fixes.
2. Read contributing guidelines:
https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md
3. Describe what your pull request does and which issue you're targeting
(if any)

-->

20 months agoUse `--index-url` in PyPi description (#22620)
KN4CK3R [Fri, 27 Jan 2023 14:12:18 +0000 (15:12 +0100)]
Use `--index-url` in PyPi description (#22620)

Fixes #22616

Co-authored-by: zeripath <art27@cantab.net>
20 months agoShow migration validation error (#22619)
KN4CK3R [Fri, 27 Jan 2023 12:56:00 +0000 (13:56 +0100)]
Show migration validation error (#22619)

Discord request:
https://discord.com/channels/322538954119184384/322910365237248000/1067083214096703488

If there is a json schema validation error the full file content gets
dumped into the log. That does not help and may be a lot of data. This
PR prints the schema validation error message instead.

20 months agoAllow issue templates to not render title (#22589)
techknowlogick [Fri, 27 Jan 2023 04:45:49 +0000 (23:45 -0500)]
Allow issue templates to not render title (#22589)

This adds a yaml attribute that will allow the option for when markdown
is rendered that the title will be not included in the output

Based on work from @brechtvl

20 months agoFix `delete_repo` in template (#22606)
John Olheiser [Thu, 26 Jan 2023 20:36:15 +0000 (14:36 -0600)]
Fix `delete_repo` in template (#22606)

Currently the value doesn't match the model, so selecting it results in
a 500.

https://github.com/go-gitea/gitea/blob/e8ac6a9aeacf0adf21982abc51baa8938e5dd6bb/models/auth/token_scope.go#L42

Signed-off-by: jolheiser <john.olheiser@gmail.com>
20 months agoset org visibility class to basic in header (#22605)
yp05327 [Thu, 26 Jan 2023 18:44:34 +0000 (03:44 +0900)]
set org visibility class to basic in header (#22605)

Fixes https://github.com/go-gitea/gitea/issues/22601

At people and team page, we have red private tag or orange limited tag,
but at repo page, it is gray (basic).
I think it is better to set them into same color (basic).

20 months agoAdd API endpoint to get latest release (#21267)
JakobDev [Thu, 26 Jan 2023 16:33:47 +0000 (17:33 +0100)]
Add API endpoint to get latest release (#21267)

This PR adds a new API endpoint to get the latest stable release of a
repo, similar to [GitHub
API](https://docs.github.com/en/rest/releases/releases#get-the-latest-release).

20 months agoAdd ARIA support for Fomantic UI checkboxes (#22599)
wxiaoguang [Wed, 25 Jan 2023 15:52:10 +0000 (23:52 +0800)]
Add ARIA support for Fomantic UI checkboxes (#22599)

Replace #22593

This is a general approach to add ARIA support for all Fomantic UI
checkboxes (including radioboxes)

* Pros:
* General approach, it works for all Fomantic UI checkboxes / radioboxes
    * No need to write IDs manually everywhere
    * No need to tell new contributors to write IDs again and again

* Cons:
* Slightly affects performance, but it's really trivial, because there
was already a heavy `$('.ui.checkbox').checkbox()` for Fomantic UI
before. So everything is still fine.

Screenshot (from the repo setting page, which has various checkboxes):

<details>

![image](https://user-images.githubusercontent.com/2114189/214480937-3a54d36f-55c3-49de-9c45-c4bb21f1f4c6.png)

</details>

20 months agoWebhooks: for issue close/reopen action, add commit ID that caused it (#22583)
Brecht Van Lommel [Wed, 25 Jan 2023 04:47:53 +0000 (05:47 +0100)]
Webhooks: for issue close/reopen action, add commit ID that caused it (#22583)

The `commit_id` property name is the same as equivalent functionality in
GitHub. If the action was not caused by a commit, an empty string is
used.

This can for example be used to automatically add a Resolved label to an
issue fixed by a commit, or clear it when the issue is reopened.

20 months agoAdd templates to customize text when creating and migrating repositories
Brecht Van Lommel [Tue, 24 Jan 2023 19:01:39 +0000 (20:01 +0100)]
Add templates to customize text when creating and migrating repositories

These can be used to explain which types of repositories a Gitea instance is
willing to host, or other rules for creating repositories.

20 months agoPrevent duplicate labels when importing more than 99 (#22591)
Sybren [Tue, 24 Jan 2023 19:44:55 +0000 (20:44 +0100)]
Prevent duplicate labels when importing more than 99 (#22591)

Importing labels (via `gitea restore-repo`) did not split them up into
batches properly. The first "batch" would create all labels, the second
"batch" would create all labels except those in the first "batch", etc.
This meant that when importing more than 99 labels (the batch size)
there would always be duplicate ones.

This is solved by actually passing `labels[:lbBatchSize]` to the
`CreateLabels()` function, instead of the entire list `labels`.

20 months agoRemove address from DCO (#22595)
Yarden Shoham [Tue, 24 Jan 2023 18:52:38 +0000 (20:52 +0200)]
Remove address from DCO (#22595)

I copy-pasted from https://developercertificate.org/

20 months agoAllow setting `redirect_to` cookie on OAuth login (#22594)
Sybren [Tue, 24 Jan 2023 16:41:38 +0000 (17:41 +0100)]
Allow setting `redirect_to` cookie on OAuth login (#22594)

The regular login flow can use a `redirect_to` cookie to ensure the user
ends their authentication flow on the same page as where they started
it.

This commit adds the same functionality to the OAuth login URLs, so that
you can use URLs like these to directly use a specific OAuth provider:

`/user/oauth2/{provider}?redirect_to={post-login path}`

Only the `auth.SignInOAuth()` function needed a change for this, as the
rest of the login flow is aware of this cookie and uses it properly
already.

20 months agoProject links should use parent link methods (#22587)
John Olheiser [Mon, 23 Jan 2023 21:51:18 +0000 (15:51 -0600)]
Project links should use parent link methods (#22587)

Instead of re-creating, these should use the available `Link` methods
from the "parent" of the project, which also take sub-urls into account.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
20 months agolink update in README files (#22582)
rekayno [Mon, 23 Jan 2023 20:57:57 +0000 (23:57 +0300)]
link update in README files (#22582)

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
20 months agoFrontport 1.18.2 and 1.18.3 Changelogs (#22580)
John Olheiser [Mon, 23 Jan 2023 15:36:00 +0000 (09:36 -0600)]
Frontport 1.18.2 and 1.18.3 Changelogs (#22580)

Frontport #22530 #22575

Signed-off-by: jolheiser <john.olheiser@gmail.com>
20 months agoFix incorrect Redis URL snippets in the example app.ini (#22573)
tiny6996 [Mon, 23 Jan 2023 02:17:15 +0000 (20:17 -0600)]
Fix incorrect Redis URL snippets in the example app.ini (#22573)

Fixes #22571

Co-authored-by: Yarden Shoham <hrsi88@gmail.com>
20 months agoPrevent multiple `To` recipients (#22566)
KN4CK3R [Sun, 22 Jan 2023 14:23:52 +0000 (15:23 +0100)]
Prevent multiple `To` recipients (#22566)

Change the mailer interface to prevent leaking of possible hidden email
addresses when sending to multiple recipients.

Co-authored-by: Gusted <williamzijl7@hotmail.com>
20 months agogitlab supports ssh key signing (#22564)
techknowlogick [Sun, 22 Jan 2023 10:17:49 +0000 (05:17 -0500)]
gitlab supports ssh key signing (#22564)

20 months agoAddress feedback from #22517 (#22563)
Francesco Siddi [Sun, 22 Jan 2023 04:14:43 +0000 (05:14 +0100)]
Address feedback from #22517 (#22563)

- use octicons for icon
- use fomantic for centering the link

20 months agoFix bug on user setting (#22539)
Lunny Xiao [Sat, 21 Jan 2023 14:31:11 +0000 (22:31 +0800)]
Fix bug on user setting (#22539)

Fix #22537

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
20 months agoUpdate JS dependencies (#22538)
silverwind [Sat, 21 Jan 2023 02:42:13 +0000 (03:42 +0100)]
Update JS dependencies (#22538)

- Update all JS dependencies
- Add new eslint rules
- Rebuild SVGs
- Tested citation and build

SVG changes are because of https://github.com/primer/octicons/pull/883.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
20 months agoSplit default gitpod view to include all tasks (#22555)
Yarden Shoham [Fri, 20 Jan 2023 19:46:33 +0000 (21:46 +0200)]
Split default gitpod view to include all tasks (#22555)

It was showing only the `docs` process

Signed-off-by: Yarden Shoham <hrsi88@gmail.com>
20 months agofix: read:org scope (#22556)
John Olheiser [Fri, 20 Jan 2023 18:42:54 +0000 (12:42 -0600)]
fix: read:org scope (#22556)

Hard to see in the diff, but this was duplicated in the wrong section.

![read-org](https://user-images.githubusercontent.com/42128690/213774506-9b47ce23-d2e5-4dfd-af49-6ae4947ac724.png)

20 months agoPull Requests: add color to approved/reject icon in pull requests list
Brecht Van Lommel [Wed, 18 Jan 2023 04:13:04 +0000 (05:13 +0100)]
Pull Requests: add color to approved/reject icon in pull requests list

Makes it easier to scan the list of pull requests and see the status.

20 months agoTruncate commit summary on repo files table. (#22551)
zeripath [Fri, 20 Jan 2023 15:23:03 +0000 (15:23 +0000)]
Truncate commit summary on repo files table. (#22551)

There was an unintended regression in #21124 which assumed that
`.commits-list .message-wrapper` would only match the commit summaries
on `/{owner}/{name}/commits/*`. This assumption is incorrect as the
directory/file view also uses a `.commits-list` wrapper.

Rather than completely restructure this page this PR simply adjusts the
styling to again use `display: inline-block;` for `#repo-files-table
.commit-list .message-wrapper`

Fix #22360

Signed-off-by: Andrew Thornton <art27@cantab.net>
20 months agoSupport org/user level projects (#22235)
Lunny Xiao [Fri, 20 Jan 2023 11:42:33 +0000 (19:42 +0800)]
Support org/user level projects (#22235)

Fix #13405

<img width="1151" alt="image"
src="https://user-images.githubusercontent.com/81045/209442911-7baa3924-c389-47b6-b63b-a740803e640e.png">

Co-authored-by: 6543 <6543@obermui.de>
20 months agoFix template bug of access scope (#22540)
Lunny Xiao [Fri, 20 Jan 2023 07:43:43 +0000 (15:43 +0800)]
Fix template bug of access scope (#22540)

Fix https://github.com/go-gitea/gitea/pull/20908#discussion_r1082075526

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
20 months agoMute all links in issue timeline (#22533)
silverwind [Fri, 20 Jan 2023 04:00:32 +0000 (05:00 +0100)]
Mute all links in issue timeline (#22533)

https://github.com/go-gitea/gitea/pull/21799 introduced a regression
where some links in the issue timeline were not muted any more. Fix it
by replacing all `class="text grey"` with `class="text grey
muted-links"` in the file.

Before:
<img width="384" alt="Screenshot 2023-01-19 at 22 23 05"
src="https://user-images.githubusercontent.com/115237/213565351-1bb82f4e-fa72-4cd7-8e36-e527bbfe5c5f.png">

After:
<img width="377" alt="Screenshot 2023-01-19 at 22 23 11"
src="https://user-images.githubusercontent.com/115237/213565359-87e14855-6599-472a-be0b-61297b168f9a.png">

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
20 months agoWhen updating by rebase we need to set the environment for head repo (#22535)
zeripath [Thu, 19 Jan 2023 22:31:44 +0000 (22:31 +0000)]
When updating by rebase we need to set the environment for head repo (#22535)

The update by rebase code reuses the merge code but shortcircuits and
pushes back up to the head. However, it doesn't set the correct pushing
environment - and just uses the same environment as the base repo. This
leads to the push update failing and thence the PR becomes out-of-sync
with the head.

This PR fixes this and adjusts the trace logging elsewhere to help make
this clearer.

Fix #18802

Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
20 months agoFix assignment to `cm.AssigneeID` when importing comments (#22528)
Sybren [Thu, 19 Jan 2023 18:24:40 +0000 (19:24 +0100)]
Fix assignment to `cm.AssigneeID` when importing comments (#22528)

This is a fix for https://github.com/go-gitea/gitea/pull/22510

The code assumed that the `AssigneeID` from the comment YAML was an
`int64`, but it is actually an `int`, causing a panic. It also had no
check on whether the type cast was actually valid, so badly formatted
YAML could also cause a panic.

Both these issues have been fixed.

20 months agoDropzone: Add "Copy link" button for new uploads (#22517)
Francesco Siddi [Thu, 19 Jan 2023 05:33:40 +0000 (06:33 +0100)]
Dropzone: Add "Copy link" button for new uploads (#22517)

Once an attachment is successfully uploaded via Dropzone, display a
"Copy link" under the "Remove file" button.
Once the button is clicked, depending if the attachment is an image or a
file, the appropriate markup is written to the clipboard, so it can be
conveniently pasted in the description.

20 months agoSupport importing comment types (#22510)
Sybren [Thu, 19 Jan 2023 02:14:56 +0000 (03:14 +0100)]
Support importing comment types (#22510)

This commit adds support for specifying comment types when importing
with `gitea restore-repo`. It makes it possible to import issue changes,
such as "title changed" or "assigned user changed".

An earlier version of this pull request was made by Matti Ranta, in
https://future.projects.blender.org/blender-migration/gitea-bf/pulls/3

There are two changes with regard to Matti's original code:

1. The comment type was an `int64` in Matti's code, and is now using a
string. This makes it possible to use `comment_type: title`, which is
more reliable and future-proof than an index into an internal list in
the Gitea Go code.

2. Matti's code also had support for including labels, but in a way that
would require knowing the database ID of the labels before the import
even starts, which is impossible. This can be solved by using label
names instead of IDs; for simplicity I I left that out of this PR.

20 months agoFix issue not auto-closing when it includes a reference to a branch (#22514)
Brecht Van Lommel [Thu, 19 Jan 2023 00:24:38 +0000 (01:24 +0100)]
Fix issue not auto-closing when it includes a reference to a branch (#22514)

Ensure branch prefix is stripped away for both when comparing the branch
name.

20 months agoFix invalid issue branch reference if not specified in template (#22513)
Brecht Van Lommel [Wed, 18 Jan 2023 21:50:22 +0000 (22:50 +0100)]
Fix invalid issue branch reference if not specified in template (#22513)

When an issue template does not contain a ref, it would end up with an
invalid `ref/heads/` value instead of having no branch referenced .

20 months agoFix 500 error viewing pull request when fork has pull requests disabled (#22512)
Brecht Van Lommel [Wed, 18 Jan 2023 19:54:57 +0000 (20:54 +0100)]
Fix 500 error viewing pull request when fork has pull requests disabled (#22512)

Swallow error just like in #20839, for the case where there is no
protected branch.

Fixes #20826 for me, though I can't tell if this now covers all cases.

20 months agoLoad asciicast css async (#22502)
Jason Song [Wed, 18 Jan 2023 18:19:38 +0000 (02:19 +0800)]
Load asciicast css async (#22502)

Load asciicast css asynchronously.

Related to #22448.

20 months agoReliable selection of admin user (#22509)
Sybren [Wed, 18 Jan 2023 16:57:16 +0000 (17:57 +0100)]
Reliable selection of admin user (#22509)

When importing a repository via `gitea restore-repo`, external users
will get remapped to an admin user. This admin user is obtained via
`users.GetAdminUser()`, which unfortunately picks a more-or-less random
admin to return.

This makes it hard to predict which admin user will get assigned. This
patch orders the admin by ascending ID before choosing the first one,
i.e. it picks the admin with the lowest ID.

Even though it would be nicer to have full control over which user is
chosen, this at least gives us a predictable result.

20 months agoDisplay unreferenced packages total size in package admin panel (#22498)
Lunny Xiao [Wed, 18 Jan 2023 15:52:04 +0000 (23:52 +0800)]
Display unreferenced packages total size in package admin panel (#22498)

20 months agoSimplify the error message when `index.js` couldn't be loaded (#22354)
wxiaoguang [Wed, 18 Jan 2023 01:36:40 +0000 (09:36 +0800)]
Simplify the error message when `index.js` couldn't be loaded (#22354)

In some cases, the loading failure of `index.js` is not related to the
ROOT_URL directly, ex: https://gitea.com/gitea/helm-chart/issues/392

If the user's reversed proxy is mis-configured:
`http://public-domain/gitea/xxx` -> `http://gitea:3000/gitea/xxx`, it
also causes the loading failure.

So this PR removes the ROOT_URL related tip from the error message.

20 months agoSupport asciicast files as new markup (#22448)
Jason Song [Wed, 18 Jan 2023 00:46:58 +0000 (08:46 +0800)]
Support asciicast files as new markup (#22448)

Support [asciicast
files](https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md)
as a new markup via
[asciinema-player](https://github.com/asciinema/asciinema-player). For
more on asciinema, see the [introduction](https://asciinema.org/).

So users can use asciinema recorder to generate an asciicast file (or
you can download a sample file from
https://asciinema.org/a/335480.cast?dl=1), then upload it to Gitea and
play it on Gitea.

Snapshots:
<details>

## Upload asciicast files

<img width="1134" alt="image"
src="https://user-images.githubusercontent.com/9418365/212461061-cc2c7181-0e14-4534-af55-1ec60a639fd1.png">

## Open an asciicast file

<img width="1137" alt="image"
src="https://user-images.githubusercontent.com/9418365/212461090-a3b5141f-4894-430d-a2b4-ea257801a0ed.png">

## Play it

<img width="1144" alt="image"
src="https://user-images.githubusercontent.com/9418365/212461157-4e82db69-0e41-471d-928f-ac1fe0737105.png">

## Copy contents from the "video"

<img width="1145" alt="image"
src="https://user-images.githubusercontent.com/9418365/212461286-211612bc-15d6-427a-89a9-6abff5c6a0a5.png">

## View the source

<img width="1140" alt="image"
src="https://user-images.githubusercontent.com/9418365/212461187-05473b2d-ba3d-4072-84a6-4aa1e7d82182.png">

</details>

Known issue:

Don't support the [v1 version asciicast
files](https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v1.md),
it's a poorly designed version, it does not specify the file extension
and uses `*.json` usually, so it's impossible to recognize the files.

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
20 months agoSupport scoped access tokens (#20908)
Chongyi Zheng [Tue, 17 Jan 2023 21:46:03 +0000 (16:46 -0500)]
Support scoped access tokens (#20908)

This PR adds the support for scopes of access tokens, mimicking the
design of GitHub OAuth scopes.

The changes of the core logic are in `models/auth` that `AccessToken`
struct will have a `Scope` field. The normalized (no duplication of
scope), comma-separated scope string will be stored in `access_token`
table in the database.
In `services/auth`, the scope will be stored in context, which will be
used by `reqToken` middleware in API calls. Only OAuth2 tokens will have
granular token scopes, while others like BasicAuth will default to scope
`all`.
A large amount of work happens in `routers/api/v1/api.go` and the
corresponding `tests/integration` tests, that is adding necessary scopes
to each of the API calls as they fit.

- [x] Add `Scope` field to `AccessToken`
- [x] Add access control to all API endpoints
- [x] Update frontend & backend for when creating tokens
- [x] Add a database migration for `scope` column (enable 'all' access
to past tokens)

I'm aiming to complete it before Gitea 1.19 release.

Fixes #4300

20 months agosome refactor about code comments (#20821)
Lunny Xiao [Tue, 17 Jan 2023 21:03:44 +0000 (05:03 +0800)]
some refactor about code comments (#20821)

20 months agodocs: add swagger.json file location to FAQ (#22489)
John Olheiser [Tue, 17 Jan 2023 20:18:42 +0000 (14:18 -0600)]
docs: add swagger.json file location to FAQ (#22489)

This just adds a mention on how to get the `swagger.json` for an
instance.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
20 months agodocs: bump Gitea version (#22490)
John Olheiser [Tue, 17 Jan 2023 18:42:12 +0000 (12:42 -0600)]
docs: bump Gitea version (#22490)

Forgot to do this with the frontport

Signed-off-by: jolheiser <john.olheiser@gmail.com>
20 months agochore: changelog 1.18.1 (#22471) (#22487)
John Olheiser [Tue, 17 Jan 2023 18:18:22 +0000 (12:18 -0600)]
chore: changelog 1.18.1 (#22471) (#22487)

Frontport #22471

Signed-off-by: jolheiser <john.olheiser@gmail.com>
20 months agoFixed lint warnings in Grafana raised by Mixtool (#22486)
Emily [Tue, 17 Jan 2023 16:23:25 +0000 (17:23 +0100)]
Fixed lint warnings in Grafana raised by Mixtool (#22486)

This PR introduces a few minor changes to the gitea-monitoring-mixin,
specifically linting issues raised by
[Mixtool](https://github.com/monitoring-mixins/mixtool):
- Query selectors using `job` and `instance` have been update to allow
multi-select
- Added missing attributes to `job` and `instance` template

As this change is very minor I haven't created an issue, but please let
me know if you'd like me to do so. According to the guidelines, it
seemed to only be for larger designs :)