Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
This module defines the settings used for an individual IRC connection. These are static settings that are not expected change over the lifetime of a connection.
Synopsis
- data ServerSettings = ServerSettings {
- _ssNicks :: !(NonEmpty Text)
- _ssUser :: !Text
- _ssReal :: !Text
- _ssPassword :: !(Maybe Secret)
- _ssSaslMechanism :: !(Maybe SaslMechanism)
- _ssHostName :: !HostName
- _ssPort :: !(Maybe PortNumber)
- _ssTls :: !UseTls
- _ssTlsClientCert :: !(Maybe FilePath)
- _ssTlsClientKey :: !(Maybe FilePath)
- _ssTlsClientKeyPassword :: !(Maybe Secret)
- _ssTlsServerCert :: !(Maybe FilePath)
- _ssTlsCiphers :: String
- _ssConnectCmds :: ![[ExpansionChunk]]
- _ssSocksHost :: !(Maybe HostName)
- _ssSocksPort :: !PortNumber
- _ssChanservChannels :: ![Identifier]
- _ssFloodPenalty :: !Rational
- _ssFloodThreshold :: !Rational
- _ssMessageHooks :: ![HookConfig]
- _ssName :: !(Maybe Text)
- _ssReconnectAttempts :: !Int
- _ssReconnectError :: !(Maybe KnownRegex)
- _ssAutoconnect :: !Bool
- _ssNickCompletion :: WordCompletionMode
- _ssLogDir :: Maybe FilePath
- _ssBindHostName :: Maybe HostName
- _ssSts :: !Bool
- _ssTlsPubkeyFingerprint :: !(Maybe Fingerprint)
- _ssTlsCertFingerprint :: !(Maybe Fingerprint)
- _ssShowAccounts :: !Bool
- _ssCapabilities :: ![Text]
- data HookConfig = HookConfig Text [Text]
- serverSpec :: ValueSpec (ServerSettings -> ServerSettings)
- identifierSpec :: ValueSpec Identifier
- ssNicks :: Lens' ServerSettings (NonEmpty Text)
- ssUser :: Lens' ServerSettings Text
- ssReal :: Lens' ServerSettings Text
- ssPassword :: Lens' ServerSettings (Maybe Secret)
- ssSaslMechanism :: Lens' ServerSettings (Maybe SaslMechanism)
- ssHostName :: Lens' ServerSettings HostName
- ssPort :: Lens' ServerSettings (Maybe PortNumber)
- ssTls :: Lens' ServerSettings UseTls
- ssTlsClientCert :: Lens' ServerSettings (Maybe FilePath)
- ssTlsClientKey :: Lens' ServerSettings (Maybe FilePath)
- ssTlsClientKeyPassword :: Lens' ServerSettings (Maybe Secret)
- ssTlsServerCert :: Lens' ServerSettings (Maybe FilePath)
- ssTlsCiphers :: Lens' ServerSettings String
- ssConnectCmds :: Lens' ServerSettings [[ExpansionChunk]]
- ssSocksHost :: Lens' ServerSettings (Maybe HostName)
- ssSocksPort :: Lens' ServerSettings PortNumber
- ssChanservChannels :: Lens' ServerSettings [Identifier]
- ssFloodPenalty :: Lens' ServerSettings Rational
- ssFloodThreshold :: Lens' ServerSettings Rational
- ssMessageHooks :: Lens' ServerSettings [HookConfig]
- ssName :: Lens' ServerSettings (Maybe Text)
- ssReconnectAttempts :: Lens' ServerSettings Int
- ssReconnectError :: Lens' ServerSettings (Maybe KnownRegex)
- ssAutoconnect :: Lens' ServerSettings Bool
- ssNickCompletion :: Lens' ServerSettings WordCompletionMode
- ssLogDir :: Lens' ServerSettings (Maybe FilePath)
- ssBindHostName :: Lens' ServerSettings (Maybe HostName)
- ssSts :: Lens' ServerSettings Bool
- ssTlsPubkeyFingerprint :: Lens' ServerSettings (Maybe Fingerprint)
- ssTlsCertFingerprint :: Lens' ServerSettings (Maybe Fingerprint)
- ssShowAccounts :: Lens' ServerSettings Bool
- ssCapabilities :: Lens' ServerSettings [Text]
- data SaslMechanism
- _SaslExternal :: Prism' SaslMechanism (Maybe Text)
- _SaslEcdsa :: Prism' SaslMechanism (Maybe Text, Text, FilePath)
- _SaslPlain :: Prism' SaslMechanism (Maybe Text, Text, Secret)
- data Secret
- data SecretException = SecretException String String
- loadSecrets :: ServerSettings -> IO ServerSettings
- defaultServerSettings :: ServerSettings
- data UseTls
- data Fingerprint
- data KnownRegex = KnownRegex Text Regex
- getRegex :: KnownRegex -> Regex
Server settings type
data ServerSettings Source #
Static server-level settings
ServerSettings | |
|
Instances
Show ServerSettings Source # | |
Defined in Client.Configuration.ServerSettings showsPrec :: Int -> ServerSettings -> ShowS # show :: ServerSettings -> String # showList :: [ServerSettings] -> ShowS # |
data HookConfig Source #
Hook name and configuration arguments
Instances
Show HookConfig Source # | |
Defined in Client.Configuration.ServerSettings showsPrec :: Int -> HookConfig -> ShowS # show :: HookConfig -> String # showList :: [HookConfig] -> ShowS # |
Lenses
SASL Mechanisms
data SaslMechanism Source #
SASL mechanisms and configuration data.
SaslPlain (Maybe Text) Text Secret | SASL PLAIN RFC4616 - authzid authcid password |
SaslEcdsa (Maybe Text) Text FilePath | SASL NIST - https://github.com/kaniini/ecdsatool - authzid keypath |
SaslExternal (Maybe Text) | SASL EXTERNAL RFC4422 - authzid |
Instances
Show SaslMechanism Source # | |
Defined in Client.Configuration.ServerSettings showsPrec :: Int -> SaslMechanism -> ShowS # show :: SaslMechanism -> String # showList :: [SaslMechanism] -> ShowS # |
_SaslEcdsa :: Prism' SaslMechanism (Maybe Text, Text, FilePath) Source #
_SaslPlain :: Prism' SaslMechanism (Maybe Text, Text, Secret) Source #
Secrets
SecretText Text | Constant text |
SecretCommand (NonEmpty Text) | Command to generate text |
data SecretException Source #
Instances
Show SecretException Source # | |
Defined in Client.Configuration.ServerSettings showsPrec :: Int -> SecretException -> ShowS # show :: SecretException -> String # showList :: [SecretException] -> ShowS # | |
Exception SecretException Source # | |
Defined in Client.Configuration.ServerSettings |
loadSecrets :: ServerSettings -> IO ServerSettings Source #
Run the secret commands in a server configuration replacing them with secret text.
Throws SecretException
Defaults
defaultServerSettings :: ServerSettings Source #
The defaults for server settings.
TLS settings
Security setting for network connection
UseTls | TLS connection |
UseInsecureTls | TLS connection without certificate checking |
UseInsecure | Plain connection |
data Fingerprint Source #
Fingerprint used to validate server certificates.
FingerprintSha1 ByteString | SHA-1 fingerprint |
FingerprintSha256 ByteString | SHA-2 256-bit fingerprint |
FingerprintSha512 ByteString | SHA-2 512-bit fingerprint |
Instances
Show Fingerprint Source # | |
Defined in Client.Configuration.ServerSettings showsPrec :: Int -> Fingerprint -> ShowS # show :: Fingerprint -> String # showList :: [Fingerprint] -> ShowS # |
Regex wrapper
data KnownRegex Source #
Regular expression matched with original source to help with debugging.
Instances
Show KnownRegex Source # | |
Defined in Client.Configuration.ServerSettings showsPrec :: Int -> KnownRegex -> ShowS # show :: KnownRegex -> String # showList :: [KnownRegex] -> ShowS # |
getRegex :: KnownRegex -> Regex Source #