Skip to content

Commit be19565

Browse files
authored
Merge branch 'go-gitea:main' into main
2 parents 80e3c30 + cdc0733 commit be19565

Some content is hidden

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

62 files changed

+861
-972
lines changed

cmd/admin_user_create.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func runCreateUser(ctx context.Context, c *cli.Command) error {
151151
if err != nil {
152152
return err
153153
}
154+
// codeql[disable-next-line=go/clear-text-logging]
154155
fmt.Printf("generated random password is '%s'\n", password)
155156
} else if userType == user_model.UserTypeIndividual {
156157
return errors.New("must set either password or random-password flag")

cmd/admin_user_must_change_password.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ func runMustChangePassword(ctx context.Context, c *cli.Command) error {
5858
return err
5959
}
6060

61+
// codeql[disable-next-line=go/clear-text-logging]
6162
fmt.Printf("Updated %d users setting MustChangePassword to %t\n", n, mustChangePassword)
6263
return nil
6364
}

cmd/generate.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func runGenerateSecretKey(_ context.Context, c *cli.Command) error {
9191
return err
9292
}
9393

94+
// codeql[disable-next-line=go/clear-text-logging]
9495
fmt.Printf("%s", secretKey)
9596

9697
if isatty.IsTerminal(os.Stdout.Fd()) {

cmd/hook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ Gitea or set your environment appropriately.`, "")
186186
userID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPusherID), 10, 64)
187187
prID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPRID), 10, 64)
188188
deployKeyID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvDeployKeyID), 10, 64)
189-
actionPerm, _ := strconv.ParseInt(os.Getenv(repo_module.EnvActionPerm), 10, 64)
189+
actionPerm, _ := strconv.Atoi(os.Getenv(repo_module.EnvActionPerm))
190190

191191
hookOptions := private.HookOptions{
192192
UserID: userID,
@@ -196,7 +196,7 @@ Gitea or set your environment appropriately.`, "")
196196
GitPushOptions: pushOptions(),
197197
PullRequestID: prID,
198198
DeployKeyID: deployKeyID,
199-
ActionPerm: int(actionPerm),
199+
ActionPerm: actionPerm,
200200
}
201201

202202
scanner := bufio.NewScanner(os.Stdin)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ replace github.com/jaytaylor/html2text => github.com/Necoro/html2text v0.0.0-202
295295

296296
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
297297

298-
replace github.com/nektos/act => gitea.com/gitea/act v0.261.6
298+
replace github.com/nektos/act => gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763
299299

300300
// TODO: the only difference is in `PutObject`: the fork doesn't use `NewVerifyingReader(r, sha256.New(), oid, expectedSize)`, need to figure out why
301301
replace github.com/charmbracelet/git-lfs-transfer => gitea.com/gitea/git-lfs-transfer v0.2.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
3131
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
3232
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
3333
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
34-
gitea.com/gitea/act v0.261.6 h1:CjZwKOyejonNFDmsXOw3wGm5Vet573hHM6VMLsxtvPY=
35-
gitea.com/gitea/act v0.261.6/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
34+
gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763 h1:ohdxegvslDEllZmRNDqpKun6L4Oq81jNdEDtGgHEV2c=
35+
gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
3636
gitea.com/gitea/git-lfs-transfer v0.2.0 h1:baHaNoBSRaeq/xKayEXwiDQtlIjps4Ac/Ll4KqLMB40=
3737
gitea.com/gitea/git-lfs-transfer v0.2.0/go.mod h1:UrXUCm3xLQkq15fu7qlXHUMlrhdlXHoi13KH2Dfiits=
3838
gitea.com/gitea/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:BAFmdZpRW7zMQZQDClaCWobRj9uL1MR3MzpCVJvc5s4=

models/fixtures/branch.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,15 @@
213213
is_deleted: false
214214
deleted_by_id: 0
215215
deleted_unix: 0
216+
217+
-
218+
id: 26
219+
repo_id: 10
220+
name: 'feature/1'
221+
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
222+
commit_message: 'Initial commit'
223+
commit_time: 1489950479
224+
pusher_id: 2
225+
is_deleted: false
226+
deleted_by_id: 0
227+
deleted_unix: 0

models/repo/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ func (repo *Repository) IsGenerated() bool {
605605

606606
// RepoPath returns repository path by given user and repository name.
607607
func RepoPath(userName, repoName string) string { //revive:disable-line:exported
608-
return filepath.Join(user_model.UserPath(userName), strings.ToLower(repoName)+".git")
608+
return filepath.Join(setting.RepoRootPath, filepath.Clean(strings.ToLower(userName)), filepath.Clean(strings.ToLower(repoName)+".git"))
609609
}
610610

611611
// RepoPath returns the repository path

models/user/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ func GetInactiveUsers(ctx context.Context, olderThan time.Duration) ([]*User, er
980980

981981
// UserPath returns the path absolute path of user repositories.
982982
func UserPath(userName string) string { //revive:disable-line:exported
983-
return filepath.Join(setting.RepoRootPath, strings.ToLower(userName))
983+
return filepath.Join(setting.RepoRootPath, filepath.Clean(strings.ToLower(userName)))
984984
}
985985

986986
// GetUserByID returns the user object by given ID if exists.

modules/auth/password/hash/argon2.go

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,11 @@ func NewArgon2Hasher(config string) *Argon2Hasher {
6161
return nil
6262
}
6363

64-
parsed, err := parseUIntParam(vals[0], "time", "argon2", config, nil)
65-
hasher.time = uint32(parsed)
66-
67-
parsed, err = parseUIntParam(vals[1], "memory", "argon2", config, err)
68-
hasher.memory = uint32(parsed)
69-
70-
parsed, err = parseUIntParam(vals[2], "threads", "argon2", config, err)
71-
hasher.threads = uint8(parsed)
72-
73-
parsed, err = parseUIntParam(vals[3], "keyLen", "argon2", config, err)
74-
hasher.keyLen = uint32(parsed)
64+
var err error
65+
hasher.time, err = parseUintParam[uint32](vals[0], "time", "argon2", config, nil)
66+
hasher.memory, err = parseUintParam[uint32](vals[1], "memory", "argon2", config, err)
67+
hasher.threads, err = parseUintParam[uint8](vals[2], "threads", "argon2", config, err)
68+
hasher.keyLen, err = parseUintParam[uint32](vals[3], "keyLen", "argon2", config, err)
7569
if err != nil {
7670
return nil
7771
}

0 commit comments

Comments
 (0)