Skip to content

Commit be18b73

Browse files
committed
Merge branch 'main' into add-issue-planned-time
2 parents ff60376 + 25f3ec5 commit be18b73

File tree

284 files changed

+3570
-1723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+3570
-1723
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
1111
"ghcr.io/devcontainers/features/python:1": {
1212
"version": "3.12"
13-
}
13+
},
14+
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {}
1415
},
1516
"customizations": {
1617
"vscode": {
@@ -25,7 +26,7 @@
2526
"Vue.volar",
2627
"ms-azuretools.vscode-docker",
2728
"vitest.explorer",
28-
"qwtel.sqlite-viewer",
29+
"cweijan.vscode-database-client2",
2930
"GitHub.vscode-pull-request-github",
3031
"Azurite.azurite"
3132
]

.eslintrc.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ rules:
324324
jquery/no-sizzle: [2]
325325
jquery/no-slide: [2]
326326
jquery/no-submit: [2]
327-
jquery/no-text: [0]
327+
jquery/no-text: [2]
328328
jquery/no-toggle: [2]
329329
jquery/no-trigger: [0]
330330
jquery/no-trim: [2]
@@ -477,7 +477,7 @@ rules:
477477
no-jquery/no-slide: [2]
478478
no-jquery/no-sub: [2]
479479
no-jquery/no-support: [2]
480-
no-jquery/no-text: [0]
480+
no-jquery/no-text: [2]
481481
no-jquery/no-trigger: [0]
482482
no-jquery/no-trim: [2]
483483
no-jquery/no-type: [2]
@@ -798,7 +798,7 @@ rules:
798798
unicorn/prefer-object-has-own: [0]
799799
unicorn/prefer-optional-catch-binding: [2]
800800
unicorn/prefer-prototype-methods: [0]
801-
unicorn/prefer-query-selector: [0]
801+
unicorn/prefer-query-selector: [2]
802802
unicorn/prefer-reflect-apply: [0]
803803
unicorn/prefer-regexp-test: [2]
804804
unicorn/prefer-set-has: [0]

.github/pull_request_template.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<!-- start tips -->
1+
<!-- start tips -->
22
Please check the following:
33
1. Make sure you are targeting the `main` branch, pull requests on release branches are only allowed for backports.
44
2. Make sure you have read contributing guidelines: https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md .
5-
3. Describe what your pull request does and which issue you're targeting (if any).
6-
4. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily.
7-
5. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`.
8-
6. Delete all these tips before posting.
5+
3. For documentations contribution, please go to https://gitea.com/gitea/docs
6+
4. Describe what your pull request does and which issue you're targeting (if any).
7+
5. It is recommended to enable "Allow edits by maintainers", so maintainers can help more easily.
8+
6. Your input here will be included in the commit message when this PR has been merged. If you don't want some content to be included, please separate them with a line like `---`.
9+
7. Delete all these tips before posting.
910
<!-- end tips -->

.gitpod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ vscode:
4343
- Vue.volar
4444
- ms-azuretools.vscode-docker
4545
- vitest.explorer
46-
- qwtel.sqlite-viewer
46+
- cweijan.vscode-database-client2
4747
- GitHub.vscode-pull-request-github
4848

4949
ports:

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ linters:
2222
- typecheck
2323
- unconvert
2424
- unused
25+
- unparam
2526
- wastedassign
2627

2728
run:

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,8 @@ $REWRITTEN_PR_SUMMARY
358358

359359
## Documentation
360360

361-
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated in the same PR.
361+
If you add a new feature or change an existing aspect of Gitea, the documentation for that feature must be created or updated in another PR at [https://gitea.com/gitea/docs](https://gitea.com/gitea/docs).
362+
**The docs directory on main repository will be removed at some time. We will have a yaml file to store configuration file's meta data. After that completed, configuration documentation should be in the main repository.**
362363

363364
## API v1
364365

Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ COMMA := ,
2525

2626
XGO_VERSION := go-1.22.x
2727

28-
AIR_PACKAGE ?= github.com/cosmtrek/air@v1
28+
AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/[email protected]
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.57.2
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@db51e79a0e37c572d8b59ae0c58bf2bbbbe53285
3535
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3636
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1
3737
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1
3838
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1
39+
GOPLS_PACKAGE ?= golang.org/x/tools/[email protected]
3940

4041
DOCKER_IMAGE ?= gitea/gitea
4142
DOCKER_TAG ?= latest
@@ -213,6 +214,7 @@ help:
213214
@echo " - lint-go lint go files"
214215
@echo " - lint-go-fix lint go files and fix issues"
215216
@echo " - lint-go-vet lint go files with vet"
217+
@echo " - lint-go-gopls lint go files with gopls"
216218
@echo " - lint-js lint js files"
217219
@echo " - lint-js-fix lint js files and fix issues"
218220
@echo " - lint-css lint css files"
@@ -366,7 +368,7 @@ lint-frontend: lint-js lint-css
366368
lint-frontend-fix: lint-js-fix lint-css-fix
367369

368370
.PHONY: lint-backend
369-
lint-backend: lint-go lint-go-vet lint-editorconfig
371+
lint-backend: lint-go lint-go-vet lint-go-gopls lint-editorconfig
370372

371373
.PHONY: lint-backend-fix
372374
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig
@@ -424,6 +426,11 @@ lint-go-vet:
424426
@GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
425427
@$(GO) vet -vettool=gitea-vet ./...
426428

429+
.PHONY: lint-go-gopls
430+
lint-go-gopls:
431+
@echo "Running gopls check..."
432+
@GO=$(GO) GOPLS_PACKAGE=$(GOPLS_PACKAGE) tools/lint-go-gopls.sh $(GO_SOURCES_NO_BINDATA)
433+
427434
.PHONY: lint-editorconfig
428435
lint-editorconfig:
429436
@$(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) $(EDITORCONFIG_FILES)
@@ -864,13 +871,14 @@ deps-tools:
864871
$(GO) install $(GO_LICENSES_PACKAGE)
865872
$(GO) install $(GOVULNCHECK_PACKAGE)
866873
$(GO) install $(ACTIONLINT_PACKAGE)
874+
$(GO) install $(GOPLS_PACKAGE)
867875

868876
node_modules: package-lock.json
869877
npm install --no-save
870878
@touch node_modules
871879

872880
.venv: poetry.lock
873-
poetry install --no-root
881+
poetry install
874882
@touch .venv
875883

876884
.PHONY: update
@@ -887,7 +895,7 @@ update-js: node-check | node_modules
887895
update-py: node-check | node_modules
888896
npx updates -u -f pyproject.toml
889897
rm -rf .venv poetry.lock
890-
poetry install --no-root
898+
poetry install
891899
@touch .venv
892900

893901
.PHONY: fomantic

cmd/migrate_storage.go

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ package cmd
55

66
import (
77
"context"
8+
"errors"
89
"fmt"
10+
"io/fs"
911
"strings"
1012

1113
actions_model "code.gitea.io/gitea/models/actions"
@@ -194,8 +196,20 @@ func migrateActionsLog(ctx context.Context, dstStorage storage.ObjectStorage) er
194196

195197
func migrateActionsArtifacts(ctx context.Context, dstStorage storage.ObjectStorage) error {
196198
return db.Iterate(ctx, nil, func(ctx context.Context, artifact *actions_model.ActionArtifact) error {
197-
_, err := storage.Copy(dstStorage, artifact.ArtifactPath, storage.ActionsArtifacts, artifact.ArtifactPath)
198-
return err
199+
if artifact.Status == int64(actions_model.ArtifactStatusExpired) {
200+
return nil
201+
}
202+
203+
_, err := storage.Copy(dstStorage, artifact.StoragePath, storage.ActionsArtifacts, artifact.StoragePath)
204+
if err != nil {
205+
// ignore files that do not exist
206+
if errors.Is(err, fs.ErrNotExist) {
207+
return nil
208+
}
209+
return err
210+
}
211+
212+
return nil
199213
})
200214
}
201215

custom/conf/app.example.ini

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ RUN_USER = ; git
8181
;; Overwrite the automatically generated public URL. Necessary for proxies and docker.
8282
;ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s:%(HTTP_PORT)s/
8383
;;
84+
;; For development purpose only. It makes Gitea handle sub-path ("/sub-path/owner/repo/...") directly when debugging without a reverse proxy.
85+
;; DO NOT USE IT IN PRODUCTION!!!
86+
;USE_SUB_URL_PATH = false
87+
;;
8488
;; when STATIC_URL_PREFIX is empty it will follow ROOT_URL
8589
;STATIC_URL_PREFIX =
8690
;;
@@ -1334,6 +1338,9 @@ LEVEL = Info
13341338
;;
13351339
;; Maximum allowed file size in bytes to render CSV files as table. (Set to 0 for no limit).
13361340
;MAX_FILE_SIZE = 524288
1341+
;;
1342+
;; Maximum allowed rows to render CSV files. (Set to 0 for no limit)
1343+
;MAX_ROWS = 2500
13371344

13381345
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13391346
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1687,6 +1694,16 @@ LEVEL = Info
16871694
;; convert \r\n to \n for Sendmail
16881695
;SENDMAIL_CONVERT_CRLF = true
16891696

1697+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1698+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1699+
;[mailer.override_header]
1700+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1701+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1702+
;; This is empty by default, use it only if you know what you need it for.
1703+
1704+
;Content-Type = text/html; charset=utf-8
1705+
;In-Reply-To =
1706+
16901707
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16911708
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
16921709
;[email.incoming]

docs/content/administration/config-cheat-sheet.en-us.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,11 +724,13 @@ Define allowed algorithms and their minimum key length (use -1 to disable a type
724724

725725
## Mailer (`mailer`)
726726

727-
⚠️ This section is for Gitea 1.18 and later. If you are using Gitea 1.17 or older,
727+
:::warning
728+
This section is for Gitea 1.18 and later. If you are using Gitea 1.17 or older,
728729
please refer to
729730
[Gitea 1.17 app.ini example](https://github.com/go-gitea/gitea/blob/release/v1.17/custom/conf/app.example.ini)
730731
and
731732
[Gitea 1.17 configuration document](https://github.com/go-gitea/gitea/blob/release/v1.17/docs/content/doc/advanced/config-cheat-sheet.en-us.md)
733+
:::
732734

733735
- `ENABLED`: **false**: Enable to use a mail service.
734736
- `PROTOCOL`: **_empty_**: Mail server protocol. One of "smtp", "smtps", "smtp+starttls", "smtp+unix", "sendmail", "dummy". _Before 1.18, this was inferred from a combination of `MAILER_TYPE` and `IS_TLS_ENABLED`._
@@ -761,6 +763,21 @@ and
761763
- `SEND_BUFFER_LEN`: **100**: Buffer length of mailing queue. **DEPRECATED** use `LENGTH` in `[queue.mailer]`
762764
- `SEND_AS_PLAIN_TEXT`: **false**: Send mails only in plain text, without HTML alternative.
763765

766+
## Override Email Headers (`mailer.override_header`)
767+
768+
:::warning
769+
This is empty by default, use it only if you know what you need it for.
770+
:::
771+
772+
examples would be:
773+
774+
```ini
775+
[mailer.override_header]
776+
777+
Content-Type = text/html; charset=utf-8
778+
In-Reply-To =
779+
```
780+
764781
## Incoming Email (`email.incoming`)
765782

766783
- `ENABLED`: **false**: Enable handling of incoming emails.

0 commit comments

Comments
 (0)