1
0
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:
Thomas Rittson
2021-08-04 09:00:30 +10:00
committed by GitHub
parent a31c231749
commit b1ed6d2c21
6 changed files with 21 additions and 13 deletions

View File

@ -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

View File

@ -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;

View File

@ -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;