diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000000..096e38649e5 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,8 @@ +[codespell] +# 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,followings 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 diff --git a/SECURITY.md b/SECURITY.md index 24ffd4c10dc..94195dbdd3a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,14 +2,14 @@ ## 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). ## 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/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"}) 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/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/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") 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