Skip to content

Commit cc7c2c0

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Remove Gusted as Gitea maintainer (go-gitea#21676) Fix token generation when using INTERNAL_TOKEN_URI (go-gitea#21669) Clean up formatting on install page (go-gitea#21668) Add Webhook authorization header (go-gitea#20926) feat: notify doers of a merge when automerging (go-gitea#21553) Remove deprecated DSA host key from Docker Container (go-gitea#21522) Alter package_version.metadata_json to LONGTEXT (go-gitea#21667) Handle branch name with prefix in GitHub migration (go-gitea#20357) [skip ci] Updated translations via Crowdin Split migrations folder (go-gitea#21549)
2 parents 0550c54 + 4c6b4a6 commit cc7c2c0

File tree

244 files changed

+2595
-1823
lines changed

Some content is hidden

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

244 files changed

+2595
-1823
lines changed

MAINTAINERS

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Janis Estelmann <[email protected]> (@KN4CK3R)
4444
Steven Kriegler <[email protected]> (@justusbunsi)
4545
Jimmy Praet <[email protected]> (@jpraet)
4646
Leon Hofmeister <[email protected]> (@delvh)
47-
Gusted <[email protected]) (@Gusted)
4847
silentcode <[email protected]> (@silentcodeg)
4948
Wim <[email protected]> (@42wim)
5049
xinyu <[email protected]> (@penlinux)

Makefile

+56-38
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(G
100100

101101
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
102102

103-
GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/models/migrations code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
103+
GO_PACKAGES ?= $(filter-out code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
104+
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
104105

105106
FOMANTIC_WORK_DIR := web_src/fomantic
106107

@@ -366,7 +367,7 @@ test: test-frontend test-backend
366367
.PHONY: test-backend
367368
test-backend:
368369
@echo "Running go test with $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
369-
@$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(GO_PACKAGES)
370+
@$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' $(GO_TEST_PACKAGES)
370371

371372
.PHONY: test-frontend
372373
test-frontend: node_modules
@@ -387,7 +388,7 @@ test-check:
387388
.PHONY: test\#%
388389
test\#%:
389390
@echo "Running go test with -tags '$(TEST_TAGS)'..."
390-
@$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_PACKAGES)
391+
@$(GO) test $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_TEST_PACKAGES)
391392

