Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* giteaofficial/main:
  Improve reverse proxies documentation (go-gitea#23068)
  Improve accessibility for issue comments (go-gitea#22612)
  Wrap unless-check in docker manifests (go-gitea#23079)
  Add accessibility to the menu on the navbar (go-gitea#23059)
  Use minio/sha256-simd for accelerated SHA256 (go-gitea#23052)
  Fix some more hidden problems (go-gitea#23074)
  Add sillyguodong to maintainers (go-gitea#23067)
  Improving CONTRIBUTING.md for backport details (go-gitea#23057)
  • Loading branch information
zjjhot committed Feb 23, 2023
2 parents cf06ad5 + 0ce79bb commit 57153f6
Show file tree
Hide file tree
Showing 35 changed files with 81 additions and 43 deletions.
14 changes: 11 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,7 @@ known as the release freeze. All the feature pull requests should be
merged before feature freeze. And, during the frozen period, a corresponding
release branch is open for fixes backported from main branch. Release candidates
are made during this period for user testing to
obtain a final version that is maintained in this branch. A release is
maintained by issuing patch releases to only correct critical problems
such as crashes or security issues.
obtain a final version that is maintained in this branch.

Major release cycles are seasonal. They always begin on the 25th and end on
the 24th (i.e., the 25th of December to March 24th).
Expand All @@ -311,6 +309,16 @@ for the previous version. For example, if the latest, published release is
v1.2, then minor changes for the previous release—e.g., v1.1.0 -> v1.1.1—are
still possible.

The previous release gets fixes for:

- Security issues
- Critical bugs
- Regressions
- Build issues
- Necessary enhancements (including necessary UI/UX fixes)

The backported fixes should avoid breaking downgrade between minor releases as much as possible.

## Maintainers

To make sure every PR is checked, we have [team
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ Jason Song <[email protected]> (@wolfogre)
Yarden Shoham <[email protected]> (@yardenshoham)
Yu Tian <[email protected]> (@Zettat123)
Eddie Yang <[email protected]> (@yp05327)
Dong Ge <[email protected]> (@sillyguodong)
2 changes: 1 addition & 1 deletion docker/manifest.rootless.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-rootless
{{#if build.tags}}
{{#unless contains "-rc" build.tag}}
{{#unless (contains "-rc" build.tag)}}
tags:
{{#each build.tags}}
- {{this}}-rootless
Expand Down
2 changes: 1 addition & 1 deletion docker/manifest.tmpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}
{{#if build.tags}}
{{#unless contains "-rc" build.tag }}
{{#unless (contains "-rc" build.tag)}}
tags:
{{#each build.tags}}
- {{this}}
Expand Down
20 changes: 20 additions & 0 deletions docs/content/doc/usage/reverse-proxies.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,3 +365,23 @@ gitea:
```
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
## Traefik with a sub-path
In case you already have a site, and you want Gitea to share the domain name, you can setup Traefik to serve Gitea under a sub-path by adding the following to your `docker-compose.yaml` (Assuming the provider is docker) :

```yaml
gitea:
image: gitea/gitea
...
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitea.rule=Host(`example.com`) && PathPrefix(`/gitea`)"
- "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000"
- "traefik.http.middlewares.gitea-stripprefix.stripprefix.prefixes=/gitea"
- "traefik.http.routers.gitea.middlewares=gitea-stripprefix"
```
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ require (
github.com/mholt/archiver/v3 v3.5.1
github.com/microcosm-cc/bluemonday v1.0.21
github.com/minio/minio-go/v7 v7.0.46
github.com/minio/sha256-simd v1.0.0
github.com/msteinert/pam v1.1.0
github.com/nektos/act v0.0.0
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
Expand Down Expand Up @@ -220,7 +221,6 @@ require (
github.com/mholt/acmez v1.0.4 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
Expand Down
2 changes: 1 addition & 1 deletion models/auth/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package auth

import (
"context"
"crypto/sha256"
"encoding/base32"
"encoding/base64"
"fmt"
Expand All @@ -18,6 +17,7 @@ import (
"code.gitea.io/gitea/modules/util"

uuid "github.com/google/uuid"
"github.com/minio/sha256-simd"
"golang.org/x/crypto/bcrypt"
"xorm.io/builder"
"xorm.io/xorm"
Expand Down
2 changes: 1 addition & 1 deletion models/auth/twofactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package auth

import (
"crypto/md5"
"crypto/sha256"
"crypto/subtle"
"encoding/base32"
"encoding/base64"
Expand All @@ -18,6 +17,7 @@ import (
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"

"github.com/minio/sha256-simd"
"github.com/pquerna/otp/totp"
"golang.org/x/crypto/pbkdf2"
)
Expand Down
2 changes: 1 addition & 1 deletion models/migrations/base/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
package base

import (
"crypto/sha256"
"encoding/hex"

"github.com/minio/sha256-simd"
"golang.org/x/crypto/pbkdf2"
)

Expand Down
2 changes: 1 addition & 1 deletion models/migrations/v1_14/v166.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
package v1_14 //nolint

import (
"crypto/sha256"
"encoding/hex"

"github.com/minio/sha256-simd"
"golang.org/x/crypto/argon2"
"golang.org/x/crypto/bcrypt"
"golang.org/x/crypto/pbkdf2"
Expand Down
2 changes: 1 addition & 1 deletion modules/auth/password/hash/pbkdf2.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
package hash

import (
"crypto/sha256"
"encoding/hex"
"strings"

"code.gitea.io/gitea/modules/log"

"github.com/minio/sha256-simd"
"golang.org/x/crypto/pbkdf2"
)

Expand Down
3 changes: 2 additions & 1 deletion modules/avatar/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
package avatar

import (
"crypto/sha256"
"encoding/hex"
"strconv"

"github.com/minio/sha256-simd"
)

// HashAvatar will generate a unique string, which ensures that when there's a
Expand Down
3 changes: 2 additions & 1 deletion modules/avatar/identicon/identicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
package identicon

import (
"crypto/sha256"
"fmt"
"image"
"image/color"

"github.com/minio/sha256-simd"
)

const minImageSize = 16
Expand Down
2 changes: 1 addition & 1 deletion modules/base/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package base
import (
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"errors"
Expand All @@ -26,6 +25,7 @@ import (
"code.gitea.io/gitea/modules/util"

"github.com/dustin/go-humanize"
"github.com/minio/sha256-simd"
)

// EncodeMD5 encodes string to md5 hex value.
Expand Down
2 changes: 1 addition & 1 deletion modules/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package context

import (
"context"
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
Expand Down Expand Up @@ -40,6 +39,7 @@ import (
"gitea.com/go-chi/cache"
"gitea.com/go-chi/session"
chi "github.com/go-chi/chi/v5"
"github.com/minio/sha256-simd"
"github.com/unrolled/render"
"golang.org/x/crypto/pbkdf2"
)
Expand Down
3 changes: 2 additions & 1 deletion modules/git/last_commit_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
package git

import (
"crypto/sha256"
"fmt"

"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"

"github.com/minio/sha256-simd"
)

// Cache represents a caching interface
Expand Down
3 changes: 2 additions & 1 deletion modules/lfs/content_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package lfs

import (
"crypto/sha256"
"encoding/hex"
"errors"
"hash"
Expand All @@ -13,6 +12,8 @@ import (

"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/storage"

"github.com/minio/sha256-simd"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion modules/lfs/pointer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package lfs

import (
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
Expand All @@ -15,6 +14,8 @@ import (
"strings"

"code.gitea.io/gitea/modules/log"

"github.com/minio/sha256-simd"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion modules/secret/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"errors"
"io"

"github.com/minio/sha256-simd"
)

// AesEncrypt encrypts text and given key with AES.
Expand Down
2 changes: 1 addition & 1 deletion modules/util/keypair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
"encoding/pem"
"regexp"
"testing"

"github.com/minio/sha256-simd"
"github.com/stretchr/testify/assert"
)

Expand Down
3 changes: 2 additions & 1 deletion routers/api/packages/chef/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"crypto"
"crypto/rsa"
"crypto/sha1"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/pem"
Expand All @@ -25,6 +24,8 @@ import (
chef_module "code.gitea.io/gitea/modules/packages/chef"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/auth"

"github.com/minio/sha256-simd"
)

const (
Expand Down
3 changes: 2 additions & 1 deletion routers/api/packages/maven/maven.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package maven
import (
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"encoding/hex"
"encoding/xml"
Expand All @@ -27,6 +26,8 @@ import (
maven_module "code.gitea.io/gitea/modules/packages/maven"
"code.gitea.io/gitea/routers/api/packages/helper"
packages_service "code.gitea.io/gitea/services/packages"

"github.com/minio/sha256-simd"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion services/auth/source/oauth2/jwtsigningkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/pem"
Expand All @@ -25,6 +24,7 @@ import (
"code.gitea.io/gitea/modules/util"

"github.com/golang-jwt/jwt/v4"
"github.com/minio/sha256-simd"
ini "gopkg.in/ini.v1"
)

Expand Down
2 changes: 1 addition & 1 deletion services/lfs/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package lfs

import (
stdCtx "context"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"errors"
Expand All @@ -32,6 +31,7 @@ import (
"code.gitea.io/gitea/modules/storage"

"github.com/golang-jwt/jwt/v4"
"github.com/minio/sha256-simd"
)

// requestContext contain variables from the HTTP request.
Expand Down
3 changes: 2 additions & 1 deletion services/mailer/token/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ package token
import (
"context"
crypto_hmac "crypto/hmac"
"crypto/sha256"
"encoding/base32"
"fmt"
"time"

user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/util"

"github.com/minio/sha256-simd"
)

// A token is a verifiable container describing an action.
Expand Down
2 changes: 1 addition & 1 deletion services/webhook/deliver.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"context"
"crypto/hmac"
"crypto/sha1"
"crypto/sha256"
"crypto/tls"
"encoding/hex"
"fmt"
Expand All @@ -29,6 +28,7 @@ import (
webhook_module "code.gitea.io/gitea/modules/webhook"

"github.com/gobwas/glob"
"github.com/minio/sha256-simd"
)

// Deliver deliver hook task
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/auth/edit.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if $cfg.GroupsEnabled}}checked{{end}}>
</div>
</div>
<div id="ldap-group-options" class="ui segment secondary" {{if not $cfg.GroupsEnabled}}hidden{{end}}>
<div id="ldap-group-options" class="ui segment secondary {{if not $cfg.GroupsEnabled}}gt-hidden{{end}}">
<div class="field">
<label>{{.locale.Tr "admin.auths.group_search_base"}}</label>
<input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="e.g. ou=group,dc=mydomain,dc=com">
Expand Down
Loading

0 comments on commit 57153f6

Please sign in to comment.