aboutsummaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-03-08 03:06:23 +0530
committerBobby <[email protected]>2026-03-08 03:06:23 +0530
commitcaf265e7050edefa64ecf7e13828ec9636bce867 (patch)
tree6bb8554dbb34695a74c2dca556bf512998cf62ab /database
parentcca905d35412f1549400fc3d1aca6dc704d8cae6 (diff)
downloaddove-caf265e7050edefa64ecf7e13828ec9636bce867.tar.xz
dove-caf265e7050edefa64ecf7e13828ec9636bce867.zip
Refactor configuration handling and add mail management features
- Removed dependency on messages package in TOML loading and parsing. - Introduced new config constants and messages for better clarity and maintainability. - Implemented mail user and mailbox management with corresponding controllers and views. - Added new templates for mailboxes, mailbox creation, and user management. - Enhanced logging and error handling throughout the application. - Established a structured approach for applying default values in TOML configuration. - Created new utility functions for SMTP and email handling.
Diffstat (limited to 'database')
-rw-r--r--database/migration.go16
-rw-r--r--database/resolve.go (renamed from database/functions.go)4
2 files changed, 10 insertions, 10 deletions
diff --git a/database/migration.go b/database/migration.go
index e18f2d6..efd3aba 100644
--- a/database/migration.go
+++ b/database/migration.go
@@ -1,8 +1,8 @@
package database
import (
- "dove/models"
"dove/models/domain"
+ "dove/models/mail"
"dove/utils/logger"
)
@@ -10,15 +10,15 @@ func migrate() {
migrationError := DB.AutoMigrate(
&domain.TLD{},
&domain.Domain{},
- &models.User{},
- &models.Mailbox{},
- &models.Alias{},
- &models.Email{},
- &models.Tag{},
- &models.Attachment{},
+ &mail.User{},
+ &mail.Mailbox{},
+ &mail.Alias{},
+ &mail.Email{},
+ &mail.Tag{},
+ &mail.Attachment{},
)
if migrationError != nil {
logger.Fatalf(LogPrefix, MigrationFailed, migrationError)
}
-}
+} \ No newline at end of file
diff --git a/database/functions.go b/database/resolve.go
index 09d6ae4..db90dc5 100644
--- a/database/functions.go
+++ b/database/resolve.go
@@ -13,10 +13,10 @@ func resolveDatabasePath() string {
}
func resolveGORMLogLevel() logger.Interface {
- switch config.Server.Debug {
+ switch config.HTTP.Debug {
case true:
return logger.Default.LogMode(logger.Info)
default:
return logger.Default.LogMode(logger.Silent)
}
-}
+} \ No newline at end of file