sameas RemoteConfig inheritance
I found a way to avoid inheritance complicating anything outside of Logs.Remote. It seems fine to require all inherited values to be inherited and not set in the sameas remote's config. Since inherited values will be used for stuff like encryption and perhaps chunking, which control the actual content stored on the remote, it seems likely that there will not be any reason to need them to vary between two remotes that access the same underlying data store. The newer version of containers is free; the minimum ghc version is bundled with a newer version than that.
This commit is contained in:
parent
59908586f4
commit
c3975ff3b4
8 changed files with 54 additions and 14 deletions
|
@ -11,6 +11,7 @@ import Common
|
|||
import Types.Remote (RemoteConfigField, RemoteConfig)
|
||||
|
||||
import qualified Data.Map as M
|
||||
import qualified Data.Set as S
|
||||
|
||||
{- The name of a configured remote is stored in its config using this key. -}
|
||||
nameField :: RemoteConfigField
|
||||
|
@ -35,3 +36,13 @@ typeField = "type"
|
|||
autoEnableField :: RemoteConfigField
|
||||
autoEnableField = "autoenable"
|
||||
|
||||
encryptionField :: RemoteConfigField
|
||||
encryptionField = "encryption"
|
||||
|
||||
{- A remote with sameas-uuid set will inherit these values from the config
|
||||
- of that uuid. These values cannot be overridden. -}
|
||||
sameasInherits :: S.Set RemoteConfigField
|
||||
sameasInherits = S.fromList
|
||||
[ encryptionField
|
||||
-- TODO more encryption related fields
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue