summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Kiki.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Kiki.hs b/lib/Kiki.hs
index 6b4ee83..f4c8820 100644
--- a/lib/Kiki.hs
+++ b/lib/Kiki.hs
@@ -235,6 +235,22 @@ refreshCache rt rootdir = do
235 -- sshspathpub0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key.pub" 235 -- sshspathpub0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key.pub"
236 -- contactipsec0 = fromMaybe "" rootdir ++ "/etc/ipsec.d/certs/%(onion).pem" 236 -- contactipsec0 = fromMaybe "" rootdir ++ "/etc/ipsec.d/certs/%(onion).pem"
237 237
238 -- TODO (atomic transactions)
239 --
240 -- Use this stratagy for atomic transactions:
241 --
242 -- # cachedir=./cache
243 -- # destdir=config # relative to cachedir
244 -- # mkdir -p "$cachedir"
245 -- # cd "$cachedir"
246 -- # tempdir=$(mktemp -d --tmpdir=.) || exit 1
247 -- # touch "$tempdir"/asdf
248 -- # ln -s "$tempdir" "$tempdir".link
249 -- # mv -T "$tempdir".link "$destdir"
250 --
251 -- (before ln -s, "$tempdir" could be renamed to something meaningful)
252 --
253 -- For now, we will just rm -rf the old cache and regenerate in-place.
238 readProcessWithExitCode "rm" ["-rf", mkpath "*"] "" -- clean up, in case gpg altered the keyring. 254 readProcessWithExitCode "rm" ["-rf", mkpath "*"] "" -- clean up, in case gpg altered the keyring.
239 255
240 flip (maybe $ warn "missing working key?") (rtWorkingKey rt) $ \wk -> do 256 flip (maybe $ warn "missing working key?") (rtWorkingKey rt) $ \wk -> do