summaryrefslogtreecommitdiff
path: root/cokiki.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2016-08-29 22:24:08 -0400
committerjoe <joe@jerkface.net>2016-08-29 22:24:08 -0400
commit78c2c3753e69818aa7fd5d3a0354fea5d0fc452b (patch)
tree9f1b155c07db63d22f01e04198d00b89a109f6b9 /cokiki.hs
parent63af3d0f3d149b110e172223c18afacd77a172f8 (diff)
cokiki build fix & show --packets option.
Diffstat (limited to 'cokiki.hs')
-rw-r--r--cokiki.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/cokiki.hs b/cokiki.hs
index f8eed0a..54cc4ba 100644
--- a/cokiki.hs
+++ b/cokiki.hs
@@ -19,6 +19,7 @@ import System.Exit
19import System.IO 19import System.IO
20import System.Posix.User 20import System.Posix.User
21import CommandLine 21import CommandLine
22import Data.OpenPGP (SymmetricAlgorithm(Unencrypted))
22 23
23usage = unlines 24usage = unlines
24 [ "cokiki <command> [--chroot=ROOTDIR]" 25 [ "cokiki <command> [--chroot=ROOTDIR]"
@@ -116,7 +117,7 @@ sshClient uid root cmn = whenRoot uid root cmn $ do
116 maybe (return ()) (myWriteFile (root "/etc/ssh/ssh_config") . unparseSshConfig) sshconfig' 117 maybe (return ()) (myWriteFile (root "/etc/ssh/ssh_config") . unparseSshConfig) sshconfig'
117 118
118 -- /var/cache/kiki/config/ssh_known_hosts <-- contains known hosts from /root/.gnupg/... 119 -- /var/cache/kiki/config/ssh_known_hosts <-- contains known hosts from /root/.gnupg/...
119 Kiki.importAndRefresh root cmn 120 Kiki.importAndRefresh root cmn Unencrypted
120 121
121sshServer uid root cmn = whenRoot uid root cmn $ do 122sshServer uid root cmn = whenRoot uid root cmn $ do
122 sshconfig <- parseSshConfig . fromMaybe "" <$> maybeReadFile (root "/etc/ssh/sshd_config") 123 sshconfig <- parseSshConfig . fromMaybe "" <$> maybeReadFile (root "/etc/ssh/sshd_config")
@@ -129,7 +130,7 @@ sshServer uid root cmn = whenRoot uid root cmn $ do
129 hPutStrLn stderr "adding HostKey directive" 130 hPutStrLn stderr "adding HostKey directive"
130 myWriteFile (root "/etc/ssh/sshd_config") $ unparseSshConfig sshconfig' 131 myWriteFile (root "/etc/ssh/sshd_config") $ unparseSshConfig sshconfig'
131 -- /etc/ssh/sshd_config <-- 'HostKey /var/cache/kiki/config/ssh_host_ecdsa_key' etc. 132 -- /etc/ssh/sshd_config <-- 'HostKey /var/cache/kiki/config/ssh_host_ecdsa_key' etc.
132 Kiki.importAndRefresh root cmn 133 Kiki.importAndRefresh root cmn Unencrypted
133 134
134strongswan uid root cmn = whenRoot uid root cmn $ do 135strongswan uid root cmn = whenRoot uid root cmn $ do
135 -- Parsing as if ssh config, that's not right, but good enough for now. 136 -- Parsing as if ssh config, that's not right, but good enough for now.
@@ -143,7 +144,7 @@ strongswan uid root cmn = whenRoot uid root cmn $ do
143 hPutStrLn stderr "adding include directive" 144 hPutStrLn stderr "adding include directive"
144 myWriteFile (root "/etc/ipsec.conf") $ unparseSshConfig ipsecconf' 145 myWriteFile (root "/etc/ipsec.conf") $ unparseSshConfig ipsecconf'
145 -- etc/ipsec.conf <-- 'include /var/cache/kiki/ipsec.conf' 146 -- etc/ipsec.conf <-- 'include /var/cache/kiki/ipsec.conf'
146 Kiki.importAndRefresh root cmn 147 Kiki.importAndRefresh root cmn Unencrypted
147 148
148configureTor uid root cmn = whenRoot uid root cmn $ do 149configureTor uid root cmn = whenRoot uid root cmn $ do
149 -- Parsing as if ssh config, that's not right, but good enough for now. 150 -- Parsing as if ssh config, that's not right, but good enough for now.
@@ -197,7 +198,7 @@ configureTor uid root cmn = whenRoot uid root cmn $ do
197 , ["HiddenServicePort"," ","22"," ","127.0.0.1:22"] 198 , ["HiddenServicePort"," ","22"," ","127.0.0.1:22"]
198 , ["HiddenServicePort"," ","25"," ","127.0.0.1:25"] ] 199 , ["HiddenServicePort"," ","25"," ","127.0.0.1:25"] ]
199 myWriteFile (root "/etc/tor/torrc") $ unparseSshConfig torrc' 200 myWriteFile (root "/etc/tor/torrc") $ unparseSshConfig torrc'
200 Kiki.importAndRefresh root cmn 201 Kiki.importAndRefresh root cmn Unencrypted
201 return () 202 return ()
202 203
203 204