summaryrefslogtreecommitdiff
path: root/Propellor
diff options
context:
space:
mode:
authorJoey Hess2014-04-23 13:54:02 -0400
committerJoey Hess2014-04-23 13:54:02 -0400
commit792957153ca9c22de28da7be83940aa5e07af0fa (patch)
tree3963b00a1d2a594d890adff4181895536e4c9f07 /Propellor
parent50fb9961f3dfd5fcce8875c6b2b216da35cf7c42 (diff)
parentfa45d9f47ca07a99af6c9f7a335f8522836426da (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'Propellor')
-rw-r--r--Propellor/Property/Dns.hs2
-rw-r--r--Propellor/Property/SiteSpecific/JoeySites.hs31
-rw-r--r--Propellor/SimpleSh.hs4
3 files changed, 31 insertions, 6 deletions
diff --git a/Propellor/Property/Dns.hs b/Propellor/Property/Dns.hs
index 73d427c0..40cadb6d 100644
--- a/Propellor/Property/Dns.hs
+++ b/Propellor/Property/Dns.hs
@@ -116,8 +116,8 @@ secondaryFor masters hosts domain = RevertableProperty setup cleanup
-- running.
servingZones :: Property
servingZones = namedConfWritten
- `requires` Apt.serviceInstalledRunning "bind9"
`onChange` Service.reloaded "bind9"
+ `requires` Apt.serviceInstalledRunning "bind9"
namedConfWritten :: Property
namedConfWritten = property "named.conf configured" $ do
diff --git a/Propellor/Property/SiteSpecific/JoeySites.hs b/Propellor/Property/SiteSpecific/JoeySites.hs
index b43d83f8..06865c45 100644
--- a/Propellor/Property/SiteSpecific/JoeySites.hs
+++ b/Propellor/Property/SiteSpecific/JoeySites.hs
@@ -102,6 +102,30 @@ kgbServer = withOS desc $ \o -> case o of
where
desc = "kgb.kitenet.net setup"
+mumbleServer :: [Host] -> Property
+mumbleServer hosts = combineProperties "mumble.debian.net"
+ [ Obnam.latestVersion
+ , Obnam.backup "/var/lib/mumble-server" "55 5 * * *"
+ [ "--repository=sftp://joey@turtle.kitenet.net/~/lib/backup/mumble.debian.net.obnam"
+ , "--client-name=mumble"
+ ] Obnam.OnlyClient
+ `requires` Ssh.keyImported SshRsa "root"
+ `requires` Ssh.knownHost hosts "turtle.kitenet.net" "root"
+ , trivial $ cmdProperty "chown" ["-R", "mumble-server:mumble-server", "/var/lib/mumble-server"]
+ , Apt.serviceInstalledRunning "mumble-server"
+ ]
+
+obnamLowMem :: Property
+obnamLowMem = combineProperties "obnam tuned for low memory use"
+ [ Obnam.latestVersion
+ , "/etc/obnam.conf" `File.containsLines`
+ [ "[config]"
+ , "# Suggested by liw to keep Obnam memory consumption down (at some speed cost)."
+ , "upload-queue-size = 128"
+ , "lru-size = 128"
+ ]
+ ]
+
-- git.kitenet.net and git.joeyh.name
gitServer :: [Host] -> Property
gitServer hosts = propertyList "git.kitenet.net setup"
@@ -229,9 +253,8 @@ mainhttpscert True =
, " SSLCertificateChainFile /etc/ssl/certs/startssl.pem"
]
-
-annexRsyncServer :: Property
-annexRsyncServer = combineProperties "rsync server for git-annex autobuilders"
+gitAnnexDistributor :: Property
+gitAnnexDistributor = combineProperties "git-annex distributor, including rsync server and signer"
[ Apt.installed ["rsync"]
, File.hasPrivContent "/etc/rsyncd.conf"
, File.hasPrivContent "/etc/rsyncd.secrets"
@@ -239,6 +262,8 @@ annexRsyncServer = combineProperties "rsync server for git-annex autobuilders"
`onChange` Service.running "rsync"
, endpoint "/srv/web/downloads.kitenet.net/git-annex/autobuild"
, endpoint "/srv/web/downloads.kitenet.net/git-annex/autobuild/x86_64-apple-mavericks"
+ -- git-annex distribution signing key
+ , Gpg.keyImported "89C809CB" "joey"
]
where
endpoint d = combineProperties ("endpoint " ++ d)
diff --git a/Propellor/SimpleSh.hs b/Propellor/SimpleSh.hs
index 7e0f19ff..c088eda7 100644
--- a/Propellor/SimpleSh.hs
+++ b/Propellor/SimpleSh.hs
@@ -32,7 +32,6 @@ simpleSh namedpipe = do
forever $ do
(client, _addr) <- accept s
h <- socketToHandle client ReadWriteMode
- hSetBuffering h LineBuffering
maybe noop (run h) . readish =<< hGetLine h
where
run h (Cmd cmd params) = do
@@ -47,6 +46,7 @@ simpleSh namedpipe = do
let runwriter = do
v <- readChan chan
hPutStrLn h (show v)
+ hFlush h
case v of
Done -> noop
_ -> runwriter
@@ -73,8 +73,8 @@ simpleShClient namedpipe cmd params handler = do
s <- socket AF_UNIX Stream defaultProtocol
connect s (SockAddrUnix namedpipe)
h <- socketToHandle s ReadWriteMode
- hSetBuffering h LineBuffering
hPutStrLn h $ show $ Cmd cmd params
+ hFlush h
resps <- catMaybes . map readish . lines <$> hGetContents h
hClose h `after` handler resps