mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-13 08:38:43 +03:00
king: In http-server/set-config effect, key+cert is Wain, not Cord.
This commit is contained in:
parent
e7d05988d3
commit
75f60504ee
@ -78,7 +78,7 @@ instance FromNoun H.StdMethod where
|
||||
|
||||
-- Http Server Configuration ---------------------------------------------------
|
||||
|
||||
newtype PEM = PEM { unPEM :: Cord }
|
||||
newtype PEM = PEM { unPEM :: Wain }
|
||||
deriving newtype (Eq, Ord, Show, ToNoun, FromNoun)
|
||||
|
||||
type Key = PEM
|
||||
|
@ -8,7 +8,7 @@ module Urbit.Noun.Conversions
|
||||
, Bytes(..), Octs(..), File(..)
|
||||
, Cord(..), Knot(..), Term(..), Tape(..), Tour(..)
|
||||
, BigTape(..), BigCord(..)
|
||||
, Wall, Each(..)
|
||||
, Wain(..), Wall, Each(..)
|
||||
, UD(..), UV(..), UW(..), cordToUW
|
||||
, Mug(..), Path(..), EvilPath(..), Ship(..)
|
||||
, Lenient(..), pathToFilePath, filePathToPath
|
||||
@ -442,6 +442,20 @@ instance FromNoun Tape where
|
||||
Right tx -> pure (Tape tx)
|
||||
|
||||
|
||||
-- Wain -- List of Lines -------------------------------------------------------
|
||||
|
||||
newtype Wain = Wain { unWain :: Text }
|
||||
deriving newtype (Eq, Ord, Show, IsString, NFData)
|
||||
|
||||
instance ToNoun Wain where
|
||||
toNoun (Wain t) = toNoun (Cord <$> lines t)
|
||||
|
||||
instance FromNoun Wain where
|
||||
parseNoun n = named "Wain" $ do
|
||||
tx :: [Cord] <- parseNoun n
|
||||
pure $ Wain $ unlines (unCord <$> tx)
|
||||
|
||||
|
||||
-- Wall -- Text Lines ----------------------------------------------------------
|
||||
|
||||
type Wall = [Tape]
|
||||
|
@ -216,6 +216,9 @@ writePortsFile f = writeFile f . encodeUtf8 . portsFileText
|
||||
cordBytes :: Cord -> ByteString
|
||||
cordBytes = encodeUtf8 . unCord
|
||||
|
||||
wainBytes :: Wain -> ByteString
|
||||
wainBytes = encodeUtf8 . unWain
|
||||
|
||||
pass :: Monad m => m ()
|
||||
pass = pure ()
|
||||
|
||||
@ -506,7 +509,7 @@ startServ isFake conf plan = do
|
||||
logDebug "startServ"
|
||||
|
||||
let tls = hscSecure conf <&> \(PEM key, PEM cert) ->
|
||||
(W.tlsSettingsMemory (cordBytes cert) (cordBytes key))
|
||||
(W.tlsSettingsMemory (wainBytes cert) (wainBytes key))
|
||||
|
||||
sId <- io $ ServId . UV . fromIntegral <$> (randomIO :: IO Word32)
|
||||
liv <- newTVarIO emptyLiveReqs
|
||||
|
Loading…
Reference in New Issue
Block a user