Improve admin credentials error messages with setup instructions

This commit is contained in:
2025-10-11 21:22:38 +02:00
parent 62605b3689
commit a904a0d1a3
2 changed files with 21 additions and 3 deletions

View File

@@ -48,7 +48,13 @@ func DefaultConfig() *Config {
// validate checks if the configuration is valid
func (c *Config) validate() error {
if c.AdminEmail == "" || c.AdminPassword == "" {
return fmt.Errorf("LEMMA_ADMIN_EMAIL and LEMMA_ADMIN_PASSWORD must be set")
return fmt.Errorf(`admin credentials not configured
To get started, set these environment variables:
export LEMMA_ADMIN_EMAIL="admin@example.com"
export LEMMA_ADMIN_PASSWORD="your-secure-password"
Then start the server again.`)
}
// Validate encryption key if provided (if not provided, it will be auto-generated)