mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	settings: S3 is enabled if LOCAL_UPLOADS_DIR is unset.
We should not key off of `S3_KEY`/`S3_SECRET_KEY`, since those are optional if the host is in EC2 and using instance profiles. Instead, check if `LOCAL_UPLOADS_DIR` is None1, which is the authoritative source for if the S3 backend is in use.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							a09dab5eaf
						
					
				
				
					commit
					ba5d1108c0
				
			@@ -514,7 +514,7 @@ ROOT_DOMAIN_URI = EXTERNAL_URI_SCHEME + EXTERNAL_HOST
 | 
			
		||||
 | 
			
		||||
S3_KEY = get_secret("s3_key")
 | 
			
		||||
S3_SECRET_KEY = get_secret("s3_secret_key")
 | 
			
		||||
if S3_KEY is not None and S3_SECRET_KEY is not None and S3_REGION is None:
 | 
			
		||||
if LOCAL_UPLOADS_DIR is None and S3_REGION is None:
 | 
			
		||||
    import boto3
 | 
			
		||||
 | 
			
		||||
    S3_REGION = boto3.client("s3").meta.region_name
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user