mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
Uncomment google/amazon code, just disable it in the service registration
This commit is contained in:
parent
b184360eb7
commit
5100c36c06
@ -57,23 +57,23 @@ namespace BTCPayServer.Tests
|
|||||||
Assert.Equal(nameof(ServerController.StorageProvider), localResult.ActionName);
|
Assert.Equal(nameof(ServerController.StorageProvider), localResult.ActionName);
|
||||||
Assert.Equal(StorageProvider.FileSystem.ToString(), localResult.RouteValues["provider"]);
|
Assert.Equal(StorageProvider.FileSystem.ToString(), localResult.RouteValues["provider"]);
|
||||||
|
|
||||||
//
|
|
||||||
// var AmazonS3result = Assert
|
var AmazonS3result = Assert
|
||||||
// .IsType<RedirectToActionResult>(controller.Storage(new StorageSettings()
|
.IsType<RedirectToActionResult>(controller.Storage(new StorageSettings()
|
||||||
// {
|
{
|
||||||
// Provider = StorageProvider.AmazonS3
|
Provider = StorageProvider.AmazonS3
|
||||||
// }));
|
}));
|
||||||
// Assert.Equal(nameof(ServerController.StorageProvider), AmazonS3result.ActionName);
|
Assert.Equal(nameof(ServerController.StorageProvider), AmazonS3result.ActionName);
|
||||||
// Assert.Equal(StorageProvider.AmazonS3.ToString(), AmazonS3result.RouteValues["provider"]);
|
Assert.Equal(StorageProvider.AmazonS3.ToString(), AmazonS3result.RouteValues["provider"]);
|
||||||
//
|
|
||||||
// var GoogleResult = Assert
|
var GoogleResult = Assert
|
||||||
// .IsType<RedirectToActionResult>(controller.Storage(new StorageSettings()
|
.IsType<RedirectToActionResult>(controller.Storage(new StorageSettings()
|
||||||
// {
|
{
|
||||||
// Provider = StorageProvider.GoogleCloudStorage
|
Provider = StorageProvider.GoogleCloudStorage
|
||||||
// }));
|
}));
|
||||||
// Assert.Equal(nameof(ServerController.StorageProvider), GoogleResult.ActionName);
|
Assert.Equal(nameof(ServerController.StorageProvider), GoogleResult.ActionName);
|
||||||
// Assert.Equal(StorageProvider.GoogleCloudStorage.ToString(), GoogleResult.RouteValues["provider"]);
|
Assert.Equal(StorageProvider.GoogleCloudStorage.ToString(), GoogleResult.RouteValues["provider"]);
|
||||||
//
|
|
||||||
|
|
||||||
var AzureResult = Assert
|
var AzureResult = Assert
|
||||||
.IsType<RedirectToActionResult>(controller.Storage(new StorageSettings()
|
.IsType<RedirectToActionResult>(controller.Storage(new StorageSettings()
|
||||||
|
@ -224,13 +224,13 @@ namespace BTCPayServer.Controllers
|
|||||||
return View(nameof(EditAzureBlobStorageStorageProvider),
|
return View(nameof(EditAzureBlobStorageStorageProvider),
|
||||||
fileProviderService.GetProviderConfiguration(data));
|
fileProviderService.GetProviderConfiguration(data));
|
||||||
|
|
||||||
// case AmazonS3FileProviderService fileProviderService:
|
case AmazonS3FileProviderService fileProviderService:
|
||||||
// return View(nameof(EditAmazonS3StorageProvider),
|
return View(nameof(EditAmazonS3StorageProvider),
|
||||||
// fileProviderService.GetProviderConfiguration(data));
|
fileProviderService.GetProviderConfiguration(data));
|
||||||
//
|
|
||||||
// case GoogleCloudStorageFileProviderService fileProviderService:
|
case GoogleCloudStorageFileProviderService fileProviderService:
|
||||||
// return View(nameof(EditGoogleCloudStorageStorageProvider),
|
return View(nameof(EditGoogleCloudStorageStorageProvider),
|
||||||
// fileProviderService.GetProviderConfiguration(data));
|
fileProviderService.GetProviderConfiguration(data));
|
||||||
|
|
||||||
case FileSystemFileProviderService fileProviderService:
|
case FileSystemFileProviderService fileProviderService:
|
||||||
return View(nameof(EditFileSystemStorageProvider),
|
return View(nameof(EditFileSystemStorageProvider),
|
||||||
@ -247,18 +247,18 @@ namespace BTCPayServer.Controllers
|
|||||||
return await SaveStorageProvider(viewModel, BTCPayServer.Storage.Models.StorageProvider.AzureBlobStorage);
|
return await SaveStorageProvider(viewModel, BTCPayServer.Storage.Models.StorageProvider.AzureBlobStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [HttpPost("server/storage/AmazonS3")]
|
[HttpPost("server/storage/AmazonS3")]
|
||||||
// public async Task<IActionResult> EditAmazonS3StorageProvider(AmazonS3StorageConfiguration viewModel)
|
public async Task<IActionResult> EditAmazonS3StorageProvider(AmazonS3StorageConfiguration viewModel)
|
||||||
// {
|
{
|
||||||
// return await SaveStorageProvider(viewModel, BTCPayServer.Storage.Models.StorageProvider.AmazonS3);
|
return await SaveStorageProvider(viewModel, BTCPayServer.Storage.Models.StorageProvider.AmazonS3);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// [HttpPost("server/storage/GoogleCloudStorage")]
|
[HttpPost("server/storage/GoogleCloudStorage")]
|
||||||
// public async Task<IActionResult> EditGoogleCloudStorageStorageProvider(
|
public async Task<IActionResult> EditGoogleCloudStorageStorageProvider(
|
||||||
// GoogleCloudStorageConfiguration viewModel)
|
GoogleCloudStorageConfiguration viewModel)
|
||||||
// {
|
{
|
||||||
// return await SaveStorageProvider(viewModel, BTCPayServer.Storage.Models.StorageProvider.GoogleCloudStorage);
|
return await SaveStorageProvider(viewModel, BTCPayServer.Storage.Models.StorageProvider.GoogleCloudStorage);
|
||||||
// }
|
}
|
||||||
|
|
||||||
[HttpPost("server/storage/FileSystem")]
|
[HttpPost("server/storage/FileSystem")]
|
||||||
public async Task<IActionResult> EditFileSystemStorageProvider(FileSystemStorageConfiguration viewModel)
|
public async Task<IActionResult> EditFileSystemStorageProvider(FileSystemStorageConfiguration viewModel)
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
public enum StorageProvider
|
public enum StorageProvider
|
||||||
{
|
{
|
||||||
AzureBlobStorage=0,
|
AzureBlobStorage=0,
|
||||||
// AmazonS3 =1,
|
AmazonS3 =1,
|
||||||
// GoogleCloudStorage =2,
|
GoogleCloudStorage =2,
|
||||||
FileSystem =3
|
FileSystem =3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
//using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
//using BTCPayServer.Storage.Models;
|
using BTCPayServer.Storage.Models;
|
||||||
//using BTCPayServer.Storage.Services.Providers.AmazonS3Storage.Configuration;
|
using BTCPayServer.Storage.Services.Providers.AmazonS3Storage.Configuration;
|
||||||
//using TwentyTwenty.Storage;
|
using TwentyTwenty.Storage;
|
||||||
//using TwentyTwenty.Storage.Amazon;
|
using TwentyTwenty.Storage.Amazon;
|
||||||
//
|
|
||||||
//namespace BTCPayServer.Storage.Services.Providers.AmazonS3Storage
|
namespace BTCPayServer.Storage.Services.Providers.AmazonS3Storage
|
||||||
//{
|
{
|
||||||
// public class
|
public class
|
||||||
// AmazonS3FileProviderService : BaseTwentyTwentyStorageFileProviderServiceBase<AmazonS3StorageConfiguration>
|
AmazonS3FileProviderService : BaseTwentyTwentyStorageFileProviderServiceBase<AmazonS3StorageConfiguration>
|
||||||
// {
|
{
|
||||||
// public override StorageProvider StorageProvider()
|
public override StorageProvider StorageProvider()
|
||||||
// {
|
{
|
||||||
// return Storage.Models.StorageProvider.AmazonS3;
|
return Storage.Models.StorageProvider.AmazonS3;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public override AmazonS3StorageConfiguration GetProviderConfiguration(StorageSettings configuration)
|
public override AmazonS3StorageConfiguration GetProviderConfiguration(StorageSettings configuration)
|
||||||
// {
|
{
|
||||||
// return configuration.Configuration.ParseAmazonS3StorageConfiguration();
|
return configuration.Configuration.ParseAmazonS3StorageConfiguration();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// protected override Task<IStorageProvider> GetStorageProvider(AmazonS3StorageConfiguration configuration)
|
protected override Task<IStorageProvider> GetStorageProvider(AmazonS3StorageConfiguration configuration)
|
||||||
// {
|
{
|
||||||
// return Task.FromResult<IStorageProvider>(new AmazonStorageProvider(configuration));
|
return Task.FromResult<IStorageProvider>(new AmazonStorageProvider(configuration));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
//using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
//using BTCPayServer.Storage.Models;
|
using BTCPayServer.Storage.Models;
|
||||||
//using BTCPayServer.Storage.Services.Providers.GoogleCloudStorage.Configuration;
|
using BTCPayServer.Storage.Services.Providers.GoogleCloudStorage.Configuration;
|
||||||
//using Google.Apis.Auth.OAuth2;
|
using Google.Apis.Auth.OAuth2;
|
||||||
//using TwentyTwenty.Storage;
|
using TwentyTwenty.Storage;
|
||||||
//using TwentyTwenty.Storage.Google;
|
using TwentyTwenty.Storage.Google;
|
||||||
//
|
|
||||||
//namespace BTCPayServer.Storage.Services.Providers.GoogleCloudStorage
|
namespace BTCPayServer.Storage.Services.Providers.GoogleCloudStorage
|
||||||
//{
|
{
|
||||||
// public class
|
public class
|
||||||
// GoogleCloudStorageFileProviderService : BaseTwentyTwentyStorageFileProviderServiceBase<
|
GoogleCloudStorageFileProviderService : BaseTwentyTwentyStorageFileProviderServiceBase<
|
||||||
// GoogleCloudStorageConfiguration>
|
GoogleCloudStorageConfiguration>
|
||||||
// {
|
{
|
||||||
// public override StorageProvider StorageProvider()
|
public override StorageProvider StorageProvider()
|
||||||
// {
|
{
|
||||||
// return Storage.Models.StorageProvider.GoogleCloudStorage;
|
return Storage.Models.StorageProvider.GoogleCloudStorage;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public override GoogleCloudStorageConfiguration GetProviderConfiguration(StorageSettings configuration)
|
public override GoogleCloudStorageConfiguration GetProviderConfiguration(StorageSettings configuration)
|
||||||
// {
|
{
|
||||||
// return configuration.Configuration.ParseGoogleCloudStorageConfiguration();
|
return configuration.Configuration.ParseGoogleCloudStorageConfiguration();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// protected override Task<IStorageProvider> GetStorageProvider(
|
protected override Task<IStorageProvider> GetStorageProvider(
|
||||||
// GoogleCloudStorageConfiguration configuration)
|
GoogleCloudStorageConfiguration configuration)
|
||||||
// {
|
{
|
||||||
// return Task.FromResult<IStorageProvider>(new GoogleStorageProvider(GoogleCredential.FromJson(configuration.JsonCredentials), configuration));
|
return Task.FromResult<IStorageProvider>(new GoogleStorageProvider(GoogleCredential.FromJson(configuration.JsonCredentials), configuration));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user