feat(storage): STORAGE_FILEPATH option (#2416)

- `STORAGE_FILEPATH=` disables storing to and reading from a local servers.json file
- `STORAGE_FILEPATH` defaults to `/gluetun/servers.json`
- Fix #2074
This commit is contained in:
Jean-François Roy
2024-08-18 17:26:46 -07:00
committed by GitHub
parent 3bf937d705
commit 12c411e203
7 changed files with 82 additions and 14 deletions

View File

@@ -239,7 +239,7 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
// TODO run this in a loop or in openvpn to reload from file without restarting
storageLogger := logger.New(log.SetComponent("storage"))
storage, err := storage.New(storageLogger, constants.ServersData)
storage, err := storage.New(storageLogger, *allSettings.Storage.Filepath)
if err != nil {
return err
}