mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Remove DB and Directory settings out of the BTCPayServerOptions (#2168)
This commit is contained in:
26
BTCPayServer/Configuration/DataDirectories.cs
Normal file
26
BTCPayServer/Configuration/DataDirectories.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace BTCPayServer.Configuration
|
||||
{
|
||||
public class DataDirectories
|
||||
{
|
||||
public DataDirectories(IConfiguration conf)
|
||||
{
|
||||
var networkType = DefaultConfiguration.GetNetworkType(conf);
|
||||
var defaultSettings = BTCPayDefaultSettings.GetDefaultSettings(networkType);
|
||||
DataDir = conf["datadir"] ?? defaultSettings.DefaultDataDirectory;
|
||||
PluginDir = conf["plugindir"] ?? defaultSettings.DefaultPluginDirectory;
|
||||
StorageDir = Path.Combine(DataDir, Storage.Services.Providers.FileSystemStorage.FileSystemFileProviderService.LocalStorageDirectoryName);
|
||||
TempStorageDir = Path.Combine(StorageDir, "tmp");
|
||||
}
|
||||
public string DataDir { get; }
|
||||
public string PluginDir { get; }
|
||||
public string TempStorageDir { get; }
|
||||
public string StorageDir { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user