-- cgit v1.2.3 From 4467982c2b135233b0eb8bf5ae217d6220310ef5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Apr 2014 16:48:20 -0400 Subject: propellor spin --- config-joey.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config-joey.hs b/config-joey.hs index 254e810a..698bb3c3 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -19,6 +19,7 @@ import qualified Propellor.Property.Docker as Docker import qualified Propellor.Property.Git as Git import qualified Propellor.Property.Apache as Apache import qualified Propellor.Property.Postfix as Postfix +import qualified Propellor.Property.Service as Service import qualified Propellor.Property.SiteSpecific.GitHome as GitHome import qualified Propellor.Property.SiteSpecific.GitAnnexBuilder as GitAnnexBuilder import qualified Propellor.Property.SiteSpecific.JoeySites as JoeySites @@ -73,6 +74,11 @@ hosts = -- (o) ` & Docker.garbageCollected `period` Daily & Apt.installed ["git-annex", "mtr", "screen"] + + -- Nothing is using https on clam, so listen on that port + -- for ssh, for traveling on bad networks. + & "/etc/ssh/sshd_config" `File.containsLine` "Port 443" + `onChange` Service.restarted "ssh" -- Orca is the main git-annex build box. , standardSystem "orca.kitenet.net" Unstable "amd64" -- cgit v1.2.3 From d6d52e1e40b8f11188f5009cc0c5c2f32555ddad Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Apr 2014 16:58:10 -0400 Subject: todo --- doc/todo/docker_todo_list.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/todo/docker_todo_list.mdwn b/doc/todo/docker_todo_list.mdwn index 65762cff..2f215a50 100644 --- a/doc/todo/docker_todo_list.mdwn +++ b/doc/todo/docker_todo_list.mdwn @@ -6,3 +6,6 @@ need ntp installed for a good date source. * Docking a container in a host should add to the host any cnames that are assigned to the container. +* It seems that provisionContainer sometimes hangs when the container + is already running. This seems likely to be a problem with the simpleSh + socket hack. -- cgit v1.2.3 -- cgit v1.2.3 From 820db65ff0dae8b40fb1dd24e1dba3f0e0e63cdf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Apr 2014 20:05:39 -0400 Subject: add debuggin for simplesh --- Propellor/SimpleSh.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Propellor/SimpleSh.hs b/Propellor/SimpleSh.hs index c088eda7..73ff41ae 100644 --- a/Propellor/SimpleSh.hs +++ b/Propellor/SimpleSh.hs @@ -70,13 +70,17 @@ simpleSh namedpipe = do simpleShClient :: FilePath -> String -> [String] -> ([Resp] -> IO a) -> IO a simpleShClient namedpipe cmd params handler = do + debug ["simplesh connecting"] s <- socket AF_UNIX Stream defaultProtocol connect s (SockAddrUnix namedpipe) h <- socketToHandle s ReadWriteMode hPutStrLn h $ show $ Cmd cmd params hFlush h + debug ["simplesh sent command"] resps <- catMaybes . map readish . lines <$> hGetContents h - hClose h `after` handler resps + v <- hClose h `after` handler resps + debug ["simplesh processed response"] + return v simpleShClientRetry :: Int -> FilePath -> String -> [String] -> ([Resp] -> IO a) -> IO a simpleShClientRetry retries namedpipe cmd params handler = go retries @@ -88,7 +92,8 @@ simpleShClientRetry retries namedpipe cmd params handler = go retries v <- tryIO run case v of Right r -> return r - Left _ -> do + Left e -> do + debug ["simplesh connection retry", show e] threadDelaySeconds (Seconds 1) go (n - 1) -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From af4055beff14ece34490736c67e1110fa84bbf0d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Apr 2014 20:55:12 -0400 Subject: propellor spin --- Propellor/Property/SiteSpecific/JoeySites.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Propellor/Property/SiteSpecific/JoeySites.hs b/Propellor/Property/SiteSpecific/JoeySites.hs index 06865c45..5b518d17 100644 --- a/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/Propellor/Property/SiteSpecific/JoeySites.hs @@ -15,6 +15,7 @@ import qualified Propellor.Property.User as User import qualified Propellor.Property.Obnam as Obnam import qualified Propellor.Property.Apache as Apache import Utility.SafeCommand +import Utility.FileMode import Data.List import System.Posix.Files @@ -183,10 +184,16 @@ annexWebSite :: [Host] -> Git.RepoUrl -> HostName -> AnnexUUID -> [(String, Git. annexWebSite hosts origin hn uuid remotes = propertyList (hn ++" website using git-annex") [ Git.cloned "joey" origin dir Nothing `onChange` setup + , postupdatehook `File.hasContent` + [ "!/bin/sh" + , "exec git update-server-info" + ] `onChange` + (postupdatehook `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) , setupapache ] where dir = "/srv/web/" ++ hn + postupdatehook = dir ".git/hooks/post-update" setup = userScriptProperty "joey" setupscript `requires` Ssh.keyImported SshRsa "joey" `requires` Ssh.knownHost hosts "turtle.kitenet.net" "joey" -- cgit v1.2.3 From cfb71c42f47f4ee27d0ed12ecbe3f2ba89b00613 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Apr 2014 20:56:24 -0400 Subject: propellor spin --- Propellor/Property/SiteSpecific/JoeySites.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Propellor/Property/SiteSpecific/JoeySites.hs b/Propellor/Property/SiteSpecific/JoeySites.hs index 5b518d17..bdc60a5b 100644 --- a/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/Propellor/Property/SiteSpecific/JoeySites.hs @@ -185,7 +185,7 @@ annexWebSite hosts origin hn uuid remotes = propertyList (hn ++" website using g [ Git.cloned "joey" origin dir Nothing `onChange` setup , postupdatehook `File.hasContent` - [ "!/bin/sh" + [ "#!/bin/sh" , "exec git update-server-info" ] `onChange` (postupdatehook `File.mode` (combineModes (ownerWriteMode:readModes ++ executeModes))) -- cgit v1.2.3 -- cgit v1.2.3 From 320e988fd133758427884dcdb38ff81061e4e5dd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Apr 2014 21:15:35 -0400 Subject: threw in a update-server-info after clone, to avoid a gotcha --- Propellor/Property/Git.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Propellor/Property/Git.hs b/Propellor/Property/Git.hs index ba370e51..e5df7e48 100644 --- a/Propellor/Property/Git.hs +++ b/Propellor/Property/Git.hs @@ -86,4 +86,8 @@ cloned owner url dir mbranch = check originurl (property desc checkout) [ Just $ "git clone " ++ shellEscape url ++ " " ++ shellEscape dir ++ " < /dev/null" , Just $ "cd " ++ shellEscape dir , ("git checkout " ++) <$> mbranch + -- In case this repo is exposted via the web, + -- although the hook to do this ongoing is not + -- installed here. + , Just "git update-server-info" ] -- cgit v1.2.3 From 2bc9a2a7379f80595f5b8f3dc5475f64d5537cfc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 1 May 2014 10:48:33 -0300 Subject: add module Mains for picky versions of ghc --- config-joey.hs | 1 + propellor.hs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/config-joey.hs b/config-joey.hs index 698bb3c3..a35f77bd 100644 --- a/config-joey.hs +++ b/config-joey.hs @@ -1,4 +1,5 @@ -- This is the live config file used by propellor's author. +module Main where import Propellor import Propellor.CmdLine diff --git a/propellor.hs b/propellor.hs index c7727751..2478450f 100644 --- a/propellor.hs +++ b/propellor.hs @@ -12,6 +12,8 @@ -- The source is either copied from /usr/src/propellor, or is cloned from -- git over the network. +module Main where + import Utility.UserInfo import Utility.Monad import Utility.Process -- cgit v1.2.3