We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 80e3c30 + cdc0733 commit be19565Copy full SHA for be19565
cmd/admin_user_create.go
@@ -151,6 +151,7 @@ func runCreateUser(ctx context.Context, c *cli.Command) error {
151
if err != nil {
152
return err
153
}
154
+ // codeql[disable-next-line=go/clear-text-logging]
155
fmt.Printf("generated random password is '%s'\n", password)
156
} else if userType == user_model.UserTypeIndividual {
157
return errors.New("must set either password or random-password flag")
cmd/admin_user_must_change_password.go
@@ -58,6 +58,7 @@ func runMustChangePassword(ctx context.Context, c *cli.Command) error {
58
59
60
61
62
fmt.Printf("Updated %d users setting MustChangePassword to %t\n", n, mustChangePassword)
63
return nil
64
cmd/generate.go
@@ -91,6 +91,7 @@ func runGenerateSecretKey(_ context.Context, c *cli.Command) error {
91
92
93
94
95
fmt.Printf("%s", secretKey)
96
97
if isatty.IsTerminal(os.Stdout.Fd()) {
cmd/hook.go
@@ -186,7 +186,7 @@ Gitea or set your environment appropriately.`, "")
186
userID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPusherID), 10, 64)
187
prID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvPRID), 10, 64)
188
deployKeyID, _ := strconv.ParseInt(os.Getenv(repo_module.EnvDeployKeyID), 10, 64)
189
- actionPerm, _ := strconv.ParseInt(os.Getenv(repo_module.EnvActionPerm), 10, 64)
+ actionPerm, _ := strconv.Atoi(os.Getenv(repo_module.EnvActionPerm))
190
191
hookOptions := private.HookOptions{
192
UserID: userID,
@@ -196,7 +196,7 @@ Gitea or set your environment appropriately.`, "")
196
GitPushOptions: pushOptions(),
197
PullRequestID: prID,
198
DeployKeyID: deployKeyID,
199
- ActionPerm: int(actionPerm),
+ ActionPerm: actionPerm,
200
201
202
scanner := bufio.NewScanner(os.Stdin)
go.mod
@@ -295,7 +295,7 @@ replace github.com/jaytaylor/html2text => github.com/Necoro/html2text v0.0.0-202
295
296
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
297
298
-replace github.com/nektos/act => gitea.com/gitea/act v0.261.6
+replace github.com/nektos/act => gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763
299
300
// TODO: the only difference is in `PutObject`: the fork doesn't use `NewVerifyingReader(r, sha256.New(), oid, expectedSize)`, need to figure out why
301
replace github.com/charmbracelet/git-lfs-transfer => gitea.com/gitea/git-lfs-transfer v0.2.0
go.sum
@@ -31,8 +31,8 @@ dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA=
31
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
32
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
33
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=
+gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763 h1:ohdxegvslDEllZmRNDqpKun6L4Oq81jNdEDtGgHEV2c=
+gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
36
gitea.com/gitea/git-lfs-transfer v0.2.0 h1:baHaNoBSRaeq/xKayEXwiDQtlIjps4Ac/Ll4KqLMB40=
37
gitea.com/gitea/git-lfs-transfer v0.2.0/go.mod h1:UrXUCm3xLQkq15fu7qlXHUMlrhdlXHoi13KH2Dfiits=
38
gitea.com/gitea/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:BAFmdZpRW7zMQZQDClaCWobRj9uL1MR3MzpCVJvc5s4=
models/fixtures/branch.yml
@@ -213,3 +213,15 @@
213
is_deleted: false
214
deleted_by_id: 0
215
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
@@ -605,7 +605,7 @@ func (repo *Repository) IsGenerated() bool {
605
606
// RepoPath returns repository path by given user and repository name.
607
func RepoPath(userName, repoName string) string { //revive:disable-line:exported
608
- return filepath.Join(user_model.UserPath(userName), strings.ToLower(repoName)+".git")
+ return filepath.Join(setting.RepoRootPath, filepath.Clean(strings.ToLower(userName)), filepath.Clean(strings.ToLower(repoName)+".git"))
609
610
611
// RepoPath returns the repository path
models/user/user.go
@@ -980,7 +980,7 @@ func GetInactiveUsers(ctx context.Context, olderThan time.Duration) ([]*User, er
980
981
// UserPath returns the path absolute path of user repositories.
982
func UserPath(userName string) string { //revive:disable-line:exported
983
- return filepath.Join(setting.RepoRootPath, strings.ToLower(userName))
+ return filepath.Join(setting.RepoRootPath, filepath.Clean(strings.ToLower(userName)))
984
985
986
// GetUserByID returns the user object by given ID if exists.
modules/auth/password/hash/argon2.go
@@ -61,17 +61,11 @@ func NewArgon2Hasher(config string) *Argon2Hasher {
- 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)
+ var err error
+ hasher.time, err = parseUintParam[uint32](vals[0], "time", "argon2", config, nil)
+ hasher.memory, err = parseUintParam[uint32](vals[1], "memory", "argon2", config, err)
+ hasher.threads, err = parseUintParam[uint8](vals[2], "threads", "argon2", config, err)
+ hasher.keyLen, err = parseUintParam[uint32](vals[3], "keyLen", "argon2", config, err)
75
76
77
0 commit comments