Copyright | (c) Eric Mertens 2016 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Client.Configuration.ServerSettings
Description
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 :: !TlsMode
- _ssTlsVerify :: !TlsVerify
- _ssTlsClientCert :: !(Maybe FilePath)
- _ssTlsClientKey :: !(Maybe FilePath)
- _ssTlsClientKeyPassword :: !(Maybe Secret)
- _ssTlsServerCert :: !(Maybe FilePath)
- _ssTlsCiphers :: String
- _ssTls13Ciphers :: Maybe String
- _ssTlsPubkeyFingerprint :: !(Maybe Fingerprint)
- _ssTlsCertFingerprint :: !(Maybe Fingerprint)
- _ssSts :: !Bool
- _ssConnectCmds :: ![[ExpansionChunk]]
- _ssSocksHost :: !(Maybe HostName)
- _ssSocksPort :: !PortNumber
- _ssSocksUsername :: !(Maybe Text)
- _ssSocksPassword :: !(Maybe Secret)
- _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
- _ssShowAccounts :: !Bool
- _ssCapabilities :: ![Text]
- _ssWindowHints :: Map Focus WindowHint
- _ssPalette :: NetworkPalette
- data HookConfig = HookConfig Text [Text]
- serverSpec :: ValueSpec (Maybe Text, 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 TlsMode
- ssTlsVerify :: Lens' ServerSettings TlsVerify
- ssTlsClientCert :: Lens' ServerSettings (Maybe FilePath)
- ssTlsClientKey :: Lens' ServerSettings (Maybe FilePath)
- ssTlsClientKeyPassword :: Lens' ServerSettings (Maybe Secret)
- ssTlsServerCert :: Lens' ServerSettings (Maybe FilePath)
- ssTlsCiphers :: Lens' ServerSettings String
- ssTls13Ciphers :: Lens' ServerSettings (Maybe String)
- ssConnectCmds :: Lens' ServerSettings [[ExpansionChunk]]
- ssSocksHost :: Lens' ServerSettings (Maybe HostName)
- ssSocksPort :: Lens' ServerSettings PortNumber
- ssSocksUsername :: Lens' ServerSettings (Maybe Text)
- ssSocksPassword :: Lens' ServerSettings (Maybe Secret)
- 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]
- ssWindowHints :: Lens' ServerSettings (Map Focus WindowHint)
- ssPalette :: Lens' ServerSettings NetworkPalette
- data SaslMechanism
- _SaslExternal :: Prism' SaslMechanism (Maybe Text)
- _SaslEcdsa :: Prism' SaslMechanism (Maybe Text, Text, FilePath)
- _SaslPlain :: Prism' SaslMechanism (Maybe Text, Text, Secret)
- _SaslScram :: Prism' SaslMechanism (ScramDigest, Maybe Text, Text, Secret)
- data Secret
- data SecretException = SecretException String String
- loadSecrets :: ServerSettings -> IO ServerSettings
- data WindowHint = WindowHint {}
- defaultServerSettings :: ServerSettings
- data UseTls
- data Fingerprint
- data TlsMode
- data KnownRegex = KnownRegex Text Regex
- getRegex :: KnownRegex -> Regex
Server settings type
data ServerSettings Source #
Static server-level settings
Constructors
ServerSettings | |
Fields
|
Instances
Show ServerSettings Source # | |
Defined in Client.Configuration.ServerSettings Methods showsPrec :: Int -> ServerSettings -> ShowS # show :: ServerSettings -> String # showList :: [ServerSettings] -> ShowS # |
data HookConfig Source #
Hook name and configuration arguments
Constructors
HookConfig Text [Text] |
Instances
Show HookConfig Source # | |
Defined in Client.Configuration.ServerSettings Methods showsPrec :: Int -> HookConfig -> ShowS # show :: HookConfig -> String # showList :: [HookConfig] -> ShowS # |
serverSpec :: ValueSpec (Maybe Text, ServerSettings -> ServerSettings) Source #
Lenses
SASL Mechanisms
data SaslMechanism Source #
SASL mechanisms and configuration data.
Constructors
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 |
SaslScram ScramDigest (Maybe Text) Text Secret | SASL SCRAM-SHA-256 RFC7677 - authzid authcid password |
SaslEcdh (Maybe Text) Text Secret | SASL ECDH-X25519-CHALLENGE - authzid authcid private-key |
Instances
Show SaslMechanism Source # | |
Defined in Client.Configuration.ServerSettings Methods 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 #
_SaslScram :: Prism' SaslMechanism (ScramDigest, Maybe Text, Text, Secret) Source #
Secrets
Constructors
SecretText Text | Constant text |
SecretCommand (NonEmpty Text) | Command to generate text |
data SecretException Source #
Constructors
SecretException String String |
Instances
Exception SecretException Source # | |
Defined in Client.Configuration.ServerSettings Methods toException :: SecretException -> SomeException # | |
Show SecretException Source # | |
Defined in Client.Configuration.ServerSettings Methods showsPrec :: Int -> SecretException -> ShowS # show :: SecretException -> String # showList :: [SecretException] -> ShowS # |
loadSecrets :: ServerSettings -> IO ServerSettings Source #
Run the secret commands in a server configuration replacing them with secret text.
Throws SecretException
Window Hints
data WindowHint Source #
Constructors
WindowHint | |
Fields |
Instances
Show WindowHint Source # | |
Defined in Client.Configuration.ServerSettings Methods showsPrec :: Int -> WindowHint -> ShowS # show :: WindowHint -> String # showList :: [WindowHint] -> ShowS # |
Defaults
defaultServerSettings :: ServerSettings Source #
The defaults for server settings.
TLS settings
Security setting for network connection
Constructors
UseTls | TLS connection |
UseInsecureTls | TLS connection without certificate checking |
UseInsecure | Plain connection |
data Fingerprint Source #
Fingerprint used to validate server certificates.
Constructors
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 Methods 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.
Constructors
KnownRegex Text Regex |
Instances
Show KnownRegex Source # | |
Defined in Client.Configuration.ServerSettings Methods showsPrec :: Int -> KnownRegex -> ShowS # show :: KnownRegex -> String # showList :: [KnownRegex] -> ShowS # |
getRegex :: KnownRegex -> Regex Source #