From aab4b2dd25861cd0f4f40a9150738ea7c6b28589 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 23 Jul 2023 17:16:14 -0400 Subject: [PATCH 01/12] Add github action to codespell main on push and PRs --- .github/workflows/codespell.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000000..3ebbf5504b9 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,22 @@ +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From 84d7271b9ee6fc4a0c044975e60e7329ac736216 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 23 Jul 2023 17:16:14 -0400 Subject: [PATCH 02/12] Add rudimentary codespell config --- .codespellrc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000000..da3c05717ce --- /dev/null +++ b/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +skip = .git,*.pdf,*.svg +# +# ignore-words-list = From c1f7906a0e0ed918aef7c34c55673c951bb0c302 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 23 Jul 2023 17:19:19 -0400 Subject: [PATCH 03/12] Add some skips for venodred parts etc --- .codespellrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index da3c05717ce..4119e230cd4 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,4 @@ [codespell] -skip = .git,*.pdf,*.svg +skip = .git,*.pdf,*.svg,*.min.js,plugins,locale # -# ignore-words-list = +ignore-words-list = unknwon From cb3f401999f8ca501b9d454f9f45d3e8eafaf0fa Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 23 Jul 2023 17:19:37 -0400 Subject: [PATCH 04/12] exmaple -> example --- internal/db/users_test.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/internal/db/users_test.go b/internal/db/users_test.go index 8b2e7e594e0..ebe60fa2cc9 100644 --- a/internal/db/users_test.go +++ b/internal/db/users_test.go @@ -484,7 +484,7 @@ func usersDeleteByID(t *testing.T, db *users) { reposStore := NewReposStore(db.DB) t.Run("user still has repository ownership", func(t *testing.T) { - alice, err := db.Create(ctx, "alice", "alice@exmaple.com", CreateUserOptions{}) + alice, err := db.Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) require.NoError(t, err) _, err = reposStore.Create(ctx, alice.ID, CreateRepoOptions{Name: "repo1"}) @@ -496,7 +496,7 @@ func usersDeleteByID(t *testing.T, db *users) { }) t.Run("user still has organization membership", func(t *testing.T) { - bob, err := db.Create(ctx, "bob", "bob@exmaple.com", CreateUserOptions{}) + bob, err := db.Create(ctx, "bob", "bob@example.com", CreateUserOptions{}) require.NoError(t, err) // TODO: Use Orgs.Create to replace SQL hack when the method is available. @@ -517,14 +517,14 @@ func usersDeleteByID(t *testing.T, db *users) { assert.Equal(t, wantErr, err) }) - cindy, err := db.Create(ctx, "cindy", "cindy@exmaple.com", CreateUserOptions{}) + cindy, err := db.Create(ctx, "cindy", "cindy@example.com", CreateUserOptions{}) require.NoError(t, err) - frank, err := db.Create(ctx, "frank", "frank@exmaple.com", CreateUserOptions{}) + frank, err := db.Create(ctx, "frank", "frank@example.com", CreateUserOptions{}) require.NoError(t, err) repo2, err := reposStore.Create(ctx, cindy.ID, CreateRepoOptions{Name: "repo2"}) require.NoError(t, err) - testUser, err := db.Create(ctx, "testUser", "testUser@exmaple.com", CreateUserOptions{}) + testUser, err := db.Create(ctx, "testUser", "testUser@example.com", CreateUserOptions{}) require.NoError(t, err) // Mock watches, stars and follows @@ -694,14 +694,14 @@ func usersDeleteInactivated(t *testing.T, db *users) { ctx := context.Background() // User with repository ownership should be skipped - alice, err := db.Create(ctx, "alice", "alice@exmaple.com", CreateUserOptions{}) + alice, err := db.Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) require.NoError(t, err) reposStore := NewReposStore(db.DB) _, err = reposStore.Create(ctx, alice.ID, CreateRepoOptions{Name: "repo1"}) require.NoError(t, err) // User with organization membership should be skipped - bob, err := db.Create(ctx, "bob", "bob@exmaple.com", CreateUserOptions{}) + bob, err := db.Create(ctx, "bob", "bob@example.com", CreateUserOptions{}) require.NoError(t, err) // TODO: Use Orgs.Create to replace SQL hack when the method is available. org1, err := db.Create(ctx, "org1", "org1@example.com", CreateUserOptions{}) @@ -716,11 +716,11 @@ func usersDeleteInactivated(t *testing.T, db *users) { require.NoError(t, err) // User activated state should be skipped - _, err = db.Create(ctx, "cindy", "cindy@exmaple.com", CreateUserOptions{Activated: true}) + _, err = db.Create(ctx, "cindy", "cindy@example.com", CreateUserOptions{Activated: true}) require.NoError(t, err) // User meant to be deleted - david, err := db.Create(ctx, "david", "david@exmaple.com", CreateUserOptions{}) + david, err := db.Create(ctx, "david", "david@example.com", CreateUserOptions{}) require.NoError(t, err) tempSSHRootPath := filepath.Join(os.TempDir(), "usersDeleteInactivated-tempSSHRootPath") @@ -749,7 +749,7 @@ func usersGetByEmail(t *testing.T, db *users) { t.Run("ignore organization", func(t *testing.T) { // TODO: Use Orgs.Create to replace SQL hack when the method is available. - org, err := db.Create(ctx, "gogs", "gogs@exmaple.com", CreateUserOptions{}) + org, err := db.Create(ctx, "gogs", "gogs@example.com", CreateUserOptions{}) require.NoError(t, err) err = db.Model(&User{}).Where("id", org.ID).UpdateColumn("type", UserTypeOrganization).Error @@ -761,7 +761,7 @@ func usersGetByEmail(t *testing.T, db *users) { }) t.Run("by primary email", func(t *testing.T) { - alice, err := db.Create(ctx, "alice", "alice@exmaple.com", CreateUserOptions{}) + alice, err := db.Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) require.NoError(t, err) _, err = db.GetByEmail(ctx, alice.Email) @@ -783,7 +783,7 @@ func usersGetByEmail(t *testing.T, db *users) { require.NoError(t, err) // TODO: Use UserEmails.Create to replace SQL hack when the method is available. - email2 := "bob2@exmaple.com" + email2 := "bob2@example.com" err = db.Exec(`INSERT INTO email_address (uid, email) VALUES (?, ?)`, bob.ID, email2).Error require.NoError(t, err) @@ -804,7 +804,7 @@ func usersGetByEmail(t *testing.T, db *users) { func usersGetByID(t *testing.T, db *users) { ctx := context.Background() - alice, err := db.Create(ctx, "alice", "alice@exmaple.com", CreateUserOptions{}) + alice, err := db.Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) require.NoError(t, err) user, err := db.GetByID(ctx, alice.ID) @@ -819,7 +819,7 @@ func usersGetByID(t *testing.T, db *users) { func usersGetByUsername(t *testing.T, db *users) { ctx := context.Background() - alice, err := db.Create(ctx, "alice", "alice@exmaple.com", CreateUserOptions{}) + alice, err := db.Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) require.NoError(t, err) user, err := db.GetByUsername(ctx, alice.Name) @@ -834,7 +834,7 @@ func usersGetByUsername(t *testing.T, db *users) { func usersGetByKeyID(t *testing.T, db *users) { ctx := context.Background() - alice, err := db.Create(ctx, "alice", "alice@exmaple.com", CreateUserOptions{}) + alice, err := db.Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) require.NoError(t, err) // TODO: Use PublicKeys.Create to replace SQL hack when the method is available. @@ -861,11 +861,11 @@ func usersGetByKeyID(t *testing.T, db *users) { func usersGetMailableEmailsByUsernames(t *testing.T, db *users) { ctx := context.Background() - alice, err := db.Create(ctx, "alice", "alice@exmaple.com", CreateUserOptions{}) + alice, err := db.Create(ctx, "alice", "alice@example.com", CreateUserOptions{}) require.NoError(t, err) - bob, err := db.Create(ctx, "bob", "bob@exmaple.com", CreateUserOptions{Activated: true}) + bob, err := db.Create(ctx, "bob", "bob@example.com", CreateUserOptions{Activated: true}) require.NoError(t, err) - _, err = db.Create(ctx, "cindy", "cindy@exmaple.com", CreateUserOptions{Activated: true}) + _, err = db.Create(ctx, "cindy", "cindy@example.com", CreateUserOptions{Activated: true}) require.NoError(t, err) got, err := db.GetMailableEmailsByUsernames(ctx, []string{alice.Name, bob.Name, "ignore-non-exist"}) From ca0ec61cf8972951317c9675e6192a86f52ac641 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 23 Jul 2023 17:20:34 -0400 Subject: [PATCH 05/12] more skips --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index 4119e230cd4..6f8a940689c 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,4 @@ [codespell] -skip = .git,*.pdf,*.svg,*.min.js,plugins,locale +skip = .git,*.pdf,*.svg,*.min.js,plugins,locale,*.min.css.map,license # ignore-words-list = unknwon From bf40f3b40b38bc10e8743156d2eb35c3d3463828 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 23 Jul 2023 17:22:50 -0400 Subject: [PATCH 06/12] more ignores --- .codespellrc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.codespellrc b/.codespellrc index 6f8a940689c..f7924172207 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,5 @@ [codespell] -skip = .git,*.pdf,*.svg,*.min.js,plugins,locale,*.min.css.map,license -# -ignore-words-list = unknwon +skip = .git,*.pdf,*.svg,*.js,plugins,locale,*.min.css*,license +# unknwon - name +# poping - used broadly +ignore-words-list = unknwon,poping From 3f28ec824dd01d126539b8757f73a561d5b595ed Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 23 Jul 2023 17:25:10 -0400 Subject: [PATCH 07/12] skipts --- .codespellrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index f7924172207..c2b61ec3d4b 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,5 +1,7 @@ [codespell] skip = .git,*.pdf,*.svg,*.js,plugins,locale,*.min.css*,license +ignore-regex = Leve e rápido # unknwon - name # poping - used broadly -ignore-words-list = unknwon,poping +# oder - from German +ignore-words-list = unknwon,poping,oder,readby,hastable,expport From e207fdabdd4131c93a16769a9575944d2331bf65 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 24 Jul 2023 09:20:22 -0400 Subject: [PATCH 08/12] skipts --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index c2b61ec3d4b..e48af756c95 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,5 +1,5 @@ [codespell] -skip = .git,*.pdf,*.svg,*.js,plugins,locale,*.min.css*,license +skip = .git,*.pdf,*.svg,*.js,plugins,locale,*.min.css*,license,conf ignore-regex = Leve e rápido # unknwon - name # poping - used broadly From 11515344aad2527f102d3b7575e84473f85a80f2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 24 Jul 2023 09:48:12 -0400 Subject: [PATCH 09/12] more ignores --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index e48af756c95..e03daaffe46 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,6 @@ [codespell] skip = .git,*.pdf,*.svg,*.js,plugins,locale,*.min.css*,license,conf -ignore-regex = Leve e rápido +ignore-regex = (Leve e rápido|gogs\.io/unknwon/upsteam) # unknwon - name # poping - used broadly # oder - from German From 69c9ff18d524a3e9bffe157478785964acddfdd8 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 24 Jul 2023 09:50:34 -0400 Subject: [PATCH 10/12] more ignores --- .codespellrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index e03daaffe46..096e38649e5 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,7 +1,8 @@ [codespell] -skip = .git,*.pdf,*.svg,*.js,plugins,locale,*.min.css*,license,conf +# Ignore entire home.tmpl since has other languages +skip = .git,*.pdf,*.svg,*.js,plugins,locale,*.min.css*,license,conf,home.tmpl ignore-regex = (Leve e rápido|gogs\.io/unknwon/upsteam) # unknwon - name # poping - used broadly # oder - from German -ignore-words-list = unknwon,poping,oder,readby,hastable,expport +ignore-words-list = unknwon,poping,oder,readby,hastable,expport,followings From 1314b78681b9a167bc9e872cc8252d16f2c43d29 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 24 Jul 2023 09:51:23 -0400 Subject: [PATCH 11/12] [DATALAD RUNCMD] Do interactive fixing of leftover typos === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- SECURITY.md | 2 +- internal/gitutil/diff.go | 2 +- internal/testutil/testutil.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 24ffd4c10dc..1b2a5464513 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,7 +2,7 @@ ## Supported versions -Only lastest two minor version releases are supported (>= 0.12) for accepting vulnerability reports and patching fixes. +Only latest two minor version releases are supported (>= 0.12) for accepting vulnerability reports and patching fixes. Existing vulnerability reports are being tracked in [Gogs Vulnerability Reports](https://jcunknwon.notion.site/Gogs-Vulnerability-Reports-81d7df52e45c4f159274e46ba48ed1b9). diff --git a/internal/gitutil/diff.go b/internal/gitutil/diff.go index d0e2c76e34a..ff9ecd8c39d 100644 --- a/internal/gitutil/diff.go +++ b/internal/gitutil/diff.go @@ -77,7 +77,7 @@ func (s *DiffSection) ComputedInlineDiffFor(line *git.DiffLine) template.HTML { func diffsToHTML(diffs []diffmatchpatch.Diff, lineType git.DiffLineType) template.HTML { buf := bytes.NewBuffer(nil) - // Reproduce signs which are cutted for inline diff before. + // Reproduce signs which are cut for inline diff before. switch lineType { case git.DiffLineAdd: buf.WriteByte('+') diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index c7c1bba295b..73e6402add1 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -9,5 +9,5 @@ import ( "strings" ) -// InTest is ture if the current binary looks like a test artifact. +// InTest is true if the current binary looks like a test artifact. var InTest = len(os.Args) > 0 && strings.HasSuffix(strings.TrimSuffix(os.Args[0], ".exe"), ".test") From ea087a4c5f3b3ac982c78259aa2b84424000235d Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 13 Sep 2023 10:35:52 -0400 Subject: [PATCH 12/12] [DATALAD RUNCMD] run codespell throughout fixing typo automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- SECURITY.md | 2 +- internal/cmd/web.go | 4 ++-- internal/route/user/auth.go | 2 +- internal/sync/exclusive_pool.go | 2 +- internal/sync/unique_queue.go | 2 +- scripts/windows/install-as-service.bat | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 1b2a5464513..94195dbdd3a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -9,7 +9,7 @@ Existing vulnerability reports are being tracked in [Gogs Vulnerability Reports] ## Vulnerability lifecycle 1. Report a vulnerability: - - We strongly enourage to use https://huntr.dev/ for submitting and managing status of vulnerability reports. + - We strongly encourage to use https://huntr.dev/ for submitting and managing status of vulnerability reports. - Alternatively, you may send vulnerability reports through emails to [security@gogs.io](mailto:security@gogs.io). 1. Create a [dummy issue](https://github.com/gogs/gogs/issues/6901) with high-level description of the security vulnerability for credibility and tracking purposes. 1. Project maintainers review the report and either: diff --git a/internal/cmd/web.go b/internal/cmd/web.go index 3be1db06f56..924d24f9d54 100644 --- a/internal/cmd/web.go +++ b/internal/cmd/web.go @@ -477,7 +477,7 @@ func runWeb(c *cli.Context) error { m.Get("/milestones", repo.Milestones) }, ignSignIn, context.RepoAssignment(true)) m.Group("/:username/:reponame", func() { - // FIXME: should use different URLs but mostly same logic for comments of issue and pull reuqest. + // FIXME: should use different URLs but mostly same logic for comments of issue and pull request. // So they can apply their own enable/disable logic on routers. m.Group("/issues", func() { m.Combo("/new", repo.MustEnableIssues).Get(context.RepoRef(), repo.NewIssue). @@ -502,7 +502,7 @@ func runWeb(c *cli.Context) error { }, ignSignIn, context.RepoAssignment(false, true)) m.Group("/:username/:reponame", func() { - // FIXME: should use different URLs but mostly same logic for comments of issue and pull reuqest. + // FIXME: should use different URLs but mostly same logic for comments of issue and pull request. // So they can apply their own enable/disable logic on routers. m.Group("/issues", func() { m.Group("/:index", func() { diff --git a/internal/route/user/auth.go b/internal/route/user/auth.go index 1e6a058968d..c2c77329632 100644 --- a/internal/route/user/auth.go +++ b/internal/route/user/auth.go @@ -287,7 +287,7 @@ func LoginTwoFactorRecoveryCodePost(c *context.Context) { func SignOut(c *context.Context) { _ = c.Session.Flush() - _ = c.Session.Destory(c.Context) + _ = c.Session.Destroy(c.Context) c.SetCookie(conf.Security.CookieUsername, "", -1, conf.Server.Subpath) c.SetCookie(conf.Security.CookieRememberName, "", -1, conf.Server.Subpath) c.SetCookie(conf.Session.CSRFCookieName, "", -1, conf.Server.Subpath) diff --git a/internal/sync/exclusive_pool.go b/internal/sync/exclusive_pool.go index 744cc7c996c..7c1a8930cee 100644 --- a/internal/sync/exclusive_pool.go +++ b/internal/sync/exclusive_pool.go @@ -39,7 +39,7 @@ func NewExclusivePool() *ExclusivePool { } // CheckIn checks in an instance to the pool and hangs while instance -// with same indentity is using the lock. +// with same identity is using the lock. func (p *ExclusivePool) CheckIn(identity string) { p.lock.Lock() diff --git a/internal/sync/unique_queue.go b/internal/sync/unique_queue.go index cc0ea94fe65..f2c22462c41 100644 --- a/internal/sync/unique_queue.go +++ b/internal/sync/unique_queue.go @@ -36,7 +36,7 @@ func (q *UniqueQueue) Queue() <-chan string { return q.queue } -// Exist returns true if there is an instance with given indentity +// Exist returns true if there is an instance with given identity // exists in the queue. func (q *UniqueQueue) Exist(id any) bool { return q.table.IsRunning(com.ToStr(id)) diff --git a/scripts/windows/install-as-service.bat b/scripts/windows/install-as-service.bat index 1ab4cfd7523..2ee4771313e 100644 --- a/scripts/windows/install-as-service.bat +++ b/scripts/windows/install-as-service.bat @@ -10,7 +10,7 @@ :: this script. :: And, please, read carefully the installation docs first: :: https://gogs.io/docs/installation -:: To unistall the service, run "nssm remove gogs" and restart Windows. +:: To uninstall the service, run "nssm remove gogs" and restart Windows. :: Set the folder where you extracted Gogs. Omit the last slash. SET gogspath=C:\gogs pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy