From 4773631a3854869769d23a5a696766f51322a830 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Tue, 24 Nov 2015 15:29:21 +0000 Subject: apology --- ...request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn | 1 + 1 file changed, 1 insertion(+) (limited to 'doc') diff --git a/doc/todo/pull_request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn b/doc/todo/pull_request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn index 6bdd0b42..c1df5461 100644 --- a/doc/todo/pull_request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn +++ b/doc/todo/pull_request:_Git.repoConfigured_and_Git.repoAcceptsNonFFs_properties.mdwn @@ -10,3 +10,4 @@ This branch adds Note that `Git.repoConfigured` uses a tuple instead of just two function arguments in order that it can be used infix in `config.hs` when connected to other properties with `&`, as `ConfFile.containsIniSetting`. > [[done]], thank you (had to fix some indents) --[[Joey]] +>> Sorry about that! Thought I had Emacs set up for your style guide. --spwhitton -- cgit v1.2.3 From 41116ba118ab1335947530963ad252b1c4184770 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Tue, 24 Nov 2015 15:41:34 +0000 Subject: post propellor_lines script --- ...ig_files_for_inclusion_in_Propellor_config.mdwn | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn (limited to 'doc') diff --git a/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn b/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn new file mode 100644 index 00000000..d3c77a17 --- /dev/null +++ b/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn @@ -0,0 +1,39 @@ +This script turns + + Section "Monitor" + Identifier "Configured Monitor" + EndSection + +into this: + + [ "Section \"Monitor\"" + , "\tIdentifier \"Configured Monitor\"" + , "EndSection" + ] + +for the inclusion of short config files in your Propellor config using `File.hasContent`. + +[[!format haskell """ +#!/usr/bin/runhaskell + +main = interact $ unlines . propellorLines . lines + +propellorLines :: [String] -> [String] +propellorLines (x:xs) = ("[ " ++ wrapEscapeLine x) : propellorLines' xs + +propellorLines' :: [String] -> [String] +propellorLines' = foldr step ["]"] + where + step x xs = (", " ++ wrapEscapeLine x) : xs + +wrapEscapeLine :: String -> String +wrapEscapeLine line = "\"" ++ (foldr step "" line) ++ "\"" + where + step x xs + | x == '\t' = "\\t" ++ xs + | x == '\\' = x : x : xs + | x == '"' = '\\' : x : xs + | otherwise = x : xs +"""]] + +Usage: `cat config_file | propellor_lines` (or in Emacs, dump the config file into your propellor config, select the region and use `C-u M-|` to pipe it through). -- cgit v1.2.3 From 61be7bc943907d2252be711471df3c84b99514e7 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Tue, 24 Nov 2015 15:42:25 +0000 Subject: sign script contribution --- ...cript_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn b/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn index d3c77a17..c9f5ec8b 100644 --- a/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn +++ b/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config.mdwn @@ -37,3 +37,5 @@ wrapEscapeLine line = "\"" ++ (foldr step "" line) ++ "\"" """]] Usage: `cat config_file | propellor_lines` (or in Emacs, dump the config file into your propellor config, select the region and use `C-u M-|` to pipe it through). + +-- [[spwhitton|https://spwhitton.name]] -- cgit v1.2.3 From da7d8f623bd1530d9d492b8684a84a225303ad53 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 24 Nov 2015 16:42:01 -0400 Subject: add news item for propellor 2.14.0 --- doc/news/version_2.14.0.mdwn | 14 ++++++++++++++ doc/news/version_2.8.1.mdwn | 13 ------------- 2 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 doc/news/version_2.14.0.mdwn delete mode 100644 doc/news/version_2.8.1.mdwn (limited to 'doc') diff --git a/doc/news/version_2.14.0.mdwn b/doc/news/version_2.14.0.mdwn new file mode 100644 index 00000000..2a6e7bda --- /dev/null +++ b/doc/news/version_2.14.0.mdwn @@ -0,0 +1,14 @@ +propellor 2.14.0 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Add Propellor.Property.PropellorRepo.hasOriginUrl, an explicit way to + set the git repository url normally implicitly set when using --spin. + * Added Chroot.noServices property. + * DiskImage creation automatically uses Chroot.noServices. + * Removed the (unused) dependency on quickcheck. + * DebianMirror: Added a DebianMirror type for configuration (API change) + Thanks, Félix Sipma. + * DebianMirror: Add RsyncExtra to configuration. + Thanks, Félix Sipma. + * Added Git.repoConfigured and Git.repoAcceptsNonFFs properties. + Thanks, Sean Whitton + * Added User.hasDesktopGroups property."""]] \ No newline at end of file diff --git a/doc/news/version_2.8.1.mdwn b/doc/news/version_2.8.1.mdwn deleted file mode 100644 index fafde5e4..00000000 --- a/doc/news/version_2.8.1.mdwn +++ /dev/null @@ -1,13 +0,0 @@ -propellor 2.8.1 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * Guard against power loss etc when building propellor, by updating - the executable atomically. - * Added Logcheck module, contributed by Jelmer Vernooij. - * Added Kerberos module, contributed by Jelmer Vernooij. - * Privdata that uses HostContext inside a container will now have the - name of the container as its context, rather than the name of - the host(s) where the container is used. This allows eg, having different - passwords for a user in different containers. Note that previously, - propellor would prompt using the container name as the context, but - not actually use privdata using that context; so this is a bug fix. - * Fix --add-key to not fail committing when no privdata file exists yet."""]] \ No newline at end of file -- cgit v1.2.3 From 41884ae8eb4c80293d417352a0381cfaddad3b97 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Wed, 25 Nov 2015 03:22:55 +0000 Subject: submit pull request --- ..._Locale.selectedFor_and_Locale.available_properties.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties.mdwn (limited to 'doc') diff --git a/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties.mdwn b/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties.mdwn new file mode 100644 index 00000000..544948f4 --- /dev/null +++ b/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties.mdwn @@ -0,0 +1,13 @@ +Please consider merging branch `locale` of repo `https://git.spwhitton.name/propellor` + +It adds the following properties: + +- `Locale.selectedFor` to choose a locale for a locale variable +- `Locale.available`, used by `Locale.selectedFor` to ensure a locale is generated + +Example usage (I'm British but I live in the US): + + & "en_GB.UTF-8" `Locale.selectedFor` ["LANG", "LANGUAGE"] + & "en_US.UTF-8" `Locale.selectedFor` ["LC_PAPER"] + +Pretty sure I've got the indentation right this time too ;) -- cgit v1.2.3 From 7e03e4b7a4060fa75de361339a90ed6c053c6be9 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Wed, 25 Nov 2015 05:08:18 +0000 Subject: User.hasDesktopGroups bug report --- ...sktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn (limited to 'doc') diff --git a/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn b/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn new file mode 100644 index 00000000..558582ab --- /dev/null +++ b/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn @@ -0,0 +1,5 @@ +The new `User.hasDesktopGroups` tries to add a user to the group `debian-tor` which fails if this group does not exist. + +What package creates this group? If someone could let me know that, I will patch `User.hasDesktopGroups` to only try to add a user to `debian-tor` if `Apt.isInstalled "blah"` is true. + +Or perhaps Joey added this group because this group exists by default on Debian Unstable. If so then a check can be inserted for that. -- cgit v1.2.3 From b8dd74eb947f97562c353139e0d5ad65ec718615 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Wed, 25 Nov 2015 05:09:01 +0000 Subject: sign --- ...sDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn b/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn index 558582ab..36a89b6f 100644 --- a/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn +++ b/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn @@ -3,3 +3,5 @@ The new `User.hasDesktopGroups` tries to add a user to the group `debian-tor` wh What package creates this group? If someone could let me know that, I will patch `User.hasDesktopGroups` to only try to add a user to `debian-tor` if `Apt.isInstalled "blah"` is true. Or perhaps Joey added this group because this group exists by default on Debian Unstable. If so then a check can be inserted for that. + +--[[spwhitton|https://spwhitton.name/]] -- cgit v1.2.3 From 89240b9c622511b6e99c12a1a97aaa53cd57fb02 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 25 Nov 2015 11:20:52 -0400 Subject: close --- ...DesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc') diff --git a/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn b/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn index 36a89b6f..b6e1ec20 100644 --- a/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn +++ b/doc/todo/User.hasDesktopGroups:_debian-tor_group_doesn__39__t_necessarily_exist.mdwn @@ -5,3 +5,6 @@ What package creates this group? If someone could let me know that, I will patc Or perhaps Joey added this group because this group exists by default on Debian Unstable. If so then a check can be inserted for that. --[[spwhitton|https://spwhitton.name/]] + +> Noticed that too and made it only add the user to existant groups, which +> is the same approach user-setup uses. [[done]] --[[Joey]] -- cgit v1.2.3 From df91695d31d5c4d527af0532bebf36e8580c89e9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 25 Nov 2015 11:30:25 -0400 Subject: review --- .../comment_1_3c528827f40420e3f4001f69127a0c51._comment | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties/comment_1_3c528827f40420e3f4001f69127a0c51._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties/comment_1_3c528827f40420e3f4001f69127a0c51._comment b/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties/comment_1_3c528827f40420e3f4001f69127a0c51._comment new file mode 100644 index 00000000..4d413c84 --- /dev/null +++ b/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties/comment_1_3c528827f40420e3f4001f69127a0c51._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-11-25T15:24:10Z" + content=""" +The types here don't tell me much about what values it expects. + +`selectedFor :: String -> [String] -> Property NoInfo` + +Function needs either some examples in its haddock, or better types. + +Also, the `available` property incorrectly succeeds if the locale passed to +it is not listed in locale.gen. + +(It would be nice for these properties to be revertable but that's just a +thought.) +"""]] -- cgit v1.2.3 From 52dabb9df516932ea5cba80d9e3cf585cdae9d3c Mon Sep 17 00:00:00 2001 From: spwhitton Date: Thu, 26 Nov 2015 02:51:22 +0000 Subject: Added a comment --- .../comment_2_981a305c50d699fd3d06c39ca66107ea._comment | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties/comment_2_981a305c50d699fd3d06c39ca66107ea._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties/comment_2_981a305c50d699fd3d06c39ca66107ea._comment b/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties/comment_2_981a305c50d699fd3d06c39ca66107ea._comment new file mode 100644 index 00000000..e8801aba --- /dev/null +++ b/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties/comment_2_981a305c50d699fd3d06c39ca66107ea._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 2" + date="2015-11-26T02:51:22Z" + content=""" +Thanks for the feedback. I've implemented your suggestions. Please take a look. +"""]] -- cgit v1.2.3 From 20d3aa23df465321ec191101a631dfd5a2fc055b Mon Sep 17 00:00:00 2001 From: spwhitton Date: Thu, 26 Nov 2015 04:47:45 +0000 Subject: pull request --- ...ull_request:_patch_Apt.buildDep_to_only_proceed_if_installable.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable.mdwn (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable.mdwn b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable.mdwn new file mode 100644 index 00000000..a27dc2e1 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable.mdwn @@ -0,0 +1,3 @@ +Please consider merging branch `builddepfix` of repo `https://git.spwhitton.name/propellor` + +Patches `Apt.buildDep` to check whether the build deps are installable, so that it no longer registers a change every spin. -- cgit v1.2.3 From 08a03bb4555e28ea7ebe5445d6dd250b06b18f45 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 26 Nov 2015 07:20:48 -0400 Subject: comment --- ...Locale.selectedFor_and_Locale.available_properties.mdwn | 2 ++ .../comment_1_88f5d79b8cd6064d1a65dec445819afe._comment | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_1_88f5d79b8cd6064d1a65dec445819afe._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties.mdwn b/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties.mdwn index 544948f4..b34118f0 100644 --- a/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties.mdwn +++ b/doc/todo/pull_request:_Locale.selectedFor_and_Locale.available_properties.mdwn @@ -11,3 +11,5 @@ Example usage (I'm British but I live in the US): & "en_US.UTF-8" `Locale.selectedFor` ["LC_PAPER"] Pretty sure I've got the indentation right this time too ;) + +> merged, thanks! [[done]] --[[Joey]] diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_1_88f5d79b8cd6064d1a65dec445819afe._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_1_88f5d79b8cd6064d1a65dec445819afe._comment new file mode 100644 index 00000000..209b62a3 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_1_88f5d79b8cd6064d1a65dec445819afe._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-11-26T11:14:37Z" + content=""" +Looks like Build-Depends-Index is not handled, nor are 'a | b' build deps, +or arch-specific build deps. Since versions are skipped, if a build dep +needed a newer version, the property also wouldn't try to upgrade to it +after this change. + +I feel that parsing build deps is too complex for propellor. + +It might work to somehow detect if apt has made any changes. +"""]] -- cgit v1.2.3 From 260b5cca74b29c03e1178cc0e69977d6c2fe89d7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 26 Nov 2015 08:49:10 -0400 Subject: comment --- .../comment_2_23cb35130719bf1657652b76c0791947._comment | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_2_23cb35130719bf1657652b76c0791947._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_2_23cb35130719bf1657652b76c0791947._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_2_23cb35130719bf1657652b76c0791947._comment new file mode 100644 index 00000000..ace80098 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_2_23cb35130719bf1657652b76c0791947._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2015-11-26T12:48:25Z" + content=""" +How about simply checking if /var/lib/dpkg/status is changed? + +I added a `changesFile` property combinator which should be helpful for +that. +"""]] -- cgit v1.2.3 From cc4c30ffd23e5fe4ecfdfe2afb1ba5e00e51a14e Mon Sep 17 00:00:00 2001 From: spwhitton Date: Thu, 26 Nov 2015 14:39:31 +0000 Subject: Added a comment --- .../comment_3_5759b4fddf360e8a777c0339c5426b40._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_3_5759b4fddf360e8a777c0339c5426b40._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_3_5759b4fddf360e8a777c0339c5426b40._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_3_5759b4fddf360e8a777c0339c5426b40._comment new file mode 100644 index 00000000..86f4d1de --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_3_5759b4fddf360e8a777c0339c5426b40._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 3" + date="2015-11-26T14:39:31Z" + content=""" +I was hoping your deep knowledge of Apt would be able to help with this! + +Before I proceed, how would you feel about catching the output of apt and only printing it if apt did make changes? Although that would make the output weirdly appear all at once when the build deps are actually installed, on the other hand it would mean no output if they're not, when we detect no changes to /var/lib/dpkg/status. +"""]] -- cgit v1.2.3 From e23895ff4466776f421f2d9b5e78f5f2b2bce82f Mon Sep 17 00:00:00 2001 From: jerryjacobs1989@d19093c366dfb2959c549ed1aff6175ddc7a7a5b Date: Sun, 29 Nov 2015 13:04:56 +0000 Subject: Added a comment: Thank you --- .../comment_4_5dc1c3ee7f111fcc36c72487b7713854._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/forum/Systemd.container_produces_non-standard_systemd_container/comment_4_5dc1c3ee7f111fcc36c72487b7713854._comment (limited to 'doc') diff --git a/doc/forum/Systemd.container_produces_non-standard_systemd_container/comment_4_5dc1c3ee7f111fcc36c72487b7713854._comment b/doc/forum/Systemd.container_produces_non-standard_systemd_container/comment_4_5dc1c3ee7f111fcc36c72487b7713854._comment new file mode 100644 index 00000000..d7fe1dd5 --- /dev/null +++ b/doc/forum/Systemd.container_produces_non-standard_systemd_container/comment_4_5dc1c3ee7f111fcc36c72487b7713854._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="jerryjacobs1989@d19093c366dfb2959c549ed1aff6175ddc7a7a5b" + nickname="jerryjacobs1989" + subject="Thank you" + date="2015-11-29T13:04:56Z" + content=""" +I was bitten also by this weird error message and have submitted it upstream: +https://github.com/systemd/systemd/issues/2060 +"""]] -- cgit v1.2.3 From 703c08cd618ec3d0f299b1f715e0ebfb7233ea09 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 30 Nov 2015 13:34:17 -0400 Subject: comment --- ...mment_4_cd49645ff94d9ccec74ff72a836cd1f7._comment | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_4_cd49645ff94d9ccec74ff72a836cd1f7._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_4_cd49645ff94d9ccec74ff72a836cd1f7._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_4_cd49645ff94d9ccec74ff72a836cd1f7._comment new file mode 100644 index 00000000..30149a4c --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_4_cd49645ff94d9ccec74ff72a836cd1f7._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2015-11-30T16:57:45Z" + content=""" +I think it would probably depend on the user when that makes sense to do. +If I'm installing build deps over a slow network connection, I'd like to +see the output. + +It would be awesome if this transformation could be applied to any +arbitrary Property. I don't immediately know how to do that, although it +seems useful that all process spawning already goes through +concurrent-output, which can buffer the output and display it only when the +command finishes. + +Perhaps an extension to concurrent-ouput could let it buffer the output +of all commands run by a property and then discard the buffer if the +property finished with NoChange. But I don't see a way to make this work +when multiple properties are being run concurrently. +"""]] -- cgit v1.2.3 From cf53889bcb6f4e64910a1172d1ca6ace783580a7 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Wed, 2 Dec 2015 04:46:14 +0000 Subject: Added a comment --- .../comment_5_33744064a8b224d6e44e2cf8081f6a56._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_5_33744064a8b224d6e44e2cf8081f6a56._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_5_33744064a8b224d6e44e2cf8081f6a56._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_5_33744064a8b224d6e44e2cf8081f6a56._comment new file mode 100644 index 00000000..b0283161 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_5_33744064a8b224d6e44e2cf8081f6a56._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 5" + date="2015-12-02T04:46:14Z" + content=""" +I've made a property combinator `noChangeIfUnchanged` and applied it to Apt.buildDep in my `builddepfix` branch. Please take a look. + +In my testing of this, Propellor hides the output if the build deps are already installed i.e. if the property returns NoChange. So it looks like you've already implemented your awesome at some point :) +"""]] -- cgit v1.2.3 From b2eb7434d5c95604b0326cbce6f72d8e8f2538e4 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Wed, 2 Dec 2015 04:57:57 +0000 Subject: Added a comment --- .../comment_6_db48a08bc6eece590aebd41691623665._comment | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_6_db48a08bc6eece590aebd41691623665._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_6_db48a08bc6eece590aebd41691623665._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_6_db48a08bc6eece590aebd41691623665._comment new file mode 100644 index 00000000..85c91d65 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_6_db48a08bc6eece590aebd41691623665._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 6" + date="2015-12-02T04:57:57Z" + content=""" +Seems I blanked on your `changesFile` combinator when I sat down to write mine. Taking a look now, my approach is much more direct for cases like `Apt.buildDep` when the problem is registering a change when there should be NoChange, whereas I think the intention of your changesFile is the opposite case. Though it might be nice to combine them. Let me know what you think. +"""]] -- cgit v1.2.3 From 91cc612e67b25b1b3ade72355ed9fcd69e7e9d66 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 Dec 2015 12:14:34 -0400 Subject: comment --- ...ment_7_9c45f473cbc432a32bd64bbbf048fae4._comment | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_7_9c45f473cbc432a32bd64bbbf048fae4._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_7_9c45f473cbc432a32bd64bbbf048fae4._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_7_9c45f473cbc432a32bd64bbbf048fae4._comment new file mode 100644 index 00000000..e2611fd5 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_7_9c45f473cbc432a32bd64bbbf048fae4._comment @@ -0,0 +1,21 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 7""" + date="2015-12-02T16:10:34Z" + content=""" +The two combinators are indeed very similar. The reason I wrote +changesFile the way I did is that that allows it to be applied repeatedly +when a property can change any of several files. + + trivial someprop + `changesFile` "foo" + `changesFile` "bar" + +That seems fairly likely to come up, while it would be unusual for a +property to have to change multiple files at once to be considered +to make a change at all, which is what multiple applications of +`noChangeIfUnchanged` leads to. + +But neither combinator causes apt's output to not be displayed, +which is what I thought we were talking about. +"""]] -- cgit v1.2.3 From 15c69ffb3155feb355c663447e6ef1dbec2a6f2a Mon Sep 17 00:00:00 2001 From: spwhitton Date: Wed, 2 Dec 2015 21:44:38 +0000 Subject: Added a comment --- .../comment_8_7069f68888663fef109b82a044aeb5e1._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_8_7069f68888663fef109b82a044aeb5e1._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_8_7069f68888663fef109b82a044aeb5e1._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_8_7069f68888663fef109b82a044aeb5e1._comment new file mode 100644 index 00000000..c05d6255 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_8_7069f68888663fef109b82a044aeb5e1._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 8" + date="2015-12-02T21:44:37Z" + content=""" +My original goal was to have `Apt.buildDep` return NoChange if the build deps are already installed. As a welcome but unexplained side-effect, on my system `noChangeIfUnchanged` *does* cause apt's output not to be displayed. + +I'll think about ways to combine our two combinators. +"""]] -- cgit v1.2.3 From 9e2115422c7d066b8ffb4ef0a4b02c7eb758db3e Mon Sep 17 00:00:00 2001 From: spwhitton Date: Thu, 3 Dec 2015 02:08:58 +0000 Subject: Added a comment --- .../comment_9_5694c0bec217d3513aa8e80f55482d75._comment | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_9_5694c0bec217d3513aa8e80f55482d75._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_9_5694c0bec217d3513aa8e80f55482d75._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_9_5694c0bec217d3513aa8e80f55482d75._comment new file mode 100644 index 00000000..5783dd7b --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_9_5694c0bec217d3513aa8e80f55482d75._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 9" + date="2015-12-03T02:08:58Z" + content=""" +I can get what I want if I use `trivial` and `changesFile` in the way you described. So please consider adding your method as a combinator: + + p `changeIfChanges` f = (trivial p) `changesFile` f + +which is okay because `trivial` is idempotent so `changeIfChanges` may be applied more than once (I've got this in my branch with a decent docstring and I've applied it to `Apt.buildDep`). + +I think that this ought to be its own combinator, rather than just a recommendation to use `trivial` and `changesFile` in such cases, because this doesn't follow the semantics of `trivial`: it's not necessarily the case that it is the same amount of work to check if the property needs to be ensured as it is to ensure it. + +(In this language, my `noChangeIfUnchanged` could be called `changeOnlyIfChanges`. I agree that it's very unlikely to useful.) + +(Again, on my machine, applying `changeIfChanges` to `Apt.buildDep` magically hides apt's output if the build-deps are already installed.) +"""]] -- cgit v1.2.3 From 52a339cbecd52c836153516a933c9c13b46fe00f Mon Sep 17 00:00:00 2001 From: spwhitton Date: Thu, 3 Dec 2015 03:11:50 +0000 Subject: suggest haskell-tab-indent-mode for Emacs users in coding style page --- doc/coding_style.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/coding_style.mdwn b/doc/coding_style.mdwn index 219b367c..86a8516e 100644 --- a/doc/coding_style.mdwn +++ b/doc/coding_style.mdwn @@ -107,3 +107,5 @@ Note for emacs users: You can put the following snippet into a file called (fill-column . 80))) ;; Warn about spaces used for indentation: (haskell-mode . ((eval . (highlight-regexp "^ *"))))) + +Also consider [haskell-tab-indent-mode](https://spwhitton.name/tech/code/haskell-tab-indent.el). The standard indentation modes that come with haskell-mode do not work well with tabs for indentation. This mode works well for hacking on Propellor. (A pull request has been submitted to have it included in haskell-mode.) -- cgit v1.2.3 From f71d10672e035d81c4ee20d1394e5b100d3a7b2f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 3 Dec 2015 11:25:27 -0400 Subject: comment --- ...nt_10_eb58216ef1172ee5b882090dab7219ce._comment | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_10_eb58216ef1172ee5b882090dab7219ce._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_10_eb58216ef1172ee5b882090dab7219ce._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_10_eb58216ef1172ee5b882090dab7219ce._comment new file mode 100644 index 00000000..3799a012 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_10_eb58216ef1172ee5b882090dab7219ce._comment @@ -0,0 +1,32 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 10""" + date="2015-12-03T15:05:21Z" + content=""" + + trivial (trivial p `changesFile` f) `changesFile` f' + +The parenthesized property here is all marked trivial, so a change to f +won't result in MadeChange, though a change to f' will. + +The only way propellor might intercept the output of a program is if you're +using the new Concurrent module. In that case it should buffer program output +and display it all at once. There could potentially be a bug there that +hid program output. I certianly can't reproduce changesFile hiding the output +of a program: + + *Propellor.Property.Apt> runPropellor (Host "localhost" [] mempty) $ ensureProperty $ trivial (buildDep ["git-annex"]) `changesFile` "/var/lib/dpkg/status" + Reading package lists... Done + Building dependency tree + Reading state information... Done + 0 upgraded, 0 newly installed, 0 to remove and 707 not upgraded. + NoChange + + *Propellor.Property.Apt Propellor.Property.Concurrent> withConcurrentOutput $ runPropellor (Host "localhost" [] mempty) $ ensureProperty $ (trivial (buildDep ["git-annex"]) `changesFile` "/var/lib/dpkg/status") `concurrently` cmdProperty "echo" ["hi"] + hi + Reading package lists... + Building dependency tree... + Reading state information... + 0 upgraded, 0 newly installed, 0 to remove and 707 not upgraded. + MadeChange +"""]] -- cgit v1.2.3 From 5c6a43c3b888242443d790efbc1f9282e4e5675c Mon Sep 17 00:00:00 2001 From: spwhitton Date: Thu, 3 Dec 2015 23:29:57 +0000 Subject: Added a comment --- .../comment_11_bee4b2397dfb28a3791081a83d725daf._comment | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_11_bee4b2397dfb28a3791081a83d725daf._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_11_bee4b2397dfb28a3791081a83d725daf._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_11_bee4b2397dfb28a3791081a83d725daf._comment new file mode 100644 index 00000000..f4df5527 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_11_bee4b2397dfb28a3791081a83d725daf._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 11" + date="2015-12-03T23:29:57Z" + content=""" +Thank you for your feedback. I'll think about how I might rewrite `changeIfChanges` to avoid that problem with `trivial`, and I'll try to pin down the hiding of apt's output. +"""]] -- cgit v1.2.3 From 2cc31d3c41b4b4e3b8e54c03292fd7c2951cfd8f Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sat, 5 Dec 2015 19:51:26 +0000 Subject: update link to haskell-tab-indent-mode --- doc/coding_style.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/coding_style.mdwn b/doc/coding_style.mdwn index 86a8516e..92553d76 100644 --- a/doc/coding_style.mdwn +++ b/doc/coding_style.mdwn @@ -108,4 +108,4 @@ Note for emacs users: You can put the following snippet into a file called ;; Warn about spaces used for indentation: (haskell-mode . ((eval . (highlight-regexp "^ *"))))) -Also consider [haskell-tab-indent-mode](https://spwhitton.name/tech/code/haskell-tab-indent.el). The standard indentation modes that come with haskell-mode do not work well with tabs for indentation. This mode works well for hacking on Propellor. (A pull request has been submitted to have it included in haskell-mode.) +Also consider [haskell-tab-indent-mode](https://spwhitton.name/tech/code/haskell-tab-indent/). The standard indentation modes that come with haskell-mode do not work well with tabs for indentation. This mode works well for hacking on Propellor. -- cgit v1.2.3 From db0a38f02e1dda6ce35c782fa6132f344b0905d1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 5 Dec 2015 18:57:56 -0400 Subject: followup --- ...tch_Apt.buildDep_to_only_proceed_if_installable.mdwn | 3 +++ ...comment_12_1e09f5a3f4565a9392d7b50b703a8a69._comment | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_12_1e09f5a3f4565a9392d7b50b703a8a69._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable.mdwn b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable.mdwn index a27dc2e1..275ea9f5 100644 --- a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable.mdwn +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable.mdwn @@ -1,3 +1,6 @@ Please consider merging branch `builddepfix` of repo `https://git.spwhitton.name/propellor` Patches `Apt.buildDep` to check whether the build deps are installable, so that it no longer registers a change every spin. + +> Apt.buildDep now checks if the dpkg status file has changed, so [[done]] +> --[[Joey]] diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_12_1e09f5a3f4565a9392d7b50b703a8a69._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_12_1e09f5a3f4565a9392d7b50b703a8a69._comment new file mode 100644 index 00000000..3db6fd1b --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_12_1e09f5a3f4565a9392d7b50b703a8a69._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 12""" + date="2015-12-05T22:52:42Z" + content=""" +I had a thought about this; +[[trivial is a code smell|type-level_trivial_avoidance]] and adding +UncheckedProperty type avoids needing to use trivial. + +So, now cmdProperty, runApt, and other things that make a Property but +can't really detect when it MadeChange can instead make an +UncheckedProperty, and changesFile is one of the ways to convert that into +a Property. + +My implementation also allows applying changesFile multiple times, to +detect a change to multiple files. +"""]] -- cgit v1.2.3 From b29398d8813e67068c4c5fdeaa148d77ef940d2a Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 6 Dec 2015 17:17:34 +0000 Subject: Added a comment --- .../comment_13_54de6d1c5351e9303c190edda7e7a33f._comment | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_13_54de6d1c5351e9303c190edda7e7a33f._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_13_54de6d1c5351e9303c190edda7e7a33f._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_13_54de6d1c5351e9303c190edda7e7a33f._comment new file mode 100644 index 00000000..72f6bf40 --- /dev/null +++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_13_54de6d1c5351e9303c190edda7e7a33f._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 13" + date="2015-12-06T17:17:34Z" + content=""" +Very nice. Thank you for writing it up in full so Haskell beginners like me can learn about the flexibilities and limitations of programming with Haskell types. +"""]] -- cgit v1.2.3 From 8b174a2f7160c30cd635cc92f5e24e30d9340234 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Dec 2015 15:40:46 -0400 Subject: add news item for propellor 2.15.0 --- doc/news/version_2.15.0.mdwn | 29 +++++++++++++++++++++++++++++ doc/news/version_2.9.0.mdwn | 35 ----------------------------------- 2 files changed, 29 insertions(+), 35 deletions(-) create mode 100644 doc/news/version_2.15.0.mdwn delete mode 100644 doc/news/version_2.9.0.mdwn (limited to 'doc') diff --git a/doc/news/version_2.15.0.mdwn b/doc/news/version_2.15.0.mdwn new file mode 100644 index 00000000..ebd847e2 --- /dev/null +++ b/doc/news/version_2.15.0.mdwn @@ -0,0 +1,29 @@ +propellor 2.15.0 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Added UncheckedProperty type, along with unchecked to indicate a + Property needs its result checked, and checkResult and changesFile + to check for changes. + * Properties that run an arbitrary command, such as cmdProperty + and scriptProperty are converted to use UncheckedProperty, since + they cannot tell on their own if the command truely made a change or not. + (API Change) + Transition guide: + - When GHC complains about an UncheckedProperty, add: + `assume` MadeChange + (Since these properties used to always return MadeChange, that + change is always safe to make.) + - Or, if you know that the command should modifiy a file, use: + `changesFile` filename + * The `trivial` combinator has been removed. (API change) + Instead, use: + `assume` NoChange + Or, better, use changesFile or checkResult to accurately report + when a property makes a change. + * A few properties have had their Result improved, for example + Apt.buldDep and Apt.autoRemove now check if a change was made or not. + * User.hasDesktopGroups changed to avoid trying to add the user to + groups that don't exist. + * Added Postfix.saslPasswdSet. + * Added Propellor.Property.Locale. + Thanks, Sean Whitton. + * Added Propellor.Property.Fail2Ban."""]] \ No newline at end of file diff --git a/doc/news/version_2.9.0.mdwn b/doc/news/version_2.9.0.mdwn deleted file mode 100644 index ef445452..00000000 --- a/doc/news/version_2.9.0.mdwn +++ /dev/null @@ -1,35 +0,0 @@ -propellor 2.9.0 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * Added basic Uwsgi module, maintained by Félix Sipma. - * Add Apt.hasForeignArch. Thanks, Per Olofsson. - * Improved documentation, particularly of the Propellor module. - * The Propellor module no longer exports many of the things it used to, - being now focused on only what's needed to write config.hs. - Use Propellor.Base to get all the things exported by Propellor before. - (API change) - * Some renaming of instance methods, and moving of functions to more - appropriate modules. (API change) - * Added File.isSymlinkedTo. Thanks, Per Olofsson. - * fileProperty, and properties derived from it now write the new - file content via origfile.propellor-new~, instead of to a randomly named - temp file. This allows them to clean up any temp file that may have - been left by an interrupted run of propellor. - * Added Propellor.Property.Spin, which can be used to make a host be a - controller of other hosts, which will automatically spin them each time - propellor is run. - * Ssh.keyImported is replaced with Ssh.userKeys. (API change) - The new property only gets the private key from the privdata; the - public key is provided as a parameter, and so is available as - Info that other properties can use. - * Ssh.keyImported' is renamed to Ssh.userKeyAt, and also changed - to only import the private key from the privdata. (API change) - * While Ssh.keyImported and Ssh.keyImported' avoided updating existing - keys, the new Ssh.userKeys and Ssh.userKeyAt properties will - always update out of date key files. - * Ssh.pubKey renamed to Ssh.hostPubKey. (API change) - * Added --unset-unused - * Fix typo: propigate → propagate. Thanks, Felix Gruber. - (A minor API change) - * Chroot: Converted to use a ChrootBootstrapper type class, so - other ways to bootstrap chroots can easily be added in separate - modules. (API change)"""]] \ No newline at end of file -- cgit v1.2.3 From a6a97e044e0bfef76cb6ff5d98cfe16cf4483d15 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 6 Dec 2015 20:03:58 +0000 Subject: proposal --- ..._95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn (limited to 'doc') diff --git a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn new file mode 100644 index 00000000..14fd1fe1 --- /dev/null +++ b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn @@ -0,0 +1,13 @@ +I'd like to patch the `/usr/bin/propellor` wrapper to check for two environment variables. I'm posting my proposal here to see whether Joey would be willing to merge such a patch before starting to write it. + +# Proposal + +- if the branch currently checked out in the `~/.propellor` repository does not match `PROPELLOR_SPIN_BRANCH`, Propellor would refuse to spin + +- if the `PROPELLOR_DIRTY_NOSPIN` variable is set, Propellor will refuse to spin if the `~/.propellor` repository contains uncommitted changes + +# Rationale + +`PROPELLOR_SPIN_BRANCH` is to prevent foot-shooting. When working on a feature branch one might forget to check out one's usual config branch before spinning. If the host that is spun is configured with `Cron.runPropellor`, it will be set to pull from the feature branch. If the user doesn't realise that this has happened, they might make further commits to their usual config branch and expect them to have propagated to the host by means of its `Cron.runPropellor` cronjob, but they won't reach the host until the next manual spin from the correct branch. Of course there are other possible foot-shootings available in this area. + +`PROPELLOR_DIRTY_NOSPIN` is to prevent configuration changes ending up in commits made with the undescriptive commit message "propellor spin". I understand that it doesn't bother Joey, but I want all configuration changes to be recorded with a descriptive commit message because it makes using `git revert` and `git cherry-pick` easier. So for users like me this environment variable is a useful check. -- cgit v1.2.3 From 3e2dc047b337f60aa1d42c4fc3913d52467091f6 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 6 Dec 2015 20:04:21 +0000 Subject: tense --- ...R__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn index 14fd1fe1..115b8740 100644 --- a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn +++ b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn @@ -4,7 +4,7 @@ I'd like to patch the `/usr/bin/propellor` wrapper to check for two environment - if the branch currently checked out in the `~/.propellor` repository does not match `PROPELLOR_SPIN_BRANCH`, Propellor would refuse to spin -- if the `PROPELLOR_DIRTY_NOSPIN` variable is set, Propellor will refuse to spin if the `~/.propellor` repository contains uncommitted changes +- if the `PROPELLOR_DIRTY_NOSPIN` variable is set, Propellor would refuse to spin if the `~/.propellor` repository contains uncommitted changes # Rationale -- cgit v1.2.3 From 811a45ea5c05bcc5c3e385fab686cc6778e3f8d5 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 6 Dec 2015 20:04:36 +0000 Subject: sign --- ...R__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn index 115b8740..10885389 100644 --- a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn +++ b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn @@ -11,3 +11,5 @@ I'd like to patch the `/usr/bin/propellor` wrapper to check for two environment `PROPELLOR_SPIN_BRANCH` is to prevent foot-shooting. When working on a feature branch one might forget to check out one's usual config branch before spinning. If the host that is spun is configured with `Cron.runPropellor`, it will be set to pull from the feature branch. If the user doesn't realise that this has happened, they might make further commits to their usual config branch and expect them to have propagated to the host by means of its `Cron.runPropellor` cronjob, but they won't reach the host until the next manual spin from the correct branch. Of course there are other possible foot-shootings available in this area. `PROPELLOR_DIRTY_NOSPIN` is to prevent configuration changes ending up in commits made with the undescriptive commit message "propellor spin". I understand that it doesn't bother Joey, but I want all configuration changes to be recorded with a descriptive commit message because it makes using `git revert` and `git cherry-pick` easier. So for users like me this environment variable is a useful check. + +--[[spwhitton]] -- cgit v1.2.3 From b3ba2e63e9e6c1b6ce3cd28596576c1f94ea32a4 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 6 Dec 2015 20:05:16 +0000 Subject: fix sig --- ...R__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn index 10885389..3c152e85 100644 --- a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn +++ b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn @@ -12,4 +12,4 @@ I'd like to patch the `/usr/bin/propellor` wrapper to check for two environment `PROPELLOR_DIRTY_NOSPIN` is to prevent configuration changes ending up in commits made with the undescriptive commit message "propellor spin". I understand that it doesn't bother Joey, but I want all configuration changes to be recorded with a descriptive commit message because it makes using `git revert` and `git cherry-pick` easier. So for users like me this environment variable is a useful check. ---[[spwhitton]] +--[[spwhitton|https://spwhitton.name]] -- cgit v1.2.3 From cf45e508b6f607bf16ab345e14f69e0cee3cf305 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 6 Dec 2015 20:06:10 +0000 Subject: expand desc --- ...R__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn index 3c152e85..8d3670a5 100644 --- a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn +++ b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn @@ -8,7 +8,7 @@ I'd like to patch the `/usr/bin/propellor` wrapper to check for two environment # Rationale -`PROPELLOR_SPIN_BRANCH` is to prevent foot-shooting. When working on a feature branch one might forget to check out one's usual config branch before spinning. If the host that is spun is configured with `Cron.runPropellor`, it will be set to pull from the feature branch. If the user doesn't realise that this has happened, they might make further commits to their usual config branch and expect them to have propagated to the host by means of its `Cron.runPropellor` cronjob, but they won't reach the host until the next manual spin from the correct branch. Of course there are other possible foot-shootings available in this area. +`PROPELLOR_SPIN_BRANCH` is to prevent foot-shooting. When working on a feature branch one might forget to check out one's usual config branch before spinning. If the host that is spun is configured with `Cron.runPropellor`, it will be set to pull from the feature branch. If the user doesn't realise that this has happened, they might make further commits to their usual config branch and expect them to have propagated to the host by means of its `Cron.runPropellor` cronjob, but they won't reach the host until the next manual spin from the correct branch. Of course there are other possible foot-shootings available in this area that this environment variable would prevent. `PROPELLOR_DIRTY_NOSPIN` is to prevent configuration changes ending up in commits made with the undescriptive commit message "propellor spin". I understand that it doesn't bother Joey, but I want all configuration changes to be recorded with a descriptive commit message because it makes using `git revert` and `git cherry-pick` easier. So for users like me this environment variable is a useful check. -- cgit v1.2.3 From aad109c66f57abbfc5cfb0dc8288928ee9a01a7e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Dec 2015 17:26:19 -0400 Subject: comment --- ...ent_1_432c6009fbe2309af81a47658173f753._comment | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_1_432c6009fbe2309af81a47658173f753._comment (limited to 'doc') diff --git a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_1_432c6009fbe2309af81a47658173f753._comment b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_1_432c6009fbe2309af81a47658173f753._comment new file mode 100644 index 00000000..9b9ea864 --- /dev/null +++ b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_1_432c6009fbe2309af81a47658173f753._comment @@ -0,0 +1,27 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-12-06T21:14:36Z" + content=""" +I'd use `PROPELLOR_SPIN_BRANCH`. No objections to `PROPELLOR_DIRTY_NOSPIN` +as long as it's not default. + +Note that Cron.runPropellor does not use /usr/bin/propellor, and there are +other ways of running propellor that don't use that wrapper. So I don't +think the wrapper is the place to implement this kind of thing. + +Why use environment variables for configuration? That makes it hard to make +sure propellor gets the same configuration every way it can be run. And, +propellor has a config file. :) + +Implementation could be something like, add a `configuredMain` that takes a +monoidial configuration value for such global config settings. +(so `defaultMain = configuredMain mempty`) + +Hmm, I suppose the issue with `PROPELLOR_SPIN_BRANCH` is that when a +different branch is checked out, that branch's config.hs would not have that +configured, or would perhaps set it to use that branch. So, that's why +you were thinking environment variables? + +Maybe use git-config? +"""]] -- cgit v1.2.3 From 086563af61f4cdc3c9041167d3002a7f0089902c Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 6 Dec 2015 22:24:06 +0000 Subject: Added a comment --- .../comment_2_3ddaec3927b4a4aefad45a02e83476dc._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_2_3ddaec3927b4a4aefad45a02e83476dc._comment (limited to 'doc') diff --git a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_2_3ddaec3927b4a4aefad45a02e83476dc._comment b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_2_3ddaec3927b4a4aefad45a02e83476dc._comment new file mode 100644 index 00000000..045cd927 --- /dev/null +++ b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_2_3ddaec3927b4a4aefad45a02e83476dc._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 2" + date="2015-12-06T22:24:06Z" + content=""" +I was thinking environment variables because I saw both of these as just safety checks for the user, spinning hosts from their xterm on their laptop. I'll implement both as `git-config` variables; that's a good idea as it covers more cases. + +I don't think that this patch need touch the propellor executable run by `Cron.runPropellor`, because if the check has already ensured that the correct branch got pushed to the host during the most recent spin, then `propellor_cronjob` is guaranteed to pull the correct branch. +"""]] -- cgit v1.2.3 From a6baf79237033b42bed78aab4fd0dc34b933287a Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 6 Dec 2015 23:58:51 +0000 Subject: Added a comment --- .../comment_3_cf7b9d698c67e7a12d07a53667241092._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_3_cf7b9d698c67e7a12d07a53667241092._comment (limited to 'doc') diff --git a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_3_cf7b9d698c67e7a12d07a53667241092._comment b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_3_cf7b9d698c67e7a12d07a53667241092._comment new file mode 100644 index 00000000..ca22b1d3 --- /dev/null +++ b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN/comment_3_cf7b9d698c67e7a12d07a53667241092._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 3" + date="2015-12-06T23:58:51Z" + content=""" +I've implemented these in the `safetychecks` branch of `https://git.spwhitton.name/propellor`. + +A nice side effect of my implementation is that the spin only errors out after there's been an attempt to compile Propellor. So you can run `propellor --spin` in order to have GHC typecheck your code on a feature branch. +"""]] -- cgit v1.2.3 From 7a33cc59b25b3c905a297ac26cd33abdc9cf9e69 Mon Sep 17 00:00:00 2001 From: arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8 Date: Mon, 7 Dec 2015 14:27:22 +0000 Subject: --- doc/forum/Fail_to_push_changes_when_merging.mdwn | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 doc/forum/Fail_to_push_changes_when_merging.mdwn (limited to 'doc') diff --git a/doc/forum/Fail_to_push_changes_when_merging.mdwn b/doc/forum/Fail_to_push_changes_when_merging.mdwn new file mode 100644 index 00000000..537f03b7 --- /dev/null +++ b/doc/forum/Fail_to_push_changes_when_merging.mdwn @@ -0,0 +1,28 @@ +I use a single propellor configuration repository shared across multiple hosts, but we don't have a central repository, e.g. we don't set origin on master branch so propellor do not push/pull from central repository when updating. That works fine as long as we do not merge branches. When we do we encounter the following error: + +remote: Counting objects: 108, done. +remote: Compressing objects: 100% (105/105), done. +remote: Total 108 (delta 53), reused 0 (delta 0) s +Receiving objects: 100% (108/108), 41.16 KiB | 22.00 KiB/s, done. +Resolving deltas: 100% (53/53), completed with 19 local objects. +From . + * branch HEAD -> FETCH_HEAD + +*** Please tell me who you are. + +Run + + git config --global user.email "you@example.com" + git config --global user.name "Your Name" + +to set your account's default identity. +Omit --global to set the identity only in this repository. + +fatal: unable to auto-detect email address (got 'root@lending-test.(none)') +propellor: : hIsTerminalDevice: illegal operation (handle is closed) + + +I do not understand properly how propellor does propagate changes in this case so I am unable to fix this issue in a sane way. What we currently do is simply log in in the server and wipe out propellor repo there, which works but kind of defeat the whole purpose of automated configuration management. + +Could you please advise on how we can fix this issue? Simply having a central repository would do the trick I guess, but is there another solution? + -- cgit v1.2.3 From b433bcad7b04740462b1503bb962d6012a77e27b Mon Sep 17 00:00:00 2001 From: spwhitton Date: Tue, 8 Dec 2015 01:20:26 +0000 Subject: Added a comment --- .../comment_1_a44e03cbce4c996e136f917d8e06a7bb._comment | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/forum/Fail_to_push_changes_when_merging/comment_1_a44e03cbce4c996e136f917d8e06a7bb._comment (limited to 'doc') diff --git a/doc/forum/Fail_to_push_changes_when_merging/comment_1_a44e03cbce4c996e136f917d8e06a7bb._comment b/doc/forum/Fail_to_push_changes_when_merging/comment_1_a44e03cbce4c996e136f917d8e06a7bb._comment new file mode 100644 index 00000000..751d701a --- /dev/null +++ b/doc/forum/Fail_to_push_changes_when_merging/comment_1_a44e03cbce4c996e136f917d8e06a7bb._comment @@ -0,0 +1,12 @@ +[[!comment format=mdwn + username="spwhitton" + subject="comment 1" + date="2015-12-08T01:20:26Z" + content=""" +It looks like git is failing because it can't autodetect an e-mail address for root on the target machine. This might be because the target machine does not have a FQDN, but I'm not sure. Try logging into the target machine as root and running + + git config --global user.email root@lending-test.local + git config --global user.name root + +as it suggests. +"""]] -- cgit v1.2.3 From 6cfb69fb8549f33c88b321f173a2e1a5851ad0e2 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Tue, 8 Dec 2015 01:25:43 +0000 Subject: fix formatting --- doc/forum/Fail_to_push_changes_when_merging.mdwn | 41 ++++++++++++------------ 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'doc') diff --git a/doc/forum/Fail_to_push_changes_when_merging.mdwn b/doc/forum/Fail_to_push_changes_when_merging.mdwn index 537f03b7..62bb314d 100644 --- a/doc/forum/Fail_to_push_changes_when_merging.mdwn +++ b/doc/forum/Fail_to_push_changes_when_merging.mdwn @@ -1,26 +1,25 @@ I use a single propellor configuration repository shared across multiple hosts, but we don't have a central repository, e.g. we don't set origin on master branch so propellor do not push/pull from central repository when updating. That works fine as long as we do not merge branches. When we do we encounter the following error: -remote: Counting objects: 108, done. -remote: Compressing objects: 100% (105/105), done. -remote: Total 108 (delta 53), reused 0 (delta 0) s -Receiving objects: 100% (108/108), 41.16 KiB | 22.00 KiB/s, done. -Resolving deltas: 100% (53/53), completed with 19 local objects. -From . - * branch HEAD -> FETCH_HEAD - -*** Please tell me who you are. - -Run - - git config --global user.email "you@example.com" - git config --global user.name "Your Name" - -to set your account's default identity. -Omit --global to set the identity only in this repository. - -fatal: unable to auto-detect email address (got 'root@lending-test.(none)') -propellor: : hIsTerminalDevice: illegal operation (handle is closed) - + remote: Counting objects: 108, done. + remote: Compressing objects: 100% (105/105), done. + remote: Total 108 (delta 53), reused 0 (delta 0) s + Receiving objects: 100% (108/108), 41.16 KiB | 22.00 KiB/s, done. + Resolving deltas: 100% (53/53), completed with 19 local objects. + From . + * branch HEAD -> FETCH_HEAD + + *** Please tell me who you are. + + Run + + git config --global user.email "you@example.com" + git config --global user.name "Your Name" + + to set your account's default identity. + Omit --global to set the identity only in this repository. + + fatal: unable to auto-detect email address (got 'root@lending-test.(none)') + propellor: : hIsTerminalDevice: illegal operation (handle is closed) I do not understand properly how propellor does propagate changes in this case so I am unable to fix this issue in a sane way. What we currently do is simply log in in the server and wipe out propellor repo there, which works but kind of defeat the whole purpose of automated configuration management. -- cgit v1.2.3 From 71fa3b45bc8838c12d9480db052d2a9a2726da44 Mon Sep 17 00:00:00 2001 From: arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8 Date: Tue, 8 Dec 2015 07:04:21 +0000 Subject: Added a comment --- .../comment_2_4c8e1d9409b8ecfc465550fbbf5c0708._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/Fail_to_push_changes_when_merging/comment_2_4c8e1d9409b8ecfc465550fbbf5c0708._comment (limited to 'doc') diff --git a/doc/forum/Fail_to_push_changes_when_merging/comment_2_4c8e1d9409b8ecfc465550fbbf5c0708._comment b/doc/forum/Fail_to_push_changes_when_merging/comment_2_4c8e1d9409b8ecfc465550fbbf5c0708._comment new file mode 100644 index 00000000..47eb9f6a --- /dev/null +++ b/doc/forum/Fail_to_push_changes_when_merging/comment_2_4c8e1d9409b8ecfc465550fbbf5c0708._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="arnaud@30aba4d9f1742050874551d3ddc55ca8694809f8" + nickname="arnaud" + subject="comment 2" + date="2015-12-08T07:04:21Z" + content=""" +Thanks, I will try that. But why does it not happen when updating with fast-forward? +"""]] -- cgit v1.2.3 From 5ecb4944a637c4f28a15746b2ea716850e63a5ab Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Dec 2015 11:55:19 -0400 Subject: comment --- .../comment_3_bdf54ac096c994c33d661b454d89c770._comment | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/forum/Fail_to_push_changes_when_merging/comment_3_bdf54ac096c994c33d661b454d89c770._comment (limited to 'doc') diff --git a/doc/forum/Fail_to_push_changes_when_merging/comment_3_bdf54ac096c994c33d661b454d89c770._comment b/doc/forum/Fail_to_push_changes_when_merging/comment_3_bdf54ac096c994c33d661b454d89c770._comment new file mode 100644 index 00000000..a59296a0 --- /dev/null +++ b/doc/forum/Fail_to_push_changes_when_merging/comment_3_bdf54ac096c994c33d661b454d89c770._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2015-12-08T15:53:27Z" + content=""" +Looks like a lacking FQDN indeed. There's a property to fix that! ;) + +Git is also picky about the user having a name. + +AFAIK, git does not make commits for fast-forward merges, but it does for +non-fast-forward merges. I suspect that it's making such a merge in your +case. +"""]] -- cgit v1.2.3 From d763549d77902f600d6cc8ced2c0759e718eb6f3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Dec 2015 12:01:11 -0400 Subject: close --- ...R__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn index 8d3670a5..fad2a1e0 100644 --- a/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn +++ b/doc/todo/proposal:_env_vars_PROPELLOR__95__SPIN__95__BRANCH___38___PROPELLOR__95__DIRTY__95__NOSPIN.mdwn @@ -13,3 +13,5 @@ I'd like to patch the `/usr/bin/propellor` wrapper to check for two environment `PROPELLOR_DIRTY_NOSPIN` is to prevent configuration changes ending up in commits made with the undescriptive commit message "propellor spin". I understand that it doesn't bother Joey, but I want all configuration changes to be recorded with a descriptive commit message because it makes using `git revert` and `git cherry-pick` easier. So for users like me this environment variable is a useful check. --[[spwhitton|https://spwhitton.name]] + +> nice work! [[merged|done]] --[[Joey]] -- cgit v1.2.3 From 8d8ccb74f28345f5a073828fca5d9eb603ff26b7 Mon Sep 17 00:00:00 2001 From: gueux Date: Fri, 11 Dec 2015 13:15:57 +0000 Subject: --- doc/todo/should_not_overwrite_unchanged_private_files.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/todo/should_not_overwrite_unchanged_private_files.mdwn (limited to 'doc') diff --git a/doc/todo/should_not_overwrite_unchanged_private_files.mdwn b/doc/todo/should_not_overwrite_unchanged_private_files.mdwn new file mode 100644 index 00000000..090849f1 --- /dev/null +++ b/doc/todo/should_not_overwrite_unchanged_private_files.mdwn @@ -0,0 +1 @@ +A private file is overwritten by propellor at each run. It is not optimal when the host runs an integrity checker (like samhain). It would be great to have a file modified only if necessary. -- cgit v1.2.3 From 98a6b99db565f3beb91305614aec9c95e68c27bb Mon Sep 17 00:00:00 2001 From: gueux Date: Fri, 11 Dec 2015 13:24:42 +0000 Subject: --- ...kupEncrypted_fails_if_gpg_key_is_already_in_keyring.mdwn | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring.mdwn (limited to 'doc') diff --git a/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring.mdwn b/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring.mdwn new file mode 100644 index 00000000..f191393e --- /dev/null +++ b/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring.mdwn @@ -0,0 +1,13 @@ +Obnam.backupEncrypted "/" (Cron.Times "44 2 * * *") [] Obnam.OnlyClient (Gpg.GpgKeyId "XXXXXX") + +$ propellor --spin myhost +myhost apt installed obnam ... ok +gpg: key XXXXXX: already in secret keyring +gpg: Total number processed: 1 +gpg: secret keys read: 1 +gpg: secret keys unchanged: 1 +** warning: user error (su ["-c","gpg --import","root"] exited 2) +myhost / backed up by obnam ... failed +myhost overall ... failed +Shared connection to myhost closed. +propellor: remote propellor failed -- cgit v1.2.3 From 7e788e4bf711b2501ef49014cdaa7dd164b4984e Mon Sep 17 00:00:00 2001 From: gueux Date: Fri, 11 Dec 2015 13:25:25 +0000 Subject: --- ...ted_fails_if_gpg_key_is_already_in_keyring.mdwn | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'doc') diff --git a/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring.mdwn b/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring.mdwn index f191393e..45f85767 100644 --- a/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring.mdwn +++ b/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring.mdwn @@ -1,13 +1,13 @@ -Obnam.backupEncrypted "/" (Cron.Times "44 2 * * *") [] Obnam.OnlyClient (Gpg.GpgKeyId "XXXXXX") + Obnam.backupEncrypted "/" (Cron.Times "44 2 * * *") [] Obnam.OnlyClient (Gpg.GpgKeyId "XXXXXX") -$ propellor --spin myhost -myhost apt installed obnam ... ok -gpg: key XXXXXX: already in secret keyring -gpg: Total number processed: 1 -gpg: secret keys read: 1 -gpg: secret keys unchanged: 1 -** warning: user error (su ["-c","gpg --import","root"] exited 2) -myhost / backed up by obnam ... failed -myhost overall ... failed -Shared connection to myhost closed. -propellor: remote propellor failed + $ propellor --spin myhost + myhost apt installed obnam ... ok + gpg: key XXXXXX: already in secret keyring + gpg: Total number processed: 1 + gpg: secret keys read: 1 + gpg: secret keys unchanged: 1 + ** warning: user error (su ["-c","gpg --import","root"] exited 2) + myhost / backed up by obnam ... failed + myhost overall ... failed + Shared connection to myhost closed. + propellor: remote propellor failed -- cgit v1.2.3 From 6fc3f3012452f948d32448d2c40de60b838217a1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Dec 2015 12:40:44 -0400 Subject: comment --- ...mment_1_d65fd2ebfca6b9994db9512232ce78ff._comment | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/todo/should_not_overwrite_unchanged_private_files/comment_1_d65fd2ebfca6b9994db9512232ce78ff._comment (limited to 'doc') diff --git a/doc/todo/should_not_overwrite_unchanged_private_files/comment_1_d65fd2ebfca6b9994db9512232ce78ff._comment b/doc/todo/should_not_overwrite_unchanged_private_files/comment_1_d65fd2ebfca6b9994db9512232ce78ff._comment new file mode 100644 index 00000000..6e44dde6 --- /dev/null +++ b/doc/todo/should_not_overwrite_unchanged_private_files/comment_1_d65fd2ebfca6b9994db9512232ce78ff._comment @@ -0,0 +1,20 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-12-11T16:35:43Z" + content=""" +Doesn't rebuilding propellor overwrite lots of files too? Is the +privdata.local file somehow a particular problem, perhaps becuase +of its permissions? + +You should find it easy enough to make propellor read any existing +file and only update the file when there are changes. But it seems to me +your integrity checker would still go off whenever a new version +of the file is legitimately reveiced. Perhaps it would be better to +write a property to configure your integrity checker to not fire on +this file? + +(I've thought from time to time about having rsync update the privdata.local +file. Since it's unchanged in most spins, that would probably save network +bandwidth.) +"""]] -- cgit v1.2.3 From bab0f206119fcb26201fc21c77d78c9420cb60ab Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Dec 2015 12:46:03 -0400 Subject: comment --- .../comment_1_c9a24f6022fbe9063356df3ddbd767d6._comment | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring/comment_1_c9a24f6022fbe9063356df3ddbd767d6._comment (limited to 'doc') diff --git a/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring/comment_1_c9a24f6022fbe9063356df3ddbd767d6._comment b/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring/comment_1_c9a24f6022fbe9063356df3ddbd767d6._comment new file mode 100644 index 00000000..c65cc5cd --- /dev/null +++ b/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring/comment_1_c9a24f6022fbe9063356df3ddbd767d6._comment @@ -0,0 +1,16 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2015-12-11T16:41:30Z" + content=""" +More accurately, it's Gpg.keyImported that's failing, and this is because +it's implemented using a flagFile to remember if it's imported the gpg key +before. So the fix would be to implement: + + hasPrivKey :: GpgKeyId -> User -> IO Bool + + hasPubKey :: GpgKeyId -> User -> IO Bool + +And then Gpg.keyImported could use those with `check` to avoid redundant +import. +"""]] -- cgit v1.2.3 From 7bea86e0efb9a914b85459811113b8bc3ae47b9e Mon Sep 17 00:00:00 2001 From: gueux Date: Sun, 13 Dec 2015 20:44:20 +0000 Subject: Added a comment --- .../comment_2_2e37e89b8f108f027d2d8c5962a24536._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/todo/should_not_overwrite_unchanged_private_files/comment_2_2e37e89b8f108f027d2d8c5962a24536._comment (limited to 'doc') diff --git a/doc/todo/should_not_overwrite_unchanged_private_files/comment_2_2e37e89b8f108f027d2d8c5962a24536._comment b/doc/todo/should_not_overwrite_unchanged_private_files/comment_2_2e37e89b8f108f027d2d8c5962a24536._comment new file mode 100644 index 00000000..dbf7ac3b --- /dev/null +++ b/doc/todo/should_not_overwrite_unchanged_private_files/comment_2_2e37e89b8f108f027d2d8c5962a24536._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="gueux" + subject="comment 2" + date="2015-12-13T20:44:20Z" + content=""" +The integrity checker should shout everytime it finds a new version of a file (and if a new version of the file is legitimately received, I can then run \"samhain -t update -m none --interactive\"). As the private files are very often sensitive information, the integrity should shout on them too. To me, it sounds like it should be the default (it may also be useful for backup systems that check when a file was last modified?), but I dont see exactly what should be changed to enable that. What do you think? + +Having privdata uploaded only if it is updated would certainly be cool for slow internet connections. +"""]] -- cgit v1.2.3 From 1443f21864565ad08404c463b6198ba385615ac8 Mon Sep 17 00:00:00 2001 From: gueux Date: Sun, 13 Dec 2015 20:45:06 +0000 Subject: Added a comment --- .../comment_2_2300ca8616f5bd229bf7b72a6fb96980._comment | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring/comment_2_2300ca8616f5bd229bf7b72a6fb96980._comment (limited to 'doc') diff --git a/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring/comment_2_2300ca8616f5bd229bf7b72a6fb96980._comment b/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring/comment_2_2300ca8616f5bd229bf7b72a6fb96980._comment new file mode 100644 index 00000000..8592e7e1 --- /dev/null +++ b/doc/forum/Obnam.backupEncrypted_fails_if_gpg_key_is_already_in_keyring/comment_2_2300ca8616f5bd229bf7b72a6fb96980._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="gueux" + subject="comment 2" + date="2015-12-13T20:45:06Z" + content=""" +OK, I'll try to implement something this way :). +"""]] -- cgit v1.2.3 From ea1b7f15af0fd277ec5431d034b6aecaa45a8d72 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 13 Dec 2015 22:05:42 -0400 Subject: comment --- .../comment_3_5e7127049c1798dfc830d33da0fd78d7._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/should_not_overwrite_unchanged_private_files/comment_3_5e7127049c1798dfc830d33da0fd78d7._comment (limited to 'doc') diff --git a/doc/todo/should_not_overwrite_unchanged_private_files/comment_3_5e7127049c1798dfc830d33da0fd78d7._comment b/doc/todo/should_not_overwrite_unchanged_private_files/comment_3_5e7127049c1798dfc830d33da0fd78d7._comment new file mode 100644 index 00000000..b2de7f4a --- /dev/null +++ b/doc/todo/should_not_overwrite_unchanged_private_files/comment_3_5e7127049c1798dfc830d33da0fd78d7._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2015-12-14T02:03:40Z" + content=""" +The place the privdata file gets saved is Spin.hs, when `update` +calls "writeFileProtected privfile" +"""]] -- cgit v1.2.3 From e528dd7f7b6c2bfa8fc3eed26a4f981e201ac32e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 19 Dec 2015 17:03:23 -0400 Subject: add news item for propellor 2.15.1 --- doc/news/version_2.10.0.mdwn | 4 ---- doc/news/version_2.15.1.mdwn | 11 +++++++++++ 2 files changed, 11 insertions(+), 4 deletions(-) delete mode 100644 doc/news/version_2.10.0.mdwn create mode 100644 doc/news/version_2.15.1.mdwn (limited to 'doc') diff --git a/doc/news/version_2.10.0.mdwn b/doc/news/version_2.10.0.mdwn deleted file mode 100644 index 67d08c88..00000000 --- a/doc/news/version_2.10.0.mdwn +++ /dev/null @@ -1,4 +0,0 @@ -propellor 2.10.0 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * The Propellor.Property.Spin added in the last release is replaced - with a very different Propellor.Property.ControlHeir."""]] \ No newline at end of file diff --git a/doc/news/version_2.15.1.mdwn b/doc/news/version_2.15.1.mdwn new file mode 100644 index 00000000..ea750b6a --- /dev/null +++ b/doc/news/version_2.15.1.mdwn @@ -0,0 +1,11 @@ +propellor 2.15.1 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Added git configs propellor.spin-branch and propellor.forbid-dirty-spin. + Thanks, Sean Whitton. + * Added User.systemAccountFor and User.systemAccountFor' properties. + Thanks, Félix Sipma. + * Gpg.keyImported converted to not use a flag file and instead check + if gpg has the provided key already. + Thanks, Félix Sipma. + * Merged Utility changes from git-annex. + * Clean build with ghc 7.10."""]] \ No newline at end of file -- cgit v1.2.3 From 0b0e8aaf827b0de5232b648142873e29504f2076 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Mon, 28 Dec 2015 16:58:41 +0000 Subject: pull request --- doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn (limited to 'doc') diff --git a/doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn b/doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn new file mode 100644 index 00000000..ff34006a --- /dev/null +++ b/doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn @@ -0,0 +1,7 @@ +Please consider merging branch `hothasktags` of my repo `https://git.spwhitton.name/propellor` + +Moves the `2>/dev/null` redirection in the Makefile rule for `tags` in order to silence xargs if hothasktags is not installed (avoids `xargs: hothasktags: No such file or directory`). + +I assume that your originally intention was not to cause an error if hothasktags is not installed, since you have `|| true` at the end of the line. However, someone trying to build propellor's Debian package saw the error output from xargs and thought it meant hothasktags should be a build-dep. This patch prevents someone thinking that. + +-- [[spwhitton|https://spwhitton.name]] -- cgit v1.2.3 From c98120966770db0329589c2aaf76e36131052cbd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 28 Dec 2015 14:33:52 -0400 Subject: merged --- doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn b/doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn index ff34006a..efa17987 100644 --- a/doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn +++ b/doc/todo/silence_xargs_when_hothasktags_not_installed.mdwn @@ -5,3 +5,5 @@ Moves the `2>/dev/null` redirection in the Makefile rule for `tags` in order to I assume that your originally intention was not to cause an error if hothasktags is not installed, since you have `|| true` at the end of the line. However, someone trying to build propellor's Debian package saw the error output from xargs and thought it meant hothasktags should be a build-dep. This patch prevents someone thinking that. -- [[spwhitton|https://spwhitton.name]] + +> [[merged|done]] --[[Joey]] -- cgit v1.2.3 From 299d478dfd96037c660109c4f0519fd1cc37a887 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 30 Dec 2015 15:03:51 -0400 Subject: comment --- .../comment_2_9070abc82d8aa259aca187ed5d6638cc._comment | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/forum/gnupg2/comment_2_9070abc82d8aa259aca187ed5d6638cc._comment (limited to 'doc') diff --git a/doc/forum/gnupg2/comment_2_9070abc82d8aa259aca187ed5d6638cc._comment b/doc/forum/gnupg2/comment_2_9070abc82d8aa259aca187ed5d6638cc._comment new file mode 100644 index 00000000..d8233cee --- /dev/null +++ b/doc/forum/gnupg2/comment_2_9070abc82d8aa259aca187ed5d6638cc._comment @@ -0,0 +1,12 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2015-12-30T19:02:30Z" + content=""" +I've merged a patch that adds a GNUPGBIN environment variable. + +It might make sense for propellor to look at git's gpg.program +configuration and use it if set. Probably a propellor user wants to use the +same gpg program for both signing and verifying their git commit and for +propellor's privdata. +"""]] -- cgit v1.2.3 From a7e2fc5b0a3c331ebe30c4298358388fc74ea693 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 3 Jan 2016 16:57:53 -0400 Subject: comment --- .../gnupg2/comment_3_996fe5791c175d709217875b5e751c4f._comment | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/forum/gnupg2/comment_3_996fe5791c175d709217875b5e751c4f._comment (limited to 'doc') diff --git a/doc/forum/gnupg2/comment_3_996fe5791c175d709217875b5e751c4f._comment b/doc/forum/gnupg2/comment_3_996fe5791c175d709217875b5e751c4f._comment new file mode 100644 index 00000000..ead20fb6 --- /dev/null +++ b/doc/forum/gnupg2/comment_3_996fe5791c175d709217875b5e751c4f._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2016-01-03T20:57:42Z" + content=""" +gpg.program is also honored now +"""]] -- cgit v1.2.3 From 6a889ff04faf68d35e035a464ac01a7a96bde3e2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 3 Jan 2016 17:02:02 -0400 Subject: add news item for propellor 2.15.2 --- doc/news/version_2.12.0.mdwn | 18 ------------------ doc/news/version_2.15.2.mdwn | 9 +++++++++ 2 files changed, 9 insertions(+), 18 deletions(-) delete mode 100644 doc/news/version_2.12.0.mdwn create mode 100644 doc/news/version_2.15.2.mdwn (limited to 'doc') diff --git a/doc/news/version_2.12.0.mdwn b/doc/news/version_2.12.0.mdwn deleted file mode 100644 index 58a7193c..00000000 --- a/doc/news/version_2.12.0.mdwn +++ /dev/null @@ -1,18 +0,0 @@ -propellor 2.12.0 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * The DiskImage module can now make bootable images using grub. - * Add a ChrootTarball chroot type, for using pre-built tarballs - as chroots. Thanks, Ben Boeckel. - * HostName: Improve domain extraction code. - * Added Mount.fstabbed property to generate /etc/fstab to replicate - current mounts. - * HostName: Improve domain extraction code. - * Add File.basedOn. Thanks, Per Olofsson. - * Changed how the operating system is provided to Chroot (API change). - Where before debootstrapped and bootstrapped took a System parameter, - the os property should now be added to the Chroot. - * Follow-on change to Systemd.container, which now takes a System parameter. - * Generalized Property.check so it can be used with Propellor actions as - well as IO actions. - * Hostname.sane and Hostname.setTo can now safely be used as a property - of a chroot, and won't affect the hostname of the host system."""]] \ No newline at end of file diff --git a/doc/news/version_2.15.2.mdwn b/doc/news/version_2.15.2.mdwn new file mode 100644 index 00000000..b1a3bf80 --- /dev/null +++ b/doc/news/version_2.15.2.mdwn @@ -0,0 +1,9 @@ +propellor 2.15.2 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Added GNUPGBIN environment variable or git.program git config + to control the command run for gpg. Allows eg, GNUPGBIN=gpg2 + Thanks, Félix Sipma. + * Bootstrap apt-get installs run with deconf noninteractive frontend. + * spin --via: Avoid committing on relay host. + * Postfix: Add service property to enable/disable services in master.cf. + * Added Munin module, contributed by Jelmer Vernooij."""]] \ No newline at end of file -- cgit v1.2.3 From bc5f7a81f0c7a62f788eb05c101c5bef593ba0b5 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Tue, 5 Jan 2016 12:47:32 +0000 Subject: pull request --- doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn (limited to 'doc') diff --git a/doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn b/doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn new file mode 100644 index 00000000..c9a6cc2f --- /dev/null +++ b/doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn @@ -0,0 +1,5 @@ +Please consider merging branch `defaultbranch` of repo `https://git.spwhitton.name/propellor`. + +This branch adds a new property `Git.bareRepoDefaultBranch` which sets the default branch of a bare repository. This is useful when hosting git repositories that don't have a master branch, so that something gets checked out when someone clones them. + +I limited this property to bare repositories since the notion of a default branch for a non-bare repository doesn't really make sense. -- cgit v1.2.3 From 1b4a40210fe0f9f5bb151aa9e2707837cc193883 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 Jan 2016 13:34:22 -0400 Subject: cloe --- doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn b/doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn index c9a6cc2f..038ab876 100644 --- a/doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn +++ b/doc/todo/pull_request:_Git.bareRepoDefaultBranch_property.mdwn @@ -3,3 +3,5 @@ Please consider merging branch `defaultbranch` of repo `https://git.spwhitton.na This branch adds a new property `Git.bareRepoDefaultBranch` which sets the default branch of a bare repository. This is useful when hosting git repositories that don't have a master branch, so that something gets checked out when someone clones them. I limited this property to bare repositories since the notion of a default branch for a non-bare repository doesn't really make sense. + +> [[merged|done]] --[[Joey]] -- cgit v1.2.3 From 6bbb6fd3cae8ace96eaa70adee2c6f1394244740 Mon Sep 17 00:00:00 2001 From: picca Date: Tue, 12 Jan 2016 12:31:12 +0000 Subject: --- .../propellor_2.15.2_does_not_work_on_jessie.mdwn | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 doc/forum/propellor_2.15.2_does_not_work_on_jessie.mdwn (limited to 'doc') diff --git a/doc/forum/propellor_2.15.2_does_not_work_on_jessie.mdwn b/doc/forum/propellor_2.15.2_does_not_work_on_jessie.mdwn new file mode 100644 index 00000000..7676a8a3 --- /dev/null +++ b/doc/forum/propellor_2.15.2_does_not_work_on_jessie.mdwn @@ -0,0 +1,20 @@ +Hello, I am trying to use propellor 2.15.2 on jessie. + +but when I do + +runhaskell config.hs, I get this error message + + + Propellor/Git.hs:10:9 Not in scope: `<$>' + + Propellor/Git.hs:14:9 Not in scope: `<$>' + + Propellor/Git.hs:18:9 Not in scope: `<$>' + + Propellor/Git.hs:22:21 Not in scope: `<$>' + +maybe an import is missing with ghc 7.6.3 + +Cheers + +Frederic -- cgit v1.2.3 From 358321afad0445e66c0aaaea74c4e80caafb77b4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Jan 2016 12:40:14 -0400 Subject: comment --- .../comment_1_eafe3affdad32bc9f4493a938f71d83f._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/forum/propellor_2.15.2_does_not_work_on_jessie/comment_1_eafe3affdad32bc9f4493a938f71d83f._comment (limited to 'doc') diff --git a/doc/forum/propellor_2.15.2_does_not_work_on_jessie/comment_1_eafe3affdad32bc9f4493a938f71d83f._comment b/doc/forum/propellor_2.15.2_does_not_work_on_jessie/comment_1_eafe3affdad32bc9f4493a938f71d83f._comment new file mode 100644 index 00000000..f3af56ee --- /dev/null +++ b/doc/forum/propellor_2.15.2_does_not_work_on_jessie/comment_1_eafe3affdad32bc9f4493a938f71d83f._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-01-12T16:39:26Z" + content=""" +Yes, unfortuntely by importing Control.Applicative by default, newer +versions of ghc make it rather harder to produce code that will build on +older versions too. I've added these imports. +"""]] -- cgit v1.2.3 From 2662cb07058a5a650cf163877ad166e28c664a8f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 12 Jan 2016 12:42:39 -0400 Subject: add news item for propellor 2.15.3 --- doc/news/version_2.13.0.mdwn | 27 --------------------------- doc/news/version_2.15.3.mdwn | 5 +++++ 2 files changed, 5 insertions(+), 27 deletions(-) delete mode 100644 doc/news/version_2.13.0.mdwn create mode 100644 doc/news/version_2.15.3.mdwn (limited to 'doc') diff --git a/doc/news/version_2.13.0.mdwn b/doc/news/version_2.13.0.mdwn deleted file mode 100644 index c3cb8828..00000000 --- a/doc/news/version_2.13.0.mdwn +++ /dev/null @@ -1,27 +0,0 @@ -propellor 2.13.0 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * RevertableProperty used to be assumed to contain info, but this is - now made explicit, with RevertableProperty HasInfo or - RevertableProperty NoInfo. (API change) - Transition guide: - - If you define a RevertableProperty, expect some type check - failures like: "Expecting one more argument to ‘RevertableProperty’". - - Change it to "RevertableProperty NoInfo" - - The compiler will then tell you if it needs "HasInfo" instead. - - If you have code that uses the RevertableProperty constructor - that fails to type check, use the more powerful <!> operator - instead to create the RevertableProperty. - * Various property combinators that combined a RevertableProperty - with a non-revertable property used to yield a RevertableProperty. - This was a bug, because the combined property could not be fully - reverted in many cases, and the result is now a non-revertable property. - * combineWith now takes an additional parameter to control how revert - actions are combined (API change). - * Added Propellor.Property.Concurrent for concurrent properties. - * Made the execProcess exported by propellor, and everything built on it, - avoid scrambled output when run concurrently. - * Propellor now depends on STM and text. - * The cabal file now builds propellor with -O. While -O0 makes ghc - take less memory while building propellor, it can lead to bad memory - usage at runtime due to eg, disabled stream fusion. - * Add File.isCopyOf. Thanks, Per Olofsson."""]] \ No newline at end of file diff --git a/doc/news/version_2.15.3.mdwn b/doc/news/version_2.15.3.mdwn new file mode 100644 index 00000000..a8a2a53e --- /dev/null +++ b/doc/news/version_2.15.3.mdwn @@ -0,0 +1,5 @@ +propellor 2.15.3 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Added Git.bareRepoDefaultBranch property + Thanks, Sean Whitton. + * Add missing Control.Applicative imports needed by older versions of ghc."""]] \ No newline at end of file -- cgit v1.2.3 From 143d77adcdba4800099dd7ab752f88dddde579c2 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 17 Jan 2016 21:16:47 +0000 Subject: submit pull request --- ...ducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn (limited to 'doc') diff --git a/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn b/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn new file mode 100644 index 00000000..708c346c --- /dev/null +++ b/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn @@ -0,0 +1,5 @@ +Please consider merging branch `reproducible` of repository `https://git.spwhitton.name/propellor`. + +This makes the generated `/usr/src/propellor/propellor.git` reproducible, so that the whole Debian package can be built reproducibly. + +So far as I can tell, this is the only part of the propellor build that is not reproducible at present. It's also the only issue listed on the [[reproducible builds team website|https://reproducible.debian.net/rb-pkg/unstable/amd64/propellor.html]]. -- cgit v1.2.3 From 6f40856880913837ba599f1101b02f4e7a95f0a7 Mon Sep 17 00:00:00 2001 From: spwhitton Date: Sun, 17 Jan 2016 21:17:34 +0000 Subject: sign --- ...producible___47__usr__47__src__47__propellor__47__propellor.git.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn b/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn index 708c346c..546cce37 100644 --- a/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn +++ b/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn @@ -3,3 +3,5 @@ Please consider merging branch `reproducible` of repository `https://git.spwhitt This makes the generated `/usr/src/propellor/propellor.git` reproducible, so that the whole Debian package can be built reproducibly. So far as I can tell, this is the only part of the propellor build that is not reproducible at present. It's also the only issue listed on the [[reproducible builds team website|https://reproducible.debian.net/rb-pkg/unstable/amd64/propellor.html]]. + +--spwhitton -- cgit v1.2.3 From e30d6174f680c061298d09ecbcecd989b900a7c1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 18 Jan 2016 13:21:27 -0400 Subject: comment --- ...___47__usr__47__src__47__propellor__47__propellor.git.mdwn | 2 ++ .../comment_1_d1ed8af3172ada81d166063f0b38e23a._comment | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git/comment_1_d1ed8af3172ada81d166063f0b38e23a._comment (limited to 'doc') diff --git a/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn b/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn index 546cce37..0e122ddc 100644 --- a/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn +++ b/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git.mdwn @@ -5,3 +5,5 @@ This makes the generated `/usr/src/propellor/propellor.git` reproducible, so tha So far as I can tell, this is the only part of the propellor build that is not reproducible at present. It's also the only issue listed on the [[reproducible builds team website|https://reproducible.debian.net/rb-pkg/unstable/amd64/propellor.html]]. --spwhitton + +> merged; [[done]] --[[Joey]] diff --git a/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git/comment_1_d1ed8af3172ada81d166063f0b38e23a._comment b/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git/comment_1_d1ed8af3172ada81d166063f0b38e23a._comment new file mode 100644 index 00000000..1af7a9e6 --- /dev/null +++ b/doc/todo/pull_request:_reproducible___47__usr__47__src__47__propellor__47__propellor.git/comment_1_d1ed8af3172ada81d166063f0b38e23a._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-01-18T17:17:55Z" + content=""" +I've merged that, thanks. + +IIRC, ghc only produces reproducible output when not doing any parallel +building. If that is currently avoided, it's probably only by accident. +It might be worth forcing -j1 when building the debian package. +"""]] -- cgit v1.2.3 From c6651b2fa7fa7ab3c31f340524e3473301e14a3b Mon Sep 17 00:00:00 2001 From: cmt.miniBill@1ee673129c276f72c8d7c2974091af7618a22c2a Date: Mon, 1 Feb 2016 23:09:49 +0000 Subject: Added a comment: Output --- .../comment_1_0c428752e38798f0e8c8a72457c0a670._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/concurrency/comment_1_0c428752e38798f0e8c8a72457c0a670._comment (limited to 'doc') diff --git a/doc/todo/concurrency/comment_1_0c428752e38798f0e8c8a72457c0a670._comment b/doc/todo/concurrency/comment_1_0c428752e38798f0e8c8a72457c0a670._comment new file mode 100644 index 00000000..f5505140 --- /dev/null +++ b/doc/todo/concurrency/comment_1_0c428752e38798f0e8c8a72457c0a670._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="cmt.miniBill@1ee673129c276f72c8d7c2974091af7618a22c2a" + nickname="cmt.miniBill" + subject="Output" + date="2016-02-01T23:09:49Z" + content=""" +Didn't you solve the output problem for git-annex? +"""]] -- cgit v1.2.3 From 1671aae6d464f090f255dfe676e89db5345fd48a Mon Sep 17 00:00:00 2001 From: cmt.miniBill@1ee673129c276f72c8d7c2974091af7618a22c2a Date: Tue, 2 Feb 2016 10:23:21 +0000 Subject: --- ...Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 doc/todo/Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn (limited to 'doc') diff --git a/doc/todo/Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn b/doc/todo/Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn new file mode 100644 index 00000000..796802b8 --- /dev/null +++ b/doc/todo/Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn @@ -0,0 +1,2 @@ +Please merge this commit +https://github.com/miniBill/propellor/commit/0d9cd127c3448998aa4e4d20a8ce4083ee4b4362 -- cgit v1.2.3 From 218060d05467812ddbd4b3f0e59fc4f10f08b659 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 2 Feb 2016 12:04:53 -0400 Subject: close --- doc/todo/concurrency.mdwn | 3 +++ .../comment_2_d259eb0ff27327cc94542c9374d3da90._comment | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 doc/todo/concurrency/comment_2_d259eb0ff27327cc94542c9374d3da90._comment (limited to 'doc') diff --git a/doc/todo/concurrency.mdwn b/doc/todo/concurrency.mdwn index fa0e22ea..0d1dc847 100644 --- a/doc/todo/concurrency.mdwn +++ b/doc/todo/concurrency.mdwn @@ -109,3 +109,6 @@ responsible for such output, but it could be printed out, with appropriate warnings, at the end. [[!tag user/joey]] + +> [[done]]; use Propellor.Property.Concurrent to make properties run +> concurrently. --[[Joey]] diff --git a/doc/todo/concurrency/comment_2_d259eb0ff27327cc94542c9374d3da90._comment b/doc/todo/concurrency/comment_2_d259eb0ff27327cc94542c9374d3da90._comment new file mode 100644 index 00000000..b2f2e192 --- /dev/null +++ b/doc/todo/concurrency/comment_2_d259eb0ff27327cc94542c9374d3da90._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2016-02-02T16:04:31Z" + content=""" +Oh I forgot to close this. Propellor has had Propellor.Property.Concurrent +for a while. +"""]] -- cgit v1.2.3 From fcd124fe7e28e7abdfa8db15a4fbc3524aa98de0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 2 Feb 2016 12:06:56 -0400 Subject: close --- ...Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/todo/Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn b/doc/todo/Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn index 796802b8..58c9b5ca 100644 --- a/doc/todo/Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn +++ b/doc/todo/Fix___40__-__62__-__41___signature_in_Propellor.Types.Container.mdwn @@ -1,2 +1,4 @@ Please merge this commit https://github.com/miniBill/propellor/commit/0d9cd127c3448998aa4e4d20a8ce4083ee4b4362 + +> [[done]], thanks --[[Joey]] -- cgit v1.2.3 From 16a674dab73893657f040bbd15a04bf0ec5c44a7 Mon Sep 17 00:00:00 2001 From: picca Date: Mon, 8 Feb 2016 10:33:22 +0000 Subject: --- doc/forum/howto_mapM_RevertableProperty.mdwn | 52 ++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 doc/forum/howto_mapM_RevertableProperty.mdwn (limited to 'doc') diff --git a/doc/forum/howto_mapM_RevertableProperty.mdwn b/doc/forum/howto_mapM_RevertableProperty.mdwn new file mode 100644 index 00000000..7ebcbd47 --- /dev/null +++ b/doc/forum/howto_mapM_RevertableProperty.mdwn @@ -0,0 +1,52 @@ +Hello + +I have this kind of property + + myProperty :: Conf -> RevertableProperty NoInfo + + +now I have a [Conf] and I want to create also a RevertableProperty NoInfo which apply myProperty for each Conf + +I tried to find an equivalent of mapM for properties but I found nothing which works as expected. + +I tried with combineProperties but it failed also with a "cryptic message" +mpoints is the [Conf] + + + src/config.hs:250:17: + Couldn't match type `CInfo + (PropertyListType (Property [NoInfo])) + (PropertyListType (Property [NoInfo]))' + with `NoInfo' + Expected type: RevertableProperty NoInfo + Actual type: RevertableProperty + (CInfo + (PropertyListType (Property [NoInfo])) + (PropertyListType (Property [NoInfo]))) + In the expression: mount umount + In an equation for `mountExp': + mountExp b + = mount umount + where + mount + = combineProperties + "mount nfs files" (mapM mount'' mpoints) + umount + = combineProperties + "umount nfs files" (mapM umount'' mpoints) + mpoints + = [MountConf + "nfs" + ("ruche-" + ++ + beamline ++ ".mydomain.org:/" ++ beamline ++ "-users") + ("/nfs/ruche-" ++ beamline ++ "/" ++ beamline ++ "-users"), + ....] + beamline = show b + +What is the right way to create a RevertableProperty from a list of RevertableProperty + +thanks + +Frederic + -- cgit v1.2.3 From f1d37c9382bc0715be0689c61541a8fdef893de3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 8 Feb 2016 11:19:23 -0400 Subject: response --- ...ent_1_c2800340a5361add82f5e9e30b56b18c._comment | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/forum/howto_mapM_RevertableProperty/comment_1_c2800340a5361add82f5e9e30b56b18c._comment (limited to 'doc') diff --git a/doc/forum/howto_mapM_RevertableProperty/comment_1_c2800340a5361add82f5e9e30b56b18c._comment b/doc/forum/howto_mapM_RevertableProperty/comment_1_c2800340a5361add82f5e9e30b56b18c._comment new file mode 100644 index 00000000..66ac9a4f --- /dev/null +++ b/doc/forum/howto_mapM_RevertableProperty/comment_1_c2800340a5361add82f5e9e30b56b18c._comment @@ -0,0 +1,22 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-02-08T15:00:26Z" + content=""" +combineProperties takes a list of PropertyListType, which is a type family +consisting of [Property NoInfo] and [Property HasInfo]. So, you need to get +from RevertableProperty NoInfo to one of those. `toProp` can do that. + + combineProperties "desc" (map (toProp . myProperty) confs) + +But! I had a look and it was easy to make [RevertableProperty i] an +instance of PropertyListType, which makes what you already tried type check +too. I've done so in git. + +It would perhaps be nice to make lists of various sorts of properties +instances of Traversable, so that mapM etc could be used over them. That +would need some kind of monad for combining properties though, which does +not currently exist. Might make more sense to make an instance of Foldable +or just Monoid for properties. Any improvements in this area would be +appreciated! +"""]] -- cgit v1.2.3 From dcc395e2d17b1a8b885179daa721c01f8b21f21e Mon Sep 17 00:00:00 2001 From: picca Date: Wed, 10 Feb 2016 06:41:49 +0000 Subject: Added a comment --- ...ent_2_1327f1f218433ce262f871771c43452c._comment | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 doc/forum/howto_mapM_RevertableProperty/comment_2_1327f1f218433ce262f871771c43452c._comment (limited to 'doc') diff --git a/doc/forum/howto_mapM_RevertableProperty/comment_2_1327f1f218433ce262f871771c43452c._comment b/doc/forum/howto_mapM_RevertableProperty/comment_2_1327f1f218433ce262f871771c43452c._comment new file mode 100644 index 00000000..20f6e640 --- /dev/null +++ b/doc/forum/howto_mapM_RevertableProperty/comment_2_1327f1f218433ce262f871771c43452c._comment @@ -0,0 +1,23 @@ +[[!comment format=mdwn + username="picca" + subject="comment 2" + date="2016-02-10T06:41:49Z" + content=""" +Thanks a lot joey :) + +I am learning haskell for now and I am not very confortable yet with the haskell Monoid, functor, applicative and monad. + +So what you are saying is that it would be great to do something like + + instance monoid Property where + mempty = doNothing + mappend p1 p2 = combineProperty [p1, p2] + mconcat ps = combineProperty ps + +in order to combine properties. +my question is why did you choose to create combineProperty instead of a Monoid at first ? + +thanks + +Frederic +"""]] -- cgit v1.2.3 From e6cbbe3926c4dbc0817a3ed383da91e38ee384b4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 10 Feb 2016 12:17:51 -0400 Subject: comment --- .../comment_3_7e519cc5f1c07b66561ec31866ddbc8a._comment | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/forum/howto_mapM_RevertableProperty/comment_3_7e519cc5f1c07b66561ec31866ddbc8a._comment (limited to 'doc') diff --git a/doc/forum/howto_mapM_RevertableProperty/comment_3_7e519cc5f1c07b66561ec31866ddbc8a._comment b/doc/forum/howto_mapM_RevertableProperty/comment_3_7e519cc5f1c07b66561ec31866ddbc8a._comment new file mode 100644 index 00000000..79ca2d93 --- /dev/null +++ b/doc/forum/howto_mapM_RevertableProperty/comment_3_7e519cc5f1c07b66561ec31866ddbc8a._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2016-02-10T16:09:08Z" + content=""" +Would probably be better to use `before`, since `combineProperties` +needs a description of the combined properties. + +Using `doNothing` is kind of a hack, it would make propellor say it was +running "noop property". Perhaps better to use a SemiGroup than a Monoid. +"""]] -- cgit v1.2.3 From 67b51860a3b7ca56e19e54af262f93a1bc5a9394 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Feb 2016 12:53:12 -0400 Subject: add news item for propellor 2.15.4 --- doc/news/version_2.14.0.mdwn | 14 -------------- doc/news/version_2.15.4.mdwn | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) delete mode 100644 doc/news/version_2.14.0.mdwn create mode 100644 doc/news/version_2.15.4.mdwn (limited to 'doc') diff --git a/doc/news/version_2.14.0.mdwn b/doc/news/version_2.14.0.mdwn deleted file mode 100644 index 2a6e7bda..00000000 --- a/doc/news/version_2.14.0.mdwn +++ /dev/null @@ -1,14 +0,0 @@ -propellor 2.14.0 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * Add Propellor.Property.PropellorRepo.hasOriginUrl, an explicit way to - set the git repository url normally implicitly set when using --spin. - * Added Chroot.noServices property. - * DiskImage creation automatically uses Chroot.noServices. - * Removed the (unused) dependency on quickcheck. - * DebianMirror: Added a DebianMirror type for configuration (API change) - Thanks, Félix Sipma. - * DebianMirror: Add RsyncExtra to configuration. - Thanks, Félix Sipma. - * Added Git.repoConfigured and Git.repoAcceptsNonFFs properties. - Thanks, Sean Whitton - * Added User.hasDesktopGroups property."""]] \ No newline at end of file diff --git a/doc/news/version_2.15.4.mdwn b/doc/news/version_2.15.4.mdwn new file mode 100644 index 00000000..4e20bcc9 --- /dev/null +++ b/doc/news/version_2.15.4.mdwn @@ -0,0 +1,15 @@ +propellor 2.15.4 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Build /usr/src/propellor/propellor.git reproducibly, + which makes the whole Debian package build reproducibly. + Thanks, Sean Whitton. + * Obnam: To cause old generations to be forgotten, keepParam can be + passed to a backup property; this causes obnam forget to be run. + * Delete /etc/apt/apt.conf.d/50unattended-upgrades.ucf-dist when + unattended-upgrades is installed, to work around #812380 which results + in many warnings from apt, including in cron mails. + * Added Propellor.Property.LetsEncrypt + * Apache.httpsVirtualHost: New property, setting up a https vhost + with the certificate automatically obtained using letsencrypt. + * Allow using combineProperties and propertyList with lists of + RevertableProperty."""]] \ No newline at end of file -- cgit v1.2.3 From 17b1fcef0881e8edb5e78a6f78d4c1fee481a25f Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Mon, 22 Feb 2016 04:25:24 +0000 Subject: Added a comment: Quasiquoter --- .../comment_1_98a4c56ba162a1e04a5b5649ff39ee3f._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config/comment_1_98a4c56ba162a1e04a5b5649ff39ee3f._comment (limited to 'doc') diff --git a/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config/comment_1_98a4c56ba162a1e04a5b5649ff39ee3f._comment b/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config/comment_1_98a4c56ba162a1e04a5b5649ff39ee3f._comment new file mode 100644 index 00000000..553ba0b9 --- /dev/null +++ b/doc/forum/Script_to_convert_config_files_for_inclusion_in_Propellor_config/comment_1_98a4c56ba162a1e04a5b5649ff39ee3f._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" + nickname="mithrandi" + subject="Quasiquoter" + date="2016-02-22T04:25:24Z" + content=""" +You could also use something like [raw-strings-qq](http://hackage.haskell.org/package/raw-strings-qq) to embed the files as-is without having to quote/escape a ton of stuff. +"""]] -- cgit v1.2.3 From 8c30a41ab97ac127ea0ba98e23540f7790f6dbfb Mon Sep 17 00:00:00 2001 From: gnusosa@2538fbd05a723a8f83b066e159f5d5f83b9f400d Date: Wed, 24 Feb 2016 20:19:17 +0000 Subject: --- doc/forum/Understanding_changesFile_equation.mdwn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/forum/Understanding_changesFile_equation.mdwn (limited to 'doc') diff --git a/doc/forum/Understanding_changesFile_equation.mdwn b/doc/forum/Understanding_changesFile_equation.mdwn new file mode 100644 index 00000000..5e360097 --- /dev/null +++ b/doc/forum/Understanding_changesFile_equation.mdwn @@ -0,0 +1,15 @@ +Hi, I'm trying to understand a part of the `changesFile` equation, specifically `oldstat`. + +``` +changesFile :: Checkable p i => p i -> FilePath -> Property i +changesFile p f = checkResult getstat comparestat p + where + getstat = catchMaybeIO $ getSymbolicLinkStatus f + comparestat oldstat = do + newstat <- getstat + return $ if samestat oldstat newstat then NoChange else MadeChange +``` + +As we see, we catch `getstat` given `f`, but what I don't understand or see, is how is `oldstat` been passed/generated? + +Thanks for the help. -- cgit v1.2.3 From a2323b58c2edba99f06d7810b95da05aecb20b5f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 24 Feb 2016 17:12:43 -0400 Subject: comment --- .../comment_1_eab28824f8cd1a03bcc16aee4e161643._comment | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/forum/Understanding_changesFile_equation/comment_1_eab28824f8cd1a03bcc16aee4e161643._comment (limited to 'doc') diff --git a/doc/forum/Understanding_changesFile_equation/comment_1_eab28824f8cd1a03bcc16aee4e161643._comment b/doc/forum/Understanding_changesFile_equation/comment_1_eab28824f8cd1a03bcc16aee4e161643._comment new file mode 100644 index 00000000..22bcc014 --- /dev/null +++ b/doc/forum/Understanding_changesFile_equation/comment_1_eab28824f8cd1a03bcc16aee4e161643._comment @@ -0,0 +1,15 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-02-24T21:09:52Z" + content=""" +`checkResult` is the key to understanding this. Its (simplified) type +signature: + + checkResult :: m a -> (a -> m Result) -> p i -> Property i + +It's being given getstat as the first parameter. It runs that before the +property does anything, and it passes that value to comparestat. + +So, oldstat is the getstat value from before the property did anything. +"""]] -- cgit v1.2.3 From c2d824b258860b6e1b69bfbe98f52354719038de Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Fri, 26 Feb 2016 12:20:37 +0000 Subject: --- doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn (limited to 'doc') diff --git a/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn b/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn new file mode 100644 index 00000000..48054980 --- /dev/null +++ b/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn @@ -0,0 +1 @@ +I couldn't quite figure out what is wrong with the code as written, but the properties in modAuthorizedKey relating to the file modes/ownership get applied before the properties to create the directory and file are applied, so if they don't already exists then you get an error. -- cgit v1.2.3 From abc1f31e8d6c73fc80d8b0cbb82c907bc94e75d0 Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Fri, 26 Feb 2016 12:52:53 +0000 Subject: --- doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn b/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn index 48054980..aa40dffc 100644 --- a/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn +++ b/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user.mdwn @@ -1 +1 @@ -I couldn't quite figure out what is wrong with the code as written, but the properties in modAuthorizedKey relating to the file modes/ownership get applied before the properties to create the directory and file are applied, so if they don't already exists then you get an error. +I couldn't quite figure out what is wrong with the code as written, but the properties in modAuthorizedKey relating to the file modes/ownership get applied before the properties to create the directory and file are applied, so if they don't already exist then you get an error. -- cgit v1.2.3 From 5efbf179bc0be8528c8aad39870169ec24d98510 Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Fri, 26 Feb 2016 13:06:38 +0000 Subject: Added a comment --- .../comment_2_5b5c8217eeb48159109b453197694db3._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/revertable_Ssh.authorizedKey/comment_2_5b5c8217eeb48159109b453197694db3._comment (limited to 'doc') diff --git a/doc/todo/revertable_Ssh.authorizedKey/comment_2_5b5c8217eeb48159109b453197694db3._comment b/doc/todo/revertable_Ssh.authorizedKey/comment_2_5b5c8217eeb48159109b453197694db3._comment new file mode 100644 index 00000000..ddadd4f4 --- /dev/null +++ b/doc/todo/revertable_Ssh.authorizedKey/comment_2_5b5c8217eeb48159109b453197694db3._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" + nickname="mithrandi" + subject="comment 2" + date="2016-02-26T13:06:38Z" + content=""" +Ssh.unauthorizedKey exists now; is there a reason not to add it to authorizedKey to make it revertable? +"""]] -- cgit v1.2.3 From b56f33bf5f3870081cf42fc67c752e1918a01b50 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 26 Feb 2016 10:56:08 -0400 Subject: fixed --- .../comment_1_e22d4f2c96564a7f927a83207651be1c._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user/comment_1_e22d4f2c96564a7f927a83207651be1c._comment (limited to 'doc') diff --git a/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user/comment_1_e22d4f2c96564a7f927a83207651be1c._comment b/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user/comment_1_e22d4f2c96564a7f927a83207651be1c._comment new file mode 100644 index 00000000..40ab94c4 --- /dev/null +++ b/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user/comment_1_e22d4f2c96564a7f927a83207651be1c._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-02-26T14:55:32Z" + content=""" +Indeed, I think I've fixed it by making the permissions fixup come `after` +the property that creates the file, rather than `before`. +"""]] -- cgit v1.2.3 From 05b698f8b2ef2969124a0389e5475bbb2c0d26bf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 26 Feb 2016 11:03:49 -0400 Subject: close --- doc/todo/revertable_Ssh.authorizedKey.mdwn | 2 ++ .../comment_3_54b1c00246663c845a1b919ccdc168fd._comment | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 doc/todo/revertable_Ssh.authorizedKey/comment_3_54b1c00246663c845a1b919ccdc168fd._comment (limited to 'doc') diff --git a/doc/todo/revertable_Ssh.authorizedKey.mdwn b/doc/todo/revertable_Ssh.authorizedKey.mdwn index f92eaee8..79c59bcc 100644 --- a/doc/todo/revertable_Ssh.authorizedKey.mdwn +++ b/doc/todo/revertable_Ssh.authorizedKey.mdwn @@ -1 +1,3 @@ I recently lost the security key I store my primary SSH key on, and had to remove that key from all authorized_keys files I had access to. It would be great if Ssh.authorizedKey was revertable, so that this could be done simply by adding a ! before existing Ssh.authorizedKey lines. + +> [[done]] --[[Joey]] diff --git a/doc/todo/revertable_Ssh.authorizedKey/comment_3_54b1c00246663c845a1b919ccdc168fd._comment b/doc/todo/revertable_Ssh.authorizedKey/comment_3_54b1c00246663c845a1b919ccdc168fd._comment new file mode 100644 index 00000000..e6ba53cb --- /dev/null +++ b/doc/todo/revertable_Ssh.authorizedKey/comment_3_54b1c00246663c845a1b919ccdc168fd._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2016-02-26T14:56:36Z" + content=""" +No particular reason. I've made the change. +"""]] -- cgit v1.2.3 From d1984555f7f452937bc672c385ab4bbab6527fcc Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Fri, 26 Feb 2016 23:36:33 +0000 Subject: Added a comment --- .../comment_2_3cd8b6d02f8826f27b41c1ca27817bfe._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user/comment_2_3cd8b6d02f8826f27b41c1ca27817bfe._comment (limited to 'doc') diff --git a/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user/comment_2_3cd8b6d02f8826f27b41c1ca27817bfe._comment b/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user/comment_2_3cd8b6d02f8826f27b41c1ca27817bfe._comment new file mode 100644 index 00000000..5b308812 --- /dev/null +++ b/doc/forum/Ssh.authorizedKey_does_not_work_on_brand_new_user/comment_2_3cd8b6d02f8826f27b41c1ca27817bfe._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" + nickname="mithrandi" + subject="comment 2" + date="2016-02-26T23:36:33Z" + content=""" +I just verified that it works now (with your fix), thanks! +"""]] -- cgit v1.2.3 From 35cd7f2b56d7ebdc4da73851ce28bbc091604462 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 27 Feb 2016 14:10:17 -0400 Subject: add news item for propellor 2.16.0 --- doc/news/version_2.15.0.mdwn | 29 ----------------------------- doc/news/version_2.16.0.mdwn | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 29 deletions(-) delete mode 100644 doc/news/version_2.15.0.mdwn create mode 100644 doc/news/version_2.16.0.mdwn (limited to 'doc') diff --git a/doc/news/version_2.15.0.mdwn b/doc/news/version_2.15.0.mdwn deleted file mode 100644 index ebd847e2..00000000 --- a/doc/news/version_2.15.0.mdwn +++ /dev/null @@ -1,29 +0,0 @@ -propellor 2.15.0 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * Added UncheckedProperty type, along with unchecked to indicate a - Property needs its result checked, and checkResult and changesFile - to check for changes. - * Properties that run an arbitrary command, such as cmdProperty - and scriptProperty are converted to use UncheckedProperty, since - they cannot tell on their own if the command truely made a change or not. - (API Change) - Transition guide: - - When GHC complains about an UncheckedProperty, add: - `assume` MadeChange - (Since these properties used to always return MadeChange, that - change is always safe to make.) - - Or, if you know that the command should modifiy a file, use: - `changesFile` filename - * The `trivial` combinator has been removed. (API change) - Instead, use: - `assume` NoChange - Or, better, use changesFile or checkResult to accurately report - when a property makes a change. - * A few properties have had their Result improved, for example - Apt.buldDep and Apt.autoRemove now check if a change was made or not. - * User.hasDesktopGroups changed to avoid trying to add the user to - groups that don't exist. - * Added Postfix.saslPasswdSet. - * Added Propellor.Property.Locale. - Thanks, Sean Whitton. - * Added Propellor.Property.Fail2Ban."""]] \ No newline at end of file diff --git a/doc/news/version_2.16.0.mdwn b/doc/news/version_2.16.0.mdwn new file mode 100644 index 00000000..b7527f05 --- /dev/null +++ b/doc/news/version_2.16.0.mdwn @@ -0,0 +1,18 @@ +propellor 2.16.0 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * Obnam: Only let one backup job run at a time when a host has multiple + different backup properties, to avoid concurrent jobs fighting over + scarce resources (particularly memory). Other jobs block on a lock + file. + * Removed references to a Debian derivative from code and documentation + because of an unfortunate trademark use policy. + http://joeyh.name/blog/entry/trademark\_nonsense/ + * That included changing a data constructor to "Buntish", an API change. + * Firewall.rule: Now takes a Table parameter. (API change) + * Firewall: add InIFace/OutIFace Rules, add Source/Destination Rules, + add CustomTarget, and more improvements. + Thanks, Félix Sipma. + * Ssh.authorizedKey: Fix bug preventing it from working when the + authorized\_keys file does not yet exist. + * Removed Ssh.unauthorizedKey and made Ssh.authorizedKey revertable. + (API change)"""]] \ No newline at end of file -- cgit v1.2.3 From b44742500185c4e1bd5357645c8b2b5c49e9c4ab Mon Sep 17 00:00:00 2001 From: picca Date: Mon, 29 Feb 2016 11:10:37 +0000 Subject: --- doc/forum/chroot_issue_when_upgrading.mdwn | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 doc/forum/chroot_issue_when_upgrading.mdwn (limited to 'doc') diff --git a/doc/forum/chroot_issue_when_upgrading.mdwn b/doc/forum/chroot_issue_when_upgrading.mdwn new file mode 100644 index 00000000..9d65eed4 --- /dev/null +++ b/doc/forum/chroot_issue_when_upgrading.mdwn @@ -0,0 +1,42 @@ +Hello, + +It seems that my unstable chroot is broken. +When I do an upgrade, I get this error message + + + E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. + /srv/chroot/unstable-i386-sbuild has Operating System (Debian Unstable) "i386" ... ok + /srv/chroot/unstable-i386-sbuild noop property ... ok + /srv/chroot/unstable-i386-sbuild apt installed apt-transport-https ... ok + /srv/chroot/unstable-i386-sbuild standard sources.list ... ok + Hit:1 http://ftp2.fr.debian.org/debian unstable InRelease + Hit:2 http://mirrors.kernel.org/debian unstable InRelease + /srv/chroot/unstable-i386-sbuild apt update ... failed + /srv/chroot/unstable-i386-sbuild apt cache cleaned ... ok + mordor chroot /srv/chroot/unstable-i386-sbuild provisioned ... failed + +the properties are here + sbuild :: System -> Proxy -> RevertableProperty HasInfo + sbuild system proxy = Sbuild.schroot schrootname chroot + where + chroot = Chroot.debootstrapped Debootstrap.BuilddD chrootdir + & os system + & case proxy of + (Just p) -> "/etc/apt/apt.conf.d/01proxy" `File.hasContent` ["Acquire::http::Proxy \"" ++ p ++ "\";"] + Nothing -> doNothing + & Apt.installed ["apt-transport-https"] + & Apt.stdSourcesList + & Apt.update `onChange` Apt.upgrade + & Apt.cacheCleaned + schrootname = Sbuild.schrootname system + chrootdir = "/srv/chroot" schrootname + +so the update failed and the solution seems to be + + dpkg --configure -a + +Is it possible to deal with this problem in the update property in order to make it transparent for the users. + +Cheers + +Frederic -- cgit v1.2.3 From d432565f6619ccac8cee073fbc6c58f9e2a5e27c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Feb 2016 18:04:03 -0400 Subject: comment --- ...ment_1_291a24a225148978dc6a5b447742fc81._comment.swp | Bin 0 -> 4096 bytes .../comment_1_291a24a225148978dc6a5b447742fc81._comment | 7 +++++++ .../comment_2_eea48d51f241651935f695ea1dc7dd87._comment | 16 ++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 doc/forum/chroot_issue_when_upgrading/.comment_1_291a24a225148978dc6a5b447742fc81._comment.swp create mode 100644 doc/forum/chroot_issue_when_upgrading/comment_1_291a24a225148978dc6a5b447742fc81._comment create mode 100644 doc/forum/chroot_issue_when_upgrading/comment_2_eea48d51f241651935f695ea1dc7dd87._comment (limited to 'doc') diff --git a/doc/forum/chroot_issue_when_upgrading/.comment_1_291a24a225148978dc6a5b447742fc81._comment.swp b/doc/forum/chroot_issue_when_upgrading/.comment_1_291a24a225148978dc6a5b447742fc81._comment.swp new file mode 100644 index 00000000..e0855782 Binary files /dev/null and b/doc/forum/chroot_issue_when_upgrading/.comment_1_291a24a225148978dc6a5b447742fc81._comment.swp differ diff --git a/doc/forum/chroot_issue_when_upgrading/comment_1_291a24a225148978dc6a5b447742fc81._comment b/doc/forum/chroot_issue_when_upgrading/comment_1_291a24a225148978dc6a5b447742fc81._comment new file mode 100644 index 00000000..e9c3f7e8 --- /dev/null +++ b/doc/forum/chroot_issue_when_upgrading/comment_1_291a24a225148978dc6a5b447742fc81._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-02-29T21:43:24Z" + content=""" + +"""]] diff --git a/doc/forum/chroot_issue_when_upgrading/comment_2_eea48d51f241651935f695ea1dc7dd87._comment b/doc/forum/chroot_issue_when_upgrading/comment_2_eea48d51f241651935f695ea1dc7dd87._comment new file mode 100644 index 00000000..654ea40c --- /dev/null +++ b/doc/forum/chroot_issue_when_upgrading/comment_2_eea48d51f241651935f695ea1dc7dd87._comment @@ -0,0 +1,16 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2016-02-29T21:44:19Z" + content=""" +There are several ways this could happen, along the lines of a power +failure or ctrl-c at the wrong time. A failing postinst may also cause +apt to leave other packages un-configured, although `dpkg configure -a` +probably won't recover from that case. + +I think it makes sense for Apt.upgrade to run `dpkg --configure -a` +in case the last upgrade got into this state. I don't think it makes sense +for Apt.install to do that (too much overhead to do it every time, +and I don't think that unconfigured packages normally prevent installing +of an unrelated package anyway). I've made a change along these lines. +"""]] -- cgit v1.2.3 From d88338177a84553269a2c8e81a4f591c2bb88a77 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Feb 2016 18:04:27 -0400 Subject: cleanup --- ...mment_1_291a24a225148978dc6a5b447742fc81._comment.swp | Bin 4096 -> 0 bytes .../comment_1_291a24a225148978dc6a5b447742fc81._comment | 7 ------- 2 files changed, 7 deletions(-) delete mode 100644 doc/forum/chroot_issue_when_upgrading/.comment_1_291a24a225148978dc6a5b447742fc81._comment.swp delete mode 100644 doc/forum/chroot_issue_when_upgrading/comment_1_291a24a225148978dc6a5b447742fc81._comment (limited to 'doc') diff --git a/doc/forum/chroot_issue_when_upgrading/.comment_1_291a24a225148978dc6a5b447742fc81._comment.swp b/doc/forum/chroot_issue_when_upgrading/.comment_1_291a24a225148978dc6a5b447742fc81._comment.swp deleted file mode 100644 index e0855782..00000000 Binary files a/doc/forum/chroot_issue_when_upgrading/.comment_1_291a24a225148978dc6a5b447742fc81._comment.swp and /dev/null differ diff --git a/doc/forum/chroot_issue_when_upgrading/comment_1_291a24a225148978dc6a5b447742fc81._comment b/doc/forum/chroot_issue_when_upgrading/comment_1_291a24a225148978dc6a5b447742fc81._comment deleted file mode 100644 index e9c3f7e8..00000000 --- a/doc/forum/chroot_issue_when_upgrading/comment_1_291a24a225148978dc6a5b447742fc81._comment +++ /dev/null @@ -1,7 +0,0 @@ -[[!comment format=mdwn - username="joey" - subject="""comment 1""" - date="2016-02-29T21:43:24Z" - content=""" - -"""]] -- cgit v1.2.3 From 462a5ca596a2500610be75f3315382d174f8689b Mon Sep 17 00:00:00 2001 From: evan@0e4cded17eab71af967a38b123fbc211cf215421 Date: Tue, 1 Mar 2016 14:54:04 +0000 Subject: Created link to FreeBSD Port efforts. --- doc/forum/FreeBSD_Port.mdwn | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/forum/FreeBSD_Port.mdwn (limited to 'doc') diff --git a/doc/forum/FreeBSD_Port.mdwn b/doc/forum/FreeBSD_Port.mdwn new file mode 100644 index 00000000..6a184d61 --- /dev/null +++ b/doc/forum/FreeBSD_Port.mdwn @@ -0,0 +1,12 @@ +Hey all, I just thought I'd mention I'm working on porting Propellor to FreeBSD. Here's my [GitHub fork](https://github.com/misandrist/propellor/tree/FreeBSD), and the branch is called FreeBSD. + +Currently: + +- I've started passing the System down into the Bootstrap to choose the right shell commands and package dependencies +- I've briefly commented out the Cron job creation +- I've added a module for FreeBSD, and a really minimal property for Pkg +- I've created a sample configuration which is only tests pkg update + +It's pretty encouraging so far, and I'm hoping to have more working soon. + +Thanks! -- cgit v1.2.3 From faba0482eb71df06ac0ddb1e134289b5b3d45ec0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 2 Mar 2016 15:34:16 -0400 Subject: update --- doc/todo/type_level_port_conflict_detection.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc') diff --git a/doc/todo/type_level_port_conflict_detection.mdwn b/doc/todo/type_level_port_conflict_detection.mdwn index 6708ac3a..47d5f0cf 100644 --- a/doc/todo/type_level_port_conflict_detection.mdwn +++ b/doc/todo/type_level_port_conflict_detection.mdwn @@ -4,4 +4,7 @@ Needs ghc newer than 7.6.3. It may be possible to port Data.Type.Equality and Data.Type.Bool to older versions; I got them to compile but they didn't work right. --[[Joey]] +I have a `resourceconflict` branch that adds this in Propellor.Resources, +but it is not yet integrated into the Property types. --[[Joey]] + [[!tag user/joey]] -- cgit v1.2.3 From 85bee039bf8b18ed103766c233edaa63a00c24fb Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Fri, 4 Mar 2016 15:44:43 +0000 Subject: --- doc/forum/Git_repo_updating.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/forum/Git_repo_updating.mdwn (limited to 'doc') diff --git a/doc/forum/Git_repo_updating.mdwn b/doc/forum/Git_repo_updating.mdwn new file mode 100644 index 00000000..e0cccedd --- /dev/null +++ b/doc/forum/Git_repo_updating.mdwn @@ -0,0 +1 @@ +Propellor.Property.Git.cloned clones a git repo to a location, great! Is there an easy way to keep it updated afterwards, though? I guess having a property that enforce up-to-dateness wouldn't be so practical since you have to hit the remote to check, perhaps a cron job to run some equivalent of `git fetch && git reset --hard && git clean -dfx`. (Just thinking out loud here, and wondering what everyone else is doing) -- cgit v1.2.3 From 9f007eea3ac7487cca3c4bb662134023b19e5166 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 4 Mar 2016 12:31:10 -0400 Subject: comment --- .../comment_1_f601e29b5fb82700b21914f3fb1ef49b._comment | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 doc/forum/Git_repo_updating/comment_1_f601e29b5fb82700b21914f3fb1ef49b._comment (limited to 'doc') diff --git a/doc/forum/Git_repo_updating/comment_1_f601e29b5fb82700b21914f3fb1ef49b._comment b/doc/forum/Git_repo_updating/comment_1_f601e29b5fb82700b21914f3fb1ef49b._comment new file mode 100644 index 00000000..9aaa4f60 --- /dev/null +++ b/doc/forum/Git_repo_updating/comment_1_f601e29b5fb82700b21914f3fb1ef49b._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-03-04T16:25:55Z" + content=""" +You could certianly write a property that did a git pull every time. It +would do some unnessesary work and still not keep the checkout always +immediately up-to-date. + +Better to have some kind of hook that causes the checkout to update when +changes are pushed into its parent repository. How such a hook works +depends on where the parent repository is hosted. Propellor properties +could be written to set up whatever's needed for such a hook on the system +where the repository is checked out. If you're hosting your own git +server as well, propellor properties could set up the post-update hook in +the origin repo too. +"""]] -- cgit v1.2.3 From d3504da8209ce2d2c9da9507a72252516a2a901f Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Sat, 5 Mar 2016 23:58:19 +0000 Subject: --- doc/forum/Weird_SSH_issue.mdwn | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/forum/Weird_SSH_issue.mdwn (limited to 'doc') diff --git a/doc/forum/Weird_SSH_issue.mdwn b/doc/forum/Weird_SSH_issue.mdwn new file mode 100644 index 00000000..11094d55 --- /dev/null +++ b/doc/forum/Weird_SSH_issue.mdwn @@ -0,0 +1,3 @@ +For some reason (and I'm not sure exactly when this started), when I propellor --spin a host when the control master socket does not yet exist, none of the output from the remote host comes back. The remote run works fine, I just have to ^C the local propellor once I see that the remote run is done (by watching top on the remote host or something). If the socket does already exist (eg. spinning again immediately), then everything is fine. + +I assume this is some issue with my local SSH version or config, but I have no clue what. Anyone have any ideas? -- cgit v1.2.3 From 78aaf8cfca51d5a137360fa4b3a11ca6afdb6e20 Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Sun, 6 Mar 2016 00:26:33 +0000 Subject: --- doc/forum/Locales_always_generated.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 doc/forum/Locales_always_generated.mdwn (limited to 'doc') diff --git a/doc/forum/Locales_always_generated.mdwn b/doc/forum/Locales_always_generated.mdwn new file mode 100644 index 00000000..83fd5de2 --- /dev/null +++ b/doc/forum/Locales_always_generated.mdwn @@ -0,0 +1,16 @@ +I'm using the `Locale.available` property, and it seems the locales are always generated: + +Generating locales (this might take a while)... + en_GB.UTF-8... done + en_US.UTF-8... done + en_ZA.UTF-8... done +Generation complete. +onyx.fusionapp.com en_ZA.UTF-8 locale generated ... done +Generating locales (this might take a while)... + en_GB.UTF-8... done + en_US.UTF-8... done + en_ZA.UTF-8... done +Generation complete. +onyx.fusionapp.com en_US.UTF-8 locale generated ... done + +I inspected the definition of the property, but I'm not sure where the bug is. Should `fileProperty` with identical contents be causing `onChange` to trigger? -- cgit v1.2.3 From 0cba86b5cbde5c24e55124ad802481b2fe005566 Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Sun, 6 Mar 2016 00:29:40 +0000 Subject: --- doc/forum/Locales_always_generated.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/forum/Locales_always_generated.mdwn b/doc/forum/Locales_always_generated.mdwn index 83fd5de2..769cbad0 100644 --- a/doc/forum/Locales_always_generated.mdwn +++ b/doc/forum/Locales_always_generated.mdwn @@ -1,5 +1,6 @@ I'm using the `Locale.available` property, and it seems the locales are always generated: +``` Generating locales (this might take a while)... en_GB.UTF-8... done en_US.UTF-8... done @@ -12,5 +13,6 @@ Generating locales (this might take a while)... en_ZA.UTF-8... done Generation complete. onyx.fusionapp.com en_US.UTF-8 locale generated ... done +``` I inspected the definition of the property, but I'm not sure where the bug is. Should `fileProperty` with identical contents be causing `onChange` to trigger? -- cgit v1.2.3 From 19d7083ed8759d8b76420186f34e31fb46e869d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Mar 2016 13:05:08 -0400 Subject: comment --- .../comment_1_8598e38bc60fd25ebecb7b3b09d74940._comment | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/forum/Weird_SSH_issue/comment_1_8598e38bc60fd25ebecb7b3b09d74940._comment (limited to 'doc') diff --git a/doc/forum/Weird_SSH_issue/comment_1_8598e38bc60fd25ebecb7b3b09d74940._comment b/doc/forum/Weird_SSH_issue/comment_1_8598e38bc60fd25ebecb7b3b09d74940._comment new file mode 100644 index 00000000..0eb98f6c --- /dev/null +++ b/doc/forum/Weird_SSH_issue/comment_1_8598e38bc60fd25ebecb7b3b09d74940._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-03-06T17:00:02Z" + content=""" +I think I've been seeing this too, recently. + +I had not put together that it involves the ssh control socket. +And am not 100% sure it does yet. +"""]] -- cgit v1.2.3 From 50bd944e6226cddca0ab0da6d0ed8fd0cfba0b6d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Mar 2016 13:27:56 -0400 Subject: comment --- .../comment_1_26e9d3c1ec2ad32d18ee2205254b71b8._comment | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/forum/Locales_always_generated/comment_1_26e9d3c1ec2ad32d18ee2205254b71b8._comment (limited to 'doc') diff --git a/doc/forum/Locales_always_generated/comment_1_26e9d3c1ec2ad32d18ee2205254b71b8._comment b/doc/forum/Locales_always_generated/comment_1_26e9d3c1ec2ad32d18ee2205254b71b8._comment new file mode 100644 index 00000000..de64aaa8 --- /dev/null +++ b/doc/forum/Locales_always_generated/comment_1_26e9d3c1ec2ad32d18ee2205254b71b8._comment @@ -0,0 +1,12 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-03-06T17:06:16Z" + content=""" +What seems to be going on is, /etc/locale.gen is changed, uncommenting +the line, but then the dpkg-reconfigure locales rewrites the file +with the same set of locales enabled but a different set of lines and +comments. So, next time the property runs, it wants to change the file again. + +I changed it to run locale-gen instead, which avoids the problem. +"""]] -- cgit v1.2.3 From de670e617d4450003ccaa6bfc0b2f6cbec5dd62f Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Sun, 6 Mar 2016 17:38:57 +0000 Subject: Added a comment --- .../comment_2_fcce3726ab696a55abb12367ff5bf36c._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/Locales_always_generated/comment_2_fcce3726ab696a55abb12367ff5bf36c._comment (limited to 'doc') diff --git a/doc/forum/Locales_always_generated/comment_2_fcce3726ab696a55abb12367ff5bf36c._comment b/doc/forum/Locales_always_generated/comment_2_fcce3726ab696a55abb12367ff5bf36c._comment new file mode 100644 index 00000000..67143d74 --- /dev/null +++ b/doc/forum/Locales_always_generated/comment_2_fcce3726ab696a55abb12367ff5bf36c._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" + nickname="mithrandi" + subject="comment 2" + date="2016-03-06T17:38:57Z" + content=""" +Ah, nice! I hadn't noticed that the contents was actually changing. +"""]] -- cgit v1.2.3 From 3db71c4f83da6a20c040a44e4fe0cf64c5303190 Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Sun, 6 Mar 2016 17:39:34 +0000 Subject: Added a comment --- .../comment_2_5c0bb1b38a92ff17277f514703ce2761._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/Weird_SSH_issue/comment_2_5c0bb1b38a92ff17277f514703ce2761._comment (limited to 'doc') diff --git a/doc/forum/Weird_SSH_issue/comment_2_5c0bb1b38a92ff17277f514703ce2761._comment b/doc/forum/Weird_SSH_issue/comment_2_5c0bb1b38a92ff17277f514703ce2761._comment new file mode 100644 index 00000000..0b545262 --- /dev/null +++ b/doc/forum/Weird_SSH_issue/comment_2_5c0bb1b38a92ff17277f514703ce2761._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" + nickname="mithrandi" + subject="comment 2" + date="2016-03-06T17:39:34Z" + content=""" +Yes, it's possible I misdiagnosed the problem; I've never had the issue spinning twice in a row, but there may be other factors at play. +"""]] -- cgit v1.2.3 From 82d0473dd00401004fe996a6a1349d976fe979a7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Mar 2016 13:57:50 -0400 Subject: comment --- .../comment_3_8347b69df64b737f4e5df854c55d4e92._comment | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/forum/Weird_SSH_issue/comment_3_8347b69df64b737f4e5df854c55d4e92._comment (limited to 'doc') diff --git a/doc/forum/Weird_SSH_issue/comment_3_8347b69df64b737f4e5df854c55d4e92._comment b/doc/forum/Weird_SSH_issue/comment_3_8347b69df64b737f4e5df854c55d4e92._comment new file mode 100644 index 00000000..adc64e5d --- /dev/null +++ b/doc/forum/Weird_SSH_issue/comment_3_8347b69df64b737f4e5df854c55d4e92._comment @@ -0,0 +1,15 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2016-03-06T17:54:20Z" + content=""" +It also seemed to affect the first spin and not the second one when I was +seeing it. But that was 1-2 weeks ago, and I am not currently reproducing +the issue. + +If you can reproduce it consistently, it would be good to check if the +concurrent output layer, which involves intercepting all command output and +serializing it, might be involved. If you edit +`src/Utility/Process/Shim.hs` and make it simply `import System.Process as X` +and remove the other import, that will bypass the concurrent output layer. +"""]] -- cgit v1.2.3 From 15d628d6da29700bffcc24d8d959db7d82f1fe7e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Mar 2016 14:56:45 -0400 Subject: comment --- ...ent_4_2fbb97cb5bca3a0e2835e7667aff7a00._comment | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/forum/Weird_SSH_issue/comment_4_2fbb97cb5bca3a0e2835e7667aff7a00._comment (limited to 'doc') diff --git a/doc/forum/Weird_SSH_issue/comment_4_2fbb97cb5bca3a0e2835e7667aff7a00._comment b/doc/forum/Weird_SSH_issue/comment_4_2fbb97cb5bca3a0e2835e7667aff7a00._comment new file mode 100644 index 00000000..2ffdcbac --- /dev/null +++ b/doc/forum/Weird_SSH_issue/comment_4_2fbb97cb5bca3a0e2835e7667aff7a00._comment @@ -0,0 +1,22 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2016-03-06T18:43:37Z" + content=""" +Added some debugging, I found that processes run by concurrent-output tend to +alternate between running foreground and background. So, when the socket +exists and is old, it will run one more process than otherwise to +stop ssh on that socket, and this will change which run method is +used for subsequent processes. + +However, it really shouldn't matter if a process starts in the background; +concurrent-output shoud notice when the output lock frees up, and start +displaying the processes's output. + +So, this theory explains why the ssh socket seems to be involved, perhaps, +but it doesn't really explain what's happening to prevent the remote +propellor output from being shown. + +Unless some other foreground process is hanging around and keeping +the output lock. Or some bug in concurrent-output.. +"""]] -- cgit v1.2.3 From b809f529d52e78043c675961b83e16b1085815cb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Mar 2016 16:44:03 -0400 Subject: comment --- .../comment_5_bfbcb2a81bff6b6432217c72a5e54576._comment | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/forum/Weird_SSH_issue/comment_5_bfbcb2a81bff6b6432217c72a5e54576._comment (limited to 'doc') diff --git a/doc/forum/Weird_SSH_issue/comment_5_bfbcb2a81bff6b6432217c72a5e54576._comment b/doc/forum/Weird_SSH_issue/comment_5_bfbcb2a81bff6b6432217c72a5e54576._comment new file mode 100644 index 00000000..72315aa0 --- /dev/null +++ b/doc/forum/Weird_SSH_issue/comment_5_bfbcb2a81bff6b6432217c72a5e54576._comment @@ -0,0 +1,12 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 5""" + date="2016-03-06T19:57:03Z" + content=""" +Managed to reproduce the hang once, and the ssh was indeed being run as +bgProcess. However, I didn't manage to see what foreground process, if any, +was running when that happened. And had no luck reproducing it again. + +I added some more `PROPELLOR_DEBUG` output around this, so it'll tell +when a process is being run by fgProcess or bgProcess. +"""]] -- cgit v1.2.3 From 85e3d4c169ca81f47113cedb65c2c4a643a91b12 Mon Sep 17 00:00:00 2001 From: mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82 Date: Sun, 6 Mar 2016 21:27:18 +0000 Subject: Added a comment --- .../comment_6_d6c4f22f48c5f0b6d06e9a155e8e5f69._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/forum/Weird_SSH_issue/comment_6_d6c4f22f48c5f0b6d06e9a155e8e5f69._comment (limited to 'doc') diff --git a/doc/forum/Weird_SSH_issue/comment_6_d6c4f22f48c5f0b6d06e9a155e8e5f69._comment b/doc/forum/Weird_SSH_issue/comment_6_d6c4f22f48c5f0b6d06e9a155e8e5f69._comment new file mode 100644 index 00000000..7d01913b --- /dev/null +++ b/doc/forum/Weird_SSH_issue/comment_6_d6c4f22f48c5f0b6d06e9a155e8e5f69._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="mithrandi@311efa1b2b5c4999c2edae7da06fb825899e8a82" + nickname="mithrandi" + subject="comment 6" + date="2016-03-06T21:27:18Z" + content=""" +Might it have something to do with how ssh forks (but doesn't double fork or \"daemonize\") to start the control master, if one isn't already running? +"""]] -- cgit v1.2.3 From 3a9c23d6463c15c1fc5568df4c0ec212c2a84cd7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Mar 2016 19:00:49 -0400 Subject: response --- .../comment_7_77d2d330846c80ed463644860e49f184._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/forum/Weird_SSH_issue/comment_7_77d2d330846c80ed463644860e49f184._comment (limited to 'doc') diff --git a/doc/forum/Weird_SSH_issue/comment_7_77d2d330846c80ed463644860e49f184._comment b/doc/forum/Weird_SSH_issue/comment_7_77d2d330846c80ed463644860e49f184._comment new file mode 100644 index 00000000..ab82a6c1 --- /dev/null +++ b/doc/forum/Weird_SSH_issue/comment_7_77d2d330846c80ed463644860e49f184._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 7""" + date="2016-03-06T22:59:31Z" + content=""" +I don't see how that could be relevant, but if you want to, edit +src/Propellor/Ssh.hs and make sshCachingParams return [] and +see if that changes it. +"""]] -- cgit v1.2.3 From 822694e790102efa2a5bb4a0c3d62c6fce1d4e87 Mon Sep 17 00:00:00 2001 From: Evan Cofsky Date: Fri, 26 Feb 2016 10:20:21 -0600 Subject: FreeBSD Support including: - Propellor bootstrapping - Basic pkg - Basic ZFS datasets and properties - Simple Poudriere configuration (regular and ZFS) - Poudriere jail creation FIXME: - Cron.hs: runPropellor needs the System, but hasn't yet gotten it. Reorganizing: - Remove FreeBSD.Process - Move ZFS up to Property - Add Info for Pkg.update/Pkg.upgrade - Move FreeBSD.md to doc so it'll show up automatically. - Merge the FreeBSD config with the other sample config. - Use Info to check Pkg updated/upgraded and Poudriere configured. - Warnings clean-up, move ZFS types to Propellor.Types. - Maintainer and license statements. --- .gitignore | 5 +- config-simple.hs | 22 +++++ doc/FreeBSD.mdwn | 19 ++++ propellor.cabal | 7 ++ src/Propellor/Bootstrap.hs | 57 ++++++++--- src/Propellor/CmdLine.hs | 14 +-- src/Propellor/Property/Cron.hs | 8 +- src/Propellor/Property/Debootstrap.hs | 19 ++-- src/Propellor/Property/FreeBSD.hs | 14 +++ src/Propellor/Property/FreeBSD/Pkg.hs | 89 +++++++++++++++++ src/Propellor/Property/FreeBSD/Poudriere.hs | 147 ++++++++++++++++++++++++++++ src/Propellor/Property/ZFS.hs | 12 +++ src/Propellor/Property/ZFS/Process.hs | 40 ++++++++ src/Propellor/Property/ZFS/Properties.hs | 37 +++++++ src/Propellor/Spin.hs | 34 ++++--- src/Propellor/Types.hs | 18 ++-- src/Propellor/Types/OS.hs | 22 +++++ src/Propellor/Types/ZFS.hs | 133 +++++++++++++++++++++++++ 18 files changed, 639 insertions(+), 58 deletions(-) create mode 100644 doc/FreeBSD.mdwn create mode 100644 src/Propellor/Property/FreeBSD.hs create mode 100644 src/Propellor/Property/FreeBSD/Pkg.hs create mode 100644 src/Propellor/Property/FreeBSD/Poudriere.hs create mode 100644 src/Propellor/Property/ZFS.hs create mode 100644 src/Propellor/Property/ZFS/Process.hs create mode 100644 src/Propellor/Property/ZFS/Properties.hs create mode 100644 src/Propellor/Types/ZFS.hs (limited to 'doc') diff --git a/.gitignore b/.gitignore index 431b1c4b..208339f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ dist/* -propellor tags privdata/local privdata/keyring.gpg~ @@ -12,3 +11,7 @@ propellor.1 .lock .lastchecked .stack-work/* +.cabal-sandbox/ +.dir-locals.el +cabal.sandbox.config +*~ \ No newline at end of file diff --git a/config-simple.hs b/config-simple.hs index 21accd18..ac1b115f 100644 --- a/config-simple.hs +++ b/config-simple.hs @@ -1,6 +1,8 @@ -- This is the main configuration file for Propellor, and is used to build -- the propellor program. +import Data.String (fromString) + import Propellor import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt @@ -13,6 +15,9 @@ import qualified Propellor.Property.User as User --import qualified Propellor.Property.Hostname as Hostname --import qualified Propellor.Property.Tor as Tor import qualified Propellor.Property.Docker as Docker +import qualified Propellor.Property.FreeBSD.Pkg as Pkg +import qualified Propellor.Property.ZFS as ZFS +import qualified Propellor.Property.FreeBSD.Poudriere as Poudriere main :: IO () main = defaultMain hosts @@ -21,6 +26,7 @@ main = defaultMain hosts hosts :: [Host] hosts = [ mybox + , freebsd ] -- An example host. @@ -46,3 +52,19 @@ webserverContainer = Docker.container "webserver" (Docker.latestImage "debian") & Docker.publish "80:80" & Docker.volume "/var/www:/var/www" & Apt.serviceInstalledRunning "apache2" + +poudriereZFS :: Poudriere.Poudriere +poudriereZFS = Poudriere.defaultConfig { + Poudriere._zfs = Just $ Poudriere.PoudriereZFS + (ZFS.ZFS (fromString "zroot") (fromString "poudriere")) + (ZFS.fromList [ZFS.Mountpoint (fromString "/poudriere"), ZFS.ACLInherit ZFS.AIPassthrough]) + } + +-- An example host. +freebsd :: Host +freebsd = host "192.168.56.10" + & os (System (FreeBSD (FBSDProduction FBSD102)) "amd64") + & Pkg.update + & Pkg.upgrade + & Poudriere.poudriere poudriereZFS + & Poudriere.jail (Poudriere.Jail "formail" (fromString "10.2-RELEASE") (fromString "amd64")) diff --git a/doc/FreeBSD.mdwn b/doc/FreeBSD.mdwn new file mode 100644 index 00000000..1cac527e --- /dev/null +++ b/doc/FreeBSD.mdwn @@ -0,0 +1,19 @@ +# FreeBSD Support for Propellor + +This branch is to add FreeBSD support to Propellor. The first steps +will focus around package management with pkg-ng. + +# Bootstrapping + +The current Bootstrap process is very apt-centric, so current efforts +are focusing on passing the System information down into Bootstrap. + +Affected functions are: + +* `installGitCommand`, which has to install pkg itself, then install + git. The `ASSUME_ALWAYS_YES` environment variable must be set so pkg + will just do its thing. + +* `depsCommand`, which installs as many Haskell dependencies from the + system package manager. We also install gmake, but I'm not sure + where this is used yet. diff --git a/propellor.cabal b/propellor.cabal index 3518a7ee..a281e277 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -83,6 +83,9 @@ Library Propellor.Property.Fail2Ban Propellor.Property.File Propellor.Property.Firewall + Propellor.Property.FreeBSD + Propellor.Property.FreeBSD.Pkg + Propellor.Property.FreeBSD.Poudriere Propellor.Property.Git Propellor.Property.Gpg Propellor.Property.Group @@ -117,6 +120,9 @@ Library Propellor.Property.Unbound Propellor.Property.User Propellor.Property.Uwsgi + Propellor.Property.ZFS + Propellor.Property.ZFS.Process + Propellor.Property.ZFS.Properties Propellor.Property.HostingProvider.CloudAtCost Propellor.Property.HostingProvider.DigitalOcean Propellor.Property.HostingProvider.Linode @@ -146,6 +152,7 @@ Library Propellor.Types.Result Propellor.Types.ResultCheck Propellor.Types.CmdLine + Propellor.Types.ZFS Other-Modules: Propellor.Bootstrap Propellor.Git diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index c49cb5af..2c962b12 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -15,19 +15,21 @@ type ShellCommand = String -- Shell command line to ensure propellor is bootstrapped and ready to run. -- Should be run inside the propellor config dir, and will install -- all necessary build dependencies and build propellor. -bootstrapPropellorCommand :: ShellCommand -bootstrapPropellorCommand = checkDepsCommand ++ - "&& if ! test -x ./propellor; then " - ++ buildCommand ++ +bootstrapPropellorCommand :: System -> ShellCommand +bootstrapPropellorCommand sys = + (checkDepsCommand sys) ++ + "&& if ! test -x ./propellor; then " + ++ buildCommand ++ "; fi;" ++ checkBinaryCommand -- Use propellor --check to detect if the local propellor binary has -- stopped working (eg due to library changes), and must be rebuilt. checkBinaryCommand :: ShellCommand -checkBinaryCommand = "if test -x ./propellor && ! ./propellor --check 2>/dev/null; then " ++ go ++ "; fi" +checkBinaryCommand = "if test -x ./propellor && ! ./propellor --check; then " ++ go ++ "; fi" where go = intercalate " && " - [ "cabal clean" + [ "./propellor --check" + ,"cabal clean" , buildCommand ] @@ -40,8 +42,8 @@ buildCommand = intercalate " && " -- Run cabal configure to check if all dependencies are installed; -- if not, run the depsCommand. -checkDepsCommand :: ShellCommand -checkDepsCommand = "if ! cabal configure >/dev/null 2>&1; then " ++ depsCommand ++ "; fi" +checkDepsCommand :: System -> ShellCommand +checkDepsCommand sys = "if ! cabal configure >/dev/null 2>&1; then " ++ (depsCommand sys) ++ "; fi" -- Install build dependencies of propellor. -- @@ -53,17 +55,20 @@ checkDepsCommand = "if ! cabal configure >/dev/null 2>&1; then " ++ depsCommand -- So, as a second step, cabal is used to install all dependencies. -- -- Note: May succeed and leave some deps not installed. -depsCommand :: ShellCommand -depsCommand = "( " ++ intercalate " ; " (concat [osinstall, cabalinstall]) ++ " ) || true" +depsCommand :: System -> ShellCommand +depsCommand (System distr _) = "( " ++ intercalate " ; " (concat [osinstall, cabalinstall]) ++ " ) || true" where - osinstall = "apt-get update" : map aptinstall debdeps + osinstall = case distr of + (FreeBSD _) -> map pkginstall fbsddeps + _ -> "apt-get update" : map aptinstall debdeps - cabalinstall = + cabalinstall = [ "cabal update" , "cabal install --only-dependencies" ] aptinstall p = "DEBIAN_FRONTEND=noninteractive apt-get --no-upgrade --no-install-recommends -y install " ++ p + pkginstall p = "ASSUME_ALWAYS_YES=yes pkg install " ++ p -- This is the same deps listed in debian/control. debdeps = @@ -84,9 +89,33 @@ depsCommand = "( " ++ intercalate " ; " (concat [osinstall, cabalinstall]) ++ " , "libghc-text-dev" , "make" ] + fbsddeps = + [ "gnupg" + , "ghc" + , "hs-cabal-install" + , "hs-async" + , "hs-MissingH" + , "hs-hslogger" + , "hs-unix-compat" + , "hs-ansi-terminal" + , "hs-IfElse" + , "hs-network" + , "hs-mtl" + , "hs-transformers-base" + , "hs-exceptions" + , "hs-stm" + , "hs-text" + , "gmake" + ] + -installGitCommand :: ShellCommand -installGitCommand = "if ! git --version >/dev/null; then apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends --no-upgrade -y install git; fi" +installGitCommand :: System -> ShellCommand +installGitCommand (System distr _) = + case distr of + (FreeBSD _) -> + "if ! git --version >/dev/null; then ASSUME_ALWAYS_YES=yes pkg update && ASSUME_ALWAYS_YES=yes pkg install git; fi" + _ -> + "if ! git --version >/dev/null; then apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends --no-upgrade -y install git; fi" buildPropellor :: IO () buildPropellor = unlessM (actionMessage "Propellor build" build) $ diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 5dbc5836..1761a11e 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -21,7 +21,7 @@ import qualified Propellor.Property.Chroot as Chroot import qualified Propellor.Shim as Shim usage :: Handle -> IO () -usage h = hPutStrLn h $ unlines +usage h = hPutStrLn h $ unlines [ "Usage:" , " propellor" , " propellor hostname" @@ -47,10 +47,10 @@ usageError ps = do processCmdLine :: IO CmdLine processCmdLine = go =<< getArgs where - go ("--check":_) = return Check + go ("--check":_) = return Check go ("--spin":ps) = case reverse ps of - (r:"--via":hs) -> Spin - <$> mapM hostname (reverse hs) + (r:"--via":hs) -> Spin + <$> mapM hostname (reverse hs) <*> pure (Just r) _ -> Spin <$> mapM hostname ps <*> pure Nothing go ("--add-key":k:[]) = return $ AddKey k @@ -62,7 +62,7 @@ processCmdLine = go =<< getArgs go ("--edit":f:c:[]) = withprivfield f c Edit go ("--list-fields":[]) = return ListFields go ("--merge":[]) = return Merge - go ("--help":_) = do + go ("--help":_) = do usage stdout exitFailure go ("--boot":_:[]) = return $ Update Nothing -- for back-compat @@ -134,7 +134,7 @@ defaultMain hostlist = withConcurrentOutput $ do withhost :: HostName -> (Host -> IO ()) -> IO () withhost hn a = maybe (unknownhost hn hostlist) a (findHost hostlist hn) - + runhost hn = onlyprocess $ withhost hn mainProperties onlyprocess = onlyProcess (localdir ".lock") @@ -205,5 +205,5 @@ hostname s = go =<< catchDefaultIO [] dnslookup go (AddrInfo { addrCanonName = Just v } : _) = pure v go _ | "." `isInfixOf` s = pure s -- assume it's a fqdn - | otherwise = + | otherwise = error $ "cannot find host " ++ s ++ " in the DNS" diff --git a/src/Propellor/Property/Cron.hs b/src/Propellor/Property/Cron.hs index 74cab92a..a6ab3eca 100644 --- a/src/Propellor/Property/Cron.hs +++ b/src/Propellor/Property/Cron.hs @@ -21,7 +21,7 @@ data Times -- | Installs a cron job, that will run as a specified user in a particular -- directory. Note that the Desc must be unique, as it is used for the -- cron job filename. --- +-- -- Only one instance of the cron job is allowed to run at a time, no matter -- how long it runs. This is accomplished using flock locking of the cron -- job file. @@ -47,7 +47,7 @@ job desc times (User u) cddir command = combineProperties ("cronned " ++ desc) , case times of Times _ -> doNothing _ -> cronjobfile `File.mode` combineModes (readModes ++ executeModes) - -- Use a separate script because it makes the cron job name + -- Use a separate script because it makes the cron job name -- prettier in emails, and also allows running the job manually. , scriptfile `File.hasContent` [ "#!/bin/sh" @@ -81,5 +81,5 @@ niceJob desc times user cddir command = job desc times user cddir -- | Installs a cron job to run propellor. runPropellor :: Times -> Property NoInfo -runPropellor times = niceJob "propellor" times (User "root") localdir - (bootstrapPropellorCommand ++ "; ./propellor") +runPropellor times = niceJob "propellor" times (User "root") localdir "true" +-- (bootstrapPropellorCommand ++ "; ./propellor") diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs index 6a566853..508da5fb 100644 --- a/src/Propellor/Property/Debootstrap.hs +++ b/src/Propellor/Property/Debootstrap.hs @@ -23,7 +23,7 @@ import System.Posix.Files type Url = String --- | A monoid for debootstrap configuration. +-- | A monoid for debootstrap configuration. -- mempty is a default debootstrapped system. data DebootstrapConfig = DefaultConfig @@ -34,8 +34,8 @@ data DebootstrapConfig deriving (Show) instance Monoid DebootstrapConfig where - mempty = DefaultConfig - mappend = (:+) + mempty = DefaultConfig + mappend = (:+) toParams :: DebootstrapConfig -> [CommandParam] toParams DefaultConfig = [] @@ -52,7 +52,7 @@ built :: FilePath -> System -> DebootstrapConfig -> Property HasInfo built target system config = built' (toProp installed) target system config built' :: (Combines (Property NoInfo) (Property i)) => Property i -> FilePath -> System -> DebootstrapConfig -> Property (CInfo NoInfo i) -built' installprop target system@(System _ arch) config = +built' installprop target system@(System _ arch) config = check (unpopulated target <||> ispartial) setupprop `requires` installprop where @@ -88,10 +88,11 @@ built' installprop target system@(System _ arch) config = return True , return False ) - + extractSuite :: System -> Maybe String extractSuite (System (Debian s) _) = Just $ Apt.showSuite s extractSuite (System (Buntish r) _) = Just r +extractSuite _ = error "Not supported unless Debian or Buntish." -- | Ensures debootstrap is installed. -- @@ -101,7 +102,7 @@ extractSuite (System (Buntish r) _) = Just r installed :: RevertableProperty NoInfo installed = install remove where - install = withOS "debootstrap installed" $ \o -> + install = withOS "debootstrap installed" $ \o -> ifM (liftIO $ isJust <$> programPath) ( return NoChange , ensureProperty (installon o) @@ -115,7 +116,7 @@ installed = install remove removefrom (Just (System (Debian _) _)) = aptremove removefrom (Just (System (Buntish _) _)) = aptremove removefrom _ = sourceRemove - + aptinstall = Apt.installed ["debootstrap"] aptremove = Apt.removed ["debootstrap"] @@ -273,9 +274,9 @@ extractUrls base = collect [] . map toLower _ -> findend l r collect l (_:cs) = collect l cs - findend l s = + findend l s = let (u, r) = break (== '"') s u' = if "http" `isPrefixOf` u - then u + then u else base u in collect (u':l) r diff --git a/src/Propellor/Property/FreeBSD.hs b/src/Propellor/Property/FreeBSD.hs new file mode 100644 index 00000000..0943597f --- /dev/null +++ b/src/Propellor/Property/FreeBSD.hs @@ -0,0 +1,14 @@ +-- | FreeBSD Properties +-- +-- Copyright 2016 Evan Cofsky +-- License: BSD 2-clause +-- +-- This module is designed to be imported unqualified. + +module Propellor.Property.FreeBSD ( + module Propellor.Property.FreeBSD.Pkg, + module Propellor.Property.FreeBSD.Poudriere +) where + +import Propellor.Property.FreeBSD.Pkg +import Propellor.Property.FreeBSD.Poudriere diff --git a/src/Propellor/Property/FreeBSD/Pkg.hs b/src/Propellor/Property/FreeBSD/Pkg.hs new file mode 100644 index 00000000..7e02d99b --- /dev/null +++ b/src/Propellor/Property/FreeBSD/Pkg.hs @@ -0,0 +1,89 @@ +-- | FreeBSD pkgng properties +-- +-- Copyright 2016 Evan Cofsky +-- License: BSD 2-clause + +{-# Language ScopedTypeVariables, GeneralizedNewtypeDeriving #-} + +module Propellor.Property.FreeBSD.Pkg where + +import Propellor.Base +import Propellor.Types.Info + +noninteractiveEnv :: [([Char], [Char])] +noninteractiveEnv = [("ASSUME_ALWAYS_YES", "yes")] + +pkgCommand :: String -> [String] -> (String, [String]) +pkgCommand cmd args = ("pkg", (cmd:args)) + +runPkg :: String -> [String] -> IO [String] +runPkg cmd args = + let + (p, a) = pkgCommand cmd args + in + lines <$> readProcess p a + +pkgCmdProperty :: String -> [String] -> UncheckedProperty NoInfo +pkgCmdProperty cmd args = + let + (p, a) = pkgCommand cmd args + in + cmdPropertyEnv p a noninteractiveEnv + +pkgCmd :: String -> [String] -> IO [String] +pkgCmd cmd args = + let + (p, a) = pkgCommand cmd args + in + lines <$> readProcessEnv p a (Just noninteractiveEnv) + +newtype PkgUpdate = PkgUpdate String + deriving (Typeable, Monoid, Show) +instance IsInfo PkgUpdate where + propagateInfo _ = False + +pkgUpdated :: PkgUpdate -> Bool +pkgUpdated (PkgUpdate _) = True + +update :: Property HasInfo +update = + let + upd = pkgCmd "update" [] + go = ifM (pkgUpdated <$> askInfo) ((noChange), (liftIO upd >> return MadeChange)) + in + infoProperty "pkg update has run" go (addInfo mempty (PkgUpdate "")) [] + +newtype PkgUpgrade = PkgUpgrade String + deriving (Typeable, Monoid, Show) +instance IsInfo PkgUpgrade where + propagateInfo _ = False + +pkgUpgraded :: PkgUpgrade -> Bool +pkgUpgraded (PkgUpgrade _) = True + +upgrade :: Property HasInfo +upgrade = + let + upd = pkgCmd "upgrade" [] + go = ifM (pkgUpgraded <$> askInfo) ((noChange), (liftIO upd >> return MadeChange)) + in + infoProperty "pkg upgrade has run" go (addInfo mempty (PkgUpgrade "")) [] `requires` update + +type Package = String + +installed :: Package -> Property NoInfo +installed pkg = + check (isInstallable pkg) $ pkgCmdProperty "install" [pkg] + +isInstallable :: Package -> IO Bool +isInstallable p = do + l <- isInstalled p + e <- exists p + + return $ (not l) && e + +isInstalled :: Package -> IO Bool +isInstalled p = catch (runPkg "info" [p] >> return True) (\(_ :: IOError ) -> return False) + +exists :: Package -> IO Bool +exists p = catch (runPkg "search" ["--search", "name", "--exact", p] >> return True) (\(_ :: IOError ) -> return False) diff --git a/src/Propellor/Property/FreeBSD/Poudriere.hs b/src/Propellor/Property/FreeBSD/Poudriere.hs new file mode 100644 index 00000000..217e6e5a --- /dev/null +++ b/src/Propellor/Property/FreeBSD/Poudriere.hs @@ -0,0 +1,147 @@ +-- | FreeBSD Poudriere properties +-- +-- Copyright 2016 Evan Cofsky +-- License: BSD 2-clause + +{-# Language GeneralizedNewtypeDeriving #-} + +-- | Maintainer: Evan Cofsky + +module Propellor.Property.FreeBSD.Poudriere where + +import Propellor.Base +import Propellor.Types.Info +import Data.List +import Data.String (IsString(..)) + +import qualified Propellor.Property.FreeBSD.Pkg as Pkg +import qualified Propellor.Property.ZFS as ZFS +import qualified Propellor.Property.File as File + +poudriereConfigPath :: FilePath +poudriereConfigPath = "/usr/local/etc/poudriere.conf" + +newtype PoudriereConfigured = PoudriereConfigured String + deriving (Typeable, Monoid, Show) +instance IsInfo PoudriereConfigured where + propagateInfo _ = False + +poudriereConfigured :: PoudriereConfigured -> Bool +poudriereConfigured (PoudriereConfigured _) = True + +setConfigured :: Property HasInfo +setConfigured = pureInfoProperty "Poudriere Configured" (PoudriereConfigured "") + +poudriere :: Poudriere -> Property HasInfo +poudriere conf@(Poudriere _ _ _ _ _ _ zfs) = + let + confProp = + File.containsLines poudriereConfigPath (toLines conf) + setZfs (PoudriereZFS z p) = ZFS.zfsSetProperties z p `describe` "Configuring Poudriere with ZFS" + prop :: CombinedType (Property NoInfo) (Property NoInfo) + prop = + if isJust zfs + then ((setZfs $ fromJust zfs) `before` confProp) + else propertyList "Configuring Poudriere without ZFS" [confProp] + in + prop + `requires` Pkg.installed "poudriere" + `before` setConfigured + +poudriereCommand :: String -> [String] -> (String, [String]) +poudriereCommand cmd args = ("poudriere", cmd:args) + +runPoudriere :: String -> [String] -> IO [String] +runPoudriere cmd args = + let + (p, a) = poudriereCommand cmd args + in + lines <$> readProcess p a + +listJails :: IO [String] +listJails = runPoudriere "jail" ["-l", "-q"] + +jailExists :: Jail -> IO Bool +jailExists (Jail name _ _) = isInfixOf [name] <$> listJails + +jail :: Jail -> Property NoInfo +jail j@(Jail name version arch) = + let + cfgd = poudriereConfigured <$> askInfo + + notExists :: IO Bool + notExists = not <$> jailExists j + chk = do + c <- cfgd + x <- liftIO notExists + return $ c && x + + (cmd, args) = poudriereCommand "jail" ["-c", "-j", name, "-a", show arch, "-v", show version] + createJail = cmdProperty cmd args + in + checkResult chk (\_ -> return MadeChange) createJail + `describe` unwords ["Create poudriere jail", name] + + +data Poudriere = Poudriere + { _resolvConf :: String + , _freebsdHost :: String + , _baseFs :: String + , _usePortLint :: Bool + , _distFilesCache :: FilePath + , _svnHost :: String + , _zfs :: Maybe PoudriereZFS} + +defaultConfig :: Poudriere +defaultConfig = Poudriere + "/etc/resolv.conf" + "ftp://ftp5.us.FreeBSD.org" + "/usr/local/poudriere" + True + "/usr/ports/distfiles" + "svn.freebsd.org" + Nothing + +data PoudriereZFS = PoudriereZFS ZFS.ZFS ZFS.ZFSProperties + +data Jail = Jail String FBSDVersion PoudriereArch + +data PoudriereArch = I386 | AMD64 deriving (Eq) +instance Show PoudriereArch where + show I386 = "i386" + show AMD64 = "amd64" + +instance IsString PoudriereArch where + fromString "i386" = I386 + fromString "amd64" = AMD64 + fromString _ = error "Not a valid Poudriere architecture." + +yesNoProp :: Bool -> String +yesNoProp b = if b then "yes" else "no" + +instance ToShellConfigLines Poudriere where + toAssoc c = map (\(k, f) -> (k, f c)) + [("RESOLV_CONF", _resolvConf) + ,("FREEBSD_HOST", _freebsdHost) + ,("BASEFS", _baseFs) + ,("USE_PORTLINT", yesNoProp . _usePortLint) + ,("DISTFILES_CACHE", _distFilesCache) + ,("SVN_HOST", _svnHost)] ++ maybe [("NO_ZFS", "yes")] toAssoc (_zfs c) + +instance ToShellConfigLines PoudriereZFS where + toAssoc (PoudriereZFS (ZFS.ZFS (ZFS.ZPool pool) dataset) _) = + [("NO_ZFS", "no") + , ("ZPOOL", pool) + , ("ZROOTFS", show dataset)] + +type ConfigLine = String +type ConfigFile = [ConfigLine] + +class ToShellConfigLines a where + toAssoc :: a -> [(String, String)] + + toLines :: a -> [ConfigLine] + toLines c = map (\(k, v) -> intercalate "=" [k, v]) $ toAssoc c + +confFile :: FilePath +confFile = "/usr/local/etc/poudriere.conf" diff --git a/src/Propellor/Property/ZFS.hs b/src/Propellor/Property/ZFS.hs new file mode 100644 index 00000000..e42861e5 --- /dev/null +++ b/src/Propellor/Property/ZFS.hs @@ -0,0 +1,12 @@ +-- | ZFS properties +-- +-- Copyright 2016 Evan Cofsky +-- License: BSD 2-clause + +module Propellor.Property.ZFS ( + module Propellor.Property.ZFS.Properties + ,module Propellor.Types.ZFS + ) where + +import Propellor.Property.ZFS.Properties +import Propellor.Types.ZFS diff --git a/src/Propellor/Property/ZFS/Process.hs b/src/Propellor/Property/ZFS/Process.hs new file mode 100644 index 00000000..c6615252 --- /dev/null +++ b/src/Propellor/Property/ZFS/Process.hs @@ -0,0 +1,40 @@ +-- | Functions running zfs processes. +-- +-- Copyright 2016 Evan Cofsky +-- License: BSD 2-clause + +module Propellor.Property.ZFS.Process where + +import Propellor.Base +import Data.String.Utils (split) +import Data.List + +-- | Gets the properties of a ZFS volume. +zfsGetProperties :: ZFS -> IO ZFSProperties +zfsGetProperties z = + let + plist = fromPropertyList . map (\(_:k:v:_) -> (k, v)) . (map (split "\t")) + in + do + plist <$> runZfs "get" [Just "-H", Just "-p", Just "all"] z + +zfsExists :: ZFS -> IO Bool +zfsExists z = + any id . map (isInfixOf (zfsName z)) <$> runZfs "list" [Just "-H"] z + +-- | Runs the zfs command with the arguments. +-- +-- Runs the command with -H which will skip the header line and +-- separate all fields with tabs. +-- +-- Replaces Nothing in the argument list with the ZFS pool/dataset. +runZfs :: String -> [Maybe String] -> ZFS -> IO [String] +runZfs cmd args z = + let + (p, a) = zfsCommand cmd args z + in + lines <$> readProcess p a + +-- | Return the ZFS command line suitable for readProcess or cmdProperty. +zfsCommand :: String -> [Maybe String] -> ZFS -> (String, [String]) +zfsCommand cmd args z = ("zfs", cmd:(map (maybe (zfsName z) id) args)) diff --git a/src/Propellor/Property/ZFS/Properties.hs b/src/Propellor/Property/ZFS/Properties.hs new file mode 100644 index 00000000..ba303bc3 --- /dev/null +++ b/src/Propellor/Property/ZFS/Properties.hs @@ -0,0 +1,37 @@ +-- | Functions defining zfs Properties. +-- +-- Copyright 2016 Evan Cofsky +-- License: BSD 2-clause + +module Propellor.Property.ZFS.Properties ( + zfsExists, zfsSetProperties + ) where + +import Propellor.Base +import Data.List (intercalate) +import qualified Propellor.Property.ZFS.Process as ZP + +-- | Will ensure that a ZFS volume exists with the specified mount point. +-- This requires the pool to exist as well, but we don't create pools yet. +zfsExists :: ZFS -> Property NoInfo +zfsExists z = + let + (p, a) = ZP.zfsCommand "create" [Nothing] z + create = cmdProperty p a + in + check (not <$> ZP.zfsExists z) (create) `describe` (unwords ["Creating", zfsName z]) + +-- | Sets the given properties. Returns True if all were successfully changed, False if not. +zfsSetProperties :: ZFS -> ZFSProperties -> Property NoInfo +zfsSetProperties z setProperties = + let + spcmd :: String -> String -> (String, [String]) + spcmd p v = ZP.zfsCommand "set" [Just (intercalate "=" [p, v]), Nothing] z + + setprop :: (String, String) -> Property NoInfo + setprop (p, v) = check (ZP.zfsExists z) $ cmdProperty (fst (spcmd p v)) (snd (spcmd p v)) + + setall = combineProperties (unwords ["Setting properties on", zfsName z]) $ + map setprop $ toPropertyList setProperties + in + setall `requires` zfsExists z diff --git a/src/Propellor/Spin.hs b/src/Propellor/Spin.hs index 495ebaf4..6666d089 100644 --- a/src/Propellor/Spin.hs +++ b/src/Propellor/Spin.hs @@ -1,3 +1,5 @@ +{-# Language ScopedTypeVariables #-} + module Propellor.Spin ( commitSpin, spin, @@ -41,7 +43,7 @@ commitSpin = do currentBranch <- getCurrentBranch when (b /= currentBranch) $ error ("spin aborted: check out " - ++ b ++ " branch first") + ++ b ++ " branch first") -- safety check #2: check we can commit with a dirty tree noDirtySpin <- getGitConfigBool "propellor.forbid-dirty-spin" @@ -52,7 +54,7 @@ commitSpin = do error "spin aborted: commit changes first" void $ actionMessage "Git commit" $ - gitCommit (Just spinCommitMessage) + gitCommit (Just spinCommitMessage) [Param "--allow-empty", Param "-a"] -- Push to central origin repo first, if possible. -- The remote propellor will pull from there, which avoids @@ -76,10 +78,12 @@ spin' mprivdata relay target hst = do Just r -> pure r Nothing -> getSshTarget target hst + let (InfoVal o) = (getInfo $ hostInfo hst) :: InfoVal System + -- Install, or update the remote propellor. updateServer target relay hst - (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap probecmd]) - (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap updatecmd]) + (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap (probecmd o)]) + (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap (updatecmd o)]) =<< getprivdata -- And now we can run it. @@ -91,19 +95,19 @@ spin' mprivdata relay target hst = do relaying = relay == Just target viarelay = isJust relay && not relaying - probecmd = intercalate " ; " - [ "if [ ! -d " ++ localdir ++ "/.git ]" + probecmd sys = intercalate " ; " + ["if [ ! -d " ++ localdir ++ "/.git ]" , "then (" ++ intercalate " && " - [ installGitCommand + [ installGitCommand sys , "echo " ++ toMarked statusMarker (show NeedGitClone) ] ++ ") || echo " ++ toMarked statusMarker (show NeedPrecompiled) - , "else " ++ updatecmd + , "else " ++ (updatecmd sys) , "fi" ] - - updatecmd = intercalate " && " + + updatecmd sys = intercalate " && " [ "cd " ++ localdir - , bootstrapPropellorCommand + , bootstrapPropellorCommand sys , if viarelay then "./propellor --continue " ++ shellEscape (show (Relay target)) @@ -116,7 +120,7 @@ spin' mprivdata relay target hst = do cmdline | viarelay = Spin [target] (Just target) | otherwise = SimpleRun target - + getprivdata = case mprivdata of Nothing | relaying -> do @@ -124,12 +128,12 @@ spin' mprivdata relay target hst = do d <- readPrivDataFile f nukeFile f return d - | otherwise -> + | otherwise -> filterPrivData hst <$> decryptPrivData Just pd -> pure pd -- Check if the Host contains an IP address that matches one of the IPs --- in the DNS for the HostName. If so, the HostName is used as-is, +-- in the DNS for the HostName. If so, the HostName is used as-is, -- but if the DNS is out of sync with the Host config, or doesn't have -- the host in it at all, use one of the Host's IPs instead. getSshTarget :: HostName -> Host -> IO String @@ -199,7 +203,7 @@ update forhost = do , Param $ "./propellor --gitpush " ++ show hin ++ " " ++ show hout , Param "." ] - + -- When --spin --relay is run, get a privdata file -- to be relayed to the target host. privfile = maybe privDataLocal privDataRelay forhost diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index f224c8ba..542a1f66 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -34,6 +34,7 @@ module Propellor.Types , module Propellor.Types.OS , module Propellor.Types.Dns , module Propellor.Types.Result + , module Propellor.Types.ZFS , propertySatisfy , ignoreInfo ) where @@ -49,6 +50,7 @@ import Propellor.Types.Info import Propellor.Types.OS import Propellor.Types.Dns import Propellor.Types.Result +import Propellor.Types.ZFS -- | Everything Propellor knows about a system: Its hostname, -- properties and their collected info. @@ -126,7 +128,7 @@ type instance CInfo NoInfo HasInfo = HasInfo type instance CInfo NoInfo NoInfo = NoInfo -- | Constructs a Property with associated Info. -infoProperty +infoProperty :: Desc -- ^ description of the property -> Propellor Result -- ^ action to run to satisfy the property (must be idempotent; may run repeatedly) -> Info -- ^ info associated with the property @@ -158,7 +160,7 @@ propertySatisfy :: Property i -> Propellor Result propertySatisfy (IProperty _ a _ _) = a propertySatisfy (SProperty _ a _) = a --- | Changes the action that is performed to satisfy a property. +-- | Changes the action that is performed to satisfy a property. adjustPropertySatisfy :: Property i -> (Propellor Result -> Propellor Result) -> Property i adjustPropertySatisfy (IProperty d s i cs) f = IProperty d (f s) i cs adjustPropertySatisfy (SProperty d s cs) f = SProperty d (f s) cs @@ -172,7 +174,7 @@ propertyDesc (IProperty d _ _ _) = d propertyDesc (SProperty d _ _) = d instance Show (Property i) where - show p = "property " ++ show (propertyDesc p) + show p = "property " ++ show (propertyDesc p) -- | A Property can include a list of child properties that it also -- satisfies. This allows them to be introspected to collect their info, etc. @@ -188,7 +190,7 @@ data RevertableProperty i = RevertableProperty } instance Show (RevertableProperty i) where - show (RevertableProperty p _) = show p + show (RevertableProperty p _) = show p class MkRevertableProperty i1 i2 where -- | Shorthand to construct a revertable property. @@ -216,7 +218,7 @@ instance IsProp (Property HasInfo) where setDesc (IProperty _ a i cs) d = IProperty d a i cs toProp = id getDesc = propertyDesc - getInfoRecursive (IProperty _ _ i cs) = + getInfoRecursive (IProperty _ _ i cs) = i <> mconcat (map getInfoRecursive cs) instance IsProp (Property NoInfo) where setDesc (SProperty _ a cs) d = SProperty d a cs @@ -256,8 +258,8 @@ type ResultCombiner = Propellor Result -> Propellor Result -> Propellor Result class Combines x y where -- | Combines together two properties, yielding a property that -- has the description and info of the first, and that has the second - -- property as a child. - combineWith + -- property as a child. + combineWith :: ResultCombiner -- ^ How to combine the actions to satisfy the properties. -> ResultCombiner @@ -308,7 +310,7 @@ instance Combines (Property HasInfo) (RevertableProperty HasInfo) where instance Combines (Property NoInfo) (RevertableProperty HasInfo) where combineWith = combineWithPR -combineWithRR +combineWithRR :: Combines (Property x) (Property y) => ResultCombiner -> ResultCombiner diff --git a/src/Propellor/Types/OS.hs b/src/Propellor/Types/OS.hs index c302d11d..5b425f71 100644 --- a/src/Propellor/Types/OS.hs +++ b/src/Propellor/Types/OS.hs @@ -4,6 +4,8 @@ module Propellor.Types.OS ( System(..), Distribution(..), DebianSuite(..), + FreeBSDRelease(..), + FBSDVersion(..), isStable, Release, Architecture, @@ -17,6 +19,7 @@ module Propellor.Types.OS ( import Network.BSD (HostName) import Data.Typeable +import Data.String -- | High level description of a operating system. data System = System Distribution Architecture @@ -25,6 +28,7 @@ data System = System Distribution Architecture data Distribution = Debian DebianSuite | Buntish Release -- ^ A well-known Debian derivative founded by a space tourist. The actual name of this distribution is not used in Propellor per ) + | FreeBSD FreeBSDRelease deriving (Show, Eq) -- | Debian has several rolling suites, and a number of stable releases, @@ -32,6 +36,24 @@ data Distribution data DebianSuite = Experimental | Unstable | Testing | Stable Release deriving (Show, Eq) +-- | FreeBSD breaks their releases into "Production" and "Legacy". +data FreeBSDRelease = FBSDProduction FBSDVersion | FBSDLegacy FBSDVersion + deriving (Show, Eq) + +data FBSDVersion = FBSD101 | FBSD102 | FBSD093 + deriving (Eq) + +instance IsString FBSDVersion where + fromString "10.1-RELEASE" = FBSD101 + fromString "10.2-RELEASE" = FBSD102 + fromString "9.3-RELEASE" = FBSD093 + fromString _ = error "Invalid FreeBSD release" + +instance Show FBSDVersion where + show FBSD101 = "10.1-RELEASE" + show FBSD102 = "10.2-RELEASE" + show FBSD093 = "9.3-RELEASE" + isStable :: DebianSuite -> Bool isStable (Stable _) = True isStable _ = False diff --git a/src/Propellor/Types/ZFS.hs b/src/Propellor/Types/ZFS.hs new file mode 100644 index 00000000..8784c641 --- /dev/null +++ b/src/Propellor/Types/ZFS.hs @@ -0,0 +1,133 @@ +-- | Types for ZFS Properties. +-- +-- Copyright 2016 Evan Cofsky +-- License: BSD 2-clause + +module Propellor.Types.ZFS where + +import Data.String +import qualified Data.Set as Set +import qualified Data.String.Utils as SU +import Data.List + +-- | A single ZFS filesystem. +data ZFS = ZFS ZPool ZDataset deriving (Show, Eq, Ord) + +-- | Represents a zpool. +data ZPool = ZPool String deriving (Show, Eq, Ord) + +-- | Represents a dataset in a zpool. +-- +-- Can be constructed from a / separated string. +data ZDataset = ZDataset [String] deriving (Eq, Ord) + +type ZFSProperties = Set.Set ZFSProperty + +fromList :: [ZFSProperty] -> ZFSProperties +fromList = Set.fromList + +toPropertyList :: ZFSProperties -> [(String, String)] +toPropertyList = Set.foldr (\p l -> l ++ [toPair p]) [] + +fromPropertyList :: [(String, String)] -> ZFSProperties +fromPropertyList props = + Set.fromList $ map fromPair props + +zfsName :: ZFS -> String +zfsName (ZFS (ZPool pool) dataset) = intercalate "/" [pool, show dataset] + +instance Show ZDataset where + show (ZDataset paths) = intercalate "/" paths + +instance IsString ZDataset where + fromString s = ZDataset $ SU.split "/" s + +instance IsString ZPool where + fromString p = ZPool p + +class Value a where + toValue :: a -> String + fromValue :: (IsString a) => String -> a + fromValue = fromString + +data ZFSYesNo = ZFSYesNo Bool deriving (Show, Eq, Ord) +data ZFSOnOff = ZFSOnOff Bool deriving (Show, Eq, Ord) +data ZFSSize = ZFSSize Integer deriving (Show, Eq, Ord) +data ZFSString = ZFSString String deriving (Show, Eq, Ord) + +instance Value ZFSYesNo where + toValue (ZFSYesNo True) = "yes" + toValue (ZFSYesNo False) = "no" + +instance Value ZFSOnOff where + toValue (ZFSOnOff True) = "on" + toValue (ZFSOnOff False) = "off" + +instance Value ZFSSize where + toValue (ZFSSize s) = show s + +instance Value ZFSString where + toValue (ZFSString s) = s + +instance IsString ZFSString where + fromString = ZFSString + +instance IsString ZFSYesNo where + fromString "yes" = ZFSYesNo True + fromString "no" = ZFSYesNo False + fromString _ = error "Not yes or no" + +instance IsString ZFSOnOff where + fromString "on" = ZFSOnOff True + fromString "off" = ZFSOnOff False + fromString _ = error "Not on or off" + +data ZFSACLInherit = AIDiscard | AINoAllow | AISecure | AIPassthrough deriving (Show, Eq, Ord) +instance IsString ZFSACLInherit where + fromString "discard" = AIDiscard + fromString "noallow" = AINoAllow + fromString "secure" = AISecure + fromString "passthrough" = AIPassthrough + fromString _ = error "Not valid aclpassthrough value" + +instance Value ZFSACLInherit where + toValue AIDiscard = "discard" + toValue AINoAllow = "noallow" + toValue AISecure = "secure" + toValue AIPassthrough = "passthrough" + +data ZFSACLMode = AMDiscard | AMGroupmask | AMPassthrough deriving (Show, Eq, Ord) +instance IsString ZFSACLMode where + fromString "discard" = AMDiscard + fromString "groupmask" = AMGroupmask + fromString "passthrough" = AMPassthrough + fromString _ = error "Invalid zfsaclmode" + +instance Value ZFSACLMode where + toValue AMDiscard = "discard" + toValue AMGroupmask = "groupmask" + toValue AMPassthrough = "passthrough" + +data ZFSProperty = Mounted ZFSYesNo + | Mountpoint ZFSString + | ReadOnly ZFSYesNo + | ACLInherit ZFSACLInherit + | ACLMode ZFSACLMode + | StringProperty String ZFSString + deriving (Show, Eq, Ord) + +toPair :: ZFSProperty -> (String, String) +toPair (Mounted v) = ("mounted", toValue v) +toPair (Mountpoint v) = ("mountpoint", toValue v) +toPair (ReadOnly v) = ("readonly", toValue v) +toPair (ACLInherit v) = ("aclinherit", toValue v) +toPair (ACLMode v) = ("aclmode", toValue v) +toPair (StringProperty s v) = (s, toValue v) + +fromPair :: (String, String) -> ZFSProperty +fromPair ("mounted", v) = Mounted (fromString v) +fromPair ("mountpoint", v) = Mountpoint (fromString v) +fromPair ("readonly", v) = ReadOnly (fromString v) +fromPair ("aclinherit", v) = ACLInherit (fromString v) +fromPair ("aclmode", v) = ACLMode (fromString v) +fromPair (s, v) = StringProperty s (fromString v) -- cgit v1.2.3