forked from go-gitea/gitea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/go-gitea/gitea
* 'main' of https://github.com/go-gitea/gitea: show pull link for agit pull request also (go-gitea#18235) [skip ci] Updated translations via Crowdin Add some .ignore entries (go-gitea#18296) Remove unneeded debug messages to stdout. (go-gitea#18298) Handle missing default branch better in owner/repo/branches page (go-gitea#18290) Revert "Prevent possible XSS when using jQuery (go-gitea#18289)" (go-gitea#18293) not show double error response in git hook (go-gitea#18292) Remove accidental debugging in blob_excerpt.tmpl (go-gitea#18287) Prevent possible XSS when using jQuery (go-gitea#18289) Return nicer error if trying to pull from non-existent user (go-gitea#18288) [skip ci] Updated translations via Crowdin docs: mention client_max_body_size affects LFS (go-gitea#18291) Add lockfile-check (go-gitea#18285) Webauthn nits (go-gitea#18284)
- Loading branch information
Showing
48 changed files
with
247 additions
and
576 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
/vendor | ||
/public/vendor/plugins | ||
*.min.css | ||
*.min.js | ||
/modules/options/bindata.go | ||
/modules/public/bindata.go | ||
/modules/templates/bindata.go | ||
/public/vendor/plugins | ||
/vendor | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright 2021 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package migrations | ||
|
||
import ( | ||
"encoding/base32" | ||
"encoding/base64" | ||
|
||
"xorm.io/xorm" | ||
) | ||
|
||
func useBase32HexForCredIDInWebAuthnCredential(x *xorm.Engine) error { | ||
|
||
// Create webauthnCredential table | ||
type webauthnCredential struct { | ||
ID int64 `xorm:"pk autoincr"` | ||
CredentialID string `xorm:"INDEX"` | ||
} | ||
if err := x.Sync2(&webauthnCredential{}); err != nil { | ||
return err | ||
} | ||
|
||
var start int | ||
regs := make([]*webauthnCredential, 0, 50) | ||
for { | ||
err := x.OrderBy("id").Limit(50, start).Find(®s) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
for _, reg := range regs { | ||
credID, _ := base64.RawStdEncoding.DecodeString(reg.CredentialID) | ||
reg.CredentialID = base32.HexEncoding.EncodeToString(credID) | ||
|
||
_, err := x.Update(reg) | ||
if err != nil { | ||
return err | ||
} | ||
} | ||
|
||
if len(regs) < 50 { | ||
break | ||
} | ||
start += 50 | ||
regs = regs[:0] | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.