Generalize disk file creation logic

This commit is contained in:
2025-05-29 08:03:42 +02:00
parent 7451f1b7b4
commit 20de618568
6 changed files with 103 additions and 58 deletions

@ -1,3 +1,5 @@
use crate::utils::file_size_utils::FileSize;
/// Name of the cookie that contains session information
pub const SESSION_COOKIE_NAME: &str = "X-auth-token";
@ -47,10 +49,10 @@ pub const DISK_NAME_MIN_LEN: usize = 2;
pub const DISK_NAME_MAX_LEN: usize = 10;
/// Disk size min (B)
pub const DISK_SIZE_MIN: usize = 100 * 1000 * 1000;
pub const DISK_SIZE_MIN: FileSize = FileSize::from_mb(50);
/// Disk size max (B)
pub const DISK_SIZE_MAX: usize = 1000 * 1000 * 1000 * 1000 * 2;
pub const DISK_SIZE_MAX: FileSize = FileSize::from_gb(20000);
/// Net nat entry comment max size
pub const NET_NAT_COMMENT_MAX_SIZE: usize = 250;