diff --git a/config.go b/config.go index c149084..2426091 100644 --- a/config.go +++ b/config.go @@ -156,6 +156,8 @@ func (app *appContext) loadConfig() error { app.MustSetValue("ui", "port", "8056") app.MustSetValue("advanced", "tls_port", "8057") + app.MustSetValue("advanced", "value_log_size", "1024") + pwrMethods := []string{"allow_pwr_username", "allow_pwr_email", "allow_pwr_contact_method"} allDisabled := true for _, v := range pwrMethods { diff --git a/config/config-base.yaml b/config/config-base.yaml index 49e4392..5fff581 100644 --- a/config/config-base.yaml +++ b/config/config-base.yaml @@ -330,6 +330,19 @@ sections: requires_restart: true type: password description: Leave blank for no Authentication. + - setting: value_log_note + name: 'Value Log:' + type: note + depends_true: enabled + required: false + description: The Value Log (vlog) file in your config folder is used to ensure data integrity in the database. It can get large, so you can adjust the maximum size. After quitting jfa-go, the file can be deleted safely without data loss. + style: info + - setting: value_log_size + name: Database max vlog size (MiB) + requires_restart: true + type: number + value: 1024 + description: Max size for the database's value log. Lower values may reduce performance. - setting: debug_log_emails name: 'Debug Storage Logging: Emails' requires_restart: true diff --git a/storage.go b/storage.go index 0a4e5cb..f9e503d 100644 --- a/storage.go +++ b/storage.go @@ -175,6 +175,7 @@ func generateLogActions(c *ini.File) map[string]DebugLogAction { func (app *appContext) ConnectDB() { opts := badgerhold.DefaultOptions + opts.Options.ValueLogFileSize = app.config.Section("advanced").Key("value_log_size").MustInt64(1024) * 1024 opts.Dir = app.storage.db_path opts.ValueDir = app.storage.db_path db, err := badgerhold.Open(opts)