From 80adbebbc8e0814d0fa0ac660d5c9452e458067b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 25 Jan 2022 19:15:58 +0100 Subject: [PATCH 1/6] Unexport git.GlobalCommandArgs (#18376) Unexport the git.GlobalCommandArgs variable. --- integrations/git_clone_wiki_test.go | 2 +- .../git_helper_for_declarative_test.go | 24 +++-------------- integrations/git_test.go | 4 +-- modules/git/command.go | 26 +++++++++++++++---- modules/git/commit.go | 6 ++--- modules/git/git.go | 10 +++---- modules/git/lfs.go | 2 +- modules/git/repo.go | 4 +-- 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/integrations/git_clone_wiki_test.go b/integrations/git_clone_wiki_test.go index 16cee254bcf7c..a73174f6aaaec 100644 --- a/integrations/git_clone_wiki_test.go +++ b/integrations/git_clone_wiki_test.go @@ -41,7 +41,7 @@ func TestRepoCloneWiki(t *testing.T) { u, _ = url.Parse(r) u.User = url.UserPassword("user2", userPassword) t.Run("Clone", func(t *testing.T) { - assert.NoError(t, git.CloneWithArgs(context.Background(), u.String(), dstPath, allowLFSFilters(), git.CloneRepoOptions{})) + assert.NoError(t, git.CloneWithArgs(context.Background(), u.String(), dstPath, git.AllowLFSFiltersArgs(), git.CloneRepoOptions{})) assertFileEqual(t, filepath.Join(dstPath, "Home.md"), []byte("# Home page\n\nThis is the home page!\n")) assertFileExist(t, filepath.Join(dstPath, "Page-With-Image.md")) assertFileExist(t, filepath.Join(dstPath, "Page-With-Spaced-Name.md")) diff --git a/integrations/git_helper_for_declarative_test.go b/integrations/git_helper_for_declarative_test.go index de96f633c0425..e1b6b779e9629 100644 --- a/integrations/git_helper_for_declarative_test.go +++ b/integrations/git_helper_for_declarative_test.go @@ -14,7 +14,6 @@ import ( "path" "path/filepath" "strconv" - "strings" "testing" "time" @@ -60,21 +59,6 @@ func createSSHUrl(gitPath string, u *url.URL) *url.URL { return &u2 } -func allowLFSFilters() []string { - // Now here we should explicitly allow lfs filters to run - filteredLFSGlobalArgs := make([]string, len(git.GlobalCommandArgs)) - j := 0 - for _, arg := range git.GlobalCommandArgs { - if strings.Contains(arg, "lfs") { - j-- - } else { - filteredLFSGlobalArgs[j] = arg - j++ - } - } - return filteredLFSGlobalArgs[:j] -} - func onGiteaRunTB(t testing.TB, callback func(testing.TB, *url.URL), prepare ...bool) { if len(prepare) == 0 || prepare[0] { defer prepareTestEnv(t, 1)() @@ -115,7 +99,7 @@ func onGiteaRun(t *testing.T, callback func(*testing.T, *url.URL), prepare ...bo func doGitClone(dstLocalPath string, u *url.URL) func(*testing.T) { return func(t *testing.T) { - assert.NoError(t, git.CloneWithArgs(context.Background(), u.String(), dstLocalPath, allowLFSFilters(), git.CloneRepoOptions{})) + assert.NoError(t, git.CloneWithArgs(context.Background(), u.String(), dstLocalPath, git.AllowLFSFiltersArgs(), git.CloneRepoOptions{})) exist, err := util.IsExist(filepath.Join(dstLocalPath, "README.md")) assert.NoError(t, err) assert.True(t, exist) @@ -124,7 +108,7 @@ func doGitClone(dstLocalPath string, u *url.URL) func(*testing.T) { func doPartialGitClone(dstLocalPath string, u *url.URL) func(*testing.T) { return func(t *testing.T) { - assert.NoError(t, git.CloneWithArgs(context.Background(), u.String(), dstLocalPath, allowLFSFilters(), git.CloneRepoOptions{ + assert.NoError(t, git.CloneWithArgs(context.Background(), u.String(), dstLocalPath, git.AllowLFSFiltersArgs(), git.CloneRepoOptions{ Filter: "blob:none", })) exist, err := util.IsExist(filepath.Join(dstLocalPath, "README.md")) @@ -197,7 +181,7 @@ func doGitCreateBranch(dstPath, branch string) func(*testing.T) { func doGitCheckoutBranch(dstPath string, args ...string) func(*testing.T) { return func(t *testing.T) { - _, err := git.NewCommandNoGlobals(append(append(allowLFSFilters(), "checkout"), args...)...).RunInDir(dstPath) + _, err := git.NewCommandNoGlobals(append(append(git.AllowLFSFiltersArgs(), "checkout"), args...)...).RunInDir(dstPath) assert.NoError(t, err) } } @@ -211,7 +195,7 @@ func doGitMerge(dstPath string, args ...string) func(*testing.T) { func doGitPull(dstPath string, args ...string) func(*testing.T) { return func(t *testing.T) { - _, err := git.NewCommandNoGlobals(append(append(allowLFSFilters(), "pull"), args...)...).RunInDir(dstPath) + _, err := git.NewCommandNoGlobals(append(append(git.AllowLFSFiltersArgs(), "pull"), args...)...).RunInDir(dstPath) assert.NoError(t, err) } } diff --git a/integrations/git_test.go b/integrations/git_test.go index 93ff9d2543380..e5a85eb756cd9 100644 --- a/integrations/git_test.go +++ b/integrations/git_test.go @@ -167,7 +167,7 @@ func lfsCommitAndPushTest(t *testing.T, dstPath string) (littleLFS, bigLFS strin err = git.AddChanges(dstPath, false, ".gitattributes") assert.NoError(t, err) - err = git.CommitChangesWithArgs(dstPath, allowLFSFilters(), git.CommitChangesOptions{ + err = git.CommitChangesWithArgs(dstPath, git.AllowLFSFiltersArgs(), git.CommitChangesOptions{ Committer: &git.Signature{ Email: "user2@example.com", Name: "User Two", @@ -346,7 +346,7 @@ func generateCommitWithNewData(size int, repoPath, email, fullName, prefix strin // Commit // Now here we should explicitly allow lfs filters to run - globalArgs := allowLFSFilters() + globalArgs := git.AllowLFSFiltersArgs() err = git.AddChangesWithArgs(repoPath, globalArgs, false, filepath.Base(tmpFile.Name())) if err != nil { return "", err diff --git a/modules/git/command.go b/modules/git/command.go index 3cf85c2d85209..e8afaa0e46c16 100644 --- a/modules/git/command.go +++ b/modules/git/command.go @@ -20,8 +20,8 @@ import ( ) var ( - // GlobalCommandArgs global command args for external package setting - GlobalCommandArgs []string + // globalCommandArgs global command args for external package setting + globalCommandArgs []string // defaultCommandExecutionTimeout default command execution timeout duration defaultCommandExecutionTimeout = 360 * time.Second @@ -52,9 +52,9 @@ func NewCommand(args ...string) *Command { // NewCommandContext creates and returns a new Git Command based on given command and arguments. func NewCommandContext(ctx context.Context, args ...string) *Command { - // Make an explicit copy of GlobalCommandArgs, otherwise append might overwrite it - cargs := make([]string, len(GlobalCommandArgs)) - copy(cargs, GlobalCommandArgs) + // Make an explicit copy of globalCommandArgs, otherwise append might overwrite it + cargs := make([]string, len(globalCommandArgs)) + copy(cargs, globalCommandArgs) return &Command{ name: GitExecutable, args: append(cargs, args...), @@ -278,3 +278,19 @@ func (c *Command) RunTimeout(timeout time.Duration) (string, error) { func (c *Command) Run() (string, error) { return c.RunTimeout(-1) } + +// AllowLFSFiltersArgs return globalCommandArgs with lfs filter, it should only be used for tests +func AllowLFSFiltersArgs() []string { + // Now here we should explicitly allow lfs filters to run + filteredLFSGlobalArgs := make([]string, len(globalCommandArgs)) + j := 0 + for _, arg := range globalCommandArgs { + if strings.Contains(arg, "lfs") { + j-- + } else { + filteredLFSGlobalArgs[j] = arg + j++ + } + } + return filteredLFSGlobalArgs[:j] +} diff --git a/modules/git/commit.go b/modules/git/commit.go index 0ba53897f5d5e..37b2e71cc052c 100644 --- a/modules/git/commit.go +++ b/modules/git/commit.go @@ -84,7 +84,7 @@ func (c *Commit) GetCommitByPath(relpath string) (*Commit, error) { // AddChanges marks local changes to be ready for commit. func AddChanges(repoPath string, all bool, files ...string) error { - return AddChangesWithArgs(repoPath, GlobalCommandArgs, all, files...) + return AddChangesWithArgs(repoPath, globalCommandArgs, all, files...) } // AddChangesWithArgs marks local changes to be ready for commit. @@ -108,8 +108,8 @@ type CommitChangesOptions struct { // CommitChanges commits local changes with given committer, author and message. // If author is nil, it will be the same as committer. func CommitChanges(repoPath string, opts CommitChangesOptions) error { - cargs := make([]string, len(GlobalCommandArgs)) - copy(cargs, GlobalCommandArgs) + cargs := make([]string, len(globalCommandArgs)) + copy(cargs, globalCommandArgs) return CommitChangesWithArgs(repoPath, cargs, opts) } diff --git a/modules/git/git.go b/modules/git/git.go index 294d33f916bcc..217e6955c2bc2 100644 --- a/modules/git/git.go +++ b/modules/git/git.go @@ -134,21 +134,21 @@ func Init(ctx context.Context) error { } // force cleanup args - GlobalCommandArgs = []string{} + globalCommandArgs = []string{} if CheckGitVersionAtLeast("2.9") == nil { // Explicitly disable credential helper, otherwise Git credentials might leak - GlobalCommandArgs = append(GlobalCommandArgs, "-c", "credential.helper=") + globalCommandArgs = append(globalCommandArgs, "-c", "credential.helper=") } // Since git wire protocol has been released from git v2.18 if setting.Git.EnableAutoGitWireProtocol && CheckGitVersionAtLeast("2.18") == nil { - GlobalCommandArgs = append(GlobalCommandArgs, "-c", "protocol.version=2") + globalCommandArgs = append(globalCommandArgs, "-c", "protocol.version=2") } // By default partial clones are disabled, enable them from git v2.22 if !setting.Git.DisablePartialClone && CheckGitVersionAtLeast("2.22") == nil { - GlobalCommandArgs = append(GlobalCommandArgs, "-c", "uploadpack.allowfilter=true") + globalCommandArgs = append(globalCommandArgs, "-c", "uploadpack.allowfilter=true") } // Save current git version on init to gitVersion otherwise it would require an RWMutex @@ -213,7 +213,7 @@ func Init(ctx context.Context) error { if err := checkAndSetConfig("core.protectntfs", "false", true); err != nil { return err } - GlobalCommandArgs = append(GlobalCommandArgs, "-c", "core.protectntfs=false") + globalCommandArgs = append(globalCommandArgs, "-c", "core.protectntfs=false") } return nil } diff --git a/modules/git/lfs.go b/modules/git/lfs.go index 3a809d393d23a..cdd9d15b2e869 100644 --- a/modules/git/lfs.go +++ b/modules/git/lfs.go @@ -29,7 +29,7 @@ func CheckLFSVersion() { logger.Error("LFS server support needs at least Git v2.1.2") } else { once.Do(func() { - GlobalCommandArgs = append(GlobalCommandArgs, "-c", "filter.lfs.required=", + globalCommandArgs = append(globalCommandArgs, "-c", "filter.lfs.required=", "-c", "filter.lfs.smudge=", "-c", "filter.lfs.clean=") }) } diff --git a/modules/git/repo.go b/modules/git/repo.go index 5636405118fda..663e13dc18fff 100644 --- a/modules/git/repo.go +++ b/modules/git/repo.go @@ -106,8 +106,8 @@ type CloneRepoOptions struct { // Clone clones original repository to target path. func Clone(ctx context.Context, from, to string, opts CloneRepoOptions) error { - cargs := make([]string, len(GlobalCommandArgs)) - copy(cargs, GlobalCommandArgs) + cargs := make([]string, len(globalCommandArgs)) + copy(cargs, globalCommandArgs) return CloneWithArgs(ctx, from, to, cargs, opts) } From b53fd5ff9006af9d35e8de727f8ebbbb4bb30806 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 25 Jan 2022 22:09:49 +0000 Subject: [PATCH 2/6] Bump golangci-lint version (#18411) - Bump golangci-lint version to v1.44.0 (no new linter errors detected) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d12f83d98b460..87613d9510db3 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ COMMA := , XGO_VERSION := go-1.17.x MIN_GO_VERSION := 001016000 MIN_NODE_VERSION := 012017000 -MIN_GOLANGCI_LINT_VERSION := 001043000 +MIN_GOLANGCI_LINT_VERSION := 001044000 DOCKER_IMAGE ?= gitea/gitea DOCKER_TAG ?= latest From 713985b1a4c5d2faf997b5e96885e9d1a31250db Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 25 Jan 2022 23:09:57 +0000 Subject: [PATCH 3/6] Prevent deadlocks in persistable channel pause test (#18410) * Prevent deadlocks in persistable channel pause test Because of reuse of the old paused/resumed channels in this test there was a potential for deadlock. This PR ensures that the channels are always reobtained. It further adds some control code to detect hangs in future - and it ensures that the pausing warning is not shown on shutdown. Signed-off-by: Andrew Thornton * do not warn but do pause Signed-off-by: Andrew Thornton --- modules/queue/queue_disk_channel_test.go | 48 ++++++++++++++++++++++-- modules/queue/workerpool.go | 11 ++++-- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/modules/queue/queue_disk_channel_test.go b/modules/queue/queue_disk_channel_test.go index 9bbd146efe9be..026982fd92ab0 100644 --- a/modules/queue/queue_disk_channel_test.go +++ b/modules/queue/queue_disk_channel_test.go @@ -287,11 +287,16 @@ func TestPersistableChannelQueue_Pause(t *testing.T) { assert.Nil(t, result2) pausable.Resume() + paused, resumed = pausable.IsPausedIsResumed() select { + case <-paused: + assert.Fail(t, "Queue should be resumed") + return case <-resumed: default: assert.Fail(t, "Queue should be resumed") + return } select { @@ -345,16 +350,22 @@ func TestPersistableChannelQueue_Pause(t *testing.T) { pausable.Resume() + paused, resumed = pausable.IsPausedIsResumed() select { + case <-paused: + assert.Fail(t, "Queue should not be paused") + return case <-resumed: default: assert.Fail(t, "Queue should be resumed") + return } select { case result1 = <-handleChan: case <-time.After(500 * time.Millisecond): assert.Fail(t, "handler chan should contain test1") + return } assert.Equal(t, test1.TestString, result1.TestString) assert.Equal(t, test1.TestInt, result1.TestInt) @@ -369,7 +380,12 @@ func TestPersistableChannelQueue_Pause(t *testing.T) { } // Wait til it is closed - <-queue.(*PersistableChannelQueue).closed + select { + case <-queue.(*PersistableChannelQueue).closed: + case <-time.After(5 * time.Second): + assert.Fail(t, "queue should close") + return + } err = queue.Push(&test1) assert.NoError(t, err) @@ -378,6 +394,7 @@ func TestPersistableChannelQueue_Pause(t *testing.T) { select { case <-handleChan: assert.Fail(t, "Handler processing should have stopped") + return default: } @@ -393,6 +410,7 @@ func TestPersistableChannelQueue_Pause(t *testing.T) { select { case <-handleChan: assert.Fail(t, "Handler processing should have stopped") + return default: } @@ -431,6 +449,7 @@ func TestPersistableChannelQueue_Pause(t *testing.T) { select { case <-handleChan: assert.Fail(t, "Handler processing should have stopped") + return case <-paused: } @@ -449,13 +468,36 @@ func TestPersistableChannelQueue_Pause(t *testing.T) { select { case <-handleChan: assert.Fail(t, "Handler processing should have stopped") + return default: } pausable.Resume() + paused, resumed = pausable.IsPausedIsResumed() + select { + case <-paused: + assert.Fail(t, "Queue should not be paused") + return + case <-resumed: + default: + assert.Fail(t, "Queue should be resumed") + return + } - result3 := <-handleChan - result4 := <-handleChan + var result3, result4 *testData + + select { + case result3 = <-handleChan: + case <-time.After(1 * time.Second): + assert.Fail(t, "Handler processing should have resumed") + return + } + select { + case result4 = <-handleChan: + case <-time.After(1 * time.Second): + assert.Fail(t, "Handler processing should have resumed") + return + } if result4.TestString == test1.TestString { result3, result4 = result4, result3 } diff --git a/modules/queue/workerpool.go b/modules/queue/workerpool.go index 30dc8073c90b7..3eeebaa1a00db 100644 --- a/modules/queue/workerpool.go +++ b/modules/queue/workerpool.go @@ -301,9 +301,14 @@ func (p *WorkerPool) addWorkers(ctx context.Context, cancel context.CancelFunc, cancel() } if p.hasNoWorkerScaling() { - log.Warn( - "Queue: %d is configured to be non-scaling and has no workers - this configuration is likely incorrect.\n"+ - "The queue will be paused to prevent data-loss with the assumption that you will add workers and unpause as required.", p.qid) + select { + case <-p.baseCtx.Done(): + // Don't warn if the baseCtx is shutdown + default: + log.Warn( + "Queue: %d is configured to be non-scaling and has no workers - this configuration is likely incorrect.\n"+ + "The queue will be paused to prevent data-loss with the assumption that you will add workers and unpause as required.", p.qid) + } p.pause() } p.lock.Unlock() From de61e5f9a091c4e541f390636e96f0ed3f2e508e Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 26 Jan 2022 00:23:46 +0000 Subject: [PATCH 4/6] Fix broken oauth2 authentication source edit page (#18412) It appears that there was a broken merge of the edit.tmpl page during the merge of #16594 - I am not entirely sure how this happened as the PR was correct. This PR fixes the broken template. Fix #18388 Signed-off-by: Andrew Thornton --- templates/admin/auth/edit.tmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index a9942354c0ca4..efa440ff33ef4 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -286,6 +286,10 @@

{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}

+ +
+
+
From 4889ab52de0b390bb6e96ad6a64ee082585b3d79 Mon Sep 17 00:00:00 2001 From: GiteaBot Date: Wed, 26 Jan 2022 00:28:46 +0000 Subject: [PATCH 5/6] [skip ci] Updated translations via Crowdin --- options/locale/locale_cs-CZ.ini | 7 ----- options/locale/locale_de-DE.ini | 8 ------ options/locale/locale_el-GR.ini | 8 ------ options/locale/locale_es-ES.ini | 8 ------ options/locale/locale_fa-IR.ini | 8 ------ options/locale/locale_fi-FI.ini | 7 ----- options/locale/locale_fr-FR.ini | 7 ----- options/locale/locale_hu-HU.ini | 5 ---- options/locale/locale_it-IT.ini | 6 ----- options/locale/locale_ja-JP.ini | 47 +++++++++++++++++++++++++++------ options/locale/locale_ko-KR.ini | 3 --- options/locale/locale_lv-LV.ini | 8 ------ options/locale/locale_nl-NL.ini | 7 ----- options/locale/locale_pl-PL.ini | 8 ------ options/locale/locale_pt-BR.ini | 6 ----- options/locale/locale_pt-PT.ini | 9 ------- options/locale/locale_ru-RU.ini | 8 ------ options/locale/locale_si-LK.ini | 8 ------ options/locale/locale_sv-SE.ini | 7 ----- options/locale/locale_tr-TR.ini | 8 ------ options/locale/locale_uk-UA.ini | 8 ------ options/locale/locale_zh-CN.ini | 23 +++++++++------- options/locale/locale_zh-TW.ini | 8 ------ 23 files changed, 53 insertions(+), 169 deletions(-) diff --git a/options/locale/locale_cs-CZ.ini b/options/locale/locale_cs-CZ.ini index 02b1c12916329..033df908612a0 100644 --- a/options/locale/locale_cs-CZ.ini +++ b/options/locale/locale_cs-CZ.ini @@ -1752,16 +1752,9 @@ settings.update_hook_success=Webový háček byl aktualizován. settings.delete_webhook=Odstranit webový háček settings.recent_deliveries=Nedávné dodávky settings.hook_type=Typ háčku -settings.add_slack_hook_desc=Integrovat Slack do vašeho repozitáře. settings.slack_token=Poukázka settings.slack_domain=Doména settings.slack_channel=Kanál -settings.add_discord_hook_desc=Integrovat Discord do vašeho repozitáře. -settings.add_dingtalk_hook_desc=Integrovat Dingtalk do vašeho repozitáře. -settings.add_telegram_hook_desc=Integrovat Telegram do vašeho repozitáře. -settings.add_matrix_hook_desc=Integrovat Matrix do vašeho repozitáře. -settings.add_msteams_hook_desc=Integrovat Microsoft Teams do vašeho repozitáře. -settings.add_feishu_hook_desc=Integrovat Feishu do vašeho repozitáře. settings.deploy_keys=Klíče pro nasazení settings.add_deploy_key=Přidat klíč pro nasazení settings.deploy_key_desc=Klíče pro nasazení mají k tomuto repozitáři přístup pouze pro čtení. diff --git a/options/locale/locale_de-DE.ini b/options/locale/locale_de-DE.ini index c82f11e7bd649..898cfca96d772 100644 --- a/options/locale/locale_de-DE.ini +++ b/options/locale/locale_de-DE.ini @@ -1912,17 +1912,9 @@ settings.update_hook_success=Webhook wurde aktualisiert. settings.delete_webhook=Webhook entfernen settings.recent_deliveries=Letzte Zustellungen settings.hook_type=Hook-Typ -settings.add_slack_hook_desc=Slack-Integration zu deinem Repository hinzufügen. settings.slack_token=Token settings.slack_domain=Domain settings.slack_channel=Kanal -settings.add_discord_hook_desc=Discord-Integration zu deinem Repository hinzufügen. -settings.add_dingtalk_hook_desc=Dingtalk-Integration zu deinem Repository hinzufügen. -settings.add_telegram_hook_desc=Telegram-Integration zu deinem Repository hinzufügen. -settings.add_matrix_hook_desc=Matrix-Integration zu deinem Repository hinzufügen. -settings.add_msteams_hook_desc="Microsoft Teams"-Integration zu deinem Repository hinzufügen. -settings.add_feishu_hook_desc=Feishu-Integration zu deinem Repository hinzufügen. -settings.add_Wechat_hook_desc=Wechatwork in dein Repository integrieren. settings.deploy_keys=Deploy-Schlüssel settings.add_deploy_key=Deploy-Schlüssel hinzufügen settings.deploy_key_desc=Deploy-Keys haben nur Lesezugriff auf das Repository. diff --git a/options/locale/locale_el-GR.ini b/options/locale/locale_el-GR.ini index 6e113881673aa..c48d38a7c1ec0 100644 --- a/options/locale/locale_el-GR.ini +++ b/options/locale/locale_el-GR.ini @@ -1884,17 +1884,9 @@ settings.update_hook_success=Το webhook έχει ενημερωθεί. settings.delete_webhook=Ενημέρωση Webhook settings.recent_deliveries=Πρόσφατες Παραδόσεις settings.hook_type=Τύπος Hook -settings.add_slack_hook_desc=Ενσωματώστε το Slack στο αποθετήριό σας. settings.slack_token=Διακριτικό settings.slack_domain=Domain settings.slack_channel=Κανάλι -settings.add_discord_hook_desc=Ενσωματώστε το Discord στο αποθετήριό σας. -settings.add_dingtalk_hook_desc=Ενσωματώστε το Dingtalk στο αποθετήριό σας. -settings.add_telegram_hook_desc=Ενσωματώστε το Telegram στο αποθετήριό σας. -settings.add_matrix_hook_desc=Ενσωματώστε το Matrix στο αποθετήριό σας. -settings.add_msteams_hook_desc=Ενσωμάτωση Microsoft Teams στο αποθετήριό σας. -settings.add_feishu_hook_desc=Ενσωματώστε το Feishu στο αποθετήριό σας. -settings.add_Wechat_hook_desc=Ενσωματώστε το Wechatwork στο αποθετήριό σας. settings.deploy_keys=Κλειδιά Διάθεσης settings.add_deploy_key=Προσθήκη Κλειδιού Διάθεσης settings.deploy_key_desc=Τα κλειδιά διάθεσης έχουν πρόσβαση μόνο-ανάγνωσης στο αποθετήριο. diff --git a/options/locale/locale_es-ES.ini b/options/locale/locale_es-ES.ini index 2b1b9e728b1f7..3cb8968992f9f 100644 --- a/options/locale/locale_es-ES.ini +++ b/options/locale/locale_es-ES.ini @@ -1920,17 +1920,9 @@ settings.update_hook_success=El webhook ha sido actualizado. settings.delete_webhook=Eliminar Webhook settings.recent_deliveries=Envíos Recientes settings.hook_type=Tipo de Hook -settings.add_slack_hook_desc=Integrar Slack en su repositorio. settings.slack_token=Token settings.slack_domain=Dominio settings.slack_channel=Canal -settings.add_discord_hook_desc=Integrar Discord en su repositorio. -settings.add_dingtalk_hook_desc=Integrar Dingtalk en su repositorio. -settings.add_telegram_hook_desc=Integrar Telegrama en tu repositorio. -settings.add_matrix_hook_desc=Integrar Matrix en su repositorio. -settings.add_msteams_hook_desc=Integrar Microsoft Teams en tu repositorio. -settings.add_feishu_hook_desc=Integrar Slack en su repositorio. -settings.add_Wechat_hook_desc=Integrar Wechatwork en su repositorio. settings.deploy_keys=Claves de Implementación settings.add_deploy_key=Añadir Clave de Implementación settings.deploy_key_desc=Las claves de implementación tienen acceso de sólo lectura al repositorio. diff --git a/options/locale/locale_fa-IR.ini b/options/locale/locale_fa-IR.ini index f2d468b9204d3..2430441bf9a23 100644 --- a/options/locale/locale_fa-IR.ini +++ b/options/locale/locale_fa-IR.ini @@ -1844,17 +1844,9 @@ settings.update_hook_success=هوک تحت وب به‌روز شد. settings.delete_webhook=حذف Webhook settings.recent_deliveries=واپسین تحویل ها settings.hook_type=نوع هوک -settings.add_slack_hook_desc=درست کردن سستی در مخزن شما. settings.slack_token=توکن settings.slack_domain=دامنه settings.slack_channel=کانال -settings.add_discord_hook_desc=درست کردن اختلاف‌ها در مخزن شما. -settings.add_dingtalk_hook_desc=درست کردن Dingtalk در مخزن شما. -settings.add_telegram_hook_desc=درست کردن تلگرام در مخزن شما. -settings.add_matrix_hook_desc=Matrix را در انبار خود ادغام کنید. -settings.add_msteams_hook_desc=درست کردن تیم مایکروسافت در مخزن شما. -settings.add_feishu_hook_desc=Feishu را در انبار خود ادغام کنید. -settings.add_Wechat_hook_desc=Wechatwork را در مخزن خود ادغام کنید. settings.deploy_keys=کلید های استقرار settings.add_deploy_key=افزودن کلید استقرار settings.deploy_key_desc=کلید استقرار فقط-خواندنی است برای دسترس واکشی از این مخزن. diff --git a/options/locale/locale_fi-FI.ini b/options/locale/locale_fi-FI.ini index 16ff85c6ae544..44c6b100c662f 100644 --- a/options/locale/locale_fi-FI.ini +++ b/options/locale/locale_fi-FI.ini @@ -888,16 +888,9 @@ settings.event_pull_request=Vetopyyntö settings.update_webhook=Päivitä webkoukku settings.recent_deliveries=Viimeisimmät toimitukset settings.hook_type=Koukkutyyppi -settings.add_slack_hook_desc=Liitä Slack repoon. settings.slack_token=Pääsymerkki settings.slack_domain=Verkkotunnus settings.slack_channel=Kanava -settings.add_discord_hook_desc=Liitä Discord repoon. -settings.add_dingtalk_hook_desc=Liitä Dingtalk repoon. -settings.add_telegram_hook_desc=Liitä Telegram repoon. -settings.add_matrix_hook_desc=Liitä Matrix repoon. -settings.add_msteams_hook_desc=Liitä Microsoft Teams repoon. -settings.add_feishu_hook_desc=Liitä Feishu repoon. settings.deploy_keys=Deploy avaimet settings.add_deploy_key=Lisää deploy avain settings.title=Otsikko diff --git a/options/locale/locale_fr-FR.ini b/options/locale/locale_fr-FR.ini index 410ba30fc8184..015a4a22df9d3 100644 --- a/options/locale/locale_fr-FR.ini +++ b/options/locale/locale_fr-FR.ini @@ -1746,16 +1746,9 @@ settings.update_hook_success=Webhook mis à jour. settings.delete_webhook=Retirer le Webhook settings.recent_deliveries=Livraisons récentes settings.hook_type=Type de Hook -settings.add_slack_hook_desc=Intégrer Slack au dépôt. settings.slack_token=Jeton settings.slack_domain=Domaine settings.slack_channel=Canal -settings.add_discord_hook_desc=Intégrer Discord au dépôt. -settings.add_dingtalk_hook_desc=Intégrer Dingtalk au dépôt. -settings.add_telegram_hook_desc=Intégrer Telegram au dépôt. -settings.add_matrix_hook_desc=Intégrer Matrix au dépôt. -settings.add_msteams_hook_desc=Intégrer Microsoft Teams au dépôt. -settings.add_feishu_hook_desc=Intégrer Feishu au dépôt. settings.deploy_keys=Clés de déploiement settings.add_deploy_key=Ajouter une clé de déploiement settings.deploy_key_desc=Les clefs de déploiement ont un accès en lecture seule au dépôt. diff --git a/options/locale/locale_hu-HU.ini b/options/locale/locale_hu-HU.ini index 840ee972e10ff..59dc60bbe6891 100644 --- a/options/locale/locale_hu-HU.ini +++ b/options/locale/locale_hu-HU.ini @@ -1221,14 +1221,9 @@ settings.update_hook_success=Webhook frissítve. settings.delete_webhook=Webhook törlése settings.recent_deliveries=Legutóbbi Küldések settings.hook_type=Hook típusa -settings.add_slack_hook_desc=Slack integrálása a tárolóba. settings.slack_token=Token settings.slack_domain=Tartomány settings.slack_channel=Csatorna -settings.add_discord_hook_desc=Discord integrálása a tárolóba. -settings.add_dingtalk_hook_desc=Dingtalk integrálása a tárolóba. -settings.add_telegram_hook_desc=Telegram integrálása a tárolóba. -settings.add_msteams_hook_desc=Microsoft Teams integrálása a tárolóba. settings.deploy_keys=Telepítési kulcsok settings.add_deploy_key=Telepítési kulcs hozzáadása settings.deploy_key_desc=A Deploy kulcsoknak csak olvasó joguk van ehhez a tárolóhoz. diff --git a/options/locale/locale_it-IT.ini b/options/locale/locale_it-IT.ini index 9f1cc47a15509..f00afa4c06e5b 100644 --- a/options/locale/locale_it-IT.ini +++ b/options/locale/locale_it-IT.ini @@ -1569,15 +1569,9 @@ settings.update_hook_success=Il webhook è stato aggiornato. settings.delete_webhook=Rimuovi Webhook settings.recent_deliveries=Recenti Deliveries settings.hook_type=Tipo di Hook -settings.add_slack_hook_desc=Integra Slack nel tuo repository. settings.slack_token=Gettone settings.slack_domain=Dominio settings.slack_channel=Canale -settings.add_discord_hook_desc=Integra Discord nel tuo repository. -settings.add_dingtalk_hook_desc=Integra Dingtalk nel tuo repository. -settings.add_telegram_hook_desc=Integra Telegram nella tua repository. -settings.add_msteams_hook_desc=Integra Microsoft Teams nella tua repository. -settings.add_feishu_hook_desc=Integra Feishu nel tuo repository. settings.deploy_keys=Dispiega Chiavi settings.add_deploy_key=Aggiungi Deploy Key settings.deploy_key_desc=Le deploy key possiedono l'accesso solamente alla lettura di un repository. diff --git a/options/locale/locale_ja-JP.ini b/options/locale/locale_ja-JP.ini index 6641fa9dee507..9bc9193ad86ed 100644 --- a/options/locale/locale_ja-JP.ini +++ b/options/locale/locale_ja-JP.ini @@ -549,6 +549,22 @@ continue=続行 cancel=キャンセル language=言語 ui=テーマ +hidden_comment_types=非表示にするコメントの種類 +comment_type_group_reference=参照 +comment_type_group_label=ラベル +comment_type_group_milestone=マイルストーン +comment_type_group_assignee=担当者 +comment_type_group_title=タイトル +comment_type_group_branch=ブランチ +comment_type_group_time_tracking=タイムトラッキング +comment_type_group_deadline=期限 +comment_type_group_dependency=依存関係 +comment_type_group_lock=ロック状態 +comment_type_group_review_request=レビュー依頼 +comment_type_group_pull_request_push=追加されたコミット +comment_type_group_project=プロジェクト +comment_type_group_issue_ref=イシューの参照 +saved_successfully=設定は正常に保存されました。 privacy=プライバシー keep_activity_private=プロフィールページのアクティビティ表示を隠す keep_activity_private_popup=アクティビティを、あなたと管理者にのみ表示します @@ -1920,17 +1936,26 @@ settings.update_hook_success=Webhookを更新しました。 settings.delete_webhook=Webhookを削除 settings.recent_deliveries=最近の配信 settings.hook_type=フックのタイプ -settings.add_slack_hook_desc=Slackをリポジトリと組み合わせます。 settings.slack_token=トークン settings.slack_domain=ドメイン settings.slack_channel=チャンネル -settings.add_discord_hook_desc=Discordをリポジトリと組み合わせます。 -settings.add_dingtalk_hook_desc=Dingtalkをリポジトリと組み合わせます。 -settings.add_telegram_hook_desc=Telegramをリポジトリと組み合わせます。 -settings.add_matrix_hook_desc=Matrix とリポジトリを組み合わせます。 -settings.add_msteams_hook_desc=Microsoft Teamsをリポジトリと組み合わせます。 -settings.add_feishu_hook_desc=Feishuをリポジトリと組み合わせます。 -settings.add_Wechat_hook_desc=Wechatworkをリポジトリと組み合わせます。 +settings.add_web_hook_desc=%s をリポジトリと組み合わせます。 +settings.web_hook_name_gitea=Gitea +settings.web_hook_name_gogs=Gogs +settings.web_hook_name_slack=Slack +settings.web_hook_name_discord=Discord +settings.web_hook_name_dingtalk=DingTalk +settings.web_hook_name_telegram=Telegram +settings.web_hook_name_matrix=Matrix +settings.web_hook_name_msteams=Microsoft Teams +settings.web_hook_name_feishu_or_larksuite=Feishu / Lark Suite +settings.web_hook_name_feishu=Feishu +settings.web_hook_name_larksuite=Lark Suite +settings.web_hook_name_wechatwork=WeCom (Wechat Work) +settings.web_hook_name_packagist=Packagist +settings.packagist_username=Packagist ユーザー名 +settings.packagist_api_token=API トークン +settings.packagist_package_url=Packagist パッケージ URL settings.deploy_keys=デプロイキー settings.add_deploy_key=デプロイキーを追加 settings.deploy_key_desc=デプロイキーには、リポジトリの読み取り専用プルアクセス権が与えられます。 @@ -2787,6 +2812,12 @@ monitor.queue.pool.flush.title=キューの掃き出し monitor.queue.pool.flush.desc=キューが空になるかタイムアウトになると終了するワーカーを、ひとつ追加します。 monitor.queue.pool.flush.submit=掃き出しワーカーを追加 monitor.queue.pool.flush.added=掃き出しワーカーを %[1]s に追加しました +monitor.queue.pool.pause.title=キューの一時停止 +monitor.queue.pool.pause.desc=キューを一時停止すると、データの処理を停止します +monitor.queue.pool.pause.submit=キューを一時停止 +monitor.queue.pool.resume.title=キューの再開 +monitor.queue.pool.resume.desc=キューに処理の再開を指示します +monitor.queue.pool.resume.submit=キューを再開 monitor.queue.settings.title=プール設定 monitor.queue.settings.desc=ワーカーへのキューのブロックが発生すると、それに応じてプール数がブースト分ずつ動的に増えます。 これらの変更は現在のワーカーグループには影響しません。 diff --git a/options/locale/locale_ko-KR.ini b/options/locale/locale_ko-KR.ini index 35be071b45501..63077f4df45c3 100644 --- a/options/locale/locale_ko-KR.ini +++ b/options/locale/locale_ko-KR.ini @@ -1066,12 +1066,9 @@ settings.update_hook_success=웹훅이 갱신되었습니다. settings.delete_webhook=웹훅 삭제 settings.recent_deliveries=최근의 Deliveries settings.hook_type=훅 타입 -settings.add_slack_hook_desc=Slack을 저장소와 연동. settings.slack_token=토큰 settings.slack_domain=도메인 settings.slack_channel=채널 -settings.add_discord_hook_desc=Discord를 저장소와 연동. -settings.add_dingtalk_hook_desc=Dingtalk을 저장소와 연동. settings.deploy_keys=배포 키 settings.add_deploy_key=배포 키 추가 settings.deploy_key_desc=배포키는 저장소에서 풀만 할 수 있는 읽기 전용입니다. diff --git a/options/locale/locale_lv-LV.ini b/options/locale/locale_lv-LV.ini index 2fb6f6aa0fe5d..67bcb74f31e07 100644 --- a/options/locale/locale_lv-LV.ini +++ b/options/locale/locale_lv-LV.ini @@ -1920,17 +1920,9 @@ settings.update_hook_success=Tīmekļa āķis tika atjaunots. settings.delete_webhook=Noņemt tīmekļa āķi settings.recent_deliveries=Pēdējās piegādes settings.hook_type=Āķa veids -settings.add_slack_hook_desc=Integrēt Slack repozitorijā. settings.slack_token=Talons settings.slack_domain=Domēns settings.slack_channel=Kanāls -settings.add_discord_hook_desc=Integrēt Discord repozitorijā. -settings.add_dingtalk_hook_desc=Integrēt Dingtalk repozitorijā. -settings.add_telegram_hook_desc=Integrēt Telegram repozitorijā. -settings.add_matrix_hook_desc=Integrēt Matrix repozitorijā. -settings.add_msteams_hook_desc=Integrēt Microsoft Teams repozitorijā. -settings.add_feishu_hook_desc=Integrēt Feishu repozitorijā. -settings.add_Wechat_hook_desc=Integrēt Wechatwork repozitorijā. settings.deploy_keys=Izvietot atslēgas settings.add_deploy_key=Pievienot izvietošanas atslēgu settings.deploy_key_desc=Izvietošanas atslēgām ir lasīšanas piekļuve repozitorijam. diff --git a/options/locale/locale_nl-NL.ini b/options/locale/locale_nl-NL.ini index 395a94df42f74..283a2266a2ace 100644 --- a/options/locale/locale_nl-NL.ini +++ b/options/locale/locale_nl-NL.ini @@ -1618,16 +1618,9 @@ settings.update_hook_success=Webhook is bijgewerkt. settings.delete_webhook=Verwijder webhook settings.recent_deliveries=Recente bezorgingen settings.hook_type=Type hook -settings.add_slack_hook_desc=Integreer Slack in uw repository. settings.slack_token=Slack token settings.slack_domain=Slack domein settings.slack_channel=Slack kanaal -settings.add_discord_hook_desc=Integreer Discord in uw repository. -settings.add_dingtalk_hook_desc=Integreer Dingtalk in uw repository. -settings.add_telegram_hook_desc=Integreer Telegram in uw repository. -settings.add_matrix_hook_desc=Integreer Matrix in uw repository. -settings.add_msteams_hook_desc=Integreer Microsoft Teams in uw repository. -settings.add_feishu_hook_desc=Integreer Feishu in uw repository. settings.deploy_keys=Installeer sleutels settings.add_deploy_key=Toevoegen deploy sleutel settings.deploy_key_desc=Deploy keys hebben alleen-lezen pull-toegang tot de repository. diff --git a/options/locale/locale_pl-PL.ini b/options/locale/locale_pl-PL.ini index 9226ffebc19e1..33d6e1147e27a 100644 --- a/options/locale/locale_pl-PL.ini +++ b/options/locale/locale_pl-PL.ini @@ -1806,17 +1806,9 @@ settings.update_hook_success=Webhook został zaktualizowany. settings.delete_webhook=Usuń Webhooka settings.recent_deliveries=Ostatnie wywołania settings.hook_type=Typ hooka -settings.add_slack_hook_desc=Zintegruj Slacka ze swoim repozytorium. settings.slack_token=Token settings.slack_domain=Domena settings.slack_channel=Kanał -settings.add_discord_hook_desc=Zintegruj Discorda ze swoim repozytorium. -settings.add_dingtalk_hook_desc=Zintegruj Dingtalka ze swoim repozytorium. -settings.add_telegram_hook_desc=Zintegruj Telegrama ze swoim repozytorium. -settings.add_matrix_hook_desc=Zintegruj Matrixa ze swoim repozytorium. -settings.add_msteams_hook_desc=Zintegruj Microsoft Teams ze swoim repozytorium. -settings.add_feishu_hook_desc=Zintegruj Feishu ze swoim repozytorium. -settings.add_Wechat_hook_desc=Zintegruj Wechatwork do twojego repozytorium. settings.deploy_keys=Klucze wdrożeniowe settings.add_deploy_key=Dodaj klucz wdrożeniowy settings.deploy_key_desc=Klucze wdrożeniowe mają wyłącznie dostęp "tylko do odczytu" do pobierania danych z repozytorium. diff --git a/options/locale/locale_pt-BR.ini b/options/locale/locale_pt-BR.ini index 555ba3cbc2cbc..bf9dc176752a6 100644 --- a/options/locale/locale_pt-BR.ini +++ b/options/locale/locale_pt-BR.ini @@ -1649,15 +1649,9 @@ settings.update_hook_success=O webhook foi atualizado. settings.delete_webhook=Remover webhook settings.recent_deliveries=Entregas Recentes settings.hook_type=Tipo de Hook -settings.add_slack_hook_desc=Integre o Slack em seu repositório. settings.slack_token=Token settings.slack_domain=Domínio settings.slack_channel=Canal -settings.add_discord_hook_desc=Integre o Discord em seu repositório. -settings.add_dingtalk_hook_desc=Integre o Dingtalk em seu repositório. -settings.add_telegram_hook_desc=Integre Telegram no seu repositório. -settings.add_msteams_hook_desc=Integre Microsoft Teams no seu repositório. -settings.add_feishu_hook_desc=Integre o Feishu em seu repositório. settings.deploy_keys=Chaves de Deploy settings.add_deploy_key=Nova chave settings.deploy_key_desc=As chaves de deploy possuem somente acesso de leitura (pull) ao repositório. diff --git a/options/locale/locale_pt-PT.ini b/options/locale/locale_pt-PT.ini index 9b07fb850d7b5..6bfd9ed06cdc4 100644 --- a/options/locale/locale_pt-PT.ini +++ b/options/locale/locale_pt-PT.ini @@ -1920,18 +1920,9 @@ settings.update_hook_success=O automatismo web foi modificado. settings.delete_webhook=Remover automatismo web settings.recent_deliveries=Entregas recentes settings.hook_type=Tipo de automatismo -settings.add_slack_hook_desc=Integrar Slack no seu repositório. settings.slack_token=Código settings.slack_domain=Domínio settings.slack_channel=Canal -settings.add_discord_hook_desc=Integrar Discord no seu repositório. -settings.add_dingtalk_hook_desc=Integrar Dingtalk no seu repositório. -settings.add_telegram_hook_desc=Integrar Telegram no seu repositório. -settings.add_matrix_hook_desc=Integrar Matrix no seu repositório. -settings.add_msteams_hook_desc=Integrar Microsoft Teams no seu repositório. -settings.add_feishu_hook_desc=Integrar Feishu no seu repositório. -settings.add_Wechat_hook_desc=Integrar Wechatwork no seu repositório. -settings.add_packagist_hook_desc=Integrar Packagist no seu repositório. settings.packagist_username=Nome de utilizador no Packagist settings.packagist_api_token=Código da API settings.packagist_package_url=URL do pacote Packagist diff --git a/options/locale/locale_ru-RU.ini b/options/locale/locale_ru-RU.ini index d0d500f06983e..784b6c8cdb468 100644 --- a/options/locale/locale_ru-RU.ini +++ b/options/locale/locale_ru-RU.ini @@ -1876,17 +1876,9 @@ settings.update_hook_success=Вебхук был обновлён. settings.delete_webhook=Удалить вебхук settings.recent_deliveries=Недавние рассылки settings.hook_type=Тип hook'а -settings.add_slack_hook_desc=Добавить интеграцию с Slack в ваш репозиторий. settings.slack_token=Slack токен settings.slack_domain=Домен settings.slack_channel=Канал -settings.add_discord_hook_desc=Добавить уведомления о событиях через Discord. -settings.add_dingtalk_hook_desc=Добавить интеграцию с Dingtalk в ваш репозиторий. -settings.add_telegram_hook_desc=Добавить интеграцию с Telegram в ваш репозиторий. -settings.add_matrix_hook_desc=Добавить интеграцию Matrix в ваш репозиторий. -settings.add_msteams_hook_desc=Добавить интеграцию с Microsoft Teams в ваш репозиторий. -settings.add_feishu_hook_desc=Добавить интеграцию Feishu в ваш репозиторий. -settings.add_Wechat_hook_desc=Добавить интеграцию с Wechatwork в ваш репозиторий. settings.deploy_keys=Ключи развертывания settings.add_deploy_key=Добавить ключ развертывания settings.deploy_key_desc=Ключи развёртывания доступны только для чтения. Это не то же самое что и SSH-ключи аккаунта. diff --git a/options/locale/locale_si-LK.ini b/options/locale/locale_si-LK.ini index 4da9ceed59912..e73a831858ea3 100644 --- a/options/locale/locale_si-LK.ini +++ b/options/locale/locale_si-LK.ini @@ -1786,17 +1786,9 @@ settings.update_hook_success=වෙබ්කොක්කෙන් යාවත settings.delete_webhook=වෙබ්හූක් ඉවත් කරන්න settings.recent_deliveries=මෑත බෙදාහැරීම් settings.hook_type=කොක්කෙන් වර්ගය -settings.add_slack_hook_desc=ඒකාබද්ධ ස්ලැක් ඔබේ ගබඩාවට. settings.slack_token=ටෝකනය settings.slack_domain=වසම settings.slack_channel=නාලිකාව -settings.add_discord_hook_desc=විසංවාදය ඔබේ ගබඩාවට ඒකාබද්ධ කරන්න. -settings.add_dingtalk_hook_desc=ඒකාබද්ධ කරන්න Dingtalk ඔබේ ගබඩාවට. -settings.add_telegram_hook_desc=ටෙලිග්රාම් ඔබේ ගබඩාවට ඒකාබද්ධ කරන්න. -settings.add_matrix_hook_desc=නියමයන් ඔබේ ගබඩාවට ඒකාබද්ධ කරන්න. -settings.add_msteams_hook_desc=මයික්රොසොෆ්ට් කණ්ඩායම් ඔබේ ගබඩාවට ඒකාබද්ධ කරන්න. -settings.add_feishu_hook_desc=ඒකාබද්ධ පෙබරවාරි ඔබේ ගබඩාවට. -settings.add_Wechat_hook_desc=Wechatwork ඔබේ ගබඩාවට ඒකාබද්ධ කරන්න. settings.deploy_keys=යතුරු යෙදවිය settings.add_deploy_key=ප්රධාන යෙදවිය එකතු කරන්න settings.deploy_key_desc=යතුරු යෙදවීමේ ගබඩාවට කියවීමට පමණක් අදින්න ප්රවේශය ඇත. diff --git a/options/locale/locale_sv-SE.ini b/options/locale/locale_sv-SE.ini index 596d384a26086..38452900c3553 100644 --- a/options/locale/locale_sv-SE.ini +++ b/options/locale/locale_sv-SE.ini @@ -1436,16 +1436,9 @@ settings.update_hook_success=Webhook har blivit uppdaterad. settings.delete_webhook=Ta bort webhook settings.recent_deliveries=Färska leveranser settings.hook_type=Kroktyp -settings.add_slack_hook_desc=Integrera Slack med din utvecklingskatalog. settings.slack_token=Pollett settings.slack_domain=Domän settings.slack_channel=Kanal -settings.add_discord_hook_desc=Integrera Discord med din utvecklingskatalog. -settings.add_dingtalk_hook_desc=Integrera Dingtalk med din utvecklingskatalog. -settings.add_telegram_hook_desc=Integrera Telegram med din utvecklingskatalog. -settings.add_matrix_hook_desc=Integrera Matrix med din utvecklingskatalog. -settings.add_msteams_hook_desc=Integrera Microsoft Teams med din utvecklingskatalog. -settings.add_feishu_hook_desc=Integrera Feishu med din utvecklingskatalog. settings.deploy_keys=Driftsättningsnycklar settings.add_deploy_key=Lägg till driftsättningsnyckel settings.deploy_key_desc=Distributionsnycklar har skrivskyddad åtkomst till utvecklingskatalogen. diff --git a/options/locale/locale_tr-TR.ini b/options/locale/locale_tr-TR.ini index 4fbdb5085018a..68203898f80b8 100644 --- a/options/locale/locale_tr-TR.ini +++ b/options/locale/locale_tr-TR.ini @@ -1801,17 +1801,9 @@ settings.update_hook_success=Web isteği güncellendi. settings.delete_webhook=Web İsteğini Sil settings.recent_deliveries=Son Dağıtımlar settings.hook_type=İstek Türü -settings.add_slack_hook_desc=Deponuza Slack entegre edin. settings.slack_token=Erişim Anahtarı settings.slack_domain=Alan Adı settings.slack_channel=Kanal -settings.add_discord_hook_desc=Deponuza Discord entegre edin. -settings.add_dingtalk_hook_desc=Deponuza Dingtalk entegre edin. -settings.add_telegram_hook_desc=Deponuza Telegram entegre edin. -settings.add_matrix_hook_desc=Deponuza Matrix entegre edin. -settings.add_msteams_hook_desc=Deponuza Microsoft Teams entegre edin. -settings.add_feishu_hook_desc=Deponuza Feishu entegre edin. -settings.add_Wechat_hook_desc=Deponuza Wechatwork entegre edin. settings.deploy_keys=Dağıtım Anahtarları settings.add_deploy_key=Dağıtım Anahtarı Ekle settings.deploy_key_desc=Dağıtım anahtarları, depoyu salt okunur çekme yetkisine sahip. diff --git a/options/locale/locale_uk-UA.ini b/options/locale/locale_uk-UA.ini index abac0195f130a..84e9fe17ad7d9 100644 --- a/options/locale/locale_uk-UA.ini +++ b/options/locale/locale_uk-UA.ini @@ -1849,17 +1849,9 @@ settings.update_hook_success=Веб-хук було оновлено. settings.delete_webhook=Видалити веб-хук settings.recent_deliveries=Недавні розсилки settings.hook_type=Тип хука -settings.add_slack_hook_desc=Інтеграція Slack у ваш репозиторії. settings.slack_token=Токен settings.slack_domain=Домен settings.slack_channel=Канал -settings.add_discord_hook_desc=Інтеграція Discord у ваш репозиторії. -settings.add_dingtalk_hook_desc=Інтеграція Dingtalk у ваш репозиторії. -settings.add_telegram_hook_desc=Інтегруйте Telegram у своє сховище. -settings.add_matrix_hook_desc=Інтегрувати Matrix з вашим репозиторієм. -settings.add_msteams_hook_desc=Інтегруйте Microsoft Teams у своє сховище. -settings.add_feishu_hook_desc=Інтеграція Feishu у ваш репозиторії. -settings.add_Wechat_hook_desc=Інтегрувати Wechatwork із вашим репозиторієм. settings.deploy_keys=Ключі для розгортування settings.add_deploy_key=Додати ключ для розгортування settings.deploy_key_desc=Ключі розгортання доступні тільки для читання. Це не те ж саме що і SSH-ключі аккаунта. diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index d3259a03b3807..881a8dde1a1c9 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1936,18 +1936,23 @@ settings.update_hook_success=Web 钩子更新成功! settings.delete_webhook=删除 Web 钩子 settings.recent_deliveries=最近推送记录 settings.hook_type=钩子类型 -settings.add_slack_hook_desc=将 Slack 集成到您的仓库中。 settings.slack_token=令牌 settings.slack_domain=域名 settings.slack_channel=频道 -settings.add_discord_hook_desc=将 Discord 集成到您的仓库中。 -settings.add_dingtalk_hook_desc=将 Dingtalk 集成到您的仓库中。 -settings.add_telegram_hook_desc=将 Telegram 集成到您的仓库中。 -settings.add_matrix_hook_desc=将 Matrix 集成到您的仓库中。 -settings.add_msteams_hook_desc=将 Microsoft Teams 集成到您的仓库中。 -settings.add_feishu_hook_desc=将 Feishu 集成到您的仓库中。 -settings.add_Wechat_hook_desc=将 企业微信 集成到您的仓库中。 -settings.add_packagist_hook_desc=将 Packagist 集成到您的仓库中。 +settings.add_web_hook_desc=将 %s集成到您的代码库。 +settings.web_hook_name_gitea=Gitea +settings.web_hook_name_gogs=Gogs +settings.web_hook_name_slack=Slack +settings.web_hook_name_discord=Discord +settings.web_hook_name_dingtalk=钉钉 +settings.web_hook_name_telegram=Telegram +settings.web_hook_name_matrix=Matrix +settings.web_hook_name_msteams=Microsoft Teams +settings.web_hook_name_feishu_or_larksuite=飞书 / Lark Suite +settings.web_hook_name_feishu=飞书 +settings.web_hook_name_larksuite=Lark Suite +settings.web_hook_name_wechatwork=企业微信 +settings.web_hook_name_packagist=Packagist settings.packagist_username=Packagist 用户名 settings.packagist_api_token=API 令牌 settings.packagist_package_url=Packagist 软件包 URL diff --git a/options/locale/locale_zh-TW.ini b/options/locale/locale_zh-TW.ini index 1500f21495909..4e114d946611e 100644 --- a/options/locale/locale_zh-TW.ini +++ b/options/locale/locale_zh-TW.ini @@ -1920,17 +1920,9 @@ settings.update_hook_success=Webhook 更新成功! settings.delete_webhook=移除 Webhook settings.recent_deliveries=最近傳送記錄 settings.hook_type=Hook 類型 -settings.add_slack_hook_desc=將 Slack 整合到您的儲存庫。 settings.slack_token=Token settings.slack_domain=域名 settings.slack_channel=頻道 -settings.add_discord_hook_desc=將 Discord 整合到您的儲存庫。 -settings.add_dingtalk_hook_desc=將 Dingtalk 整合到您的儲存庫。 -settings.add_telegram_hook_desc=將 Telegram 整合到您的儲存庫。 -settings.add_matrix_hook_desc=將 Matrix 整合到您的儲存庫。 -settings.add_msteams_hook_desc=將 Microsoft Teams 整合到您的儲存庫。 -settings.add_feishu_hook_desc=將 Feishu 整合到您的儲存庫。 -settings.add_Wechat_hook_desc=將 Wechatwork 整合到您的儲存庫。 settings.deploy_keys=部署金鑰 settings.add_deploy_key=新增部署金鑰 settings.deploy_key_desc=部署金鑰具有唯讀權限,可拉取此儲存庫。 From 49dd9067535538771ef13623ed1dd9698a4a2151 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Wed, 26 Jan 2022 12:10:10 +0800 Subject: [PATCH 6/6] Use base32 for 2FA scratch token (#18384) * Use base32 for 2FA scratch token * rename Secure* to Crypto*, add comments --- models/auth/twofactor.go | 8 ++++++-- models/migrations/v71.go | 2 +- models/migrations/v85.go | 2 +- models/token.go | 2 +- models/user/user.go | 2 +- modules/generate/generate.go | 2 +- modules/secret/secret.go | 2 +- modules/util/util.go | 36 ++++++++++++++++++------------------ modules/util/util_test.go | 18 +++++++++--------- routers/web/auth/openid.go | 2 +- routers/web/repo/setting.go | 2 +- 11 files changed, 41 insertions(+), 37 deletions(-) diff --git a/models/auth/twofactor.go b/models/auth/twofactor.go index 883e6ce01c096..c5bd972f91641 100644 --- a/models/auth/twofactor.go +++ b/models/auth/twofactor.go @@ -8,6 +8,7 @@ import ( "crypto/md5" "crypto/sha256" "crypto/subtle" + "encoding/base32" "encoding/base64" "fmt" @@ -58,11 +59,14 @@ func init() { // GenerateScratchToken recreates the scratch token the user is using. func (t *TwoFactor) GenerateScratchToken() (string, error) { - token, err := util.RandomString(8) + tokenBytes, err := util.CryptoRandomBytes(6) if err != nil { return "", err } - t.ScratchSalt, _ = util.RandomString(10) + // these chars are specially chosen, avoid ambiguous chars like `0`, `O`, `1`, `I`. + const base32Chars = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789" + token := base32.NewEncoding(base32Chars).WithPadding(base32.NoPadding).EncodeToString(tokenBytes) + t.ScratchSalt, _ = util.CryptoRandomString(10) t.ScratchHash = HashToken(token, t.ScratchSalt) return token, nil } diff --git a/models/migrations/v71.go b/models/migrations/v71.go index e4ed46a21a5b1..163ec3ee5f988 100644 --- a/models/migrations/v71.go +++ b/models/migrations/v71.go @@ -53,7 +53,7 @@ func addScratchHash(x *xorm.Engine) error { for _, tfa := range tfas { // generate salt - salt, err := util.RandomString(10) + salt, err := util.CryptoRandomString(10) if err != nil { return err } diff --git a/models/migrations/v85.go b/models/migrations/v85.go index bdbcebeb00f24..9611d6e72ac28 100644 --- a/models/migrations/v85.go +++ b/models/migrations/v85.go @@ -65,7 +65,7 @@ func hashAppToken(x *xorm.Engine) error { for _, token := range tokens { // generate salt - salt, err := util.RandomString(10) + salt, err := util.CryptoRandomString(10) if err != nil { return err } diff --git a/models/token.go b/models/token.go index 44428a0809273..b89514309c492 100644 --- a/models/token.go +++ b/models/token.go @@ -62,7 +62,7 @@ func init() { // NewAccessToken creates new access token. func NewAccessToken(t *AccessToken) error { - salt, err := util.RandomString(10) + salt, err := util.CryptoRandomString(10) if err != nil { return err } diff --git a/models/user/user.go b/models/user/user.go index 57a7fcadfa96f..38352fe5e24c3 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -533,7 +533,7 @@ const SaltByteLength = 16 // GetUserSalt returns a random user salt token. func GetUserSalt() (string, error) { - rBytes, err := util.RandomBytes(SaltByteLength) + rBytes, err := util.CryptoRandomBytes(SaltByteLength) if err != nil { return "", err } diff --git a/modules/generate/generate.go b/modules/generate/generate.go index ae9aeee18b674..326fe8036b445 100644 --- a/modules/generate/generate.go +++ b/modules/generate/generate.go @@ -60,7 +60,7 @@ func NewJwtSecretBase64() (string, error) { // NewSecretKey generate a new value intended to be used by SECRET_KEY. func NewSecretKey() (string, error) { - secretKey, err := util.RandomString(64) + secretKey, err := util.CryptoRandomString(64) if err != nil { return "", err } diff --git a/modules/secret/secret.go b/modules/secret/secret.go index 6a5024b7298d2..6b410f238197b 100644 --- a/modules/secret/secret.go +++ b/modules/secret/secret.go @@ -24,7 +24,7 @@ func New() (string, error) { // NewWithLength creates a new secret for a given length func NewWithLength(length int64) (string, error) { - return util.RandomString(length) + return util.CryptoRandomString(length) } // AesEncrypt encrypts text and given key with AES. diff --git a/modules/util/util.go b/modules/util/util.go index c2117a6525b34..90d0eca15c1e8 100644 --- a/modules/util/util.go +++ b/modules/util/util.go @@ -137,8 +137,8 @@ func MergeInto(dict map[string]interface{}, values ...interface{}) (map[string]i return dict, nil } -// RandomInt returns a random integer between 0 and limit, inclusive -func RandomInt(limit int64) (int64, error) { +// CryptoRandomInt returns a crypto random integer between 0 and limit, inclusive +func CryptoRandomInt(limit int64) (int64, error) { rInt, err := rand.Int(rand.Reader, big.NewInt(limit)) if err != nil { return 0, err @@ -146,27 +146,27 @@ func RandomInt(limit int64) (int64, error) { return rInt.Int64(), nil } -const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" +const alphanumericalChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" -// RandomString generates a random alphanumerical string -func RandomString(length int64) (string, error) { - bytes := make([]byte, length) - limit := int64(len(letters)) - for i := range bytes { - num, err := RandomInt(limit) +// CryptoRandomString generates a crypto random alphanumerical string, each byte is generated by [0,61] range +func CryptoRandomString(length int64) (string, error) { + buf := make([]byte, length) + limit := int64(len(alphanumericalChars)) + for i := range buf { + num, err := CryptoRandomInt(limit) if err != nil { return "", err } - bytes[i] = letters[num] + buf[i] = alphanumericalChars[num] } - return string(bytes), nil + return string(buf), nil } -// RandomBytes generates `length` bytes -// This differs from RandomString, as RandomString is limits each byte to have -// a maximum value of 63 instead of 255(max byte size) -func RandomBytes(length int64) ([]byte, error) { - bytes := make([]byte, length) - _, err := rand.Read(bytes) - return bytes, err +// CryptoRandomBytes generates `length` crypto bytes +// This differs from CryptoRandomString, as each byte in CryptoRandomString is generated by [0,61] range +// This function generates totally random bytes, each byte is generated by [0,255] range +func CryptoRandomBytes(length int64) ([]byte, error) { + buf := make([]byte, length) + _, err := rand.Read(buf) + return buf, err } diff --git a/modules/util/util_test.go b/modules/util/util_test.go index e2e26b26274c4..b32cec23d9bcc 100644 --- a/modules/util/util_test.go +++ b/modules/util/util_test.go @@ -120,20 +120,20 @@ func Test_NormalizeEOL(t *testing.T) { } func Test_RandomInt(t *testing.T) { - int, err := RandomInt(255) + int, err := CryptoRandomInt(255) assert.True(t, int >= 0) assert.True(t, int <= 255) assert.NoError(t, err) } func Test_RandomString(t *testing.T) { - str1, err := RandomString(32) + str1, err := CryptoRandomString(32) assert.NoError(t, err) matches, err := regexp.MatchString(`^[a-zA-Z0-9]{32}$`, str1) assert.NoError(t, err) assert.True(t, matches) - str2, err := RandomString(32) + str2, err := CryptoRandomString(32) assert.NoError(t, err) matches, err = regexp.MatchString(`^[a-zA-Z0-9]{32}$`, str1) assert.NoError(t, err) @@ -141,13 +141,13 @@ func Test_RandomString(t *testing.T) { assert.NotEqual(t, str1, str2) - str3, err := RandomString(256) + str3, err := CryptoRandomString(256) assert.NoError(t, err) matches, err = regexp.MatchString(`^[a-zA-Z0-9]{256}$`, str3) assert.NoError(t, err) assert.True(t, matches) - str4, err := RandomString(256) + str4, err := CryptoRandomString(256) assert.NoError(t, err) matches, err = regexp.MatchString(`^[a-zA-Z0-9]{256}$`, str4) assert.NoError(t, err) @@ -157,18 +157,18 @@ func Test_RandomString(t *testing.T) { } func Test_RandomBytes(t *testing.T) { - bytes1, err := RandomBytes(32) + bytes1, err := CryptoRandomBytes(32) assert.NoError(t, err) - bytes2, err := RandomBytes(32) + bytes2, err := CryptoRandomBytes(32) assert.NoError(t, err) assert.NotEqual(t, bytes1, bytes2) - bytes3, err := RandomBytes(256) + bytes3, err := CryptoRandomBytes(256) assert.NoError(t, err) - bytes4, err := RandomBytes(256) + bytes4, err := CryptoRandomBytes(256) assert.NoError(t, err) assert.NotEqual(t, bytes3, bytes4) diff --git a/routers/web/auth/openid.go b/routers/web/auth/openid.go index e0c60695463bf..f3189887a5308 100644 --- a/routers/web/auth/openid.go +++ b/routers/web/auth/openid.go @@ -416,7 +416,7 @@ func RegisterOpenIDPost(ctx *context.Context) { if length < 256 { length = 256 } - password, err := util.RandomString(int64(length)) + password, err := util.CryptoRandomString(int64(length)) if err != nil { ctx.RenderWithErr(err.Error(), tplSignUpOID, form) return diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go index d1c03b59a6b85..8e249af55d072 100644 --- a/routers/web/repo/setting.go +++ b/routers/web/repo/setting.go @@ -337,7 +337,7 @@ func SettingsPost(ctx *context.Context) { return } - remoteSuffix, err := util.RandomString(10) + remoteSuffix, err := util.CryptoRandomString(10) if err != nil { ctx.ServerError("RandomString", err) return