diff --git a/cardano-launcher/app/Main.hs b/cardano-launcher/app/Main.hs index 335819b8..f29c088a 100644 --- a/cardano-launcher/app/Main.hs +++ b/cardano-launcher/app/Main.hs @@ -90,23 +90,27 @@ main = do updaterData = getUpdaterData launcherOptions -- where to generate the certificates - let tlsPath :: TLSPath - tlsPath = TLSPath $ loTlsPath launcherOptions - - -- | If we need to, we first check if there are certificates so we don't have - -- to generate them. Since the function is called `generate...`, that's what - -- it does, it generates the certificates. - eTLSGeneration <- generateTlsCertificates - loggingDependencies - configurationOptions - tlsPath - - case eTLSGeneration of - Left generationError -> do - Trace.logError baseTrace $ - "Error occured while generating TLS certificates: " <> show generationError - throwM $ FailedToGenerateTLS generationError - Right _ -> return () + let mTlsPath :: Maybe TLSPath + mTlsPath = TLSPath <$> loTlsPath launcherOptions + + + case mTlsPath of + Just tlsPath -> do + -- | If we need to, we first check if there are certificates so we don't have + -- to generate them. Since the function is called `generate...`, that's what + -- it does, it generates the certificates. + eTLSGeneration <- generateTlsCertificates + loggingDependencies + configurationOptions + tlsPath + + case eTLSGeneration of + Left generationError -> do + Trace.logError baseTrace $ + "Error occured while generating TLS certificates: " <> show generationError + throwM $ FailedToGenerateTLS generationError + Right _ -> return () + Nothing -> pure () -- TLS generation has been disabled -- In the case the user wants to avoid installing the update now, we -- run the update (if there is one) when we have it downloaded. diff --git a/cardano-launcher/src/Cardano/Shell/Configuration.hs b/cardano-launcher/src/Cardano/Shell/Configuration.hs index 571eeefa..4dbaf1fd 100644 --- a/cardano-launcher/src/Cardano/Shell/Configuration.hs +++ b/cardano-launcher/src/Cardano/Shell/Configuration.hs @@ -43,7 +43,7 @@ newtype WalletPath = WalletPath -- | Launcher options data LauncherOptions = LauncherOptions { loConfiguration :: !ConfigurationOptions - , loTlsPath :: !FilePath + , loTlsPath :: !(Maybe FilePath) , loUpdaterPath :: !FilePath , loUpdaterArgs :: ![Text] , loUpdateArchive :: !FilePath @@ -62,7 +62,7 @@ instance FromJSON LauncherOptions where updaterArgs <- o .: "updaterArgs" updateArchive <- o .: "updateArchive" configuration <- o .: "configuration" - tlsPath <- o .: "tlsPath" + tlsPath <- o .:? "tlsPath" workingDir <- o .: "workingDir" pure $ LauncherOptions