mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 23:44:22 +00:00
Refactor encryption key handling: auto-generate if not provided, update README and tests
This commit is contained in:
@@ -51,9 +51,11 @@ func (c *Config) validate() error {
|
||||
return fmt.Errorf("LEMMA_ADMIN_EMAIL and LEMMA_ADMIN_PASSWORD must be set")
|
||||
}
|
||||
|
||||
// Validate encryption key
|
||||
if err := secrets.ValidateKey(c.EncryptionKey); err != nil {
|
||||
return fmt.Errorf("invalid LEMMA_ENCRYPTION_KEY: %w", err)
|
||||
// Validate encryption key if provided (if not provided, it will be auto-generated)
|
||||
if c.EncryptionKey != "" {
|
||||
if err := secrets.ValidateKey(c.EncryptionKey); err != nil {
|
||||
return fmt.Errorf("invalid LEMMA_ENCRYPTION_KEY: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user