mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
only run if ssl has been setup
This commit is contained in:
@@ -448,11 +448,16 @@ syncConvertEcdsaCerts :: SyncOp
|
|||||||
syncConvertEcdsaCerts = SyncOp "Convert Intermediate Cert to ECDSA P256" check migrate False
|
syncConvertEcdsaCerts = SyncOp "Convert Intermediate Cert to ECDSA P256" check migrate False
|
||||||
where
|
where
|
||||||
check = do
|
check = do
|
||||||
fs <- asks $ appFilesystemBase . appSettings
|
fs <- asks $ appFilesystemBase . appSettings
|
||||||
header <- liftIO $ headMay . lines <$> readFile (toS $ intermediateCaKeyPath `relativeTo` fs)
|
let intCertKey = toS $ intermediateCaKeyPath `relativeTo` fs
|
||||||
pure $ case header of
|
exists <- liftIO $ doesPathExist intCertKey
|
||||||
Nothing -> False
|
if exists
|
||||||
Just y -> "BEGIN RSA PRIVATE KEY" `T.isInfixOf` y
|
then do
|
||||||
|
header <- liftIO $ headMay . lines <$> readFile intCertKey
|
||||||
|
pure $ case header of
|
||||||
|
Nothing -> False
|
||||||
|
Just y -> "BEGIN RSA PRIVATE KEY" `T.isInfixOf` y
|
||||||
|
else pure False
|
||||||
migrate = cantFail $ do
|
migrate = cantFail $ do
|
||||||
base <- asks $ appFilesystemBase . appSettings
|
base <- asks $ appFilesystemBase . appSettings
|
||||||
(runM . runExceptT) (injectFilesystemBase base replaceDerivativeCerts) >>= \case
|
(runM . runExceptT) (injectFilesystemBase base replaceDerivativeCerts) >>= \case
|
||||||
|
|||||||
Reference in New Issue
Block a user