From bd8efb76a3e033048bc75c6dec7ec6d6adbb058e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 22:18:50 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 12 +++++++----- src/Propellor/Property/Ssh.hs | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src') 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, -- cgit v1.2.3