summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config-joey.hs1
-rw-r--r--src/Propellor/Property/SiteSpecific/JoeySites.hs37
2 files changed, 38 insertions, 0 deletions
diff --git a/config-joey.hs b/config-joey.hs
index f9f4eaa7..b8bfcf70 100644
--- a/config-joey.hs
+++ b/config-joey.hs
@@ -96,6 +96,7 @@ clam = standardSystem "clam.kitenet.net" Unstable "amd64"
& "/var/www/index.html" `File.hasContent` ["hello, world"]
& alias "helloworld.kitenet.net"
& Docker.docked oldusenetShellBox
+ & JoeySites.scrollBox
-- ssh on some extra ports to deal with horrible networks
-- while travelling
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"]