@ -294,6 +294,14 @@ var (
} ` ini:"ui.user" `
}
// Prometheus settings
Prometheus struct {
Enabled bool
EnableBasicAuth bool
BasicAuthUsername string
BasicAuthPassword string
}
// I18n settings
Langs [ ] string
Names [ ] string
@ -652,27 +660,29 @@ func NewContext() {
}
if err = Cfg . Section ( "http" ) . MapTo ( & HTTP ) ; err != nil {
log . Fatal ( 2 , "Fail to map HTTP settings: %v" , err )
log . Fatal ( 2 , "Failed to map HTTP settings: %v" , err )
} else if err = Cfg . Section ( "webhook" ) . MapTo ( & Webhook ) ; err != nil {
log . Fatal ( 2 , "Fail to map Webhook settings: %v" , err )
log . Fatal ( 2 , "Failed to map Webhook settings: %v" , err )
} else if err = Cfg . Section ( "release.attachment" ) . MapTo ( & Release . Attachment ) ; err != nil {
log . Fatal ( 2 , "Fail to map Release.Attachment settings: %v" , err )
log . Fatal ( 2 , "Failed to map Release.Attachment settings: %v" , err )
} else if err = Cfg . Section ( "markdown" ) . MapTo ( & Markdown ) ; err != nil {
log . Fatal ( 2 , "Fail to map Markdown settings: %v" , err )
log . Fatal ( 2 , "Failed to map Markdown settings: %v" , err )
} else if err = Cfg . Section ( "smartypants" ) . MapTo ( & Smartypants ) ; err != nil {
log . Fatal ( 2 , "Fail to map Smartypants settings: %v" , err )
log . Fatal ( 2 , "Failed to map Smartypants settings: %v" , err )
} else if err = Cfg . Section ( "admin" ) . MapTo ( & Admin ) ; err != nil {
log . Fatal ( 2 , "Fail to map Admin settings: %v" , err )
log . Fatal ( 2 , "Failed to map Admin settings: %v" , err )
} else if err = Cfg . Section ( "cron" ) . MapTo ( & Cron ) ; err != nil {
log . Fatal ( 2 , "Fail to map Cron settings: %v" , err )
log . Fatal ( 2 , "Failed to map Cron settings: %v" , err )
} else if err = Cfg . Section ( "git" ) . MapTo ( & Git ) ; err != nil {
log . Fatal ( 2 , "Fail to map Git settings: %v" , err )
log . Fatal ( 2 , "Failed to map Git settings: %v" , err )
} else if err = Cfg . Section ( "mirror" ) . MapTo ( & Mirror ) ; err != nil {
log . Fatal ( 2 , "Fail to map Mirror settings: %v" , err )
log . Fatal ( 2 , "Failed to map Mirror settings: %v" , err )
} else if err = Cfg . Section ( "api" ) . MapTo ( & API ) ; err != nil {
log . Fatal ( 2 , "Fail to map API settings: %v" , err )
log . Fatal ( 2 , "Failed to map API settings: %v" , err )
} else if err = Cfg . Section ( "ui" ) . MapTo ( & UI ) ; err != nil {
log . Fatal ( 2 , "Fail to map UI settings: %v" , err )
log . Fatal ( 2 , "Failed to map UI settings: %v" , err )
} else if err = Cfg . Section ( "prometheus" ) . MapTo ( & Prometheus ) ; err != nil {
log . Fatal ( 2 , "Failed to map Prometheus settings: %v" , err )
}
if Mirror . DefaultInterval <= 0 {