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

30
modules/setting/bot.go Normal file
View File

@ -0,0 +1,30 @@
// Copyright 2022 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 setting
import (
"code.gitea.io/gitea/modules/log"
)
// Bots settings
var (
Bots = struct {
Storage
Enabled bool
DefaultBotsURL string
}{
Enabled: false,
DefaultBotsURL: "https://gitea.com",
}
)
func newBuilds() {
sec := Cfg.Section("bots")
if err := sec.MapTo(&Bots); err != nil {
log.Fatal("Failed to map Builds settings: %v", err)
}
Bots.Storage = getStorage("bots_log", "", nil)
}