summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
l---------config.hs2
-rw-r--r--debian/changelog2
-rw-r--r--doc/forum/propellor_and_gpg2/comment_1_4b732110f59f78f73fdfb745bdd9c0dd._comment13
-rw-r--r--doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__.mdwn3
-rw-r--r--doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__/comment_1_7c2b2447254ad44ee1316b47eac130df._comment12
-rw-r--r--doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__/comment_2_b4910f50225a8b763566126861faea11._comment8
-rw-r--r--doc/todo/usage__47__help_text_improvements.mdwn3
-rw-r--r--doc/todo/usage__47__help_text_improvements/comment_1_66878945cdb57d06849337262d939701._comment13
-rw-r--r--doc/todo/usage__47__help_text_improvements/comment_2_d531a45851cdef87a8f7b8182b3d04ce._comment12
-rw-r--r--doc/usage.mdwn12
-rw-r--r--privdata/relocate1
-rw-r--r--src/Propellor/CmdLine.hs48
-rw-r--r--src/Propellor/Types/CmdLine.hs1
13 files changed, 112 insertions, 18 deletions
diff --git a/config.hs b/config.hs
index 97d90636..ec313725 120000
--- a/config.hs
+++ b/config.hs
@@ -1 +1 @@
-joeyconfig.hs \ No newline at end of file
+config-simple.hs \ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index 20923ab8..eef6c1de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ propellor (3.2.4) UNRELEASED; urgency=medium
* GHC's fileSystemEncoding is used for all String IO, to avoid
encoding-related crashes in eg, Propellor.Property.File.
+ * Add --build option to simply build config.hs.
+ * More informative usage message. Thanks, Daniel Brooks
-- Joey Hess <id@joeyh.name> Sat, 24 Dec 2016 15:06:36 -0400
diff --git a/doc/forum/propellor_and_gpg2/comment_1_4b732110f59f78f73fdfb745bdd9c0dd._comment b/doc/forum/propellor_and_gpg2/comment_1_4b732110f59f78f73fdfb745bdd9c0dd._comment
new file mode 100644
index 00000000..66c4cffa
--- /dev/null
+++ b/doc/forum/propellor_and_gpg2/comment_1_4b732110f59f78f73fdfb745bdd9c0dd._comment
@@ -0,0 +1,13 @@
+[[!comment format=mdwn
+ username="anselmi@0a9758305bef5e058dd0263fa20a27b334b482c7"
+ nickname="anselmi"
+ avatar="http://cdn.libravatar.org/avatar/65b723eb35eb4e3b05fffafd3e13e0fd"
+ subject="Cache gpg passphrase."
+ date="2016-12-22T17:23:58Z"
+ content="""
+The bottom line on this is that gpg2 (via the agent and pinentry) doesn't prompt correctly when run from git. It does when run directly.
+
+One fix is to set GPG_TTY before running propellor: `export GPG_TTY=$(tty)` or some such.
+
+Anything else that caches the pass phrase in the agent works too since that removes the need to prompt.
+"""]]
diff --git a/doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__.mdwn b/doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__.mdwn
new file mode 100644
index 00000000..52b3b998
--- /dev/null
+++ b/doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__.mdwn
@@ -0,0 +1,3 @@
+I've managed to do a few useful things with propellor, but it feels a bit rough around the edges to me. It looked at first like the --check and --build options would be useful for checking that my configs would at least compile, but it turns out that --build doesn't even exist and --check just returns without doing anything. Should they just be removed, or do they need more work to finish them?
+
+[[done]]
diff --git a/doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__/comment_1_7c2b2447254ad44ee1316b47eac130df._comment b/doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__/comment_1_7c2b2447254ad44ee1316b47eac130df._comment
new file mode 100644
index 00000000..392f0f1c
--- /dev/null
+++ b/doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__/comment_1_7c2b2447254ad44ee1316b47eac130df._comment
@@ -0,0 +1,12 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-12-26T15:55:36Z"
+ content="""
+--check does just what it's supposed to do. This is used during bootstrap
+to notice if the propellor binary has gotten broken by changes to eg system
+libraries.
+
+--build seems to have been added without being implemented. But it does
+seem useful to have a way to simply build propellor so implemented it now.
+"""]]
diff --git a/doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__/comment_2_b4910f50225a8b763566126861faea11._comment b/doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__/comment_2_b4910f50225a8b763566126861faea11._comment
new file mode 100644
index 00000000..0c594483
--- /dev/null
+++ b/doc/todo/Are_--check_and_--build_on_the_way_in_or_on_the_way_out__63__/comment_2_b4910f50225a8b763566126861faea11._comment
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="db48x"
+ avatar="http://cdn.libravatar.org/avatar/ad2688127feb555a92154b16d8eeb5d3"
+ subject="aha"
+ date="2016-12-26T21:23:03Z"
+ content="""
+Thanks!
+"""]]
diff --git a/doc/todo/usage__47__help_text_improvements.mdwn b/doc/todo/usage__47__help_text_improvements.mdwn
new file mode 100644
index 00000000..80fffb3d
--- /dev/null
+++ b/doc/todo/usage__47__help_text_improvements.mdwn
@@ -0,0 +1,3 @@
+I started out looking at how to make usage.mdwn into a man page, but that's a little more work than I wanted to do tonight. Instead, I added more information to the usage message. Commit is fa0e8d83 on iabak:~db48x/propellor if you want it.
+
+> merged [[done]] tnx --[[Joey]]
diff --git a/doc/todo/usage__47__help_text_improvements/comment_1_66878945cdb57d06849337262d939701._comment b/doc/todo/usage__47__help_text_improvements/comment_1_66878945cdb57d06849337262d939701._comment
new file mode 100644
index 00000000..f30eae46
--- /dev/null
+++ b/doc/todo/usage__47__help_text_improvements/comment_1_66878945cdb57d06849337262d939701._comment
@@ -0,0 +1,13 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-12-27T02:46:19Z"
+ content="""
+I don't like the use of tabs in that; it may be that with some terminal
+with an unusual tab stop, the things don't align.
+
+It would probably be simplest to put the description in the line under the
+option.
+
+BTW, the Makefile can build propellor.1 out of usage.mdwn
+"""]]
diff --git a/doc/todo/usage__47__help_text_improvements/comment_2_d531a45851cdef87a8f7b8182b3d04ce._comment b/doc/todo/usage__47__help_text_improvements/comment_2_d531a45851cdef87a8f7b8182b3d04ce._comment
new file mode 100644
index 00000000..62cf1fe4
--- /dev/null
+++ b/doc/todo/usage__47__help_text_improvements/comment_2_d531a45851cdef87a8f7b8182b3d04ce._comment
@@ -0,0 +1,12 @@
+[[!comment format=mdwn
+ username="db48x"
+ avatar="http://cdn.libravatar.org/avatar/ad2688127feb555a92154b16d8eeb5d3"
+ subject="comment 2"
+ date="2016-12-27T06:12:52Z"
+ content="""
+/me facepalms; of course it can. I guess I saw the 'git commit' in the install target and disregarded the rest.
+
+I removed the tabs from the usage. It's a lot longer, but I suppose it gets the job done.
+
+
+"""]]
diff --git a/doc/usage.mdwn b/doc/usage.mdwn
index fec346ae..3d32538f 100644
--- a/doc/usage.mdwn
+++ b/doc/usage.mdwn
@@ -55,6 +55,14 @@ and configured in haskell.
The hostname given to --spin can be a short name, which is
then looked up in the DNS to find the FQDN.
+* propellor --build
+
+ Causes propellor to build itself, checking that your config.hs, etc are
+ valid.
+
+ You do not need to run this as a separate step; propellor automatically
+ builds itself when using things like --spin.
+
* propellor --add-key keyid
Adds a gpg key, which is used to encrypt the privdata.
@@ -66,6 +74,10 @@ and configured in haskell.
using this key. Propellor requires signed commits when pulling from
a central git repository.
+* propellor --rm-key keyid
+
+ Stops encrypting the privdata to a gpg key.
+
* propellor --list-fields
Lists all privdata fields that are used by your propellor configuration.
diff --git a/privdata/relocate b/privdata/relocate
deleted file mode 100644
index 271692d8..00000000
--- a/privdata/relocate
+++ /dev/null
@@ -1 +0,0 @@
-.joeyconfig
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index c407fce8..a36ec7f5 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -24,22 +24,36 @@ import Utility.FileSystemEncoding
usage :: Handle -> IO ()
usage h = hPutStrLn h $ unlines
[ "Usage:"
- , " propellor --init"
- , " propellor"
- , " propellor hostname"
- , " propellor --spin targethost [--via relayhost]"
- , " propellor --add-key keyid"
- , " propellor --rm-key keyid"
- , " propellor --list-fields"
- , " propellor --dump field context"
- , " propellor --edit field context"
- , " propellor --set field context"
- , " propellor --unset field context"
- , " propellor --unset-unused"
- , " propellor --merge"
- , " propellor --build"
- , " propellor --check"
- ]
+ , " with no arguments, provision the current host"
+ , ""
+ , " --init"
+ , " initialize ~/.propellor"
+ , " hostname"
+ , " provision the current host as if it had the specified hostname"
+ , " --spin targethost [--via relayhost]"
+ , " provision the specified host"
+ , " --build"
+ , " recompile using your current config"
+ , " --add-key keyid"
+ , " add an additional signing key to the private data"
+ , " --rm-key keyid"
+ , " remove a signing key from the private data"
+ , " --list-fields"
+ , " list private data fields"
+ , " --set field context"
+ , " set a private data field"
+ , " --unset field context"
+ , " clear a private data field"
+ , " --unset-unused"
+ , " clear unused fields from the private data"
+ , " --dump field context"
+ , " show the content of a private data field"
+ , " --edit field context"
+ , " edit the content of a private data field"
+ , " --merge"
+ , " combine multiple spins into a single git commit"
+ , " --check"
+ , " double-check that propellor can actually run here"]
usageError :: [String] -> IO a
usageError ps = do
@@ -55,6 +69,7 @@ processCmdLine = go =<< getArgs
<$> mapM hostname (reverse hs)
<*> pure (Just r)
_ -> Spin <$> mapM hostname ps <*> pure Nothing
+ go ("--build":[]) = return Build
go ("--add-key":k:[]) = return $ AddKey k
go ("--rm-key":k:[]) = return $ RmKey k
go ("--set":f:c:[]) = withprivfield f c Set
@@ -104,6 +119,7 @@ defaultMain hostlist = withConcurrentOutput $ do
where
go cr (Serialized cmdline) = go cr cmdline
go _ Check = return ()
+ go cr Build = buildFirst Nothing cr Build $ return ()
go _ (Set field context) = setPrivData field context
go _ (Unset field context) = unsetPrivData field context
go _ (UnsetUnused) = unsetPrivDataUnused hostlist
diff --git a/src/Propellor/Types/CmdLine.hs b/src/Propellor/Types/CmdLine.hs
index 558c6e8b..d712a456 100644
--- a/src/Propellor/Types/CmdLine.hs
+++ b/src/Propellor/Types/CmdLine.hs
@@ -28,4 +28,5 @@ data CmdLine
| ChrootChain HostName FilePath Bool Bool
| GitPush Fd Fd
| Check
+ | Build
deriving (Read, Show, Eq)