mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-14 18:24:14 +01:00
02ba08ca84
templates/swagger/v1_json.tmpl updated with `make generate-swagger` (cherry picked from commit88899c492e
) (cherry picked from commit7171bd9617
) (cherry picked from commit1a742446c1
) (cherry picked from commitd7c189d7b2
) Conflicts: routers/web/web.go (cherry picked from commitcbdea868e4
) (cherry picked from commit6cd150483b
) (cherry picked from commit47246da8d3
) (cherry picked from commitf2aa0e6b76
) (cherry picked from commit5a4fc69a16
) (cherry picked from commit48e444ca09
) (cherry picked from commit888e537811
) (cherry picked from commit5121f493c9
) (cherry picked from commit9394e55fdf
) (cherry picked from commit3a2ce51768
) (cherry picked from commit719ead3a65
) (cherry picked from commit83e6f82e2a
) (cherry picked from commit494a429b21
) (cherry picked from commitd30c90c0ab
) (cherry picked from commit3c83b325c4
) (cherry picked from commit470bffae63
) (cherry picked from commit1d65921719
) (cherry picked from commitc101c2e0b9
)
50 lines
1.4 KiB
Go
50 lines
1.4 KiB
Go
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package setting
|
|
|
|
import (
|
|
"net/url"
|
|
|
|
"code.gitea.io/gitea/modules/log"
|
|
)
|
|
|
|
// Webhook settings
|
|
var Webhook = struct {
|
|
QueueLength int
|
|
DeliverTimeout int
|
|
SkipTLSVerify bool
|
|
AllowedHostList string
|
|
Types []string
|
|
PagingNum int
|
|
ProxyURL string
|
|
ProxyURLFixed *url.URL
|
|
ProxyHosts []string
|
|
}{
|
|
QueueLength: 1000,
|
|
DeliverTimeout: 5,
|
|
SkipTLSVerify: false,
|
|
PagingNum: 10,
|
|
ProxyURL: "",
|
|
ProxyHosts: []string{},
|
|
}
|
|
|
|
func loadWebhookFrom(rootCfg ConfigProvider) {
|
|
sec := rootCfg.Section("webhook")
|
|
Webhook.QueueLength = sec.Key("QUEUE_LENGTH").MustInt(1000)
|
|
Webhook.DeliverTimeout = sec.Key("DELIVER_TIMEOUT").MustInt(5)
|
|
Webhook.SkipTLSVerify = sec.Key("SKIP_TLS_VERIFY").MustBool()
|
|
Webhook.AllowedHostList = sec.Key("ALLOWED_HOST_LIST").MustString("")
|
|
Webhook.Types = []string{"forgejo", "gitea", "gogs", "slack", "discord", "dingtalk", "telegram", "msteams", "feishu", "matrix", "wechatwork", "packagist"}
|
|
Webhook.PagingNum = sec.Key("PAGING_NUM").MustInt(10)
|
|
Webhook.ProxyURL = sec.Key("PROXY_URL").MustString("")
|
|
if Webhook.ProxyURL != "" {
|
|
var err error
|
|
Webhook.ProxyURLFixed, err = url.Parse(Webhook.ProxyURL)
|
|
if err != nil {
|
|
log.Error("Webhook PROXY_URL is not valid")
|
|
Webhook.ProxyURL = ""
|
|
}
|
|
}
|
|
Webhook.ProxyHosts = sec.Key("PROXY_HOSTS").Strings(",")
|
|
}
|