From 09435e9bcc09adf6c85d5821602a7adb6dde3a04 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 22:06:08 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src') 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"] -- cgit v1.2.3 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 From 971d688a729c66a71a73c605201f81863a8f027f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 22:24:09 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 6fa2a2a6..c84b0dca 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -26,12 +26,12 @@ scrollBox :: Property HasInfo scrollBox = propertyList "scroll shell box" $ props & alias "scroll.joeyh.name" & User.accountFor "scroll" - & Git.cloned "scroll" "git://git.kitenet.net/scroll" (d "scroll") Nothing + & Git.cloned "root" "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", "libghc-ifelse-dev", "libghc-case-insensitive-dev"] - & userScriptProperty "scroll" + & scriptProperty [ "cd " ++ d "scroll" , "cabal configure" , "make" -- cgit v1.2.3 From b508bb52fd3c7e9862c0475d052deb5474be2e0c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 22:31:45 -0400 Subject: propellor spin --- debian/changelog | 7 +++++++ src/Propellor/Property/Cmd.hs | 2 +- src/Propellor/Property/SiteSpecific/JoeySites.hs | 7 ++++--- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/debian/changelog b/debian/changelog index f15affbf..363109ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +propellor (2.2.1) UNRELEASED; urgency=medium + + * userScriptProperty now passes --shell /bin/sh, so it can be used + even for users with nonstandard shells. + + -- Joey Hess Wed, 11 Mar 2015 22:29:23 -0400 + propellor (2.2.0) unstable; urgency=medium * When running shimmed (eg in a docker container), diff --git a/src/Propellor/Property/Cmd.hs b/src/Propellor/Property/Cmd.hs index 7fd189df..ae8238f5 100644 --- a/src/Propellor/Property/Cmd.hs +++ b/src/Propellor/Property/Cmd.hs @@ -40,6 +40,6 @@ scriptProperty script = cmdProperty "sh" ["-c", shellcmd] -- | A property that can satisfied by running a series of shell commands, -- as user (cd'd to their home directory). userScriptProperty :: UserName -> [String] -> Property NoInfo -userScriptProperty user script = cmdProperty "su" ["-c", shellcmd, user] +userScriptProperty user script = cmdProperty "su" ["--shell", "/bin/sh", "-c", shellcmd, user] where shellcmd = intercalate " ; " ("set -e" : "cd" : script) diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index c84b0dca..1abad06f 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -26,13 +26,14 @@ scrollBox :: Property HasInfo scrollBox = propertyList "scroll shell box" $ props & alias "scroll.joeyh.name" & User.accountFor "scroll" - & Git.cloned "root" "git://git.kitenet.net/scroll" (d "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", "libghc-ifelse-dev", "libghc-case-insensitive-dev"] - & scriptProperty + & userScriptProperty "scroll" [ "cd " ++ d "scroll" + , "git pull" , "cabal configure" , "make" ] @@ -40,7 +41,7 @@ scrollBox = propertyList "scroll shell box" $ props [ "#!/bin/sh" , "set -e" , "echo Preparing to run scroll!" - , "cd " ++ d "scroll" + , "cd " ++ d , "mkdir -p tmp" , "TMPDIR= t=$(tempfile -d tmp)" , "rm -f \"$t\"" -- cgit v1.2.3 From d9d5bf6d447d73e1aa1ab9cb5acc6f88569960cc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 22:34:10 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 1abad06f..f97db429 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -30,7 +30,8 @@ scrollBox = propertyList "scroll shell box" $ props & 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"] + "libghc-ifelse-dev", "libghc-case-insensitive-dev", + "libghc-data-default-dev"] & userScriptProperty "scroll" [ "cd " ++ d "scroll" , "git pull" -- cgit v1.2.3 From a82b7d3e009c6be0ffdb219264a44535f4c9b2b3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 22:38:15 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index f97db429..161fbb82 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -48,7 +48,7 @@ scrollBox = propertyList "scroll shell box" $ props , "rm -f \"$t\"" , "mkdir \"$t\"" , "cd \"$t\"" - , "timeout 1d script -c ../scroll/scroll -t timing" + , "timeout 1d script --timing=timing -c ../../scroll/scroll" , "echo Thanks for playing scroll!" , "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/" -- cgit v1.2.3 From c8ea87877e0e3085c1ad5425b7c5a745bd29fe51 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 22:47:39 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 161fbb82..c620a0eb 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -23,7 +23,7 @@ import System.Posix.Files import Data.String.Utils scrollBox :: Property HasInfo -scrollBox = propertyList "scroll shell box" $ props +scrollBox = propertyList "scroll server" $ props & alias "scroll.joeyh.name" & User.accountFor "scroll" & Git.cloned "scroll" "git://git.kitenet.net/scroll" (d "scroll") Nothing @@ -48,7 +48,7 @@ scrollBox = propertyList "scroll shell box" $ props , "rm -f \"$t\"" , "mkdir \"$t\"" , "cd \"$t\"" - , "timeout 1d script --timing=timing -c ../../scroll/scroll" + , "SHELL=/bin/sh timeout 1d script --timing=timing -c ../../scroll/scroll" , "echo Thanks for playing scroll!" , "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/" @@ -59,6 +59,15 @@ scrollBox = propertyList "scroll shell box" $ props & cmdProperty "chsh" ["scroll", "-s", s] & User.hasPassword "scroll" & Apt.serviceInstalledRunning "telnetd" + & Apt.installed ["shellinabox"] + & File.hasContent "/etc/default/shellinabox" + [ "# Deployed by propellor" + , "SHELLINABOX_DAEMON_START=1" + , "SHELLINABOX_PORT=4242" + , "SHELLINABOX_ARGS=\"--no-beep --service=/:TELNET:localhost\"" + ] + `onChange` Service.restarted "shellinabox" + & Service.running "shellinabox" where d = "/home/scroll" s = d "login.sh" -- cgit v1.2.3 From 294f61b2b1b4f8cfe0bd7a9c611dcc8d04218b95 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 22:53:37 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index c620a0eb..1c00bc18 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -48,10 +48,11 @@ scrollBox = propertyList "scroll server" $ props , "rm -f \"$t\"" , "mkdir \"$t\"" , "cd \"$t\"" - , "SHELL=/bin/sh timeout 1d script --timing=timing -c ../../scroll/scroll" + , "SHELL=/bin/sh script --timing=timing -c ../../scroll/scroll" , "echo Thanks for playing scroll!" , "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/" + , "read me" ] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) -- prevent port forwarding etc by not letting scroll log in via ssh & Ssh.sshdConfig `File.containsLine` ("DenyUsers scroll") -- cgit v1.2.3 From 17dde04739d2a144466c6081011a217b874c6b01 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 22:58:05 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 1c00bc18..ffd542ed 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -65,7 +65,7 @@ scrollBox = propertyList "scroll server" $ props [ "# Deployed by propellor" , "SHELLINABOX_DAEMON_START=1" , "SHELLINABOX_PORT=4242" - , "SHELLINABOX_ARGS=\"--no-beep --service=/:TELNET:localhost\"" + , "SHELLINABOX_ARGS=\"--no-beep --service=scroll:" ++ d ++ ":" ++ s ++ "\"" ] `onChange` Service.restarted "shellinabox" & Service.running "shellinabox" -- cgit v1.2.3 From febe818cb11f4161b6ab929e9b4934fc7a212b61 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 11 Mar 2015 23:07:41 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index ffd542ed..1b03798a 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -65,7 +65,7 @@ scrollBox = propertyList "scroll server" $ props [ "# Deployed by propellor" , "SHELLINABOX_DAEMON_START=1" , "SHELLINABOX_PORT=4242" - , "SHELLINABOX_ARGS=\"--no-beep --service=scroll:" ++ d ++ ":" ++ s ++ "\"" + , "SHELLINABOX_ARGS=\"--disable-ssl --no-beep --service=:scroll:scroll:" ++ d ++ ":" ++ s ++ "\"" ] `onChange` Service.restarted "shellinabox" & Service.running "shellinabox" -- cgit v1.2.3 From b3f231c750e571795787e0f11f90a3d68720e6eb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 16:12:36 -0400 Subject: propellor spin --- config-joey.hs | 7 +++++++ src/Propellor/Property/SiteSpecific/JoeySites.hs | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/config-joey.hs b/config-joey.hs index b8bfcf70..77e93f26 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -96,7 +96,10 @@ clam = standardSystem "clam.kitenet.net" Unstable "amd64" & "/var/www/index.html" `File.hasContent` ["hello, world"] & alias "helloworld.kitenet.net" & Docker.docked oldusenetShellBox + & JoeySites.scrollBox + & alias "scroll.joeyh.name" + & alias "us.scroll.joeyh.name" -- ssh on some extra ports to deal with horrible networks -- while travelling @@ -273,6 +276,10 @@ elephant = standardSystem "elephant.kitenet.net" Unstable "amd64" & Docker.docked jerryPlay & Docker.garbageCollected `period` (Weekly (Just 1)) + & JoeySites.scrollBox + & alias "scroll.joeyh.name" + & alias "eu.scroll.joeyh.name" + -- For https port 443, shellinabox with ssh login to -- kitenet.net & alias "shell.kitenet.net" diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 1b03798a..e9bf6f52 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -24,7 +24,6 @@ import Data.String.Utils scrollBox :: Property HasInfo scrollBox = propertyList "scroll server" $ props - & alias "scroll.joeyh.name" & User.accountFor "scroll" & Git.cloned "scroll" "git://git.kitenet.net/scroll" (d "scroll") Nothing & Apt.installed ["ghc", "make", "cabal-install", "libghc-vector-dev", -- cgit v1.2.3 From 1196bffdb5be4031cac1c0e9858d4f97daa40fe9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 16:23:45 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index e9bf6f52..7c6fd0e6 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -47,11 +47,16 @@ scrollBox = propertyList "scroll server" $ props , "rm -f \"$t\"" , "mkdir \"$t\"" , "cd \"$t\"" + , "SHELL=/bin/sh script --timing=timing -c " ++ g + ] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) + & g `File.hasContent` + [ "#!/bin/sh" , "SHELL=/bin/sh script --timing=timing -c ../../scroll/scroll" - , "echo Thanks for playing scroll!" - , "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/" - , "read me" + , "echo Thanks for playing scroll! https://joeyh.name/code/scroll/" + , "echo Your game was recorded, as ID:$(basename \"$t\")" + , "echo if you would like to talk about how it went, email scroll@joeyh.name" + , "echo or, type comments below (finish with a dot on its own line)" + , "mail joey@kitenet.net" ] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) -- prevent port forwarding etc by not letting scroll log in via ssh & Ssh.sshdConfig `File.containsLine` ("DenyUsers scroll") @@ -71,6 +76,7 @@ scrollBox = propertyList "scroll server" $ props where d = "/home/scroll" s = d "login.sh" + g = d "game.sh" oldUseNetServer :: [Host] -> Property HasInfo oldUseNetServer hosts = propertyList "olduse.net server" $ props -- cgit v1.2.3 From f2750857b84a700db5bba992aa5d5e2e3c49cce7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 16:34:44 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 7c6fd0e6..cea4a853 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -51,8 +51,11 @@ scrollBox = propertyList "scroll server" $ props ] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) & g `File.hasContent` [ "#!/bin/sh" - , "SHELL=/bin/sh script --timing=timing -c ../../scroll/scroll" + , "if ../../scroll/scroll; then" + , "echo Scroll seems to have ended unexpectedly. Possibly a bug.." + , "else" , "echo Thanks for playing scroll! https://joeyh.name/code/scroll/" + , "fi" , "echo Your game was recorded, as ID:$(basename \"$t\")" , "echo if you would like to talk about how it went, email scroll@joeyh.name" , "echo or, type comments below (finish with a dot on its own line)" -- cgit v1.2.3 From ec1e16a9f3381633376d1d6f1565de9b31931ba4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 16:38:29 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index cea4a853..c4da0672 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -58,7 +58,7 @@ scrollBox = propertyList "scroll server" $ props , "fi" , "echo Your game was recorded, as ID:$(basename \"$t\")" , "echo if you would like to talk about how it went, email scroll@joeyh.name" - , "echo or, type comments below (finish with a dot on its own line)" + , "echo 'or, type comments below (finish with a dot on its own line)'" , "mail joey@kitenet.net" ] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) -- prevent port forwarding etc by not letting scroll log in via ssh -- cgit v1.2.3 From 6d978d71eaf25a47600e4cece1bd9f55fee3c41c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 16:38:47 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index c4da0672..bb03994e 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -60,7 +60,7 @@ scrollBox = propertyList "scroll server" $ props , "echo if you would like to talk about how it went, email scroll@joeyh.name" , "echo 'or, type comments below (finish with a dot on its own line)'" , "mail joey@kitenet.net" - ] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) + ] `onChange` (g `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) -- prevent port forwarding etc by not letting scroll log in via ssh & Ssh.sshdConfig `File.containsLine` ("DenyUsers scroll") `onChange` Ssh.restarted -- cgit v1.2.3 From 82e8311fc569768d991cd7f18ae50651de79517a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 16:43:09 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index bb03994e..e575e79a 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -61,6 +61,7 @@ scrollBox = propertyList "scroll server" $ props , "echo 'or, type comments below (finish with a dot on its own line)'" , "mail joey@kitenet.net" ] `onChange` (g `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) + & Apt.installed ["bsd-mailx"] -- prevent port forwarding etc by not letting scroll log in via ssh & Ssh.sshdConfig `File.containsLine` ("DenyUsers scroll") `onChange` Ssh.restarted -- cgit v1.2.3 From 677ce2d28f256bcd08964739c5e26990523d173a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 16:46:52 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index e575e79a..b3ff58ba 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -44,6 +44,7 @@ scrollBox = propertyList "scroll server" $ props , "cd " ++ d , "mkdir -p tmp" , "TMPDIR= t=$(tempfile -d tmp)" + , "export t" , "rm -f \"$t\"" , "mkdir \"$t\"" , "cd \"$t\"" @@ -59,7 +60,7 @@ scrollBox = propertyList "scroll server" $ props , "echo Your game was recorded, as ID:$(basename \"$t\")" , "echo if you would like to talk about how it went, email scroll@joeyh.name" , "echo 'or, type comments below (finish with a dot on its own line)'" - , "mail joey@kitenet.net" + , "mail -s \"scroll test $t\" joey@kitenet.net" ] `onChange` (g `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) & Apt.installed ["bsd-mailx"] -- prevent port forwarding etc by not letting scroll log in via ssh -- cgit v1.2.3 From 798787078291746666d4f3069b96ae9788a911d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 16:59:33 -0400 Subject: seems that setting postfix/destinations to " " makes debconf put in a default config, not appropriate for a client relay. Set to localhost instead. --- src/Propellor/Property/Postfix.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs index 0abd783e..8557f083 100644 --- a/src/Propellor/Property/Postfix.hs +++ b/src/Propellor/Property/Postfix.hs @@ -38,7 +38,7 @@ satellite = check (not <$> mainCfIsSet "relayhost") setup [ Apt.reConfigure "postfix" [ ("postfix/main_mailer_type", "select", "Satellite system") , ("postfix/root_address", "string", "root") - , ("postfix/destinations", "string", " ") + , ("postfix/destinations", "string", "localhost") , ("postfix/mailname", "string", hn) ] , mainCf ("relayhost", domain) -- cgit v1.2.3 From 4cf549414b0dc32d10c1f597721276d43bb8eae7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 17:06:47 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index b3ff58ba..4f08a2f5 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -52,7 +52,7 @@ scrollBox = propertyList "scroll server" $ props ] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) & g `File.hasContent` [ "#!/bin/sh" - , "if ../../scroll/scroll; then" + , "if ! ../../scroll/scroll; then" , "echo Scroll seems to have ended unexpectedly. Possibly a bug.." , "else" , "echo Thanks for playing scroll! https://joeyh.name/code/scroll/" -- cgit v1.2.3 From 16c9717a8d35f4ab6d339cf52bbf7955d86364db Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 17:13:37 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 4f08a2f5..5828b81d 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -60,6 +60,8 @@ scrollBox = propertyList "scroll server" $ props , "echo Your game was recorded, as ID:$(basename \"$t\")" , "echo if you would like to talk about how it went, email scroll@joeyh.name" , "echo 'or, type comments below (finish with a dot on its own line)'" + , "echo" + , "echo Your comments:" , "mail -s \"scroll test $t\" joey@kitenet.net" ] `onChange` (g `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) & Apt.installed ["bsd-mailx"] -- cgit v1.2.3 From d51863e6981094ca095dd20fa2413a78e748d8d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 17:15:01 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 5828b81d..217e8b8d 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -52,6 +52,8 @@ scrollBox = propertyList "scroll server" $ props ] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) & g `File.hasContent` [ "#!/bin/sh" + , "echo Press Enter to start the game." + , "read me" , "if ! ../../scroll/scroll; then" , "echo Scroll seems to have ended unexpectedly. Possibly a bug.." , "else" -- cgit v1.2.3 From 93e750fc83d0577351b7a240499686dd98b44dbb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 19:41:35 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 217e8b8d..1e0268b0 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -48,12 +48,13 @@ scrollBox = propertyList "scroll server" $ props , "rm -f \"$t\"" , "mkdir \"$t\"" , "cd \"$t\"" + , "echo" + , "echo Press Enter to start the game." + , "read me" , "SHELL=/bin/sh script --timing=timing -c " ++ g ] `onChange` (s `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) & g `File.hasContent` [ "#!/bin/sh" - , "echo Press Enter to start the game." - , "read me" , "if ! ../../scroll/scroll; then" , "echo Scroll seems to have ended unexpectedly. Possibly a bug.." , "else" -- cgit v1.2.3 From 370aad7825f15ed661419875d43320dc1c8f719d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 12 Mar 2015 19:53:40 -0400 Subject: propellor spin --- config-joey.hs | 1 + debian/changelog | 1 + src/Propellor/Shim.hs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/config-joey.hs b/config-joey.hs index c852826e..723686d6 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -360,6 +360,7 @@ jerryPlay = standardContainer "jerryplay" Unstable "amd64" kiteShellBox :: Docker.Container kiteShellBox = standardStableContainer "kiteshellbox" & JoeySites.kiteShellBox + & Docker.publish "4242:4242" type Motd = [String] diff --git a/debian/changelog b/debian/changelog index 363109ba..7619a1a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ propellor (2.2.1) UNRELEASED; urgency=medium * userScriptProperty now passes --shell /bin/sh, so it can be used even for users with nonstandard shells. + * Fix bug in docker propellor shim setup introduced in last release. -- Joey Hess Wed, 11 Mar 2015 22:29:23 -0400 diff --git a/src/Propellor/Shim.hs b/src/Propellor/Shim.hs index e1ea2825..5fc1ea05 100644 --- a/src/Propellor/Shim.hs +++ b/src/Propellor/Shim.hs @@ -34,7 +34,7 @@ setup propellorbin propellorbinpath dest = checkAlreadyShimmed propellorbin $ do fromMaybe (error "cannot find ld-linux linker") $ headMaybe $ filter ("ld-linux" `isInfixOf`) libs' let linkersym = takeDirectory linker takeFileName propellorbin - createSymbolicLink linkersym (takeFileName linker) + createSymbolicLink (takeFileName linker) linkersym let gconvdir = (dest ++) $ takeDirectory $ fromMaybe (error "cannot find gconv directory") $ -- cgit v1.2.3