feat(config/m7-363): branding config field + defaults
This commit is contained in:
@@ -19,6 +19,7 @@ type Config struct {
|
||||
Subsonic SubsonicConfig `yaml:"subsonic"`
|
||||
Events EventsConfig `yaml:"events"`
|
||||
Recommendation RecommendationConfig `yaml:"recommendation"`
|
||||
Branding BrandingConfig `yaml:"branding"`
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
@@ -37,6 +38,14 @@ type StorageConfig struct {
|
||||
DataDir string `yaml:"data_dir"`
|
||||
}
|
||||
|
||||
// BrandingConfig drives per-instance UI labelling: the app name shown
|
||||
// in the header / tab title and the description used in OG share-preview
|
||||
// metadata. Both default to sensible values when unset.
|
||||
type BrandingConfig struct {
|
||||
AppName string `yaml:"app_name"`
|
||||
Description string `yaml:"description"`
|
||||
}
|
||||
|
||||
type DatabaseConfig struct {
|
||||
URL string `yaml:"url"`
|
||||
}
|
||||
@@ -98,6 +107,10 @@ func Default() Config {
|
||||
Storage: StorageConfig{DataDir: "./data"},
|
||||
Database: DatabaseConfig{URL: ""},
|
||||
Log: LogConfig{Level: "info", Format: "text"},
|
||||
Branding: BrandingConfig{
|
||||
AppName: "Minstrel",
|
||||
Description: "Self-hosted music server with Subsonic compatibility, smart shuffle, and Lidarr integration.",
|
||||
},
|
||||
Events: EventsConfig{
|
||||
SessionTimeoutMinutes: 30,
|
||||
SkipMaxCompletionRatio: 0.5,
|
||||
@@ -150,6 +163,12 @@ func applyEnv(cfg *Config) {
|
||||
if v, ok := os.LookupEnv("SMARTMUSIC_LOG_FORMAT"); ok {
|
||||
cfg.Log.Format = strings.ToLower(v)
|
||||
}
|
||||
if v, ok := os.LookupEnv("SMARTMUSIC_BRANDING_APP_NAME"); ok {
|
||||
cfg.Branding.AppName = v
|
||||
}
|
||||
if v, ok := os.LookupEnv("SMARTMUSIC_BRANDING_DESCRIPTION"); ok {
|
||||
cfg.Branding.Description = v
|
||||
}
|
||||
if v, ok := os.LookupEnv("SMARTMUSIC_AUTH_ADMIN_USERNAME"); ok {
|
||||
cfg.Auth.AdminBootstrap.Username = v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user