| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Simplex.FileTransfer.Server.Env
Synopsis
- data XFTPServerConfig s = XFTPServerConfig {
- xftpPort :: ServiceName
- controlPort :: Maybe ServiceName
- fileIdSize :: Int
- serverStoreCfg :: XFTPStoreConfig s
- storeLogFile :: Maybe FilePath
- filesPath :: FilePath
- fileSizeQuota :: Maybe Int64
- allowedChunkSizes :: [Word32]
- allowNewFiles :: Bool
- newFileBasicAuth :: Maybe BasicAuth
- controlPortUserAuth :: Maybe BasicAuth
- controlPortAdminAuth :: Maybe BasicAuth
- fileExpiration :: Maybe ExpirationConfig
- fileTimeout :: Int
- inactiveClientExpiration :: Maybe ExpirationConfig
- xftpCredentials :: ServerCredentials
- httpCredentials :: Maybe ServerCredentials
- xftpServerVRange :: VersionRangeXFTP
- logStatsInterval :: Maybe Int64
- logStatsStartTime :: Int64
- serverStatsLogFile :: FilePath
- serverStatsBackupFile :: Maybe FilePath
- prometheusInterval :: Maybe Int
- prometheusMetricsFile :: FilePath
- transportConfig :: TransportServerConfig
- responseDelay :: Int
- webStaticPath :: Maybe FilePath
- data XFTPStoreConfig s where
- XSCMemory :: Maybe FilePath -> XFTPStoreConfig STMFileStore
- data XFTPEnv s = XFTPEnv {
- config :: XFTPServerConfig s
- store :: FileStore s
- usedStorage :: TVar Int64
- storeLog :: Maybe (StoreLog 'WriteMode)
- random :: TVar ChaChaDRG
- serverIdentity :: KeyHash
- tlsServerCreds :: Credential
- httpServerCreds :: Maybe Credential
- serverStats :: FileServerStats
- data XFTPRequest
- = XFTPReqNew FileInfo (NonEmpty RcvPublicAuthKey) (Maybe BasicAuth)
- | XFTPReqCmd XFTPFileId FileRec FileCmd
- | XFTPReqPing
- type family XFTPStoreType (fs :: FSType) where ...
- data FileStore s where
- data AFStoreType = forall fs. AFSType (SFSType fs)
- fileStore :: XFTPEnv s -> s
- fromFileStore :: FileStore s -> s
- defaultInactiveClientExpiration :: ExpirationConfig
- defFileExpirationHours :: Int64
- defaultFileExpiration :: ExpirationConfig
- newXFTPServerEnv :: FileStoreClass s => XFTPServerConfig s -> IO (XFTPEnv s)
- readFileStoreType :: Ini -> Either String AFStoreType
- runWithStoreConfig :: AFStoreType -> Ini -> FilePath -> MigrationConfirmation -> (forall s. FileStoreClass s => XFTPStoreConfig s -> IO ()) -> IO ()
- checkFileStoreMode :: Ini -> AFStoreType -> FilePath -> IO ()
- importToDatabase :: FilePath -> Ini -> MigrationConfirmation -> IO ()
- exportFromDatabase :: FilePath -> Ini -> MigrationConfirmation -> IO ()
Documentation
data XFTPServerConfig s Source #
Constructors
| XFTPServerConfig | |
Fields
| |
data XFTPStoreConfig s where Source #
Constructors
| XSCMemory :: Maybe FilePath -> XFTPStoreConfig STMFileStore |
Constructors
| XFTPEnv | |
Fields
| |
data XFTPRequest Source #
Constructors
| XFTPReqNew FileInfo (NonEmpty RcvPublicAuthKey) (Maybe BasicAuth) | |
| XFTPReqCmd XFTPFileId FileRec FileCmd | |
| XFTPReqPing |
type family XFTPStoreType (fs :: FSType) where ... Source #
Equations
| XFTPStoreType 'FSMemory = STMFileStore |
data FileStore s where Source #
Constructors
| StoreMemory :: STMFileStore -> FileStore STMFileStore |
data AFStoreType Source #
fromFileStore :: FileStore s -> s Source #
defFileExpirationHours :: Int64 Source #
newXFTPServerEnv :: FileStoreClass s => XFTPServerConfig s -> IO (XFTPEnv s) Source #
readFileStoreType :: Ini -> Either String AFStoreType Source #
runWithStoreConfig :: AFStoreType -> Ini -> FilePath -> MigrationConfirmation -> (forall s. FileStoreClass s => XFTPStoreConfig s -> IO ()) -> IO () Source #
Dispatch store config from AFStoreType singleton and run the callback. CPP guards for Postgres are handled here so Main.hs stays CPP-free.
checkFileStoreMode :: Ini -> AFStoreType -> FilePath -> IO () Source #
Validate startup config when store_files=database.
importToDatabase :: FilePath -> Ini -> MigrationConfirmation -> IO () Source #
Import StoreLog to PostgreSQL database.
exportFromDatabase :: FilePath -> Ini -> MigrationConfirmation -> IO () Source #
Export PostgreSQL database to StoreLog.