392393
.PHONY: coverage
393394
coverage:
@@ -398,7 +399,7 @@ coverage:
398399
.PHONY: unit-test-coverage
399400
unit-test-coverage:
400401
@echo "Running unit-test-coverage $(GOTESTFLAGS) -tags '$(TEST_TAGS)'..."
401-
@$(GO) test $(GOTESTFLAGS) -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
402+
@$(GO) test $(GOTESTFLAGS) -timeout=20m -tags='$(TEST_TAGS)' -cover -coverprofile coverage.out $(GO_TEST_PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
402403

403404
.PHONY: tidy
404405
tidy:
@@ -442,14 +443,7 @@ test-sqlite\#%: integrations.sqlite.test generate-ini-sqlite
442443
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./integrations.sqlite.test -test.run $(subst .,/,$*)
443444

444445
.PHONY: test-sqlite-migration
445-
test-sqlite-migration: migrations.sqlite.test migrations.individual.sqlite.test generate-ini-sqlite
446-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./migrations.sqlite.test
447-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./migrations.individual.sqlite.test
448-
449-
.PHONY: test-sqlite-migration\#%
450-
test-sqlite-migration\#%: migrations.sqlite.test migrations.individual.sqlite.test generate-ini-sqlite
451-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./migrations.individual.sqlite.test -test.run $(subst .,/,$*)
452-
446+
test-sqlite-migration: migrations.sqlite.test migrations.individual.sqlite.test
453447

454448
generate-ini-mysql:
455449
sed -e 's|{{TEST_MYSQL_HOST}}|${TEST_MYSQL_HOST}|g' \
@@ -470,9 +464,7 @@ test-mysql\#%: integrations.mysql.test generate-ini-mysql
470464
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./integrations.mysql.test -test.run $(subst .,/,$*)
471465

472466
.PHONY: test-mysql-migration
473-
test-mysql-migration: migrations.mysql.test migrations.individual.mysql.test generate-ini-mysql
474-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./migrations.mysql.test
475-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./migrations.individual.mysql.test
467+
test-mysql-migration: migrations.mysql.test migrations.individual.mysql.test
476468

477469
generate-ini-mysql8:
478470
sed -e 's|{{TEST_MYSQL8_HOST}}|${TEST_MYSQL8_HOST}|g' \
@@ -493,9 +485,7 @@ test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8
493485
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./integrations.mysql8.test -test.run $(subst .,/,$*)
494486

495487
.PHONY: test-mysql8-migration
496-
test-mysql8-migration: migrations.mysql8.test migrations.individual.mysql8.test generate-ini-mysql8
497-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./migrations.mysql8.test
498-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./migrations.individual.mysql8.test
488+
test-mysql8-migration: migrations.mysql8.test migrations.individual.mysql8.test
499489

500490
generate-ini-pgsql:
501491
sed -e 's|{{TEST_PGSQL_HOST}}|${TEST_PGSQL_HOST}|g' \
@@ -517,9 +507,7 @@ test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql
517507
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./integrations.pgsql.test -test.run $(subst .,/,$*)
518508

519509
.PHONY: test-pgsql-migration
520-
test-pgsql-migration: migrations.pgsql.test migrations.individual.pgsql.test generate-ini-pgsql
521-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./migrations.pgsql.test
522-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./migrations.individual.pgsql.test
510+
test-pgsql-migration: migrations.pgsql.test migrations.individual.pgsql.test
523511

524512
generate-ini-mssql:
525513
sed -e 's|{{TEST_MSSQL_HOST}}|${TEST_MSSQL_HOST}|g' \
@@ -540,9 +528,7 @@ test-mssql\#%: integrations.mssql.test generate-ini-mssql
540528
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./integrations.mssql.test -test.run $(subst .,/,$*)
541529

542530
.PHONY: test-mssql-migration
543-
test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test generate-ini-mssql
544-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./migrations.mssql.test -test.failfast
545-
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./migrations.individual.mssql.test -test.failfast
531+
test-mssql-migration: migrations.mssql.test migrations.individual.mssql.test
546532

547533
.PHONY: playwright
548534
playwright: $(PLAYWRIGHT_DIR)
@@ -637,50 +623,82 @@ integrations.sqlite.test: git-check $(GO_SOURCES)
637623
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -o integrations.sqlite.test -tags '$(TEST_TAGS)'
638624

639625
integrations.cover.test: git-check $(GO_SOURCES)
640-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.test
626+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.test
641627

642628
integrations.cover.sqlite.test: git-check $(GO_SOURCES)
643-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
629+
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration -coverpkg $(shell echo $(GO_TEST_PACKAGES) | tr ' ' ',') -o integrations.cover.sqlite.test -tags '$(TEST_TAGS)'
644630

645631
.PHONY: migrations.mysql.test
646-
migrations.mysql.test: $(GO_SOURCES)
632+
migrations.mysql.test: $(GO_SOURCES) generate-ini-mysql
647633
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql.test
634+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini ./migrations.mysql.test
648635

649636
.PHONY: migrations.mysql8.test
650-
migrations.mysql8.test: $(GO_SOURCES)
637+
migrations.mysql8.test: $(GO_SOURCES) generate-ini-mysql8
651638
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mysql8.test
639+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini ./migrations.mysql8.test
652640

653641
.PHONY: migrations.pgsql.test
654-
migrations.pgsql.test: $(GO_SOURCES)
642+
migrations.pgsql.test: $(GO_SOURCES) generate-ini-pgsql
655643
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.pgsql.test
644+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini ./migrations.pgsql.test
656645

657646
.PHONY: migrations.mssql.test
658-
migrations.mssql.test: $(GO_SOURCES)
647+
migrations.mssql.test: $(GO_SOURCES) generate-ini-mssql
659648
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.mssql.test
649+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini ./migrations.mssql.test
660650

661651
.PHONY: migrations.sqlite.test
662-
migrations.sqlite.test: $(GO_SOURCES)
652+
migrations.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
663653
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/integration/migration-test -o migrations.sqlite.test -tags '$(TEST_TAGS)'
654+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini ./migrations.sqlite.test
664655

665656
.PHONY: migrations.individual.mysql.test
666657
migrations.individual.mysql.test: $(GO_SOURCES)
667-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.mysql.test
658+
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
659+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
660+
done
668661

669662
.PHONY: migrations.individual.mysql8.test
670663
migrations.individual.mysql8.test: $(GO_SOURCES)
671-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.mysql8.test
664+
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
665+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mysql8.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
666+
done
667+
668+
.PHONY: migrations.individual.mysql8.test\#%
669+
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
670+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
672671

673672
.PHONY: migrations.individual.pgsql.test
674673
migrations.individual.pgsql.test: $(GO_SOURCES)
675-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.pgsql.test
674+
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
675+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
676+
done
677+
678+
.PHONY: migrations.individual.pgsql.test\#%
679+
migrations.individual.pgsql.test\#%: $(GO_SOURCES) generate-ini-pgsql
680+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/pgsql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
681+
676682

677683
.PHONY: migrations.individual.mssql.test
678-
migrations.individual.mssql.test: $(GO_SOURCES)
679-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.mssql.test
684+
migrations.individual.mssql.test: $(GO_SOURCES) generate-ini-mssql
685+
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
686+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg -test.failfast; \
687+
done
688+
689+
.PHONY: migrations.individual.mssql.test\#%
690+
migrations.individual.mssql.test\#%: $(GO_SOURCES) generate-ini-mssql
691+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/mssql.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
680692

681693
.PHONY: migrations.individual.sqlite.test
682-
migrations.individual.sqlite.test: $(GO_SOURCES)
683-
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/models/migrations -o migrations.individual.sqlite.test -tags '$(TEST_TAGS)'
694+
migrations.individual.sqlite.test: $(GO_SOURCES) generate-ini-sqlite
695+
for pkg in $(shell $(GO) list code.gitea.io/gitea/models/migrations/...); do \
696+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' $$pkg; \
697+
done
698+
699+
.PHONY: migrations.individual.sqlite.test\#%
700+
migrations.individual.sqlite.test\#%: $(GO_SOURCES) generate-ini-sqlite
701+
GITEA_ROOT="$(CURDIR)" GITEA_CONF=tests/sqlite.ini $(GO) test $(GOTESTFLAGS) -tags '$(TEST_TAGS)' code.gitea.io/gitea/models/migrations/$*
684702

685703
e2e.mysql.test: $(GO_SOURCES)
686704
$(GO) test $(GOTESTFLAGS) -c code.gitea.io/gitea/tests/e2e -o e2e.mysql.test

assets/go-licenses.json

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/doctor.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
"code.gitea.io/gitea/models/db"
1616
"code.gitea.io/gitea/models/migrations"
17+
migrate_base "code.gitea.io/gitea/models/migrations/base"
1718
"code.gitea.io/gitea/modules/doctor"
1819
"code.gitea.io/gitea/modules/log"
1920
"code.gitea.io/gitea/modules/setting"
@@ -114,7 +115,7 @@ func runRecreateTable(ctx *cli.Context) error {
114115
if err != nil {
115116
return err
116117
}
117-
recreateTables := migrations.RecreateTables(beans...)
118+
recreateTables := migrate_base.RecreateTables(beans...)
118119

119120
return db.InitEngineWithMigration(stdCtx, func(x *xorm.Engine) error {
120121
if err := migrations.EnsureUpToDate(x); err != nil {

docker/root/etc/s6/openssh/setup

-10
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ if [ ! -f /data/ssh/ssh_host_rsa_key ]; then
1414
ssh-keygen -t rsa -b 2048 -f /data/ssh/ssh_host_rsa_key -N "" > /dev/null
1515
fi
1616

17-
if [ ! -f /data/ssh/ssh_host_dsa_key ]; then
18-
echo "Generating /data/ssh/ssh_host_dsa_key..."
19-
ssh-keygen -t dsa -f /data/ssh/ssh_host_dsa_key -N "" > /dev/null
20-
fi
21-
2217
if [ ! -f /data/ssh/ssh_host_ecdsa_key ]; then
2318
echo "Generating /data/ssh/ssh_host_ecdsa_key..."
2419
ssh-keygen -t ecdsa -b 256 -f /data/ssh/ssh_host_ecdsa_key -N "" > /dev/null
@@ -36,17 +31,12 @@ if [ -e /data/ssh/ssh_host_ecdsa_cert ]; then
3631
SSH_ECDSA_CERT=${SSH_ECDSA_CERT:-"/data/ssh/ssh_host_ecdsa_cert"}
3732
fi
3833

39-
if [ -e /data/ssh/ssh_host_dsa_cert ]; then
40-
SSH_DSA_CERT=${SSH_DSA_CERT:-"/data/ssh/ssh_host_dsa_cert"}
41-
fi
42-
4334
if [ -d /etc/ssh ]; then
4435
SSH_PORT=${SSH_PORT:-"22"} \
4536
SSH_LISTEN_PORT=${SSH_LISTEN_PORT:-"${SSH_PORT}"} \
4637
SSH_ED25519_CERT="${SSH_ED25519_CERT:+"HostCertificate "}${SSH_ED25519_CERT}" \
4738
SSH_RSA_CERT="${SSH_RSA_CERT:+"HostCertificate "}${SSH_RSA_CERT}" \
4839
SSH_ECDSA_CERT="${SSH_ECDSA_CERT:+"HostCertificate "}${SSH_ECDSA_CERT}" \
49-
SSH_DSA_CERT="${SSH_DSA_CERT:+"HostCertificate "}${SSH_DSA_CERT}" \
5040
SSH_MAX_STARTUPS="${SSH_MAX_STARTUPS:+"MaxStartups "}${SSH_MAX_STARTUPS}" \
5141
SSH_MAX_SESSIONS="${SSH_MAX_SESSIONS:+"MaxSessions "}${SSH_MAX_SESSIONS}" \
5242
SSH_INCLUDE_FILE="${SSH_INCLUDE_FILE:+"Include "}${SSH_INCLUDE_FILE}" \

docker/root/etc/templates/sshd_config

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ HostKey /data/ssh/ssh_host_rsa_key
1616
${SSH_RSA_CERT}
1717
HostKey /data/ssh/ssh_host_ecdsa_key
1818
${SSH_ECDSA_CERT}
19-
HostKey /data/ssh/ssh_host_dsa_key
20-
${SSH_DSA_CERT}
2119

2220
AuthorizedKeysFile .ssh/authorized_keys
2321
AuthorizedPrincipalsFile .ssh/authorized_principals

docs/content/doc/features/webhooks.en-us.md

+4
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,7 @@ if (json_last_error() !== JSON_ERROR_NONE) {
188188
```
189189

190190
There is a Test Delivery button in the webhook settings that allows to test the configuration as well as a list of the most Recent Deliveries.
191+
192+
### Authorization header
193+
194+
**With 1.19**, Gitea hooks can be configured to send an [authorization header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization) to the webhook target.

models/activities/action.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const (
6464
ActionPublishRelease // 24
6565
ActionPullReviewDismissed // 25
6666
ActionPullRequestReadyForReview // 26
67+
ActionAutoMergePullRequest // 27
6768
)
6869

6970
// Action represents user operation type and other information to
@@ -550,7 +551,7 @@ func notifyWatchers(ctx context.Context, actions ...*Action) error {
550551
if !permIssue[i] {
551552
continue
552553
}
553-
case ActionCreatePullRequest, ActionCommentPull, ActionMergePullRequest, ActionClosePullRequest, ActionReopenPullRequest:
554+
case ActionCreatePullRequest, ActionCommentPull, ActionMergePullRequest, ActionClosePullRequest, ActionReopenPullRequest, ActionAutoMergePullRequest:
554555
if !permPR[i] {
555556
continue
556557
}

0 commit comments

Comments
 (0)