Add aws-region param to S3 store URLs
This commit is contained in:
		
							parent
							
								
									d1158bb816
								
							
						
					
					
						commit
						5789eaa3f4
					
				
					 3 changed files with 11 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -5,6 +5,9 @@
 | 
			
		|||
#include "store-api.hh"
 | 
			
		||||
#include "archive.hh"
 | 
			
		||||
#include "s3.hh"
 | 
			
		||||
#ifdef ENABLE_S3
 | 
			
		||||
#include <aws/core/client/ClientConfiguration.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
| 
						 | 
				
			
			@ -496,7 +499,7 @@ struct CurlDownloader : public Downloader
 | 
			
		|||
            // FIXME: do this on a worker thread
 | 
			
		||||
            sync2async<DownloadResult>(success, failure, [&]() -> DownloadResult {
 | 
			
		||||
#ifdef ENABLE_S3
 | 
			
		||||
                S3Helper s3Helper;
 | 
			
		||||
                S3Helper s3Helper(Aws::Region::US_EAST_1); // FIXME: make configurable
 | 
			
		||||
                auto slash = request.uri.find('/', 5);
 | 
			
		||||
                if (slash == std::string::npos)
 | 
			
		||||
                    throw nix::Error("bad S3 URI ‘%s’", request.uri);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue