diff options
Diffstat (limited to 'cokiki.hs')
-rw-r--r-- | cokiki.hs | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -19,6 +19,7 @@ import System.Exit | |||
19 | import System.IO | 19 | import System.IO |
20 | import System.Posix.User | 20 | import System.Posix.User |
21 | import CommandLine | 21 | import CommandLine |
22 | import Data.OpenPGP (SymmetricAlgorithm(Unencrypted)) | ||
22 | 23 | ||
23 | usage = unlines | 24 | usage = 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 | ||
121 | sshServer uid root cmn = whenRoot uid root cmn $ do | 122 | sshServer 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 | ||
134 | strongswan uid root cmn = whenRoot uid root cmn $ do | 135 | strongswan 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 | ||
148 | configureTor uid root cmn = whenRoot uid root cmn $ do | 149 | configureTor 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 | ||