Add default bot url

This commit is contained in:
Lunny Xiao
2022-11-16 13:33:13 +08:00
committed by Jason Song
parent 1a55d39adc
commit fc2c70033a
4 changed files with 46 additions and 27 deletions

View File

@@ -8,21 +8,23 @@ import (
"code.gitea.io/gitea/modules/log"
)
// Builds settings
// Bots settings
var (
Builds = struct {
Bots = struct {
Storage
Enabled bool
Enabled bool
DefaultBotsURL string
}{
Enabled: true,
Enabled: false,
DefaultBotsURL: "https://gitea.com",
}
)
func newBuilds() {
sec := Cfg.Section("builds")
if err := sec.MapTo(&Builds); err != nil {
sec := Cfg.Section("bots")
if err := sec.MapTo(&Bots); err != nil {
log.Fatal("Failed to map Builds settings: %v", err)
}
Builds.Storage = getStorage("builds", "", nil)
Bots.Storage = getStorage("bots_log", "", nil)
}