Merge pull request #39 from Start9Labs/feature/timestamps

fix sorting and starting web sans ssl
This commit is contained in:
Lucy C
2021-01-19 15:46:23 -07:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -202,9 +202,10 @@ startWeb foundation = do
putStrLn @Text $ "Launching Tor Web Server on port " <> show torPort
torAction <- async $ runSettings (warpSettings torPort foundation) app
putStrLn @Text $ "Launching Web Server on port " <> show appPort
action <- async $ runTLS (tlsSettings sslCertLocation sslKeyLocation)
(warpSettings appPort foundation)
app
action <- if sslAuto
then async $ runTLS (tlsSettings sslCertLocation sslKeyLocation)
(warpSettings appPort foundation) app
else async $ runSettings (warpSettings appPort foundation) app
let actions = (action, torAction)
setWebProcessThreadId (join (***) asyncThreadId actions) foundation

View File

@@ -40,7 +40,7 @@ getAvailableAppVersions rootDirectory ext@(Extension appId) = do
getMostRecentAppVersion :: KnownSymbol a => FilePath -> Extension a -> IO (Maybe RegisteredAppVersion)
getMostRecentAppVersion rootDirectory ext = do
allVersions <- liftIO $ getAvailableAppVersions rootDirectory ext
pure $ head $ sortOn (fst . unRegisteredAppVersion) allVersions
pure $ head $ sortOn (Down . fst . unRegisteredAppVersion) allVersions
-- /root/appId/version/appId.ext
getVersionedFileFromDir :: KnownSymbol a => FilePath -> Extension a -> Version -> IO (Maybe FilePath)