add memory data provider and use it for portable mode

This commit is contained in:
Nicola Murino
2019-10-25 18:37:12 +02:00
parent a4cddf4f7f
commit 8cd0aec417
7 changed files with 317 additions and 11 deletions

View File

@@ -143,11 +143,9 @@ func (s *Service) StartPortableMode(sftpdPort int, enableSCP bool) error {
}
tempDir := os.TempDir()
instanceID := xid.New().String()
databasePath := filepath.Join(tempDir, instanceID+".db")
s.LogFilePath = filepath.Join(tempDir, instanceID+".log")
dataProviderConf := config.GetProviderConf()
dataProviderConf.Driver = dataprovider.BoltDataProviderName
dataProviderConf.Name = databasePath
dataProviderConf.Driver = dataprovider.MemoryDataProviderName
config.SetProviderConf(dataProviderConf)
httpdConf := config.GetHTTPDConfig()
httpdConf.BindPort = 0