mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-01-24 09:51:57 +01:00
Enable overriding S3 endpoint with AWS_S3_ENDPOINT
This commit is contained in:
parent
6331131b68
commit
a4cacd6991
@ -59,6 +59,7 @@ import Stackage.Database.PackageInfo
|
|||||||
import Stackage.Database.Query
|
import Stackage.Database.Query
|
||||||
import Stackage.Database.Schema
|
import Stackage.Database.Schema
|
||||||
import Stackage.Database.Types
|
import Stackage.Database.Types
|
||||||
|
import System.Environment (getEnvironment)
|
||||||
import UnliftIO.Concurrent (getNumCapabilities)
|
import UnliftIO.Concurrent (getNumCapabilities)
|
||||||
import Web.PathPieces (fromPathPiece, toPathPiece)
|
import Web.PathPieces (fromPathPiece, toPathPiece)
|
||||||
import qualified Control.Retry as Retry
|
import qualified Control.Retry as Retry
|
||||||
@ -163,7 +164,12 @@ stackageServerCron StackageCronOptions {..} = do
|
|||||||
cabalMutable <- newIORef Map.empty
|
cabalMutable <- newIORef Map.empty
|
||||||
gpdCache <- newIORef IntMap.empty
|
gpdCache <- newIORef IntMap.empty
|
||||||
defaultProcessContext <- mkDefaultProcessContext
|
defaultProcessContext <- mkDefaultProcessContext
|
||||||
aws <- newEnv Discover
|
aws <- do
|
||||||
|
aws' <- newEnv Discover
|
||||||
|
endpoint <- lookup "AWS_S3_ENDPOINT" <$> getEnvironment
|
||||||
|
pure $ case endpoint of
|
||||||
|
Nothing -> aws'
|
||||||
|
Just ep -> configure (setEndpoint True (BS8.pack ep) 443 s3) aws'
|
||||||
withLogFunc (setLogMinLevel scoLogLevel lo) $ \logFunc -> do
|
withLogFunc (setLogMinLevel scoLogLevel lo) $ \logFunc -> do
|
||||||
let pantryConfig =
|
let pantryConfig =
|
||||||
PantryConfig
|
PantryConfig
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user