import Types.RepoVersion
import Types.StallDetection
import Types.View
+import Types.Cluster
import Config.DynamicConfig
import Utility.HumanTime
import Utility.Gpg (GpgCmd, mkGpgCmd)
, annexPrivateRepos :: S.Set UUID
, annexAdviceNoSshCaching :: Bool
, annexViewUnsetDirectory :: ViewUnset
+ , annexClusters :: M.Map String ClusterUUID
}
extractGitConfig :: ConfigSource -> Git.Repo -> GitConfig
, annexAdviceNoSshCaching = getbool (annexConfig "advicenosshcaching") True
, annexViewUnsetDirectory = ViewUnset $ fromMaybe "_" $
getmaybe (annexConfig "viewunsetdirectory")
+ , annexClusters =
+ M.mapMaybe (mkClusterUUID . toUUID) $
+ M.mapKeys (drop (B.length clusterprefix) . fromConfigKey) $
+ M.filterWithKey
+ (\(ConfigKey k) _ -> clusterprefix `B.isPrefixOf` k)
+ (config r)
}
where
getbool k d = fromMaybe d $ getmaybebool k
hereuuid = maybe NoUUID toUUID $ getmaybe (annexConfig "uuid")
+ clusterprefix = annexConfigPrefix <> "cluster."
+
{- Merge a GitConfig that comes from git-config with one containing
- repository-global defaults. -}
mergeGitConfig :: GitConfig -> GitConfig -> GitConfig
, remoteAnnexMaxGitBundles :: Int
, remoteAnnexAllowEncryptedGitRepo :: Bool
, remoteAnnexProxy :: Bool
+ , remoteAnnexClusterNode :: Maybe [String]
, remoteUrl :: Maybe String
{- These settings are specific to particular types of remotes
, remoteAnnexAllowEncryptedGitRepo =
getbool AllowEncryptedGitRepoField False
, remoteAnnexProxy = getbool ProxyField False
+ , remoteAnnexClusterNode = words <$> getmaybe ClusterNodeField
, remoteUrl =
case Git.Config.getMaybe (remoteConfig remotename (remoteGitConfigKey UrlField)) r of
Just (ConfigValue b)
| MaxGitBundlesField
| AllowEncryptedGitRepoField
| ProxyField
+ | ClusterNodeField
| UrlField
| ShellField
| SshOptionsField
AllowEncryptedGitRepoField -> inherited "allow-encrypted-gitrepo"
-- Allow proxy chains.
ProxyField -> inherited "proxy"
+ ClusterNodeField -> uninherited "cluster-node"
UrlField -> inherited "url"
ShellField -> inherited "shell"
SshOptionsField -> inherited "ssh-options"
type UnqualifiedConfigKey = B.ByteString
+annexConfigPrefix :: B.ByteString
+annexConfigPrefix = "annex."
+
{- A global annex setting in git config. -}
annexConfig :: UnqualifiedConfigKey -> ConfigKey
-annexConfig key = ConfigKey ("annex." <> key)
+annexConfig key = ConfigKey (annexConfigPrefix <> key)
class RemoteNameable r where
getRemoteName :: r -> RemoteName
set in global git configuration.
For details, see <https://git-annex.branchable.com/tuning/>.
+* `annex.cluster.<name>`
+
+ [[git-annex-cluster]] sets this to the UUID of a cluster, to
+ enable the local repository to act as a proxy to the cluster.
+
+ Note that cluster UUIDs are not the same as repository UUIDs,
+ and a repository UUID cannot be used here.
+
# CONFIGURATION OF REMOTES
Remotes are configured using these settings in `.git/config`.
* `remote.<name>.annex-proxy`
Set to "true" to make the local repository able to act as a proxy to this
- remote. After configuring this, run [[git-annex-updateproxy](1) to store
+ remote.
+
+ After configuring this, run [[git-annex-updateproxy](1) to store
+ the new configuration in the git-annex branch.
+
+* `remote.<name>.annex-cluster-node`
+
+ Set to the name of a cluster to make this remote be part of
+ the cluster. Names of multiple clusters can be separated by
+ whitespace to make a remote be part of more than one cluster.
+
+ After configuring this, run [[git-annex-updatecluster](1) to store
the new configuration in the git-annex branch.
* `remote.<name>.annex-private`