summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2015-03-11 22:18:50 -0400
committerJoey Hess2015-03-11 22:18:50 -0400
commitbd8efb76a3e033048bc75c6dec7ec6d6adbb058e (patch)
tree20639aeab59e16e7f08fd330a55bf9be9193353f /src
parent9fb5bc823e42a3cf3400ae9fb0c415ea1d30e2aa (diff)
propellor spin
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/SiteSpecific/JoeySites.hs12
-rw-r--r--src/Propellor/Property/Ssh.hs1
2 files changed, 8 insertions, 5 deletions
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs
index 86d742b5..6fa2a2a6 100644
--- a/src/Propellor/Property/SiteSpecific/JoeySites.hs
+++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs
@@ -26,7 +26,7 @@ scrollBox :: Property HasInfo
scrollBox = propertyList "scroll shell box" $ props
& alias "scroll.joeyh.name"
& User.accountFor "scroll"
- & Git.cloned "scroll" (d </> "scroll") "git://git.kitenet.net/scroll" Nothing
+ & Git.cloned "scroll" "git://git.kitenet.net/scroll" (d </> "scroll") Nothing
& Apt.installed ["ghc", "make", "cabal-install", "libghc-vector-dev",
"libghc-bytestring-dev", "libghc-mtl-dev", "libghc-ncurses-dev",
"libghc-random-dev", "libghc-monad-loops-dev",
@@ -46,14 +46,16 @@ scrollBox = propertyList "scroll shell box" $ props
, "rm -f \"$t\""
, "mkdir \"$t\""
, "cd \"$t\""
- , "script -c ../scroll/scroll -t timing"
+ , "timeout 1d script -c ../scroll/scroll -t timing"
, "echo Thanks for playing scroll!"
- , "echo Your game was recorded, as ID:\"$t\", if you would like to talk about how it went."
+ , "echo Your game was recorded, as ID:$(basename \"$t\"), if you would like to talk about how it went."
, "echo scroll@joeyh.name / http://joeyh.name/code/scroll/"
] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes)))
-- prevent port forwarding etc by not letting scroll log in via ssh
- & Ssh.setSshdConfig "DenyUsers scroll" True
- & cmdProperty "passwd" ["-d", "scroll"]
+ & Ssh.sshdConfig `File.containsLine` ("DenyUsers scroll")
+ `onChange` Ssh.restarted
+ & cmdProperty "chsh" ["scroll", "-s", s]
+ & User.hasPassword "scroll"
& Apt.serviceInstalledRunning "telnetd"
where
d = "/home/scroll"
diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs
index f44688c1..320136ee 100644
--- a/src/Propellor/Property/Ssh.hs
+++ b/src/Propellor/Property/Ssh.hs
@@ -1,5 +1,6 @@
module Propellor.Property.Ssh (
PubKeyText,
+ sshdConfig,
setSshdConfig,
permitRootLogin,
passwordAuthentication,