summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2015-03-11 22:06:08 -0400
committerJoey Hess2015-03-11 22:06:08 -0400
commit09435e9bcc09adf6c85d5821602a7adb6dde3a04 (patch)
tree099b6869482cbfdb24f28d77cea2bb997209bd58 /src
parent51dd9a9c63e6e04103ffad13510cf46c726ccf23 (diff)
propellor spin
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Property/SiteSpecific/JoeySites.hs37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs
index 303a6935..86d742b5 100644
--- a/src/Propellor/Property/SiteSpecific/JoeySites.hs
+++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs
@@ -22,6 +22,43 @@ import Data.List
import System.Posix.Files
import Data.String.Utils
+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
+ & 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",
+ "libghc-ifelse-dev", "libghc-case-insensitive-dev"]
+ & userScriptProperty "scroll"
+ [ "cd " ++ d </> "scroll"
+ , "cabal configure"
+ , "make"
+ ]
+ & s `File.hasContent`
+ [ "#!/bin/sh"
+ , "set -e"
+ , "echo Preparing to run scroll!"
+ , "cd " ++ d </> "scroll"
+ , "mkdir -p tmp"
+ , "TMPDIR= t=$(tempfile -d tmp)"
+ , "rm -f \"$t\""
+ , "mkdir \"$t\""
+ , "cd \"$t\""
+ , "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 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"]
+ & Apt.serviceInstalledRunning "telnetd"
+ where
+ d = "/home/scroll"
+ s = d </> "login.sh"
+
oldUseNetServer :: [Host] -> Property HasInfo
oldUseNetServer hosts = propertyList "olduse.net server" $ props
& Apt.installed ["leafnode"]