Browse Source
			
			
			Merge branch 'BlackDex-fix-upload-limits-and-logging' into main
			
			
				pull/2489/head
			
			
		 
		
			
				
					
						
						Daniel García
					
					4 years ago
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: FC8A7D14C3CD543A
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
5 additions and 
4 deletions
			 
			
		 
		
			
				- 
					
					
					 
					src/main.rs
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -336,10 +336,11 @@ async fn launch_rocket(pool: db::DbPool, extra_debug: bool) -> Result<(), Error> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    let mut config = rocket::Config::from(rocket::Config::figment()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    config.temp_dir = canonicalize(CONFIG.tmp_folder()).unwrap().into(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    config.limits = Limits::new() //
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        .limit("json", 10.megabytes()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        .limit("data-form", 150.megabytes()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        .limit("file", 150.megabytes()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    config.cli_colors = false; // Make sure Rocket does not color any values for logging.
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    config.limits = Limits::new() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        .limit("json", 20.megabytes()) // 20MB should be enough for very large imports, something like 5000+ vault entries
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        .limit("data-form", 525.megabytes()) // This needs to match the maximum allowed file size for Send
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        .limit("file", 525.megabytes()); // This needs to match the maximum allowed file size for attachments
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // If adding more paths here, consider also adding them to
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // crate::utils::LOGGED_ROUTES to make sure they appear in the log
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |