mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Fix upload limits for direct uploads (again) (#1479)
* Use constants to represent file size limits * Allow uploads of up to 500mb for self-hosted * Set nginx max body size to 505mb * Add reminder about updating nginx/proxy.conf
This commit is contained in:
@ -3,6 +3,12 @@
|
||||
public static class Constants
|
||||
{
|
||||
public const int BypassFiltersEventId = 12482444;
|
||||
|
||||
// File size limits - give 1 MB extra for cushion.
|
||||
// Note: if request size limits are changed, 'client_max_body_size'
|
||||
// in nginx/proxy.conf may also need to be updated accordingly.
|
||||
public const long FileSize101mb = 101L * 1024L * 1024L;
|
||||
public const long FileSize501mb = 501L * 1024L * 1024L;
|
||||
}
|
||||
|
||||
public static class TokenPurposes
|
||||
|
@ -18,7 +18,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
public class CipherService : ICipherService
|
||||
{
|
||||
public const long MAX_FILE_SIZE = 500L * 1024L * 1024L; // 500MB
|
||||
public const long MAX_FILE_SIZE = Constants.FileSize501mb;
|
||||
public const string MAX_FILE_SIZE_READABLE = "500 MB";
|
||||
private readonly ICipherRepository _cipherRepository;
|
||||
private readonly IFolderRepository _folderRepository;
|
||||
|
@ -17,7 +17,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
public class SendService : ISendService
|
||||
{
|
||||
public const long MAX_FILE_SIZE = 500L * 1024L * 1024L; // 500MB
|
||||
public const long MAX_FILE_SIZE = Constants.FileSize501mb;
|
||||
public const string MAX_FILE_SIZE_READABLE = "500 MB";
|
||||
private readonly ISendRepository _sendRepository;
|
||||
private readonly IUserRepository _userRepository;
|
||||
|
Reference in New Issue
Block a user