Skip to content

Commit 66dab87

Browse files
committed
Merge branch 'main' into fix-unit-disable
2 parents be50c51 + 78e8296 commit 66dab87

File tree

520 files changed

+7937
-3608
lines changed

Some content is hidden

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

520 files changed

+7937
-3608
lines changed

.devcontainer/devcontainer.json

+5-3
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,8 +26,9 @@
2526
"Vue.volar",
2627
"ms-azuretools.vscode-docker",
2728
"vitest.explorer",
28-
"qwtel.sqlite-viewer",
29-
"GitHub.vscode-pull-request-github"
29+
"cweijan.vscode-database-client2",
30+
"GitHub.vscode-pull-request-github",
31+
"Azurite.azurite"
3032
]
3133
}
3234
},

.eslintrc.yaml

+3-3
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]

.gitea/issue_template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!--
44
1. Please speak English, this is the language all maintainers can speak and write.
55
2. Please ask questions or configuration/deploy problems on our Discord
6-
server (https://discord.gg/gitea) or forum (https://discourse.gitea.io).
6+
server (https://discord.gg/gitea) or forum (https://forum.gitea.com).
77
3. Please take a moment to check that your issue doesn't already exist.
88
4. Make sure it's not mentioned in the FAQ (https://docs.gitea.com/help/faq)
99
5. Please give all relevant information below for bug reports, because
@@ -21,7 +21,7 @@
2121
- [ ] MySQL
2222
- [ ] MSSQL
2323
- [ ] SQLite
24-
- Can you reproduce the bug at https://try.gitea.io:
24+
- Can you reproduce the bug at https://demo.gitea.com:
2525
- [ ] Yes (provide example URL)
2626
- [ ] No
2727
- Log gist:

.github/ISSUE_TEMPLATE/bug-report.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ body:
3737
label: Can you reproduce the bug on the Gitea demo site?
3838
description: |
3939
If so, please provide a URL in the Description field
40-
URL of Gitea demo: https://try.gitea.io
40+
URL of Gitea demo: https://demo.gitea.com
4141
options:
4242
- "Yes"
4343
- "No"
@@ -74,7 +74,7 @@ body:
7474
attributes:
7575
label: How are you running Gitea?
7676
description: |
77-
Please include information on whether you built Gitea yourself, used one of our downloads, are using https://try.gitea.io or are using some other package
77+
Please include information on whether you built Gitea yourself, used one of our downloads, are using https://demo.gitea.com or are using some other package
7878
Please also tell us how you are running Gitea, e.g. if it is being run from docker, a command-line, systemd etc.
7979
If you are using a package or systemd tell us what distribution you are using
8080
validations:

.github/ISSUE_TEMPLATE/ui.bug-report.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ body:
4646
label: Can you reproduce the bug on the Gitea demo site?
4747
description: |
4848
If so, please provide a URL in the Description field
49-
URL of Gitea demo: https://try.gitea.io
49+
URL of Gitea demo: https://demo.gitea.com
5050
options:
5151
- "Yes"
5252
- "No"

.github/pull_request_template.md

+6-5
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 -->

.github/workflows/pull-db-tests.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,18 @@ jobs:
119119
MINIO_SECRET_KEY: 12345678
120120
ports:
121121
- "9000:9000"
122+
devstoreaccount1.azurite.local: # https://github.com/Azure/Azurite/issues/1583
123+
image: mcr.microsoft.com/azure-storage/azurite:latest
124+
ports:
125+
- 10000:10000
122126
steps:
123127
- uses: actions/checkout@v4
124128
- uses: actions/setup-go@v5
125129
with:
126130
go-version-file: go.mod
127131
check-latest: true
128132
- name: Add hosts to /etc/hosts
129-
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts'
133+
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 minio devstoreaccount1.azurite.local mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts'
130134
- run: make deps-backend
131135
- run: make backend
132136
env:
@@ -204,14 +208,18 @@ jobs:
204208
SA_PASSWORD: MwantsaSecurePassword1
205209
ports:
206210
- "1433:1433"
211+
devstoreaccount1.azurite.local: # https://github.com/Azure/Azurite/issues/1583
212+
image: mcr.microsoft.com/azure-storage/azurite:latest
213+
ports:
214+
- 10000:10000
207215
steps:
208216
- uses: actions/checkout@v4
209217
- uses: actions/setup-go@v5
210218
with:
211219
go-version-file: go.mod
212220
check-latest: true
213221
- name: Add hosts to /etc/hosts
214-
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts'
222+
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mssql devstoreaccount1.azurite.local" | sudo tee -a /etc/hosts'
215223
- run: make deps-backend
216224
- run: make backend
217225
env:

.github/workflows/release-nightly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
REF_NAME=$(echo "${{ github.ref }}" | sed -e 's/refs\/heads\///' -e 's/refs\/tags\///' -e 's/release\/v//')
4949
echo "Cleaned name is ${REF_NAME}"
50-
echo "branch=${REF_NAME}" >> "$GITHUB_OUTPUT"
50+
echo "branch=${REF_NAME}-nightly" >> "$GITHUB_OUTPUT"
5151
- name: configure aws
5252
uses: aws-actions/configure-aws-credentials@v4
5353
with:

.gitpod.yml

+1-1
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

+4-5
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ linters:
2222
- typecheck
2323
- unconvert
2424
- unused
25+
- unparam
2526
- wastedassign
2627

2728
run:
2829
timeout: 10m
2930

3031
output:
3132
sort-results: true
33+
sort-order: [file]
34+
show-stats: true
3235

3336
linters-settings:
3437
stylecheck:
@@ -40,11 +43,7 @@ linters-settings:
4043
- ifElseChain
4144
- singleCaseSwitch # Every time this occurred in the code, there was no other way.
4245
revive:
43-
ignore-generated-header: false
44-
severity: warning
45-
confidence: 0.8
46-
errorCode: 1
47-
warningCode: 1
46+
severity: error
4847
rules:
4948
- name: atomic
5049
- name: bare-return

CONTRIBUTING.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ If your issue has not been reported yet, [open an issue](https://github.com/go-g
7777
and answer the questions so we can understand and reproduce the problematic behavior. \
7878
Please write clear and concise instructions so that we can reproduce the behavior — even if it seems obvious. \
7979
The more detailed and specific you are, the faster we can fix the issue. \
80-
It is really helpful if you can reproduce your problem on a site running on the latest commits, i.e. <https://try.gitea.io>, as perhaps your problem has already been fixed on a current version. \
80+
It is really helpful if you can reproduce your problem on a site running on the latest commits, i.e. <https://demo.gitea.com>, as perhaps your problem has already been fixed on a current version. \
8181
Please follow the guidelines described in [How to Report Bugs Effectively](http://www.chiark.greenend.org.uk/~sgtatham/bugs.html) for your report.
8282

8383
Please be kind, remember that Gitea comes at no cost to you, and you're getting free help.
@@ -358,11 +358,12 @@ $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

365-
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [the GitHub API](https://docs.github.com/en/rest).
366+
The API is documented by [swagger](https://gitea.com/api/swagger) and is based on [the GitHub API](https://docs.github.com/en/rest).
366367

367368
### GitHub API compatibility
368369

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.22-alpine3.19 AS build-env
2+
FROM docker.io/library/golang:1.22-alpine3.20 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -41,7 +41,7 @@ RUN chmod 755 /tmp/local/usr/bin/entrypoint \
4141
/go/src/code.gitea.io/gitea/environment-to-ini
4242
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
4343

44-
FROM docker.io/library/alpine:3.19
44+
FROM docker.io/library/alpine:3.20
4545
LABEL maintainer="[email protected]"
4646

4747
EXPOSE 22 3000

Dockerfile.rootless

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build stage
2-
FROM docker.io/library/golang:1.22-alpine3.19 AS build-env
2+
FROM docker.io/library/golang:1.22-alpine3.20 AS build-env
33

44
ARG GOPROXY
55
ENV GOPROXY ${GOPROXY:-direct}
@@ -39,7 +39,7 @@ RUN chmod 755 /tmp/local/usr/local/bin/docker-entrypoint.sh \
3939
/go/src/code.gitea.io/gitea/environment-to-ini
4040
RUN chmod 644 /go/src/code.gitea.io/gitea/contrib/autocompletion/bash_autocomplete
4141

42-
FROM docker.io/library/alpine:3.19
42+
FROM docker.io/library/alpine:3.20
4343
LABEL maintainer="[email protected]"
4444

4545
EXPOSE 2222 3000

Makefile

+14-6
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
@@ -88,7 +89,7 @@ ifneq ($(GITHUB_REF_TYPE),branch)
8889
GITEA_VERSION ?= $(VERSION)
8990
else
9091
ifneq ($(GITHUB_REF_NAME),)
91-
VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME))
92+
VERSION ?= $(subst release/v,,$(GITHUB_REF_NAME))-nightly
9293
else
9394
VERSION ?= main
9495
endif
@@ -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

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This project has been
2626
[forked](https://blog.gitea.com/welcome-to-gitea/) from
2727
[Gogs](https://gogs.io) since November of 2016, but a lot has changed.
2828

29-
For online demonstrations, you can visit [try.gitea.io](https://try.gitea.io).
29+
For online demonstrations, you can visit [demo.gitea.com](https://demo.gitea.com).
3030

3131
For accessing free Gitea service (with a limited number of repositories), you can visit [gitea.com](https://gitea.com/user/login).
3232

@@ -56,7 +56,7 @@ More info: https://docs.gitea.com/installation/install-from-source
5656
./gitea web
5757

5858
> [!NOTE]
59-
> If you're interested in using our APIs, we have experimental support with [documentation](https://try.gitea.io/api/swagger).
59+
> If you're interested in using our APIs, we have experimental support with [documentation](https://docs.gitea.com/api).
6060
6161
## Contributing
6262

@@ -80,7 +80,7 @@ https://docs.gitea.com/contributing/localization
8080
## Further information
8181

8282
For more information and instructions about how to install Gitea, please look at our [documentation](https://docs.gitea.com/).
83-
If you have questions that are not covered by the documentation, you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://discourse.gitea.io/).
83+
If you have questions that are not covered by the documentation, you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://forum.gitea.com/).
8484

8585
We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea).
8686

README_ZH.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
Gitea 的首要目标是创建一个极易安装,运行非常快速,安装和使用体验良好的自建 Git 服务。我们采用 Go 作为后端语言,这使我们只要生成一个可执行程序即可。并且他还支持跨平台,支持 Linux, macOS 和 Windows 以及各种架构,除了 x86,amd64,还包括 ARM 和 PowerPC。
2020

21-
如果你想试用在线演示,请访问 [try.gitea.io](https://try.gitea.io/)
21+
如果你想试用在线演示和报告问题,请访问 [demo.gitea.com](https://demo.gitea.com/)
2222

2323
如果你想使用免费的 Gitea 服务(有仓库数量限制),请访问 [gitea.com](https://gitea.com/user/login)
2424

0 commit comments

Comments
 (0)