summaryrefslogtreecommitdiff
path: root/cokiki.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2016-04-26 15:37:32 -0400
committerjoe <joe@jerkface.net>2016-04-26 15:37:32 -0400
commitbcf03d8c7aa88dc5ac6355e93b1168daee338bb6 (patch)
tree36464b47ad459de82a1c31ce366aa0695c56b7d7 /cokiki.hs
parentcaf2fa3bf1b3fadd2bdda1570d0e9398d0bdb548 (diff)
cokiki requires root for everything for now.
Diffstat (limited to 'cokiki.hs')
-rw-r--r--cokiki.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/cokiki.hs b/cokiki.hs
index c93e30e..fb0523c 100644
--- a/cokiki.hs
+++ b/cokiki.hs
@@ -52,9 +52,9 @@ main = do
52 | uid==0 = action 52 | uid==0 = action
53 | otherwise = hPutStrLn stderr "operation requires root." 53 | otherwise = hPutStrLn stderr "operation requires root."
54 let sel = case cmd of 54 let sel = case cmd of
55 ["ssh-client"] -> pure (sshClient uid) <*> Kiki.ㄧchroot <*> Kiki.ㄧhomedir 55 ["ssh-client"] -> fmap whenRoot $ sshClient uid <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir
56 ["ssh-server"] -> pure (whenRoot sshServer) 56 ["ssh-server"] -> fmap whenRoot $ sshServer <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir
57 ["strongswan"] -> pure (whenRoot strongswan) 57 ["strongswan"] -> fmap whenRoot $ strongswan <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir
58 _ -> pure $ hPutStr stderr usage 58 _ -> pure $ hPutStr stderr usage
59 spec = uncurry fancy Kiki.kikiOptions "" 59 spec = uncurry fancy Kiki.kikiOptions ""
60 case runArgs (parseInvocation spec args) sel of 60 case runArgs (parseInvocation spec args) sel of
@@ -97,14 +97,14 @@ sshClient uid root cmn = do
97 -- Kiki.replaceSshServerKeys root cmn 97 -- Kiki.replaceSshServerKeys root cmn
98 Kiki.importAndRefresh root cmn 98 Kiki.importAndRefresh root cmn
99 99
100sshServer = do 100sshServer root cmn = do
101 -- /etc/ssh/sshd_config <-- 'HostKey /var/cache/kiki/ssh_host_ecdsa_key' etc. 101 -- /etc/ssh/sshd_config <-- 'HostKey /var/cache/kiki/ssh_host_ecdsa_key' etc.
102 return () 102 Kiki.importAndRefresh root cmn
103 103
104strongswan = do 104strongswan root cmn = do
105 -- etc/ipsec.conf <-- 'include /var/cache/kiki/ipsec.conf' 105 -- etc/ipsec.conf <-- 'include /var/cache/kiki/ipsec.conf'
106 -- /root/.gnupg/... <-- contains newly-generated ipsec subkey 106 -- /root/.gnupg/... <-- contains newly-generated ipsec subkey
107 Kiki.refresh id (Kiki.CommonArgsParsed Nothing Nothing) 107 Kiki.importAndRefresh root cmn
108 -- /var/cache/kiki/ipsec.conf <-- contains configurations for each remote ipsec host 108 -- /var/cache/kiki/ipsec.conf <-- contains configurations for each remote ipsec host
109 -- /var/cache/kiki/ipsec.conf <-- contains '%default' configuration for this local host 109 -- /var/cache/kiki/ipsec.conf <-- contains '%default' configuration for this local host
110 -- /var/cache/kiki/ipsec.d/certs <-- contains relevant certs 110 -- /var/cache/kiki/ipsec.d/certs <-- contains relevant certs