You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
841 B

  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package setting
  5. var (
  6. // Webhook settings
  7. Webhook = struct {
  8. QueueLength int
  9. DeliverTimeout int
  10. SkipTLSVerify bool
  11. Types []string
  12. PagingNum int
  13. }{
  14. QueueLength: 1000,
  15. DeliverTimeout: 5,
  16. SkipTLSVerify: false,
  17. PagingNum: 10,
  18. }
  19. )
  20. func newWebhookService() {
  21. sec := Cfg.Section("webhook")
  22. Webhook.QueueLength = sec.Key("QUEUE_LENGTH").MustInt(1000)
  23. Webhook.DeliverTimeout = sec.Key("DELIVER_TIMEOUT").MustInt(5)
  24. Webhook.SkipTLSVerify = sec.Key("SKIP_TLS_VERIFY").MustBool()
  25. Webhook.Types = []string{"gitea", "gogs", "slack", "discord", "dingtalk", "telegram", "msteams"}
  26. Webhook.PagingNum = sec.Key("PAGING_NUM").MustInt(10)
  27. }