Skip to content

Commit 1e4f5e1

Browse files
authored
Merge branch 'main' into followup-from-16562-prepare-for-16567
2 parents 8e3fb62 + 07bc380 commit 1e4f5e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+6691
-280
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ root: true
22
reportUnusedDisableDirectives: true
33

44
ignorePatterns:
5+
- /web_src/js/vendor
56
- /templates/base/head.tmpl
67
- /templates/repo/activity.tmpl
78
- /templates/repo/view_file.tmpl

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ This changelog goes through all the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.io).
66

7+
## [1.15.0-rc3](https://github.com/go-gitea/gitea/releases/tag/v1.15.0-rc3) - 2021-08-06
8+
9+
* BREAKING
10+
* Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606)
11+
* SECURITY
12+
* Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606)
13+
* Correctly create of git-daemon-export-ok files (#16508) (#16514)
14+
* Don't show private user's repo in explore view (#16550) (#16554)
15+
* Update node tar dependency to 6.1.6 (#16622) (#16623)
16+
* API
17+
* Swagger AccessToken fixes (#16574) (#16597)
18+
* Set AllowedHeaders on API CORS handler (#16524) (#16618)
19+
* BUGFIXES
20+
* Restore Accessibility for Dropdown (#16576) (#16617)
21+
* Pass down SignedUserName down to AccessLogger context (#16605) (#16616)
22+
* Fix table alignment in markdown (#16596) (#16602)
23+
* Fix 500 on first wiki page (#16586) (#16598)
24+
* Lock goth/gothic and Re-attempt OAuth2 registration on login if registration failed at startup (#16564) (#16570)
25+
* Upgrade levelqueue to v0.4.0 (#16560) (#16561)
26+
* Handle too long PR titles correctly (#16517) (#16549)
27+
* Fix data race in bleve indexer (#16474) (#16509)
28+
* Restore CORS on git smart http protocol (#16496) (#16506)
29+
* Fix race in log (#16490) (#16505)
30+
* Fix prepareWikiFileName to respect existing unescaped files (#16487) (#16498)
31+
* Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16480)
32+
* Update notification table with only latest data (#16445) (#16469)
33+
* Revert to use alpine 3.13 (#16451) (#16452)
34+
* Fix crash following ldap authentication update (#16447) (#16448)
35+
* Fix direct creation of external users on admin page (partial #16612) (#16613)
36+
* Prevent 500 on draft releases without tag (#16634) (#16636)
37+
738
## [1.15.0-rc2](https://github.com/go-gitea/gitea/releases/tag/v1.15.0-rc2) - 2021-07-22
839

940
* BUGFIXES
@@ -229,6 +260,16 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
229260
* Remove utf8 option from installation page (#16126)
230261
* Use Wants= over Requires= in systemd file (#15897)
231262

263+
## [1.14.6](https://github.com/go-gitea/gitea/releases/tag/v1.14.6) - 2021-08-04
264+
265+
* SECURITY
266+
* Bump github.com/markbates/goth from v1.67.1 to v1.68.0 (#16538) (#16540)
267+
* Switch to maintained JWT lib (#16532) (#16535)
268+
* Upgrade to latest version of golang-jwt (as forked for 1.14) (#16590) (#16607)
269+
* BUGFIXES
270+
* Add basic edit ldap auth test & actually fix #16252 (#16465) (#16495)
271+
* Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16481)
272+
232273
## [1.14.5](https://github.com/go-gitea/gitea/releases/tag/v1.14.5) - 2021-07-16
233274

234275
* SECURITY

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ fomantic:
699699
cd $(FOMANTIC_WORK_DIR) && npm install --no-save
700700
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
701701
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
702+
cp -f web_src/js/vendor/dropdown.js $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/definitions/modules
702703
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
703704

704705
.PHONY: webpack

custom/conf/app.example.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,9 @@ PATH =
993993
;;
994994
;; allow request with credentials
995995
;ALLOW_CREDENTIALS = false
996+
;;
997+
;; set X-FRAME-OPTIONS header
998+
;X_FRAME_OPTIONS = SAMEORIGIN
996999

9971000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9981001
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21-
version: 1.14.5
21+
version: 1.14.6
2222
minGoVersion: 1.16
2323
goVersion: 1.16
2424
minNodeVersion: 12.17

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
162162
- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: list of methods allowed to request
163163
- `MAX_AGE`: **10m**: max time to cache response
164164
- `ALLOW_CREDENTIALS`: **false**: allow request with credentials
165+
- `X_FRAME_OPTIONS`: **SAMEORIGIN**: Set the `X-Frame-Options` header value.
165166

166167
## UI (`ui`)
167168

docs/content/doc/features/authentication.en-us.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ To configure PAM, set the 'PAM Service Name' to a filename in `/etc/pam.d/`. To
170170
work with normal Linux passwords, the user running Gitea must have read access
171171
to `/etc/shadow`.
172172

173+
**Note**: PAM support is added via [build-time flags](https://docs.gitea.io/en-us/install-from-source/#build), and the official binaries provided do not have this enabled.
174+
173175
## SMTP (Simple Mail Transfer Protocol)
174176

175177
This option allows Gitea to log in to an SMTP host as a Gitea user. To

go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7
762762
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
763763
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
764764
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
765+
github.com/markbates/going v1.0.0 h1:DQw0ZP7NbNlFGcKbcE/IVSOAFzScxRtLpd0rLMzLhq0=
765766
github.com/markbates/going v1.0.0/go.mod h1:I6mnB4BPnEeqo85ynXIx1ZFLLbtiLHNXVgWeFO9OGOA=
766767
github.com/markbates/goth v1.68.0 h1:90sKvjRAKHcl9V2uC9x/PJXeD78cFPiBsyP1xVhoQfA=
767768
github.com/markbates/goth v1.68.0/go.mod h1:V2VcDMzDiMHW+YmqYl7i0cMiAUeCkAe4QE6jRKBhXZw=

models/models.go

100644100755
Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ type Statistic struct {
272272
Counter struct {
273273
User, Org, PublicKey,
274274
Repo, Watch, Star, Action, Access,
275-
Issue, Comment, Oauth, Follow,
275+
Issue, IssueClosed, IssueOpen,
276+
Comment, Oauth, Follow,
276277
Mirror, Release, LoginSource, Webhook,
277278
Milestone, Label, HookTask,
278279
Team, UpdateTask, Attachment int64
@@ -289,7 +290,24 @@ func GetStatistic() (stats Statistic) {
289290
stats.Counter.Star, _ = x.Count(new(Star))
290291
stats.Counter.Action, _ = x.Count(new(Action))
291292
stats.Counter.Access, _ = x.Count(new(Access))
292-
stats.Counter.Issue, _ = x.Count(new(Issue))
293+
294+
type IssueCount struct {
295+
Count int64
296+
IsClosed bool
297+
}
298+
issueCounts := []IssueCount{}
299+
300+
_ = x.Select("COUNT(*) AS count, is_closed").Table("issue").GroupBy("is_closed").Find(&issueCounts)
301+
for _, c := range issueCounts {
302+
if c.IsClosed {
303+
stats.Counter.IssueClosed = c.Count
304+
} else {
305+
stats.Counter.IssueOpen = c.Count
306+
}
307+
}
308+
309+
stats.Counter.Issue = stats.Counter.IssueClosed + stats.Counter.IssueOpen
310+
293311
stats.Counter.Comment, _ = x.Count(new(Comment))
294312
stats.Counter.Oauth = 0
295313
stats.Counter.Follow, _ = x.Count(new(Follow))

modules/context/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func APIContexter() func(http.Handler) http.Handler {
270270
}
271271
}
272272

273-
ctx.Resp.Header().Set(`X-Frame-Options`, `SAMEORIGIN`)
273+
ctx.Resp.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
274274

275275
ctx.Data["CsrfToken"] = html.EscapeString(ctx.csrf.GetToken())
276276

modules/context/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ func Contexter() func(next http.Handler) http.Handler {
693693
}
694694
}
695695

696-
ctx.Resp.Header().Set(`X-Frame-Options`, `SAMEORIGIN`)
696+
ctx.Resp.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
697697

698698
ctx.Data["CsrfToken"] = html.EscapeString(ctx.csrf.GetToken())
699699
ctx.Data["CsrfTokenHtml"] = template.HTML(`<input type="hidden" name="_csrf" value="` + ctx.Data["CsrfToken"].(string) + `">`)

modules/metrics/collector.go

100644100755
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ type Collector struct {
2222
Follows *prometheus.Desc
2323
HookTasks *prometheus.Desc
2424
Issues *prometheus.Desc
25+
IssuesOpen *prometheus.Desc
26+
IssuesClosed *prometheus.Desc
2527
Labels *prometheus.Desc
2628
LoginSources *prometheus.Desc
2729
Milestones *prometheus.Desc
@@ -77,6 +79,16 @@ func NewCollector() Collector {
7779
"Number of Issues",
7880
nil, nil,
7981
),
82+
IssuesOpen: prometheus.NewDesc(
83+
namespace+"issues_open",
84+
"Number of open Issues",
85+
nil, nil,
86+
),
87+
IssuesClosed: prometheus.NewDesc(
88+
namespace+"issues_closed",
89+
"Number of closed Issues",
90+
nil, nil,
91+
),
8092
Labels: prometheus.NewDesc(
8193
namespace+"labels",
8294
"Number of Labels",
@@ -165,6 +177,8 @@ func (c Collector) Describe(ch chan<- *prometheus.Desc) {
165177
ch <- c.Follows
166178
ch <- c.HookTasks
167179
ch <- c.Issues
180+
ch <- c.IssuesOpen
181+
ch <- c.IssuesClosed
168182
ch <- c.Labels
169183
ch <- c.LoginSources
170184
ch <- c.Milestones
@@ -221,6 +235,16 @@ func (c Collector) Collect(ch chan<- prometheus.Metric) {
221235
prometheus.GaugeValue,
222236
float64(stats.Counter.Issue),
223237
)
238+
ch <- prometheus.MustNewConstMetric(
239+
c.IssuesClosed,
240+
prometheus.GaugeValue,
241+
float64(stats.Counter.IssueClosed),
242+
)
243+
ch <- prometheus.MustNewConstMetric(
244+
c.IssuesOpen,
245+
prometheus.GaugeValue,
246+
float64(stats.Counter.IssueOpen),
247+
)
224248
ch <- prometheus.MustNewConstMetric(
225249
c.Labels,
226250
prometheus.GaugeValue,

modules/setting/cors.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ var (
2020
Methods []string
2121
MaxAge time.Duration
2222
AllowCredentials bool
23+
XFrameOptions string
2324
}{
24-
Enabled: false,
25-
MaxAge: 10 * time.Minute,
25+
Enabled: false,
26+
MaxAge: 10 * time.Minute,
27+
XFrameOptions: "SAMEORIGIN",
2628
}
2729
)
2830

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,7 @@ auths.oauth2_tokenURL = Token URL
24412441
auths.oauth2_authURL = Authorize URL
24422442
auths.oauth2_profileURL = Profile URL
24432443
auths.oauth2_emailURL = Email URL
2444+
auths.oauth2_tenant = Tenant
24442445
auths.enable_auto_register = Enable Auto Registration
24452446
auths.sspi_auto_create_users = Automatically create users
24462447
auths.sspi_auto_create_users_helper = Allow SSPI auth method to automatically create new accounts for users that login for the first time

options/locale/locale_es-ES.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ editor.require_signed_commit=Esta rama requiere un commit firmado
10401040
commits.desc=Ver el historial de cambios de código fuente.
10411041
commits.commits=Commits
10421042
commits.no_commits=No hay commits en común. '%s' y '%s' tienen historias completamente diferentes.
1043+
commits.nothing_to_compare=Estas ramas son iguales.
10431044
commits.search=Buscar commits…
10441045
commits.search.tooltip=Puede prefijar palabras clave con "author:", "committer:", "after:", o "before:", por ejemplo, "revert author:Alice before:2019-04-01".
10451046
commits.find=Buscar

options/locale/locale_ja-JP.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,10 @@ pulls.no_merge_helper=リポジトリ設定でマージを有効にするか、
14371437
pulls.no_merge_wip=このプルリクエストはWork In Progressとマークされているため、マージすることはできません。
14381438
pulls.no_merge_not_ready=このプルリクエストはマージする準備ができていません。 レビュー状況とステータスチェックを確認してください。
14391439
pulls.no_merge_access=このプルリクエストをマージする権限がありません。
1440+
pulls.merge_pull_request=マージコミットを作成
1441+
pulls.rebase_merge_pull_request=リベース後にファストフォワード
1442+
pulls.rebase_merge_commit_pull_request=リベース後にマージコミット作成
1443+
pulls.squash_merge_pull_request=スカッシュコミットを作成
14401444
pulls.merge_manually=手動マージ済みにする
14411445
pulls.merge_commit_id=マージコミットID
14421446
pulls.require_signed_wont_sign=ブランチでは署名されたコミットが必須ですが、このマージでは署名がされません

options/locale/locale_pt-PT.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,6 +2441,7 @@ auths.oauth2_tokenURL=URL do código
24412441
auths.oauth2_authURL=URL da autorização
24422442
auths.oauth2_profileURL=URL do perfil
24432443
auths.oauth2_emailURL=URL do email
2444+
auths.oauth2_tenant=Locatário
24442445
auths.enable_auto_register=Habilitar o registo automático
24452446
auths.sspi_auto_create_users=Criar utilizadores automaticamente
24462447
auths.sspi_auto_create_users_helper=Permitir que o método de autenticação SSPI crie, automaticamente, novas contas para utilizadores que iniciam a sessão pela primeira vez

public/img/auth/azuread.png

3.03 KB
Loading

public/img/auth/azureadv2.png

3.03 KB
Loading

public/img/auth/microsoftonline.png

792 Bytes
Loading

routers/install/routes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func installRecovery() func(next http.Handler) http.Handler {
6161
"SignedUserName": "",
6262
}
6363

64-
w.Header().Set(`X-Frame-Options`, `SAMEORIGIN`)
64+
w.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
6565

6666
if !setting.IsProd() {
6767
store["ErrorMsg"] = combinedErr

routers/web/admin/auths.go

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ func NewAuthSource(ctx *context.Context) {
9898
ctx.Data["AuthSources"] = authSources
9999
ctx.Data["SecurityProtocols"] = securityProtocols
100100
ctx.Data["SMTPAuths"] = smtp.Authenticators
101-
ctx.Data["OAuth2Providers"] = oauth2.Providers
102-
ctx.Data["OAuth2DefaultCustomURLMappings"] = oauth2.DefaultCustomURLMappings
101+
oauth2providers := oauth2.GetOAuth2Providers()
102+
ctx.Data["OAuth2Providers"] = oauth2providers
103103

104104
ctx.Data["SSPIAutoCreateUsers"] = true
105105
ctx.Data["SSPIAutoActivateUsers"] = true
@@ -108,10 +108,7 @@ func NewAuthSource(ctx *context.Context) {
108108
ctx.Data["SSPIDefaultLanguage"] = ""
109109

110110
// only the first as default
111-
for key := range oauth2.Providers {
112-
ctx.Data["oauth2_provider"] = key
113-
break
114-
}
111+
ctx.Data["oauth2_provider"] = oauth2providers[0]
115112

116113
ctx.HTML(http.StatusOK, tplAuthNew)
117114
}
@@ -170,6 +167,7 @@ func parseOAuth2Config(form forms.AuthenticationForm) *oauth2.Source {
170167
AuthURL: form.Oauth2AuthURL,
171168
ProfileURL: form.Oauth2ProfileURL,
172169
EmailURL: form.Oauth2EmailURL,
170+
Tenant: form.Oauth2Tenant,
173171
}
174172
} else {
175173
customURLMapping = nil
@@ -220,8 +218,8 @@ func NewAuthSourcePost(ctx *context.Context) {
220218
ctx.Data["AuthSources"] = authSources
221219
ctx.Data["SecurityProtocols"] = securityProtocols
222220
ctx.Data["SMTPAuths"] = smtp.Authenticators
223-
ctx.Data["OAuth2Providers"] = oauth2.Providers
224-
ctx.Data["OAuth2DefaultCustomURLMappings"] = oauth2.DefaultCustomURLMappings
221+
oauth2providers := oauth2.GetOAuth2Providers()
222+
ctx.Data["OAuth2Providers"] = oauth2providers
225223

226224
ctx.Data["SSPIAutoCreateUsers"] = true
227225
ctx.Data["SSPIAutoActivateUsers"] = true
@@ -299,8 +297,8 @@ func EditAuthSource(ctx *context.Context) {
299297

300298
ctx.Data["SecurityProtocols"] = securityProtocols
301299
ctx.Data["SMTPAuths"] = smtp.Authenticators
302-
ctx.Data["OAuth2Providers"] = oauth2.Providers
303-
ctx.Data["OAuth2DefaultCustomURLMappings"] = oauth2.DefaultCustomURLMappings
300+
oauth2providers := oauth2.GetOAuth2Providers()
301+
ctx.Data["OAuth2Providers"] = oauth2providers
304302

305303
source, err := models.GetLoginSourceByID(ctx.ParamsInt64(":authid"))
306304
if err != nil {
@@ -311,7 +309,17 @@ func EditAuthSource(ctx *context.Context) {
311309
ctx.Data["HasTLS"] = source.HasTLS()
312310

313311
if source.IsOAuth2() {
314-
ctx.Data["CurrentOAuth2Provider"] = oauth2.Providers[source.Cfg.(*oauth2.Source).Provider]
312+
type Named interface {
313+
Name() string
314+
}
315+
316+
for _, provider := range oauth2providers {
317+
if provider.Name() == source.Cfg.(Named).Name() {
318+
ctx.Data["CurrentOAuth2Provider"] = provider
319+
break
320+
}
321+
}
322+
315323
}
316324
ctx.HTML(http.StatusOK, tplAuthEdit)
317325
}
@@ -324,8 +332,8 @@ func EditAuthSourcePost(ctx *context.Context) {
324332
ctx.Data["PageIsAdminAuthentications"] = true
325333

326334
ctx.Data["SMTPAuths"] = smtp.Authenticators
327-
ctx.Data["OAuth2Providers"] = oauth2.Providers
328-
ctx.Data["OAuth2DefaultCustomURLMappings"] = oauth2.DefaultCustomURLMappings
335+
oauth2providers := oauth2.GetOAuth2Providers()
336+
ctx.Data["OAuth2Providers"] = oauth2providers
329337

330338
source, err := models.GetLoginSourceByID(ctx.ParamsInt64(":authid"))
331339
if err != nil {

routers/web/base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ func Recovery() func(next http.Handler) http.Handler {
171171
store["SignedUserName"] = ""
172172
}
173173

174-
w.Header().Set(`X-Frame-Options`, `SAMEORIGIN`)
174+
w.Header().Set(`X-Frame-Options`, setting.CORSConfig.XFrameOptions)
175175

176176
if !setting.IsProd() {
177177
store["ErrorMsg"] = combinedErr

0 commit comments

Comments
 (0)