111 lines
2.7 KiB
Plaintext
111 lines
2.7 KiB
Plaintext
let MountConfig = { mpPath : Text, mpLabel : Optional Text }
|
|
|
|
let BitwardenConfig =
|
|
{ Type = { bwKey : Text, bwTries : Natural }, default.bwTries = 3 }
|
|
|
|
let SecretMap = { sKey : Text, sVal : Text }
|
|
|
|
let SecretConfig = { secretAttributes : List SecretMap }
|
|
|
|
let PromptConfig = { Type = { promptTries : Natural }, default.promptTries = 3 }
|
|
|
|
let PasswordConfig =
|
|
< PwdBW : BitwardenConfig.Type
|
|
| PwdLS : SecretConfig
|
|
| PwdPr : PromptConfig.Type
|
|
>
|
|
|
|
let SSHFSData =
|
|
{ Type = { sshfsRemote : Text, sshfsPassword : Optional PasswordConfig }
|
|
, default.sshfsPassword = None PasswordConfig
|
|
}
|
|
|
|
let CIFSOpts =
|
|
{ Type =
|
|
{ cifsoptsUsername : Optional Text
|
|
, cifsoptsWorkgroup : Optional Text
|
|
, cifsoptsDomain : Optional Text
|
|
, cifsoptsUID : Optional Natural
|
|
, cifsoptsGID : Optional Natural
|
|
, cifsoptsIocharset : Optional Text
|
|
}
|
|
, default =
|
|
{ cifsoptsUsername = None Text
|
|
, cifsoptsWorkgroup = None Text
|
|
, cifsoptsDomain = None Text
|
|
, cifsoptsUID = None Natural
|
|
, cifsoptsGID = None Natural
|
|
, cifsoptsIocharset = None Text
|
|
}
|
|
}
|
|
|
|
let CIFSData =
|
|
{ Type =
|
|
{ cifsRemote : Text
|
|
, cifsSudo : Bool
|
|
, cifsPassword : Optional PasswordConfig
|
|
, cifsOpts : Optional CIFSOpts.Type
|
|
}
|
|
, default =
|
|
{ cifsSudo = False
|
|
, cifsPassword = None PasswordConfig
|
|
, cifsOpts = Some CIFSOpts::{=}
|
|
}
|
|
}
|
|
|
|
let VeracryptData =
|
|
{ Type =
|
|
{ vcVolume : Text
|
|
, vcPassword
|
|
{- TODO this shouldn't be optional -}
|
|
: Optional PasswordConfig
|
|
}
|
|
, default.vcPassword = None PasswordConfig
|
|
}
|
|
|
|
let DataConfig =
|
|
< VeracryptConfig : VeracryptData.Type
|
|
| SSHFSConfig : SSHFSData.Type
|
|
| CIFSConfig : CIFSData.Type
|
|
>
|
|
|
|
let DeviceConfig = { deviceMount : MountConfig, deviceData : DataConfig }
|
|
|
|
let TreeConfig =
|
|
{ Type = { tcParent : DeviceConfig, tcChildren : List Text }
|
|
, default.tcChildren = [] : List Text
|
|
}
|
|
|
|
let TreeMap = { tKey : Text, tVal : TreeConfig.Type }
|
|
|
|
let StaticConfig =
|
|
{ Type =
|
|
{ scTmpPath : Optional Text
|
|
, scVerbose : Optional Bool
|
|
, scDevices : List TreeMap
|
|
}
|
|
, default =
|
|
{ scTmpPath =
|
|
{- defaults to /tmp/media/{username} -}
|
|
None Text
|
|
, scVerbose = Some False
|
|
}
|
|
}
|
|
|
|
in { StaticConfig
|
|
, TreeConfig
|
|
, DeviceConfig
|
|
, DataConfig
|
|
, VeracryptData
|
|
, CIFSData
|
|
, CIFSOpts
|
|
, SSHFSData
|
|
, PasswordConfig
|
|
, SecretConfig
|
|
, MountConfig
|
|
, BitwardenConfig
|
|
, PromptConfig
|
|
, TreeMap
|
|
, SecretMap
|
|
}
|