Merge branch 'main' of github.com:hrfee/jfa-go

This commit is contained in:
Harvey Tindall
2025-05-13 15:11:00 +01:00
3 changed files with 16 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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)