summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/forum/Bug_with_Sbuild/comment_2_3ca5ceb0ac97451c1eea00ec72b55896._comment9
-rw-r--r--doc/forum/Bug_with_Sbuild/comment_3_59b5bafd51d1255c4ab79e468afcca1c._comment13
-rw-r--r--doc/forum/use_withUmask_in_a_property/comment_1_593c3e8b1499b4cc9cc7db74bb775506._comment38
-rw-r--r--doc/forum/use_withUmask_in_a_property/comment_2_edefd952bdb96c8a6a5d705170a05a77._comment20
-rw-r--r--doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment18
-rw-r--r--doc/todo/bytes_in_privData__63__.mdwn2
-rw-r--r--doc/todo/bytes_in_privData__63__/comment_12_a4edd5e06854a4b37eeb6b3db5c01947._comment8
-rw-r--r--doc/todo/integrate_shell-monad/comment_6_d0328983a68958a914bd9fc9fe5a3abe._comment (renamed from doc/todo/integrate_shell-monad/comment_6_d0328983a68958a914bd9fc9fe5a3abe/comment_1_f42f2893433c312821d8d47f84cb5c43._comment)0
-rw-r--r--doc/todo/merge_request:_Firejail.hs.mdwn16
-rw-r--r--doc/todo/merge_request:_changes_to_Reboot.hs/comment_8_b4b2bd5741fbc7759d85d826dc1f9f7f._comment11
-rw-r--r--doc/todo/merge_request:_changes_to_Reboot.hs/comment_9_233140189ee7ffebad687db76dfe2258._comment22
11 files changed, 157 insertions, 0 deletions
diff --git a/doc/forum/Bug_with_Sbuild/comment_2_3ca5ceb0ac97451c1eea00ec72b55896._comment b/doc/forum/Bug_with_Sbuild/comment_2_3ca5ceb0ac97451c1eea00ec72b55896._comment
new file mode 100644
index 00000000..c2b34090
--- /dev/null
+++ b/doc/forum/Bug_with_Sbuild/comment_2_3ca5ceb0ac97451c1eea00ec72b55896._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="spwhitton"
+ subject="comment 2"
+ date="2016-06-19T07:19:33Z"
+ content="""
+Thank you for reporting this and for finding the fix, Fred. In a branch I'll be submitting soon I have modified `Ccache.hasCache` to chmod setgid the cache root, and this should propagate to all newly created subdirectories.
+
+Joey: what do you think about adding `cmdProperty \"chmod\" [\"-R\", \"g+s\" \"/var/cache/ccache-foo\"]` to `Ccache.hasCache` to fix existing broken setups? In my view it would be better to just add a note to the changelog suggesting this fix, but I'm not sure what you think would be best.
+"""]]
diff --git a/doc/forum/Bug_with_Sbuild/comment_3_59b5bafd51d1255c4ab79e468afcca1c._comment b/doc/forum/Bug_with_Sbuild/comment_3_59b5bafd51d1255c4ab79e468afcca1c._comment
new file mode 100644
index 00000000..fc12b9fe
--- /dev/null
+++ b/doc/forum/Bug_with_Sbuild/comment_3_59b5bafd51d1255c4ab79e468afcca1c._comment
@@ -0,0 +1,13 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 3"""
+ date="2016-06-20T17:53:24Z"
+ content="""
+I generally try to fix up after bugs in the implementation of properties,
+because otherwise maintaining my hosts gets problimatic.
+
+In this case, the sbuild support is pretty new and probably not much
+used, so I guess it's up to you. chmod -R is rather expensive. If there's
+a cheap way to detect when that's needed and only run it then, that
+would be ideal..
+"""]]
diff --git a/doc/forum/use_withUmask_in_a_property/comment_1_593c3e8b1499b4cc9cc7db74bb775506._comment b/doc/forum/use_withUmask_in_a_property/comment_1_593c3e8b1499b4cc9cc7db74bb775506._comment
new file mode 100644
index 00000000..d52b4786
--- /dev/null
+++ b/doc/forum/use_withUmask_in_a_property/comment_1_593c3e8b1499b4cc9cc7db74bb775506._comment
@@ -0,0 +1,38 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-06-20T18:04:27Z"
+ content="""
+ withUmask :: (MonadIO m, MonadMask m) => FileMode -> m a -> m a
+
+That needs a monad, and propellor Property is not a monad itself.
+But, a Property does contain an Propellor monad action, which is run to ensure
+that the property is met. You can use withUmask inside that action.
+
+The problem then becomes, how to run a Property like
+your `cmdProperty` inside the Propellor monad?
+
+The answer is, using `ensureProperty`.
+[Documentation](http://hackage.haskell.org/package/propellor/docs/Propellor-EnsureProperty.html)
+
+Something like this is what you're looking for:
+
+ foo = Property UnixLike
+ foo = property' "generate new key file" $ \w ->
+ withUmask filemode $
+ ensureProperty w genrsa
+ where
+ filemode = -- something
+
+ genrsa :: Property UnixLike
+ genrsa = cmdProperty "openssl"
+ [ "genrsa"
+ , "4096"
+ , "> " ++ key
+ ]
+ `assume` MadeChange
+
+Incidentially, cmdProperty runs a command without exposing it to the
+shell, so I don't think the redirection in your example will work.
+You probably want to use scriptProperty instead.
+"""]]
diff --git a/doc/forum/use_withUmask_in_a_property/comment_2_edefd952bdb96c8a6a5d705170a05a77._comment b/doc/forum/use_withUmask_in_a_property/comment_2_edefd952bdb96c8a6a5d705170a05a77._comment
new file mode 100644
index 00000000..a569d068
--- /dev/null
+++ b/doc/forum/use_withUmask_in_a_property/comment_2_edefd952bdb96c8a6a5d705170a05a77._comment
@@ -0,0 +1,20 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2016-06-20T18:36:07Z"
+ content="""
+Here's another, perhaps simpler way to do it. The `adjustPropertySatisfy`
+function takes an existing Property and applies a function to the Propellor
+action inside it.
+
+ adjustPropertySatisfy :: Property metatypes -> (Propellor Result -> Propellor Result) -> Property metatypes
+
+So, given the `genrsa` Property from my example above, you could
+modify its action to use withUmask:
+
+ adjustPropertySatisfy genrsa (withUmask filemode)
+
+This is simpler, but less flexible since it causes the entire
+Propellor action to be run with the specified umask, not just part of the
+action. But it works well for your purpose I think.
+"""]]
diff --git a/doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment b/doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment
new file mode 100644
index 00000000..3a9f89c2
--- /dev/null
+++ b/doc/forum/use_withUmask_in_a_property/comment_3_5bdd79ed99f2b001d5dfc8a7d0b2c177._comment
@@ -0,0 +1,18 @@
+[[!comment format=mdwn
+ username="gueux"
+ subject="comment 3"
+ date="2016-06-20T18:49:30Z"
+ content="""
+Thanks!
+
+By reading Cmd.hs, I've managed to get this:
+
+ createKey :: FilePath -> Property UnixLike
+ createKey key = property (\"new private key file: \" ++ key) $ liftIO $ withUmask 0o0177 $ withFile key WriteMode $ \h ->
+ cmdResult <$> boolSystem' \"openssl\" [Param \"genrsa\", Param \"4096\"] (\p -> p { std_out = UseHandle h })
+
+ cmdResult :: Bool -> Result
+ cmdResult False = FailedChange
+ cmdResult True = NoChange
+
+"""]]
diff --git a/doc/todo/bytes_in_privData__63__.mdwn b/doc/todo/bytes_in_privData__63__.mdwn
index 27297fd5..66e3b1c2 100644
--- a/doc/todo/bytes_in_privData__63__.mdwn
+++ b/doc/todo/bytes_in_privData__63__.mdwn
@@ -15,3 +15,5 @@ It seems like I can't set the content of a PrivFile to arbitrary bytes.
Enter private data on stdin; ctrl-D when done:
propellor: <stdin>: hGetContents: invalid argument (invalid byte sequence)
+
+> [[done]]! --[[Joey]]
diff --git a/doc/todo/bytes_in_privData__63__/comment_12_a4edd5e06854a4b37eeb6b3db5c01947._comment b/doc/todo/bytes_in_privData__63__/comment_12_a4edd5e06854a4b37eeb6b3db5c01947._comment
new file mode 100644
index 00000000..1d645d09
--- /dev/null
+++ b/doc/todo/bytes_in_privData__63__/comment_12_a4edd5e06854a4b37eeb6b3db5c01947._comment
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 12"""
+ date="2016-06-19T17:53:17Z"
+ content="""
+I found a reasonable way to refactor it without the duplication, so have
+landed the patch.
+"""]]
diff --git a/doc/todo/integrate_shell-monad/comment_6_d0328983a68958a914bd9fc9fe5a3abe/comment_1_f42f2893433c312821d8d47f84cb5c43._comment b/doc/todo/integrate_shell-monad/comment_6_d0328983a68958a914bd9fc9fe5a3abe._comment
index 8ba13e99..8ba13e99 100644
--- a/doc/todo/integrate_shell-monad/comment_6_d0328983a68958a914bd9fc9fe5a3abe/comment_1_f42f2893433c312821d8d47f84cb5c43._comment
+++ b/doc/todo/integrate_shell-monad/comment_6_d0328983a68958a914bd9fc9fe5a3abe._comment
diff --git a/doc/todo/merge_request:_Firejail.hs.mdwn b/doc/todo/merge_request:_Firejail.hs.mdwn
new file mode 100644
index 00000000..b593c5b4
--- /dev/null
+++ b/doc/todo/merge_request:_Firejail.hs.mdwn
@@ -0,0 +1,16 @@
+Please consider merging branch `firejail` of repo `https://git.spwhitton.name/propellor`.
+
+Changes:
+
+- Add `applytoList` property combinator
+- Add `Propellor.Property.Firejail` module
+
+Comments:
+
+- I'm not sure whether Joey or I originally wrote `applyToList`; it's been in my config.hs for a while
+- `Firejail.jailed` accepts a list of executables (and `Firejail.jailed'` is not exported) because as with `Apt.installed`, I think most users will want to jail more than one program. For example `Firejail.jailed ["firefox", "evince"]`.
+- I made the build clean on GHC 7.10 but there is a warning on 7.6 that `Prelude` does not export `Foldable`. I don't know how to fix this while maintaining the 7.10 clean build, and it seems to me that having the 7.10 build be clean is more important than having the 7.6 build be clean.
+
+--spwhitton
+
+> [[done]], thanks! (I fixed the warning.) --[[Joey]]
diff --git a/doc/todo/merge_request:_changes_to_Reboot.hs/comment_8_b4b2bd5741fbc7759d85d826dc1f9f7f._comment b/doc/todo/merge_request:_changes_to_Reboot.hs/comment_8_b4b2bd5741fbc7759d85d826dc1f9f7f._comment
new file mode 100644
index 00000000..36556924
--- /dev/null
+++ b/doc/todo/merge_request:_changes_to_Reboot.hs/comment_8_b4b2bd5741fbc7759d85d826dc1f9f7f._comment
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="spwhitton"
+ subject="comment 8"
+ date="2016-06-19T12:31:40Z"
+ content="""
+Please consider merging my new `reboot` branch which addresses the discussion we've had.
+
+I also included some other improvements to `Sbuild.hs`, a bug fix in `Ccache.hs` and some GHC 7.6 compatibility fixes. With one exception,[1] I think that the changes are sufficiently self-explanatory that `git diff master..spwhitton/reboot` will be enough for you to review the branch. If not, I will happily split the commits into several branches.
+
+[1] I changed the haddocks on some functions in Sbuild.hs so that they will be properly hyperlinked, and did some other documentation rearrangements.
+"""]]
diff --git a/doc/todo/merge_request:_changes_to_Reboot.hs/comment_9_233140189ee7ffebad687db76dfe2258._comment b/doc/todo/merge_request:_changes_to_Reboot.hs/comment_9_233140189ee7ffebad687db76dfe2258._comment
new file mode 100644
index 00000000..1afbef11
--- /dev/null
+++ b/doc/todo/merge_request:_changes_to_Reboot.hs/comment_9_233140189ee7ffebad687db76dfe2258._comment
@@ -0,0 +1,22 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 9"""
+ date="2016-06-20T17:56:25Z"
+ content="""
+FĂ©lix sent some patches today fixing compiling Propellor.Exception on old
+ghc, which overlap with part of your patch. You addressed the same problem
+in different ways. Since I already merged his (more extensive I think)
+fixes for that, your branch will need to be updated.
+
+The only thing I caught during review is that the documentation for
+useOverlays says that the property has to be added before
+Sbuild.builtFor, but actually info-setting properties
+set info before any properties run, so can safely appear after properties
+that use the info they set!
+
+(I'm not sure if overlaysInTmpfs can safely come after
+Sbuild.builtFor, but if it cannot it's not due to setting useOverlays.)
+
+Also, it would be good to have some lines to add to the changelog
+about the sbuild changes.
+"""]]