Skip to content

Commit baf78c3

Browse files
author
zjj
committed
* 'main' of https://github.com/go-gitea/gitea: Change initial TrustModel to committer (go-gitea#18335) refactor httplib (go-gitea#18338) Propagate context and ensure git commands run in request context (go-gitea#17868) Upgrade Alpine from 3.13 to 3.15 (go-gitea#18050) [skip ci] Updated translations via Crowdin Stop trimming preceding and suffixing spaces from editor filenames (go-gitea#18334) [skip ci] Updated translations via Crowdin Left-Align text in Unicode warning boxes (go-gitea#18331) Only warn on bidi but still escape non-bidi (go-gitea#18333) Fix incorrect OAuth message (go-gitea#18332) [skip ci] Updated translations via Crowdin Changelog for 1.16.0-rc1 (go-gitea#18309)
2 parents a27850c + 7427b81 commit baf78c3

File tree

213 files changed

+5214
-1504
lines changed

Some content is hidden

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

213 files changed

+5214
-1504
lines changed

CHANGELOG.md

Lines changed: 295 additions & 0 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
###################################
3-
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4-
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
1+
#Build stage
2+
FROM golang:1.17-alpine3.15 AS build-env
53

64
ARG GOPROXY
75
ENV GOPROXY ${GOPROXY:-direct}
@@ -25,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2523
# Begin env-to-ini build
2624
RUN go build contrib/environment-to-ini/environment-to-ini.go
2725

28-
FROM alpine:3.13
26+
FROM alpine:3.15
2927
LABEL maintainer="[email protected]"
3028

3129
EXPOSE 22 3000

Dockerfile.rootless

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
2-
###################################
3-
#Build stage - temporarily using techknowlogick image until we upgrade to latest official alpine/go image
4-
FROM techknowlogick/go:1.17-alpine3.13 AS build-env
1+
#Build stage
2+
FROM golang:1.17-alpine3.15 AS build-env
53

64
ARG GOPROXY
75
ENV GOPROXY ${GOPROXY:-direct}
@@ -25,7 +23,7 @@ RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
2523
# Begin env-to-ini build
2624
RUN go build contrib/environment-to-ini/environment-to-ini.go
2725

28-
FROM alpine:3.13
26+
FROM alpine:3.15
2927
LABEL maintainer="[email protected]"
3028

3129
EXPOSE 2222 3000

cmd/admin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
669669
log.Trace("Processing next %d repos of %d", len(repos), count)
670670
for _, repo := range repos {
671671
log.Trace("Synchronizing repo %s with path %s", repo.FullName(), repo.RepoPath())
672-
gitRepo, err := git.OpenRepository(repo.RepoPath())
672+
gitRepo, err := git.OpenRepositoryCtx(ctx, repo.RepoPath())
673673
if err != nil {
674674
log.Warn("OpenRepository: %v", err)
675675
continue

cmd/doctor.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package cmd
66

77
import (
8-
"context"
98
"fmt"
109
golog "log"
1110
"os"
@@ -116,7 +115,7 @@ func runRecreateTable(ctx *cli.Context) error {
116115
}
117116
recreateTables := migrations.RecreateTables(beans...)
118117

119-
return db.InitEngineWithMigration(context.Background(), func(x *xorm.Engine) error {
118+
return db.InitEngineWithMigration(stdCtx, func(x *xorm.Engine) error {
120119
if err := migrations.EnsureUpToDate(x); err != nil {
121120
return err
122121
}

docker/root/usr/bin/entrypoint

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/sh
22

3+
# Protect against buggy runc in docker <20.10.6 causing problems in with Alpine >= 3.14
4+
if [ ! -x /bin/sh ]; then
5+
echo "Executable test for /bin/sh failed. Your Docker version is too old to run Alpine 3.14+ and Gitea. You must upgrade Docker.";
6+
exit 1;
7+
fi
8+
39
if [ "${USER}" != "git" ]; then
410
# rename user
511
sed -i -e "s/^git\:/${USER}\:/g" /etc/passwd

docker/rootless/usr/local/bin/docker-entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/sh
22

3+
# Protect against buggy runc in docker <20.10.6 causing problems in with Alpine >= 3.14
4+
if [ ! -x /bin/sh ]; then
5+
echo "Executable test for /bin/sh failed. Your Docker version is too old to run Alpine 3.14+ and Gitea. You must upgrade Docker.";
6+
exit 1;
7+
fi
8+
39
if [ -x /usr/local/bin/docker-setup.sh ]; then
410
/usr/local/bin/docker-setup.sh || { echo 'docker setup failed' ; exit 1; }
511
fi

integrations/api_repo_file_helpers.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package integrations
77
import (
88
repo_model "code.gitea.io/gitea/models/repo"
99
user_model "code.gitea.io/gitea/models/user"
10+
"code.gitea.io/gitea/modules/git"
1011
api "code.gitea.io/gitea/modules/structs"
1112
files_service "code.gitea.io/gitea/services/repository/files"
1213
)
@@ -20,7 +21,7 @@ func createFileInBranch(user *user_model.User, repo *repo_model.Repository, tree
2021
Author: nil,
2122
Committer: nil,
2223
}
23-
return files_service.CreateOrUpdateRepoFile(repo, user, opts)
24+
return files_service.CreateOrUpdateRepoFile(git.DefaultContext, repo, user, opts)
2425
}
2526

2627
func createFile(user *user_model.User, repo *repo_model.Repository, treePath string) (*api.FileResponse, error) {

integrations/api_repo_get_contents_list_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func testAPIGetContentsList(t *testing.T, u *url.URL) {
7272

7373
// Make a new branch in repo1
7474
newBranch := "test_branch"
75-
err := repo_service.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
75+
err := repo_service.CreateNewBranch(git.DefaultContext, user2, repo1, repo1.DefaultBranch, newBranch)
7676
assert.NoError(t, err)
7777
// Get the commit ID of the default branch
7878
gitRepo, err := git.OpenRepository(repo1.RepoPath())

integrations/api_repo_get_contents_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func testAPIGetContents(t *testing.T, u *url.URL) {
7373

7474
// Make a new branch in repo1
7575
newBranch := "test_branch"
76-
err := repo_service.CreateNewBranch(user2, repo1, repo1.DefaultBranch, newBranch)
76+
err := repo_service.CreateNewBranch(git.DefaultContext, user2, repo1, repo1.DefaultBranch, newBranch)
7777
assert.NoError(t, err)
7878
// Get the commit ID of the default branch
7979
gitRepo, err := git.OpenRepository(repo1.RepoPath())

0 commit comments

Comments
 (0)