Skip to content

Commit 55bb4b0

Browse files
authored
Merge branch 'main' into make-commit-info-cancelable
2 parents b8a683f + b3ef6a6 commit 55bb4b0

Some content is hidden

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

44 files changed

+1273
-860
lines changed

Dockerfile.rootless

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ USER git:git
6060
ENV GITEA_WORK_DIR /var/lib/gitea
6161
ENV GITEA_CUSTOM /var/lib/gitea/custom
6262
ENV GITEA_TEMP /tmp/gitea
63+
ENV TMPDIR /tmp/gitea
64+
6365
#TODO add to docs the ability to define the ini to load (usefull to test and revert a config)
6466
ENV GITEA_APP_INI /etc/gitea/app.ini
6567
ENV HOME "/var/lib/gitea/git"

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ EXTRA_GOFLAGS ?=
6464
MAKE_VERSION := $(shell $(MAKE) -v | head -n 1)
6565
MAKE_EVIDENCE_DIR := .make_evidence
6666

67-
ifneq ($(RACE_ENABLED),)
68-
GOTESTFLAGS ?= -race
67+
ifeq ($(RACE_ENABLED),true)
68+
GOFLAGS += -race
69+
GOTESTFLAGS += -race
6970
endif
7071

7172
STORED_VERSION_FILE := VERSION
@@ -380,7 +381,7 @@ test-check:
380381
.PHONY: test\#%
381382
test\#%:
382383
@echo "Running go test with -tags '$(TEST_TAGS)'..."
383-
@$(GO) test -mod=vendor -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_PACKAGES)
384+
@$(GO) test -mod=vendor $(GOTESTFLAGS) -tags='$(TEST_TAGS)' -run $(subst .,/,$*) $(GO_PACKAGES)
384385

385386
.PHONY: coverage
386387
coverage:

docker/root/etc/s6/openssh/setup

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ if [ -d /etc/ssh ]; then
4747
SSH_RSA_CERT="${SSH_RSA_CERT:+"HostCertificate "}${SSH_RSA_CERT}" \
4848
SSH_ECDSA_CERT="${SSH_ECDSA_CERT:+"HostCertificate "}${SSH_ECDSA_CERT}" \
4949
SSH_DSA_CERT="${SSH_DSA_CERT:+"HostCertificate "}${SSH_DSA_CERT}" \
50+
SSH_MAX_STARTUPS="${SSH_MAX_STARTUPS:+"MaxStartups "}${SSH_MAX_STARTUPS}" \
51+
SSH_MAX_SESSIONS="${SSH_MAX_SESSIONS:+"MaxSessions "}${SSH_MAX_SESSIONS}" \
5052
envsubst < /etc/templates/sshd_config > /etc/ssh/sshd_config
5153

5254
chmod 0644 /etc/ssh/sshd_config

docker/root/etc/templates/sshd_config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ AddressFamily any
55
ListenAddress 0.0.0.0
66
ListenAddress ::
77

8+
${SSH_MAX_STARTUPS}
9+
${SSH_MAX_SESSIONS}
10+
811
LogLevel INFO
912

1013
HostKey /data/ssh/ssh_host_ed25519_key

integrations/api_repo_lfs_locks_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"time"
1212

1313
"code.gitea.io/gitea/models"
14+
"code.gitea.io/gitea/modules/lfs"
1415
"code.gitea.io/gitea/modules/setting"
1516
api "code.gitea.io/gitea/modules/structs"
1617

@@ -40,7 +41,7 @@ func TestAPILFSLocksNotLogin(t *testing.T) {
4041
repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: 1}).(*models.Repository)
4142

4243
req := NewRequestf(t, "GET", "/%s/%s.git/info/lfs/locks", user.Name, repo.Name)
43-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
44+
req.Header.Set("Accept", lfs.MediaType)
4445
resp := MakeRequest(t, req, http.StatusUnauthorized)
4546
var lfsLockError api.LFSLockError
4647
DecodeJSON(t, resp, &lfsLockError)
@@ -102,8 +103,8 @@ func TestAPILFSLocksLogged(t *testing.T) {
102103
for _, test := range tests {
103104
session := loginUser(t, test.user.Name)
104105
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/%s.git/info/lfs/locks", test.repo.FullName()), map[string]string{"path": test.path})
105-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
106-
req.Header.Set("Content-Type", "application/vnd.git-lfs+json")
106+
req.Header.Set("Accept", lfs.MediaType)
107+
req.Header.Set("Content-Type", lfs.MediaType)
107108
resp := session.MakeRequest(t, req, test.httpResult)
108109
if len(test.addTime) > 0 {
109110
var lfsLock api.LFSLockResponse
@@ -119,7 +120,7 @@ func TestAPILFSLocksLogged(t *testing.T) {
119120
for _, test := range resultsTests {
120121
session := loginUser(t, test.user.Name)
121122
req := NewRequestf(t, "GET", "/%s.git/info/lfs/locks", test.repo.FullName())
122-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
123+
req.Header.Set("Accept", lfs.MediaType)
123124
resp := session.MakeRequest(t, req, http.StatusOK)
124125
var lfsLocks api.LFSLockList
125126
DecodeJSON(t, resp, &lfsLocks)
@@ -131,8 +132,8 @@ func TestAPILFSLocksLogged(t *testing.T) {
131132
}
132133

133134
req = NewRequestWithJSON(t, "POST", fmt.Sprintf("/%s.git/info/lfs/locks/verify", test.repo.FullName()), map[string]string{})
134-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
135-
req.Header.Set("Content-Type", "application/vnd.git-lfs+json")
135+
req.Header.Set("Accept", lfs.MediaType)
136+
req.Header.Set("Content-Type", lfs.MediaType)
136137
resp = session.MakeRequest(t, req, http.StatusOK)
137138
var lfsLocksVerify api.LFSLockListVerify
138139
DecodeJSON(t, resp, &lfsLocksVerify)
@@ -155,8 +156,8 @@ func TestAPILFSLocksLogged(t *testing.T) {
155156
for _, test := range deleteTests {
156157
session := loginUser(t, test.user.Name)
157158
req := NewRequestWithJSON(t, "POST", fmt.Sprintf("/%s.git/info/lfs/locks/%s/unlock", test.repo.FullName(), test.lockID), map[string]string{})
158-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
159-
req.Header.Set("Content-Type", "application/vnd.git-lfs+json")
159+
req.Header.Set("Accept", lfs.MediaType)
160+
req.Header.Set("Content-Type", lfs.MediaType)
160161
resp := session.MakeRequest(t, req, http.StatusOK)
161162
var lfsLockRep api.LFSLockResponse
162163
DecodeJSON(t, resp, &lfsLockRep)
@@ -168,7 +169,7 @@ func TestAPILFSLocksLogged(t *testing.T) {
168169
for _, test := range resultsTests {
169170
session := loginUser(t, test.user.Name)
170171
req := NewRequestf(t, "GET", "/%s.git/info/lfs/locks", test.repo.FullName())
171-
req.Header.Set("Accept", "application/vnd.git-lfs+json")
172+
req.Header.Set("Accept", lfs.MediaType)
172173
resp := session.MakeRequest(t, req, http.StatusOK)
173174
var lfsLocks api.LFSLockList
174175
DecodeJSON(t, resp, &lfsLocks)

0 commit comments

Comments
 (0)