@ -188,12 +188,12 @@ var (
}
}
// Picture settings
// Picture settings
AvatarUploadPath string
AvatarUploadPath string
RepositoryAvatarUploadPath string
RepositoryAvatarUploadPath string
GravatarSource string
GravatarSource string
DisableGravatar bool
DisableGravatar bool
EnableFederatedAvatar bool
EnableFederatedAvatar bool
LibravatarService * libravatar . Libravatar
LibravatarService * libravatar . Libravatar
// Log settings
// Log settings
LogRootPath string
LogRootPath string
@ -294,6 +294,14 @@ var (
} ` ini:"ui.user" `
} ` ini:"ui.user" `
}
}
// Prometheus settings
Prometheus struct {
Enabled bool
EnableBasicAuth bool
BasicAuthUsername string
BasicAuthPassword string
}
// I18n settings
// I18n settings
Langs [ ] string
Langs [ ] string
Names [ ] string
Names [ ] string
@ -652,27 +660,29 @@ func NewContext() {
}
}
if err = Cfg . Section ( "http" ) . MapTo ( & HTTP ) ; err != nil {
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 {
} 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 {
} 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 {
} 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 {
} 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 {
} 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 {
} 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 {
} 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 {
} 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 {
} 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 {
} 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 {
if Mirror . DefaultInterval <= 0 {