Skip to content

Commit 57153f6

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* 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)
2 parents cf06ad5 + 0ce79bb commit 57153f6

File tree

35 files changed

+81
-43
lines changed

35 files changed

+81
-43
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,7 @@ known as the release freeze. All the feature pull requests should be
299299
merged before feature freeze. And, during the frozen period, a corresponding
300300
release branch is open for fixes backported from main branch. Release candidates
301301
are made during this period for user testing to
302-
obtain a final version that is maintained in this branch. A release is
303-
maintained by issuing patch releases to only correct critical problems
304-
such as crashes or security issues.
302+
obtain a final version that is maintained in this branch.
305303

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

312+
The previous release gets fixes for:
313+
314+
- Security issues
315+
- Critical bugs
316+
- Regressions
317+
- Build issues
318+
- Necessary enhancements (including necessary UI/UX fixes)
319+
320+
The backported fixes should avoid breaking downgrade between minor releases as much as possible.
321+
314322
## Maintainers
315323

316324
To make sure every PR is checked, we have [team

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ Jason Song <[email protected]> (@wolfogre)
4949
Yarden Shoham <[email protected]> (@yardenshoham)
5050
Yu Tian <[email protected]> (@Zettat123)
5151
Eddie Yang <[email protected]> (@yp05327)
52+
Dong Ge <[email protected]> (@sillyguodong)

docker/manifest.rootless.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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
22
{{#if build.tags}}
3-
{{#unless contains "-rc" build.tag}}
3+
{{#unless (contains "-rc" build.tag)}}
44
tags:
55
{{#each build.tags}}
66
- {{this}}-rootless

docker/manifest.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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}}
22
{{#if build.tags}}
3-
{{#unless contains "-rc" build.tag }}
3+
{{#unless (contains "-rc" build.tag)}}
44
tags:
55
{{#each build.tags}}
66
- {{this}}

docs/content/doc/usage/reverse-proxies.en-us.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,23 @@ gitea:
365365
```
366366
367367
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
368+
369+
## Traefik with a sub-path
370+
371+
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) :
372+
373+
```yaml
374+
gitea:
375+
image: gitea/gitea
376+
...
377+
labels:
378+
- "traefik.enable=true"
379+
- "traefik.http.routers.gitea.rule=Host(`example.com`) && PathPrefix(`/gitea`)"
380+
- "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000"
381+
- "traefik.http.middlewares.gitea-stripprefix.stripprefix.prefixes=/gitea"
382+
- "traefik.http.routers.gitea.middlewares=gitea-stripprefix"
383+
```
384+
385+
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.
386+
387+
Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ require (
7676
github.com/mholt/archiver/v3 v3.5.1
7777
github.com/microcosm-cc/bluemonday v1.0.21
7878
github.com/minio/minio-go/v7 v7.0.46
79+
github.com/minio/sha256-simd v1.0.0
7980
github.com/msteinert/pam v1.1.0
8081
github.com/nektos/act v0.0.0
8182
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
@@ -220,7 +221,6 @@ require (
220221
github.com/mholt/acmez v1.0.4 // indirect
221222
github.com/miekg/dns v1.1.50 // indirect
222223
github.com/minio/md5-simd v1.1.2 // indirect
223-
github.com/minio/sha256-simd v1.0.0 // indirect
224224
github.com/mitchellh/copystructure v1.2.0 // indirect
225225
github.com/mitchellh/mapstructure v1.5.0 // indirect
226226
github.com/mitchellh/reflectwalk v1.0.2 // indirect

models/auth/oauth2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package auth
55

66
import (
77
"context"
8-
"crypto/sha256"
98
"encoding/base32"
109
"encoding/base64"
1110
"fmt"
@@ -18,6 +17,7 @@ import (
1817
"code.gitea.io/gitea/modules/util"
1918

2019
uuid "github.com/google/uuid"
20+
"github.com/minio/sha256-simd"
2121
"golang.org/x/crypto/bcrypt"
2222
"xorm.io/builder"
2323
"xorm.io/xorm"

models/auth/twofactor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package auth
55

66
import (
77
"crypto/md5"
8-
"crypto/sha256"
98
"crypto/subtle"
109
"encoding/base32"
1110
"encoding/base64"
@@ -18,6 +17,7 @@ import (
1817
"code.gitea.io/gitea/modules/timeutil"
1918
"code.gitea.io/gitea/modules/util"
2019

20+
"github.com/minio/sha256-simd"
2121
"github.com/pquerna/otp/totp"
2222
"golang.org/x/crypto/pbkdf2"
2323
)

models/migrations/base/hash.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package base
55

66
import (
7-
"crypto/sha256"
87
"encoding/hex"
98

9+
"github.com/minio/sha256-simd"
1010
"golang.org/x/crypto/pbkdf2"
1111
)
1212

models/migrations/v1_14/v166.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
package v1_14 //nolint
55

66
import (
7-
"crypto/sha256"
87
"encoding/hex"
98

9+
"github.com/minio/sha256-simd"
1010
"golang.org/x/crypto/argon2"
1111
"golang.org/x/crypto/bcrypt"
1212
"golang.org/x/crypto/pbkdf2"

modules/auth/password/hash/pbkdf2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
package hash
55

66
import (
7-
"crypto/sha256"
87
"encoding/hex"
98
"strings"
109

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

12+
"github.com/minio/sha256-simd"
1313
"golang.org/x/crypto/pbkdf2"
1414
)
1515

modules/avatar/hash.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
package avatar
55

66
import (
7-
"crypto/sha256"
87
"encoding/hex"
98
"strconv"
9+
10+
"github.com/minio/sha256-simd"
1011
)
1112

1213
// HashAvatar will generate a unique string, which ensures that when there's a

modules/avatar/identicon/identicon.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
package identicon
88

99
import (
10-
"crypto/sha256"
1110
"fmt"
1211
"image"
1312
"image/color"
13+
14+
"github.com/minio/sha256-simd"
1415
)
1516

1617
const minImageSize = 16

modules/base/tool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package base
66
import (
77
"crypto/md5"
88
"crypto/sha1"
9-
"crypto/sha256"
109
"encoding/base64"
1110
"encoding/hex"
1211
"errors"
@@ -26,6 +25,7 @@ import (
2625
"code.gitea.io/gitea/modules/util"
2726

2827
"github.com/dustin/go-humanize"
28+
"github.com/minio/sha256-simd"
2929
)
3030

3131
// EncodeMD5 encodes string to md5 hex value.

modules/context/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package context
66

77
import (
88
"context"
9-
"crypto/sha256"
109
"encoding/hex"
1110
"errors"
1211
"fmt"
@@ -40,6 +39,7 @@ import (
4039
"gitea.com/go-chi/cache"
4140
"gitea.com/go-chi/session"
4241
chi "github.com/go-chi/chi/v5"
42+
"github.com/minio/sha256-simd"
4343
"github.com/unrolled/render"
4444
"golang.org/x/crypto/pbkdf2"
4545
)

modules/git/last_commit_cache.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
package git
55

66
import (
7-
"crypto/sha256"
87
"fmt"
98

109
"code.gitea.io/gitea/modules/log"
1110
"code.gitea.io/gitea/modules/setting"
11+
12+
"github.com/minio/sha256-simd"
1213
)
1314

1415
// Cache represents a caching interface

modules/lfs/content_store.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package lfs
55

66
import (
7-
"crypto/sha256"
87
"encoding/hex"
98
"errors"
109
"hash"
@@ -13,6 +12,8 @@ import (
1312

1413
"code.gitea.io/gitea/modules/log"
1514
"code.gitea.io/gitea/modules/storage"
15+
16+
"github.com/minio/sha256-simd"
1617
)
1718

1819
var (

modules/lfs/pointer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package lfs
55

66
import (
7-
"crypto/sha256"
87
"encoding/hex"
98
"errors"
109
"fmt"
@@ -15,6 +14,8 @@ import (
1514
"strings"
1615

1716
"code.gitea.io/gitea/modules/log"
17+
18+
"github.com/minio/sha256-simd"
1819
)
1920

2021
const (

modules/secret/secret.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import (
77
"crypto/aes"
88
"crypto/cipher"
99
"crypto/rand"
10-
"crypto/sha256"
1110
"encoding/base64"
1211
"encoding/hex"
1312
"errors"
1413
"io"
14+
15+
"github.com/minio/sha256-simd"
1516
)
1617

1718
// AesEncrypt encrypts text and given key with AES.

modules/util/keypair_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import (
77
"crypto"
88
"crypto/rand"
99
"crypto/rsa"
10-
"crypto/sha256"
1110
"crypto/x509"
1211
"encoding/pem"
1312
"regexp"
1413
"testing"
1514

15+
"github.com/minio/sha256-simd"
1616
"github.com/stretchr/testify/assert"
1717
)
1818

routers/api/packages/chef/auth.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"crypto"
88
"crypto/rsa"
99
"crypto/sha1"
10-
"crypto/sha256"
1110
"crypto/x509"
1211
"encoding/base64"
1312
"encoding/pem"
@@ -25,6 +24,8 @@ import (
2524
chef_module "code.gitea.io/gitea/modules/packages/chef"
2625
"code.gitea.io/gitea/modules/util"
2726
"code.gitea.io/gitea/services/auth"
27+
28+
"github.com/minio/sha256-simd"
2829
)
2930

3031
const (

routers/api/packages/maven/maven.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package maven
66
import (
77
"crypto/md5"
88
"crypto/sha1"
9-
"crypto/sha256"
109
"crypto/sha512"
1110
"encoding/hex"
1211
"encoding/xml"
@@ -27,6 +26,8 @@ import (
2726
maven_module "code.gitea.io/gitea/modules/packages/maven"
2827
"code.gitea.io/gitea/routers/api/packages/helper"
2928
packages_service "code.gitea.io/gitea/services/packages"
29+
30+
"github.com/minio/sha256-simd"
3031
)
3132

3233
const (

services/auth/source/oauth2/jwtsigningkey.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"crypto/elliptic"
1010
"crypto/rand"
1111
"crypto/rsa"
12-
"crypto/sha256"
1312
"crypto/x509"
1413
"encoding/base64"
1514
"encoding/pem"
@@ -25,6 +24,7 @@ import (
2524
"code.gitea.io/gitea/modules/util"
2625

2726
"github.com/golang-jwt/jwt/v4"
27+
"github.com/minio/sha256-simd"
2828
ini "gopkg.in/ini.v1"
2929
)
3030

services/lfs/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package lfs
55

66
import (
77
stdCtx "context"
8-
"crypto/sha256"
98
"encoding/base64"
109
"encoding/hex"
1110
"errors"
@@ -32,6 +31,7 @@ import (
3231
"code.gitea.io/gitea/modules/storage"
3332

3433
"github.com/golang-jwt/jwt/v4"
34+
"github.com/minio/sha256-simd"
3535
)
3636

3737
// requestContext contain variables from the HTTP request.

services/mailer/token/token.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ package token
66
import (
77
"context"
88
crypto_hmac "crypto/hmac"
9-
"crypto/sha256"
109
"encoding/base32"
1110
"fmt"
1211
"time"
1312

1413
user_model "code.gitea.io/gitea/models/user"
1514
"code.gitea.io/gitea/modules/util"
15+
16+
"github.com/minio/sha256-simd"
1617
)
1718

1819
// A token is a verifiable container describing an action.

services/webhook/deliver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"context"
88
"crypto/hmac"
99
"crypto/sha1"
10-
"crypto/sha256"
1110
"crypto/tls"
1211
"encoding/hex"
1312
"fmt"
@@ -29,6 +28,7 @@ import (
2928
webhook_module "code.gitea.io/gitea/modules/webhook"
3029

3130
"github.com/gobwas/glob"
31+
"github.com/minio/sha256-simd"
3232
)
3333

3434
// Deliver deliver hook task

templates/admin/auth/edit.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
<input type="checkbox" name="groups_enabled" class="js-ldap-group-toggle" {{if $cfg.GroupsEnabled}}checked{{end}}>
118118
</div>
119119
</div>
120-
<div id="ldap-group-options" class="ui segment secondary" {{if not $cfg.GroupsEnabled}}hidden{{end}}>
120+
<div id="ldap-group-options" class="ui segment secondary {{if not $cfg.GroupsEnabled}}gt-hidden{{end}}">
121121
<div class="field">
122122
<label>{{.locale.Tr "admin.auths.group_search_base"}}</label>
123123
<input name="group_dn" value="{{$cfg.GroupDN}}" placeholder="e.g. ou=group,dc=mydomain,dc=com">

0 commit comments

Comments
 (0)