2015-12-21 09:58:09 +01:00
|
|
|
using System.Collections.Generic;
|
2016-01-26 05:54:53 +01:00
|
|
|
using System.IO;
|
2015-12-21 09:58:09 +01:00
|
|
|
|
|
|
|
namespace Teknik.Configuration
|
|
|
|
{
|
|
|
|
public class UploadConfig
|
|
|
|
{
|
2016-01-29 00:24:12 +01:00
|
|
|
public bool UploadEnabled { get; set; }
|
|
|
|
public bool DownloadEnabled { get; set; }
|
2015-12-21 09:58:09 +01:00
|
|
|
// Max upload size in bytes
|
2016-10-29 01:35:08 +02:00
|
|
|
public long MaxUploadSize { get; set; }
|
2017-02-20 02:50:05 +01:00
|
|
|
// Max Upload Size for basic users
|
|
|
|
public long MaxUploadSizeBasic { get; set; }
|
|
|
|
// Max Upload Size for premium users
|
|
|
|
public long MaxUploadSizePremium { get; set; }
|
2018-02-04 01:40:24 +01:00
|
|
|
// Gets the maximum download size before they are forced to the download page
|
|
|
|
public long MaxDownloadSize { get; set; }
|
2020-01-21 09:07:40 +01:00
|
|
|
// Maximum total size for basic users
|
|
|
|
public long MaxTotalSizeBasic { get; set; }
|
|
|
|
// Maximum total size for basic users
|
|
|
|
public long MaxTotalSizePremium { get; set; }
|
2016-01-18 07:05:20 +01:00
|
|
|
public int UrlLength { get; set; }
|
2016-01-21 07:58:45 +01:00
|
|
|
public int DeleteKeyLength { get; set; }
|
|
|
|
public int KeySize { get; set; }
|
2016-01-21 19:52:04 +01:00
|
|
|
public int BlockSize { get; set; }
|
2016-01-18 07:05:20 +01:00
|
|
|
public bool IncludeExtension { get; set; }
|
2016-01-20 01:34:40 +01:00
|
|
|
// The size of the chunk that the file will be encrypted/decrypted in (bytes)
|
|
|
|
public int ChunkSize { get; set; }
|
2016-05-09 04:04:20 +02:00
|
|
|
// Virus Scanning Settings
|
2020-07-17 09:48:24 +02:00
|
|
|
public ClamConfig ClamConfig { get; set; }
|
|
|
|
// Hash Scanning Settings
|
|
|
|
public HashScanConfig HashScanConfig { get; set; }
|
2021-08-07 07:26:09 +02:00
|
|
|
// Storage settings
|
|
|
|
public StorageConfig StorageConfig { get; set; }
|
2017-12-20 20:08:34 +01:00
|
|
|
// Content Type Restrictions
|
|
|
|
public List<string> RestrictedContentTypes { get; set; }
|
2018-02-15 04:54:06 +01:00
|
|
|
public List<string> RestrictedExtensions { get; set; }
|
2015-12-21 09:58:09 +01:00
|
|
|
|
|
|
|
public UploadConfig()
|
|
|
|
{
|
|
|
|
SetDefaults();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void SetDefaults()
|
|
|
|
{
|
2016-01-29 00:24:12 +01:00
|
|
|
UploadEnabled = true;
|
|
|
|
DownloadEnabled = true;
|
2015-12-21 09:58:09 +01:00
|
|
|
MaxUploadSize = 100000000;
|
2017-02-20 02:50:05 +01:00
|
|
|
MaxUploadSizeBasic = 100000000;
|
|
|
|
MaxUploadSizePremium = 100000000;
|
2018-02-04 01:40:24 +01:00
|
|
|
MaxDownloadSize = 100000000;
|
2020-01-21 09:07:40 +01:00
|
|
|
MaxTotalSizeBasic = 1000000000;
|
|
|
|
MaxTotalSizePremium = 5000000000;
|
2016-01-23 01:44:07 +01:00
|
|
|
UrlLength = 5;
|
2016-01-21 07:58:45 +01:00
|
|
|
DeleteKeyLength = 24;
|
2016-01-21 19:52:04 +01:00
|
|
|
KeySize = 256;
|
|
|
|
BlockSize = 128;
|
2016-01-18 07:05:20 +01:00
|
|
|
IncludeExtension = true;
|
2016-01-20 01:34:40 +01:00
|
|
|
ChunkSize = 1024;
|
2020-07-17 09:48:24 +02:00
|
|
|
ClamConfig = new ClamConfig();
|
|
|
|
HashScanConfig = new HashScanConfig();
|
2021-08-07 07:26:09 +02:00
|
|
|
StorageConfig = new StorageConfig("uploads");
|
2017-12-20 20:08:34 +01:00
|
|
|
RestrictedContentTypes = new List<string>();
|
2018-02-15 04:54:06 +01:00
|
|
|
RestrictedExtensions = new List<string>();
|
2015-12-21 09:58:09 +01:00
|
|
|
}
|
|
|
|
}
|
2017-12-20 20:08:34 +01:00
|
|
|
}
|