1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-08-13 20:04:49 +02:00

Feature: Add configuration to disable SQLite WAL mode for NFS compatibility

This commit is contained in:
Ralph Slooten
2025-03-01 22:49:24 +13:00
parent 784e3de8a1
commit b827d75c3e
3 changed files with 14 additions and 2 deletions

View File

@@ -83,6 +83,7 @@ func init() {
initConfigFromEnv()
rootCmd.Flags().StringVarP(&config.Database, "database", "d", config.Database, "Database to store persistent data")
rootCmd.Flags().BoolVar(&config.DisableWAL, "disable-wal", config.DisableWAL, "Disable WAL for local database (allows NFS mounted DBs)")
rootCmd.Flags().IntVar(&config.Compression, "compression", config.Compression, "Compression level to store raw messages (0-3)")
rootCmd.Flags().StringVar(&config.Label, "label", config.Label, "Optional label identify this Mailpit instance")
rootCmd.Flags().StringVar(&config.TenantID, "tenant-id", config.TenantID, "Database tenant ID to isolate data")
@@ -183,6 +184,8 @@ func initConfigFromEnv() {
config.Database = os.Getenv("MP_DATABASE")
}
config.DisableWAL = getEnabledFromEnv("MP_DISABLE_WAL")
if len(os.Getenv("MP_COMPRESSION")) > 0 {
config.Compression, _ = strconv.Atoi(os.Getenv("MP_COMPRESSION"))
}