From 16c109f8d4f812e88b67af70c8c7eae6900ab190 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Feb 2018 17:47:58 -0400 Subject: clean up after merge --- config.hs | 2 +- privdata/relocate | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index 97d90636..ec313725 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -joeyconfig.hs \ No newline at end of file +config-simple.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate deleted file mode 100644 index 271692d8..00000000 --- a/privdata/relocate +++ /dev/null @@ -1 +0,0 @@ -.joeyconfig -- cgit v1.3-2-g0d8e From 605b301429c36a3a9ff9f921f69196c429e70224 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 11 Feb 2018 17:49:18 -0400 Subject: add missing period --- src/Propellor/Property/Atomic.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Propellor/Property/Atomic.hs b/src/Propellor/Property/Atomic.hs index 5db17474..8519048b 100644 --- a/src/Propellor/Property/Atomic.hs +++ b/src/Propellor/Property/Atomic.hs @@ -144,7 +144,7 @@ checkDirLink d rp = liftIO $ do -- Using atomicDirSync in the above example lets git only download -- the changes once, rather than the same changes being downloaded a second -- time to update the other copy of the directory the next time propellor --- runs +-- runs. -- -- Suppose that a web server program is run from the git repository, -- and needs to be restarted after the pull. That restart should be done -- cgit v1.3-2-g0d8e From c5785263996a88dbceee664805714ed5ed16c302 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 16 Feb 2018 18:16:21 -0700 Subject: Systemd.machined should install systemd-container on Debian stretch Signed-off-by: Sean Whitton --- src/Propellor/Property/Systemd.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs index 51d1313c..8fa236d2 100644 --- a/src/Propellor/Property/Systemd.hs +++ b/src/Propellor/Property/Systemd.hs @@ -205,8 +205,8 @@ machined = withOS "machined installed" $ \w o -> case o of -- Split into separate debian package since systemd 225. (Just (System (Debian _ suite) _)) - | not (isStable suite) -> ensureProperty w $ - Apt.installed ["systemd-container"] + | not (isStable suite) || suite == (Stable "stretch") -> + ensureProperty w $ Apt.installed ["systemd-container"] _ -> noChange -- | Defines a container with a given machine name, -- cgit v1.3-2-g0d8e From fa77a253f2034f6185cf36b5407bc22a092e6ea5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 17 Feb 2018 13:54:02 -0400 Subject: changelog --- debian/changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index d613401b..22d5637d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,9 @@ propellor (5.3.2) UNRELEASED; urgency=medium (Inspired by Vaibhav Sagar's talk on Functional Devops in a Dysfunctional World at LCA 2018.) * Added Git.pulled. + * Systemd.machined: Install systemd-container on Debian + stretch. + Thanks, Sean Whitton -- Joey Hess Sun, 11 Feb 2018 11:58:04 -0400 -- cgit v1.3-2-g0d8e From b0599c446cbcc5eb5f46687699115ea27b62ef3e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 18 Feb 2018 14:31:47 -0400 Subject: releasing package propellor version 5.3.2 --- debian/changelog | 4 ++-- propellor.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 22d5637d..3515497b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -propellor (5.3.2) UNRELEASED; urgency=medium +propellor (5.3.2) unstable; urgency=medium * Added Propellor.Property.Atomic, which can make a non-atomic property that operates on a directory into an atomic property. @@ -9,7 +9,7 @@ propellor (5.3.2) UNRELEASED; urgency=medium stretch. Thanks, Sean Whitton - -- Joey Hess Sun, 11 Feb 2018 11:58:04 -0400 + -- Joey Hess Sun, 18 Feb 2018 14:31:39 -0400 propellor (5.3.1) unstable; urgency=medium diff --git a/propellor.cabal b/propellor.cabal index 48d34b47..d9157eb1 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,5 +1,5 @@ Name: propellor -Version: 5.3.1 +Version: 5.3.2 Cabal-Version: >= 1.20 License: BSD2 Maintainer: Joey Hess -- cgit v1.3-2-g0d8e From 5dd318843db607ca5b77bdc01b5d5f164180a92c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 18 Feb 2018 14:32:04 -0400 Subject: add news item for propellor 5.3.2 --- doc/news/version_5.3.2.mdwn | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/news/version_5.3.2.mdwn diff --git a/doc/news/version_5.3.2.mdwn b/doc/news/version_5.3.2.mdwn new file mode 100644 index 00000000..cd16116e --- /dev/null +++ b/doc/news/version_5.3.2.mdwn @@ -0,0 +1,10 @@ +propellor 5.3.2 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Added Propellor.Property.Atomic, which can make a non-atomic property + that operates on a directory into an atomic property. + (Inspired by Vaibhav Sagar's talk on Functional Devops in a + Dysfunctional World at LCA 2018.) + * Added Git.pulled. + * Systemd.machined: Install systemd-container on Debian + stretch. + Thanks, Sean Whitton"""]] \ No newline at end of file -- cgit v1.3-2-g0d8e From d2f4c2537cd2efa43f1718242b6d9ff4091955aa Mon Sep 17 00:00:00 2001 From: picca Date: Sun, 18 Feb 2018 19:10:32 +0000 Subject: Added a comment --- ...ment_9_f6d40ae7c03a9d94cfe8e16f11264622._comment | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_9_f6d40ae7c03a9d94cfe8e16f11264622._comment diff --git a/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_9_f6d40ae7c03a9d94cfe8e16f11264622._comment b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_9_f6d40ae7c03a9d94cfe8e16f11264622._comment new file mode 100644 index 00000000..492f40e1 --- /dev/null +++ b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_9_f6d40ae7c03a9d94cfe8e16f11264622._comment @@ -0,0 +1,21 @@ +[[!comment format=mdwn + username="picca" + avatar="http://cdn.libravatar.org/avatar/7e61c80d28018b10d31f6db7dddb864c" + subject="comment 9" + date="2018-02-18T19:10:32Z" + content=""" +Hello, I think that my problem is related to this one. + +I have a repository created from the Debian package and which is from the 5.1.0 version. +I just upgrade the package to 5.3.1 and now I do not have the message explaining that a new upstream version is available. +So I do not know how to upgrade my current repository. + +Before, I just had to do + + git merge upstream/master + +And now ? + + +thanks for your help +"""]] -- cgit v1.3-2-g0d8e From 586d6cdafaa157188a506f64d852d3164e564ec7 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 18 Feb 2018 21:35:23 +0000 Subject: Added a comment --- .../comment_10_8d27d1de5e891160c3e881bd1230829f._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_10_8d27d1de5e891160c3e881bd1230829f._comment diff --git a/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_10_8d27d1de5e891160c3e881bd1230829f._comment b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_10_8d27d1de5e891160c3e881bd1230829f._comment new file mode 100644 index 00000000..25d6ff1e --- /dev/null +++ b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_10_8d27d1de5e891160c3e881bd1230829f._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="spwhitton" + avatar="http://cdn.libravatar.org/avatar/9c3f08f80e67733fd506c353239569eb" + subject="comment 10" + date="2018-02-18T21:35:23Z" + content=""" +Do you have a git remote named 'upstream'? +"""]] -- cgit v1.3-2-g0d8e From b75b5a4d8cd9afae8eba675b8a025076c2c552d0 Mon Sep 17 00:00:00 2001 From: picca Date: Mon, 19 Feb 2018 06:31:32 +0000 Subject: Added a comment --- ...comment_11_67fe9f07dd726f890cf1c7956cbb1d86._comment | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_11_67fe9f07dd726f890cf1c7956cbb1d86._comment diff --git a/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_11_67fe9f07dd726f890cf1c7956cbb1d86._comment b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_11_67fe9f07dd726f890cf1c7956cbb1d86._comment new file mode 100644 index 00000000..106d993f --- /dev/null +++ b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_11_67fe9f07dd726f890cf1c7956cbb1d86._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="picca" + avatar="http://cdn.libravatar.org/avatar/7e61c80d28018b10d31f6db7dddb864c" + subject="comment 11" + date="2018-02-19T06:31:32Z" + content=""" +Yes sir :) + + picca@mordor:~/.propellor$ git remote -v + deploy https://salsa.debian.org/picca/propellor.git (fetch) + deploy https://salsa.debian.org/picca/propellor.git (push) + origin git@salsa.debian.org:picca/propellor.git (fetch) + origin git@salsa.debian.org:picca/propellor.git (push) + upstream /usr/src/propellor/propellor.git (fetch) + upstream /usr/src/propellor/propellor.git (push) + +"""]] -- cgit v1.3-2-g0d8e From 98dad1f10e92424871f7356469f42481b40256a6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Feb 2018 11:55:44 -0400 Subject: comment typo --- src/Propellor/DotDir.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index f62b38f8..17eb095a 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -389,7 +389,7 @@ checkRepoUpToDate = whenM (gitbundleavail <&&> dotpropellorpopulated) $ do -- -- If there's no upstream/master, the user is not using the distrepo, -- so do nothing. And, if there's a remote named "upstream", the user --- must have set that up is not using the distrepo, so do nothing. +-- must have set that up and is not using the distrepo, so do nothing. updateUpstreamMaster :: String -> IO () updateUpstreamMaster newref = unlessM (hasRemote "upstream") $ do changeWorkingDirectory =<< dotPropellor -- cgit v1.3-2-g0d8e From 6f18e665ca8d960a77e437d8edec8f3d14169585 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Feb 2018 12:46:16 -0400 Subject: Warn again about new upstream version when ~/.propellor was cloned from the Debian git bundle using an older version of propellor that set up an upstream remote. This commit was sponsored by Jake Vosloo on Patreon. --- debian/changelog | 8 ++++ ...nt_12_aea497eeecb077659db3f1dfb1e5f289._comment | 20 ++++++++++ src/Propellor/DotDir.hs | 45 +++++++++++++++++----- src/Propellor/Git.hs | 4 ++ 4 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_12_aea497eeecb077659db3f1dfb1e5f289._comment diff --git a/debian/changelog b/debian/changelog index 3515497b..55ca5a93 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +propellor (5.3.3) UNRELEASED; urgency=medium + + * Warn again about new upstream version when ~/.propellor was cloned from the + Debian git bundle using an older version of propellor that set up an + upstream remote. + + -- Joey Hess Mon, 19 Feb 2018 12:44:24 -0400 + propellor (5.3.2) unstable; urgency=medium * Added Propellor.Property.Atomic, which can make a non-atomic property diff --git a/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_12_aea497eeecb077659db3f1dfb1e5f289._comment b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_12_aea497eeecb077659db3f1dfb1e5f289._comment new file mode 100644 index 00000000..90d0ba2c --- /dev/null +++ b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_12_aea497eeecb077659db3f1dfb1e5f289._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 12""" + date="2018-02-19T15:48:21Z" + content=""" +What propellor --init sets up, when you select the clone option +and the Debian package is installed, is no remote +defined, but a remotes/upsteam/master tracking branch. + +So not normally this: + + upstream /usr/src/propellor/propellor.git (fetch) + +Aha! The very first revision of propellor --init +*did* set up an upstream remote pointing at the distrepo. At some point +that changed to the above described behavior. You're bitten by being an +early adopter. + +I've adjusted the logic to handle that case. +"""]] diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index 17eb095a..39c111f6 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -387,16 +387,17 @@ checkRepoUpToDate = whenM (gitbundleavail <&&> dotpropellorpopulated) $ do -- into the user's repository, as if fetching from a upstream remote, -- yielding a new upstream/master branch. -- --- If there's no upstream/master, the user is not using the distrepo, --- so do nothing. And, if there's a remote named "upstream", the user --- must have set that up and is not using the distrepo, so do nothing. +-- If there's no upstream/master, or the repo is not using the distrepo, +-- do nothing. updateUpstreamMaster :: String -> IO () -updateUpstreamMaster newref = unlessM (hasRemote "upstream") $ do +updateUpstreamMaster newref = do changeWorkingDirectory =<< dotPropellor - go =<< catchMaybeIO getoldrev + v <- getoldrev + case v of + Nothing -> return () + Just oldref -> go oldref where - go Nothing = return () - go (Just oldref) = do + go oldref = do let tmprepo = ".git/propellordisttmp" let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo cleantmprepo @@ -421,13 +422,37 @@ updateUpstreamMaster newref = unlessM (hasRemote "upstream") $ do cleantmprepo warnoutofdate True - getoldrev = takeWhile (/= '\n') - <$> readProcess "git" ["show-ref", upstreambranch, "--hash"] - git = run "git" run cmd ps = unlessM (boolSystem cmd (map Param ps)) $ error $ "Failed to run " ++ cmd ++ " " ++ show ps + -- Get ref that the upstreambranch points to, only when + -- the distrepo is being used. + getoldrev = do + mrev <- catchMaybeIO $ takeWhile (/= '\n') + <$> readProcess "git" ["show-ref", upstreambranch, "--hash"] + print mrev + case mrev of + Just _ -> do + -- Normally there will be no upstream + -- remote when the distrepo is used. + -- Older versions of propellor set up + -- an upstream remote pointing at the + -- distrepo. + ifM (hasRemote "upstream") + ( do + v <- remoteUrl "upstream" + print ("remote url", v) + return $ case v of + Just rurl | rurl == distrepo -> mrev + _ -> Nothing + , return mrev + ) + Nothing -> return mrev + +-- And, if there's a remote named "upstream" +-- that does not point at the distrepo, the user must have set that up +-- and is not using the distrepo, so do nothing. warnoutofdate :: Bool -> IO () warnoutofdate havebranch = do warningMessage ("** Your ~/.propellor/ is out of date..") diff --git a/src/Propellor/Git.hs b/src/Propellor/Git.hs index 10b88ddd..c446f67a 100644 --- a/src/Propellor/Git.hs +++ b/src/Propellor/Git.hs @@ -30,6 +30,10 @@ hasRemote remotename = catchDefaultIO False $ do rs <- lines <$> readProcess "git" ["remote"] return $ remotename `elem` rs +remoteUrl :: String -> IO (Maybe String) +remoteUrl remotename = catchDefaultIO Nothing $ headMaybe . lines + <$> readProcess "git" ["config", "remote." ++ remotename ++ ".url"] + hasGitRepo :: IO Bool hasGitRepo = doesFileExist ".git/HEAD" -- cgit v1.3-2-g0d8e From 335b5fba4f86929836c9eb59baa8fbd0d311dcf8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Feb 2018 12:49:03 -0400 Subject: output warning message atomically Before part went to stderr and part to stdout, and the two parts could be reordered in some cases, particularly when concurrent output caused them to be buffered. This commit was sponsored by Trenton Cronholm on Patreon. --- src/Propellor/DotDir.hs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index 39c111f6..be5d614d 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -454,11 +454,12 @@ updateUpstreamMaster newref = do -- that does not point at the distrepo, the user must have set that up -- and is not using the distrepo, so do nothing. warnoutofdate :: Bool -> IO () -warnoutofdate havebranch = do - warningMessage ("** Your ~/.propellor/ is out of date..") - let also s = infoMessage [" " ++ s] - also ("A newer upstream version is available in " ++ distrepo) - if havebranch - then also ("To merge it, run: git merge " ++ upstreambranch) - else also ("To merge it, find the most recent commit in your repository's history that corresponds to an upstream release of propellor, and set refs/remotes/" ++ upstreambranch ++ " to it. Then run propellor again.") - also "" +warnoutofdate havebranch = warningMessage $ unlines + [ "** Your ~/.propellor/ is out of date.." + , indent "A newer upstream version is available in " ++ distrepo + , indent $ if havebranch + then "To merge it, run: git merge " ++ upstreambranch + else "To merge it, find the most recent commit in your repository's history that corresponds to an upstream release of propellor, and set refs/remotes/" ++ upstreambranch ++ " to it. Then run propellor again." + ] + where + indent s = " " ++ s -- cgit v1.3-2-g0d8e From 9d167ac2e64fc3f791ac2695e7a65a70446c80ea Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Feb 2018 12:55:20 -0400 Subject: cleanup debug --- src/Propellor/DotDir.hs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index be5d614d..125cec3f 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -392,12 +392,10 @@ checkRepoUpToDate = whenM (gitbundleavail <&&> dotpropellorpopulated) $ do updateUpstreamMaster :: String -> IO () updateUpstreamMaster newref = do changeWorkingDirectory =<< dotPropellor - v <- getoldrev - case v of - Nothing -> return () - Just oldref -> go oldref + go =<< getoldref where - go oldref = do + go Nothing = return () + go (Just oldref) = do let tmprepo = ".git/propellordisttmp" let cleantmprepo = void $ catchMaybeIO $ removeDirectoryRecursive tmprepo cleantmprepo @@ -428,11 +426,10 @@ updateUpstreamMaster newref = do -- Get ref that the upstreambranch points to, only when -- the distrepo is being used. - getoldrev = do - mrev <- catchMaybeIO $ takeWhile (/= '\n') + getoldref = do + mref <- catchMaybeIO $ takeWhile (/= '\n') <$> readProcess "git" ["show-ref", upstreambranch, "--hash"] - print mrev - case mrev of + case mref of Just _ -> do -- Normally there will be no upstream -- remote when the distrepo is used. @@ -442,13 +439,12 @@ updateUpstreamMaster newref = do ifM (hasRemote "upstream") ( do v <- remoteUrl "upstream" - print ("remote url", v) return $ case v of - Just rurl | rurl == distrepo -> mrev + Just rurl | rurl == distrepo -> mref _ -> Nothing - , return mrev + , return mref ) - Nothing -> return mrev + Nothing -> return mref -- And, if there's a remote named "upstream" -- that does not point at the distrepo, the user must have set that up -- cgit v1.3-2-g0d8e From 0113a313851c31d98ee20884f8bbd3f4f3ca71c5 Mon Sep 17 00:00:00 2001 From: picca Date: Tue, 20 Feb 2018 05:58:48 +0000 Subject: Added a comment --- .../comment_13_a3039c7e86f85af4ff44bdbcd7b46313._comment | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_13_a3039c7e86f85af4ff44bdbcd7b46313._comment diff --git a/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_13_a3039c7e86f85af4ff44bdbcd7b46313._comment b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_13_a3039c7e86f85af4ff44bdbcd7b46313._comment new file mode 100644 index 00000000..39feff2e --- /dev/null +++ b/doc/forum/__42____42___warning:___42____42___Your___126____47__.propellor__47___is_out_of_date../comment_13_a3039c7e86f85af4ff44bdbcd7b46313._comment @@ -0,0 +1,12 @@ +[[!comment format=mdwn + username="picca" + avatar="http://cdn.libravatar.org/avatar/7e61c80d28018b10d31f6db7dddb864c" + subject="comment 13" + date="2018-02-20T05:58:48Z" + content=""" +Thanks a lot joey, + +and you are right, I am fund of your works :). + +Cheers. +"""]] -- cgit v1.3-2-g0d8e From 8a3310d5420024454b54ff019afcaaa40a9803f7 Mon Sep 17 00:00:00 2001 From: gueux Date: Wed, 21 Feb 2018 09:39:16 +0000 Subject: --- ...ries_to_pull_from_central_repository__63__.mdwn | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 doc/forum/--spin_tries_to_pull_from_central_repository__63__.mdwn diff --git a/doc/forum/--spin_tries_to_pull_from_central_repository__63__.mdwn b/doc/forum/--spin_tries_to_pull_from_central_repository__63__.mdwn new file mode 100644 index 00000000..5bd97367 --- /dev/null +++ b/doc/forum/--spin_tries_to_pull_from_central_repository__63__.mdwn @@ -0,0 +1,28 @@ +Did something changed recently concerning `--spin`? It seems like I can't use it without a central repo anymore... + + + $ ./propellor --spin server + Preprocessing executable 'propellor-config' for propellor-5.3.2... + Propellor build ... done + [master cabbc1b4e] propellor spin + Git commit ... done + Counting objects: 1, done. + Writing objects: 100% (1/1), 860 bytes | 860.00 KiB/s, done. + Total 1 (delta 0), reused 0 (delta 0) + To example.org:/var/lib/git/private/propellor.git + 8c8c1b2f6..cabbc1b4e master -> master + Push to central git repository ... done + gpg: encrypted with 4096-bit RSA key, ID EC0B9FA927E29C5C, created 2013-01-29 + "Félix Sipma " + Host key verification failed. + fatal: Could not read from remote repository. + + Please make sure you have the correct access rights + and the repository exists. + Pull from central git repository ... failed + fatal: ambiguous argument 'origin/master': unknown revision or path not in the working tree. + Use '--' to separate paths from revisions, like this: + 'git [...] -- [...]' + propellor: user error (git ["log","-n","1","--format=%G?","origin/master"] exited 128) + propellor: user error (ssh ["-o","ControlPath=/home/example/.ssh/propellor/server.example.org.sock","-o","ControlMaster=auto","-o","ControlPersist=yes","root@server.example.org","sh -c 'rm -rf /usr/local/propellor-precompiled ; if [ ! -d /usr/local/propellor/.git ] ; then (if ! git --version >/dev/null 2>&1; then apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq --no-install-recommends --no-upgrade -y install git; fi && echo STATUSNeedGitClone) || echo STATUSNeedPrecompiled ; else cd /usr/local/propellor && if ! cabal configure >/dev/null 2>&1; then ( apt-get update ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install gnupg ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install ghc ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install cabal-install ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-async-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-split-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-hslogger-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-unix-compat-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-ansi-terminal-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-ifelse-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-network-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-mtl-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-transformers-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-exceptions-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-stm-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-text-dev ; DEBIAN_FRONTEND=noninteractive apt-get -qq --no-upgrade --no-install-recommends -y install libghc-hashable-dev) || true; fi&& if ! test -x ./propellor; then cabal configure && cabal build -j1 propellor-config && ln -sf dist/build/propellor-config/propellor-config propellor; fi;if test -x ./propellor && ! ./propellor --check; then cabal clean && cabal configure && cabal build -j1 propellor-config && ln -sf dist/build/propellor-config/propellor-config propellor; fi && ./propellor --boot server.example.org ; fi'"] exited 1) + -- cgit v1.3-2-g0d8e From 530d9ff6bea5570d051d07546a128d456b3c5c3b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 22 Feb 2018 11:41:57 -0400 Subject: Avoid crashing if initial fetch from origin fails when spinning a host. --- debian/changelog | 1 + .../comment_1_be4533d304096f431ac8d35bbf990dab._comment | 13 +++++++++++++ src/Propellor/Git/VerifiedBranch.hs | 11 ++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_1_be4533d304096f431ac8d35bbf990dab._comment diff --git a/debian/changelog b/debian/changelog index 55ca5a93..bc7a4a69 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ propellor (5.3.3) UNRELEASED; urgency=medium * Warn again about new upstream version when ~/.propellor was cloned from the Debian git bundle using an older version of propellor that set up an upstream remote. + * Avoid crashing if initial fetch from origin fails when spinning a host. -- Joey Hess Mon, 19 Feb 2018 12:44:24 -0400 diff --git a/doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_1_be4533d304096f431ac8d35bbf990dab._comment b/doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_1_be4533d304096f431ac8d35bbf990dab._comment new file mode 100644 index 00000000..e79fabfb --- /dev/null +++ b/doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_1_be4533d304096f431ac8d35bbf990dab._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2018-02-22T15:34:07Z" + content=""" +--spin has always pushed/pulled from origin, if there is +a central git repository. + +It's an optional thing though, since the update is pushed directly to the +host it spins too. + +I've improved the code to avoid this particular crash.. +"""]] diff --git a/src/Propellor/Git/VerifiedBranch.hs b/src/Propellor/Git/VerifiedBranch.hs index 51fcb573..df607bd2 100644 --- a/src/Propellor/Git/VerifiedBranch.hs +++ b/src/Propellor/Git/VerifiedBranch.hs @@ -30,12 +30,17 @@ verifyOriginBranch originbranch = do -- Returns True if HEAD is changed by fetching and merging from origin. fetchOrigin :: IO Bool fetchOrigin = do + fetched <- actionMessage "Pull from central git repository" $ + boolSystem "git" [Param "fetch"] + if fetched + then mergeOrigin + else return False + +mergeOrigin :: IO Bool +mergeOrigin = do branchref <- getCurrentBranch let originbranch = "origin" branchref - void $ actionMessage "Pull from central git repository" $ - boolSystem "git" [Param "fetch"] - oldsha <- getCurrentGitSha1 branchref keyring <- privDataKeyring -- cgit v1.3-2-g0d8e From 6749014553b13ad148cde450baefb241a98ed771 Mon Sep 17 00:00:00 2001 From: Félix Sipma Date: Fri, 23 Feb 2018 14:11:15 +0100 Subject: add Propellor.Property.Dhparams --- propellor.cabal | 1 + src/Propellor/Property/Dhparams.hs | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/Propellor/Property/Dhparams.hs diff --git a/propellor.cabal b/propellor.cabal index d9157eb1..b2ecb3d8 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -103,6 +103,7 @@ Library Propellor.Property.Cron Propellor.Property.DebianMirror Propellor.Property.Debootstrap + Propellor.Property.Dhparams Propellor.Property.DiskImage Propellor.Property.DiskImage.PartSpec Propellor.Property.Dns diff --git a/src/Propellor/Property/Dhparams.hs b/src/Propellor/Property/Dhparams.hs new file mode 100644 index 00000000..2c30cb87 --- /dev/null +++ b/src/Propellor/Property/Dhparams.hs @@ -0,0 +1,26 @@ +-- | Maintainer: Félix Sipma + +module Propellor.Property.Dhparams where + +import Propellor.Base +import qualified Propellor.Property.Apt as Apt +import qualified Propellor.Property.File as File +import Utility.FileMode +import Utility.SafeCommand + + +length' :: Int +length' = 2048 + +file :: FilePath +file = "/etc/ssl/private/dhparams.pem" + +safeDhparams :: Property DebianLike +safeDhparams = propertyList "safe dhparams" $ props + & File.dirExists (takeDirectory file) + & Apt.installed ["openssl"] + & check (not <$> doesFileExist file) (createDhparams file length') + +createDhparams :: FilePath -> Int -> Property UnixLike +createDhparams f l = property ("generate new dhparams: " ++ f) $ liftIO $ withUmask 0o0177 $ withFile f WriteMode $ \h -> + cmdResult <$> boolSystem' "openssl" [Param "dhparam", Param (show l)] (\p -> p { std_out = UseHandle h }) -- cgit v1.3-2-g0d8e From bda831a29fe7769a7ae0429e8059e28123f12c0a Mon Sep 17 00:00:00 2001 From: gueux Date: Fri, 23 Feb 2018 13:16:09 +0000 Subject: Added a comment --- .../comment_2_7b1f28e3eeb7f181f5715863bc836bb7._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_2_7b1f28e3eeb7f181f5715863bc836bb7._comment diff --git a/doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_2_7b1f28e3eeb7f181f5715863bc836bb7._comment b/doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_2_7b1f28e3eeb7f181f5715863bc836bb7._comment new file mode 100644 index 00000000..5cb2fc0b --- /dev/null +++ b/doc/forum/--spin_tries_to_pull_from_central_repository__63__/comment_2_7b1f28e3eeb7f181f5715863bc836bb7._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="gueux" + avatar="http://cdn.libravatar.org/avatar/2982bac2c2cd94ab3860efb189deafc8" + subject="comment 2" + date="2018-02-23T13:16:09Z" + content=""" +I don't want my central repo to be accessible to anyone, but I still want to push there and use it for some of my hosts. Anyway, your fix works great, thanks! +"""]] -- cgit v1.3-2-g0d8e From fad7824a13580f505549cc746589c94542bec9cb Mon Sep 17 00:00:00 2001 From: Félix Sipma Date: Fri, 23 Feb 2018 16:33:00 +0100 Subject: rename Dhparams to Openssl --- propellor.cabal | 2 +- src/Propellor/Property/Dhparams.hs | 26 -------------------------- src/Propellor/Property/Openssl.hs | 26 ++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 src/Propellor/Property/Dhparams.hs create mode 100644 src/Propellor/Property/Openssl.hs diff --git a/propellor.cabal b/propellor.cabal index b2ecb3d8..b22abcba 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -103,7 +103,6 @@ Library Propellor.Property.Cron Propellor.Property.DebianMirror Propellor.Property.Debootstrap - Propellor.Property.Dhparams Propellor.Property.DiskImage Propellor.Property.DiskImage.PartSpec Propellor.Property.Dns @@ -141,6 +140,7 @@ Library Propellor.Property.Nginx Propellor.Property.Obnam Propellor.Property.OpenId + Propellor.Property.Openssl Propellor.Property.OS Propellor.Property.Pacman Propellor.Property.Parted diff --git a/src/Propellor/Property/Dhparams.hs b/src/Propellor/Property/Dhparams.hs deleted file mode 100644 index 2c30cb87..00000000 --- a/src/Propellor/Property/Dhparams.hs +++ /dev/null @@ -1,26 +0,0 @@ --- | Maintainer: Félix Sipma - -module Propellor.Property.Dhparams where - -import Propellor.Base -import qualified Propellor.Property.Apt as Apt -import qualified Propellor.Property.File as File -import Utility.FileMode -import Utility.SafeCommand - - -length' :: Int -length' = 2048 - -file :: FilePath -file = "/etc/ssl/private/dhparams.pem" - -safeDhparams :: Property DebianLike -safeDhparams = propertyList "safe dhparams" $ props - & File.dirExists (takeDirectory file) - & Apt.installed ["openssl"] - & check (not <$> doesFileExist file) (createDhparams file length') - -createDhparams :: FilePath -> Int -> Property UnixLike -createDhparams f l = property ("generate new dhparams: " ++ f) $ liftIO $ withUmask 0o0177 $ withFile f WriteMode $ \h -> - cmdResult <$> boolSystem' "openssl" [Param "dhparam", Param (show l)] (\p -> p { std_out = UseHandle h }) diff --git a/src/Propellor/Property/Openssl.hs b/src/Propellor/Property/Openssl.hs new file mode 100644 index 00000000..eb373e49 --- /dev/null +++ b/src/Propellor/Property/Openssl.hs @@ -0,0 +1,26 @@ +-- | Maintainer: Félix Sipma + +module Propellor.Property.Openssl where + +import Propellor.Base +import qualified Propellor.Property.Apt as Apt +import qualified Propellor.Property.File as File +import Utility.FileMode +import Utility.SafeCommand + + +dhparamsLength :: Int +dhparamsLength = 2048 + +dhparams :: FilePath +dhparams = "/etc/ssl/private/dhparams.pem" + +safeDhparams :: Property DebianLike +safeDhparams = propertyList "safe dhparams" $ props + & File.dirExists (takeDirectory file) + & Apt.installed ["openssl"] + & check (not <$> doesFileExist file) (createDhparams file length') + +createDhparams :: FilePath -> Int -> Property UnixLike +createDhparams f l = property ("generate new dhparams: " ++ f) $ liftIO $ withUmask 0o0177 $ withFile f WriteMode $ \h -> + cmdResult <$> boolSystem' "openssl" [Param "dhparam", Param (show l)] (\p -> p { std_out = UseHandle h }) -- cgit v1.3-2-g0d8e From 788ad7bcff61147dbdde484d8d56ff6aead82659 Mon Sep 17 00:00:00 2001 From: Félix Sipma Date: Fri, 23 Feb 2018 16:33:53 +0100 Subject: add installed property to Openssl --- src/Propellor/Property/Openssl.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Propellor/Property/Openssl.hs b/src/Propellor/Property/Openssl.hs index eb373e49..1967301c 100644 --- a/src/Propellor/Property/Openssl.hs +++ b/src/Propellor/Property/Openssl.hs @@ -9,6 +9,9 @@ import Utility.FileMode import Utility.SafeCommand +installed :: Property DebianLike +installed = Apt.installed ["openssl"] + dhparamsLength :: Int dhparamsLength = 2048 @@ -18,7 +21,7 @@ dhparams = "/etc/ssl/private/dhparams.pem" safeDhparams :: Property DebianLike safeDhparams = propertyList "safe dhparams" $ props & File.dirExists (takeDirectory file) - & Apt.installed ["openssl"] + & installed & check (not <$> doesFileExist file) (createDhparams file length') createDhparams :: FilePath -> Int -> Property UnixLike -- cgit v1.3-2-g0d8e From afb39c9e650826f4ef0855430040aefad67be92f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Feb 2018 14:08:27 -0400 Subject: Added Propllor.Property.Openssl module contributed by contributed by Félix Sipma. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index bc7a4a69..e1a63d61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ propellor (5.3.3) UNRELEASED; urgency=medium Debian git bundle using an older version of propellor that set up an upstream remote. * Avoid crashing if initial fetch from origin fails when spinning a host. + * Added Propllor.Property.Openssl module contributed by contributed by + Félix Sipma. -- Joey Hess Mon, 19 Feb 2018 12:44:24 -0400 -- cgit v1.3-2-g0d8e From c16bc5a806d0020f608a35185127430b65253981 Mon Sep 17 00:00:00 2001 From: Félix Sipma Date: Sat, 24 Feb 2018 21:31:03 +0100 Subject: Openssl: fix typo --- src/Propellor/Property/Openssl.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Propellor/Property/Openssl.hs b/src/Propellor/Property/Openssl.hs index 1967301c..a91b8195 100644 --- a/src/Propellor/Property/Openssl.hs +++ b/src/Propellor/Property/Openssl.hs @@ -20,9 +20,9 @@ dhparams = "/etc/ssl/private/dhparams.pem" safeDhparams :: Property DebianLike safeDhparams = propertyList "safe dhparams" $ props - & File.dirExists (takeDirectory file) + & File.dirExists (takeDirectory dhparams) & installed - & check (not <$> doesFileExist file) (createDhparams file length') + & check (not <$> doesFileExist dhparams) (createDhparams dhparams dhparamsLength) createDhparams :: FilePath -> Int -> Property UnixLike createDhparams f l = property ("generate new dhparams: " ++ f) $ liftIO $ withUmask 0o0177 $ withFile f WriteMode $ \h -> -- cgit v1.3-2-g0d8e From e9c69dab91165cda0311d05e5b6a49697fae6e05 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Feb 2018 14:34:45 -0400 Subject: releasing package propellor version 5.3.3 --- debian/changelog | 4 ++-- propellor.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index e1a63d61..b97b12b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -propellor (5.3.3) UNRELEASED; urgency=medium +propellor (5.3.3) unstable; urgency=medium * Warn again about new upstream version when ~/.propellor was cloned from the Debian git bundle using an older version of propellor that set up an @@ -7,7 +7,7 @@ propellor (5.3.3) UNRELEASED; urgency=medium * Added Propllor.Property.Openssl module contributed by contributed by Félix Sipma. - -- Joey Hess Mon, 19 Feb 2018 12:44:24 -0400 + -- Joey Hess Mon, 26 Feb 2018 14:34:37 -0400 propellor (5.3.2) unstable; urgency=medium diff --git a/propellor.cabal b/propellor.cabal index b22abcba..5f6abc8b 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,5 +1,5 @@ Name: propellor -Version: 5.3.2 +Version: 5.3.3 Cabal-Version: >= 1.20 License: BSD2 Maintainer: Joey Hess -- cgit v1.3-2-g0d8e From 094a6419f7e5ddb0566e10ef4122306187dc00d7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Feb 2018 14:35:03 -0400 Subject: add news item for propellor 5.3.3 --- doc/news/version_5.3.3.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/news/version_5.3.3.mdwn diff --git a/doc/news/version_5.3.3.mdwn b/doc/news/version_5.3.3.mdwn new file mode 100644 index 00000000..18f80d5f --- /dev/null +++ b/doc/news/version_5.3.3.mdwn @@ -0,0 +1,8 @@ +propellor 5.3.3 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Warn again about new upstream version when ~/.propellor was cloned from the + Debian git bundle using an older version of propellor that set up an + upstream remote. + * Avoid crashing if initial fetch from origin fails when spinning a host. + * Added Propllor.Property.Openssl module contributed by contributed by + Félix Sipma."""]] \ No newline at end of file -- cgit v1.3-2-g0d8e