summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
l---------config.hs2
-rw-r--r--debian/changelog2
-rw-r--r--joeyconfig.hs17
-rw-r--r--privdata/relocate1
-rw-r--r--propellor.cabal6
-rw-r--r--src/Propellor/Container.hs3
-rw-r--r--src/Propellor/EnsureProperty.hs5
-rw-r--r--src/Propellor/Info.hs6
-rw-r--r--src/Propellor/Message.hs2
-rw-r--r--src/Propellor/PropAccum.hs9
-rw-r--r--src/Propellor/Property.hs2
-rw-r--r--src/Propellor/Property/Group.hs4
12 files changed, 51 insertions, 8 deletions
diff --git a/config.hs b/config.hs
index ec313725..97d90636 120000
--- a/config.hs
+++ b/config.hs
@@ -1 +1 @@
-config-simple.hs \ No newline at end of file
+joeyconfig.hs \ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index 99c296d6..2a526c55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
propellor (3.2.2) UNRELEASED; urgency=medium
* Added Linode.serialGrub property.
+ * Clean up build warnings about redundant constraints when built with ghc 8.0.
+ * Added Group.hasUser property. Thanks, Daniel Brooks
-- Joey Hess <id@joeyh.name> Fri, 21 Oct 2016 14:59:09 -0400
diff --git a/joeyconfig.hs b/joeyconfig.hs
index 49cc05f1..22744ffc 100644
--- a/joeyconfig.hs
+++ b/joeyconfig.hs
@@ -12,6 +12,7 @@ import qualified Propellor.Property.Ssh as Ssh
import qualified Propellor.Property.Cron as Cron
import qualified Propellor.Property.Sudo as Sudo
import qualified Propellor.Property.User as User
+import qualified Propellor.Property.Group as Group
import qualified Propellor.Property.Hostname as Hostname
import qualified Propellor.Property.Tor as Tor
import qualified Propellor.Property.Dns as Dns
@@ -527,21 +528,29 @@ iabak = host "iabak.archiveteam.org" $ props
, (SshEcdsa, "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBHb0kXcrF5ThwS8wB0Hez404Zp9bz78ZxEGSqnwuF4d/N3+bymg7/HAj7l/SzRoEXKHsJ7P5320oMxBHeM16Y+k=")
]
& Apt.installed ["etckeeper", "sudo"]
- & Apt.installed ["vim", "screen", "tmux", "less", "emax-nox", "netcat"]
+ -- vital but generic tools
+ & Apt.installed ["vim", "screen", "tmux", "less", "emacs-nox", "netcat", "nano"]
+ -- tools for creating shards
+ & Apt.installed ["jq", "python3", "python3-aiohttp"]
& User.hasSomePassword (User "root")
& propertyList "admin accounts"
- (toProps $ map User.accountFor admins ++ map Sudo.enabledFor admins)
+ (toProps $ map User.accountFor admins
+ ++ map (Group.hasUser (Group "staff")) admins
+ ++ map Sudo.enabledFor admins)
& User.hasSomePassword (User "joey")
& GitHome.installedFor (User "joey")
& Ssh.authorizedKey (User "db48x") "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAIAQDQ6urXcMDeyuFf4Ga7CuGezTShKnEMPHKJm7RQUtw3yXCPX5wnbvPS2+UFnHMzJvWOX5S5b/XpBpOusP0jLpxwOCEg4nA5b7uvWJ2VIChlMqopYMo+tDOYzK/Q74MZiNWi2hvf1tn3N9SnqOa7muBMKMENIX5KJdH8cJ/BaPqAP883gF8r2SwSZFvaB0xYCT/CIylC593n/+0+Lm07NUJIO8jil3n2SwXdVg6ib65FxZoO86M46wTghnB29GXqrzraOg+5DY1zzCWpIUtFwGr4DP0HqLVtmAkC7NI14l1M0oHE0UEbhoLx/a+mOIMD2DuzW3Rs3ZmHtGLj4PL/eBU8D33AqSeM0uR/0pEcoq6A3a8ixibj9MBYD2lMh+Doa2audxS1OLM//FeNccbm1zlvvde82PZtiO11P98uN+ja4A+CfgQU5s0z0wikc4gXNhWpgvz8DrOEJrjstwOoqkLg2PpIdHRw7dhpp3K1Pc+CGAptDwbKkxs4rzUgMbO9DKI7fPcXXgKHLLShMpmSA2vsQUMfuCp2cVrQJ+Vkbwo29N0Js5yU7L4NL4H854Nbk5uwWJCs/mjXtvTimN2va23HEecTpk44HDUjJ9NyevAfPcO9q1ZtgXFTQSMcdv1m10F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NzaC1lZDI1NTE5AAAAIJQkqIgZ7D8WHW5Y3o+fpZC/4xtv/3IQrORJrTPCt7KY db48x@erebor"
+ & Ssh.authorizedKey (User "hcross") "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP5OhU2Lita9RdjPkX9N0w9wZnmVlednUDEx24bVn4Mk IABAK key - Harry C"
+ & Ssh.authorizedKey (User "kaz") "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHhFYMd9Htlf9wPZzIDyqbYYNwuo3m+kWQ9/pfAD/TE9 Kaz IABAK"
+ & Ssh.authorizedKey (User "yipdw") "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEo2mGPw2TTJMHp7G86hMBh6n9/+abzg1oXIIlkwWwzo trythil@aglarond"
& Ssh.noPasswords
& IABak.gitServer monsters
& IABak.registrationServer monsters
& IABak.graphiteServer
& IABak.publicFace
where
- admins = map User ["joey", "db48x"]
+ admins = map User ["joey", "db48x", "hcross", "kaz", "yipdw"]
--' __|II| ,.
---- __|II|II|__ ( \_,/\
diff --git a/privdata/relocate b/privdata/relocate
new file mode 100644
index 00000000..271692d8
--- /dev/null
+++ b/privdata/relocate
@@ -0,0 +1 @@
+.joeyconfig
diff --git a/propellor.cabal b/propellor.cabal
index 7d145024..dd6a4ebd 100644
--- a/propellor.cabal
+++ b/propellor.cabal
@@ -38,6 +38,8 @@ Description:
Executable propellor
Main-Is: wrapper.hs
GHC-Options: -threaded -Wall -fno-warn-tabs -O0
+ if impl(ghc >= 8.0)
+ GHC-Options: -fno-warn-redundant-constraints
Extensions: TypeOperators
Hs-Source-Dirs: src
Build-Depends:
@@ -53,6 +55,8 @@ Executable propellor
Executable propellor-config
Main-Is: config.hs
GHC-Options: -threaded -Wall -fno-warn-tabs -O0
+ if impl(ghc >= 8.0)
+ GHC-Options: -fno-warn-redundant-constraints
Extensions: TypeOperators
Hs-Source-Dirs: src
Build-Depends:
@@ -63,6 +67,8 @@ Executable propellor-config
Library
GHC-Options: -Wall -fno-warn-tabs -O0
+ if impl(ghc >= 8.0)
+ GHC-Options: -fno-warn-redundant-constraints
Extensions: TypeOperators
Hs-Source-Dirs: src
Build-Depends:
diff --git a/src/Propellor/Container.hs b/src/Propellor/Container.hs
index c4d6f864..26194456 100644
--- a/src/Propellor/Container.hs
+++ b/src/Propellor/Container.hs
@@ -43,6 +43,9 @@ propagateContainer
::
-- Since the children being added probably have info,
-- require the Property's metatypes to have info.
+ -- -Wredundant-constraints is turned off because
+ -- this constraint appears redundant, but is actually
+ -- crucial.
( IncludesInfo metatypes ~ 'True
, IsContainer c
)
diff --git a/src/Propellor/EnsureProperty.hs b/src/Propellor/EnsureProperty.hs
index c4666722..30dfd5ad 100644
--- a/src/Propellor/EnsureProperty.hs
+++ b/src/Propellor/EnsureProperty.hs
@@ -37,6 +37,9 @@ import Prelude
-- with the property to be lost.
ensureProperty
::
+ -- -Wredundant-constraints is turned off because
+ -- this constraint appears redundant, but is actually
+ -- crucial.
( Cannot_ensureProperty_WithInfo inner ~ 'True
, (Targets inner `NotSuperset` Targets outer) ~ 'CanCombine
)
@@ -45,7 +48,7 @@ ensureProperty
-> Propellor Result
ensureProperty _ = catchPropellor . getSatisfy
--- The name of this was chosen to make type errors a more understandable.
+-- The name of this was chosen to make type errors a bit more understandable.
type family Cannot_ensureProperty_WithInfo (l :: [a]) :: Bool
type instance Cannot_ensureProperty_WithInfo '[] = 'True
type instance Cannot_ensureProperty_WithInfo (t ': ts) =
diff --git a/src/Propellor/Info.hs b/src/Propellor/Info.hs
index e9218291..3d7f07a5 100644
--- a/src/Propellor/Info.hs
+++ b/src/Propellor/Info.hs
@@ -38,6 +38,9 @@ import Prelude
--
-- The new Property will include HasInfo in its metatypes.
setInfoProperty
+ -- -Wredundant-constraints is turned off because
+ -- this constraint appears redundant, but is actually
+ -- crucial.
:: (MetaTypes metatypes' ~ (+) HasInfo metatypes, SingI metatypes')
=> Property metatypes
-> Info
@@ -47,6 +50,9 @@ setInfoProperty (Property _ d a oldi c) newi =
-- | Adds more info to a Property that already HasInfo.
addInfoProperty
+ -- -Wredundant-constraints is turned off because
+ -- this constraint appears redundant, but is actually
+ -- crucial.
:: (IncludesInfo metatypes ~ 'True)
=> Property metatypes
-> Info
diff --git a/src/Propellor/Message.hs b/src/Propellor/Message.hs
index f728e143..97573516 100644
--- a/src/Propellor/Message.hs
+++ b/src/Propellor/Message.hs
@@ -73,7 +73,7 @@ actionMessage = actionMessage' Nothing
actionMessageOn :: (MonadIO m, MonadMask m, ActionResult r) => HostName -> Desc -> m r -> m r
actionMessageOn = actionMessage' . Just
-actionMessage' :: (MonadIO m, MonadMask m, ActionResult r) => Maybe HostName -> Desc -> m r -> m r
+actionMessage' :: (MonadIO m, ActionResult r) => Maybe HostName -> Desc -> m r -> m r
actionMessage' mhn desc a = do
liftIO $ outputConcurrent
=<< whenConsole (setTitleCode $ "propellor: " ++ desc)
diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs
index fcac60bf..5d1d3afb 100644
--- a/src/Propellor/PropAccum.hs
+++ b/src/Propellor/PropAccum.hs
@@ -51,6 +51,9 @@ type instance GetMetaTypes (RevertableProperty (MetaTypes t) undo) = MetaTypes t
(&)
::
( IsProp p
+ -- -Wredundant-constraints is turned off because
+ -- this constraint appears redundant, but is actually
+ -- crucial.
, MetaTypes y ~ GetMetaTypes p
, CheckCombinable x y ~ 'CanCombine
)
@@ -63,6 +66,9 @@ Props c & p = Props (c ++ [toChildProperty p])
(&^)
::
( IsProp p
+ -- -Wredundant-constraints is turned off because
+ -- this constraint appears redundant, but is actually
+ -- crucial.
, MetaTypes y ~ GetMetaTypes p
, CheckCombinable x y ~ 'CanCombine
)
@@ -73,6 +79,9 @@ Props c &^ p = Props (toChildProperty p : c)
-- | Adds a property in reverted form.
(!)
+ -- -Wredundant-constraints is turned off because
+ -- this constraint appears redundant, but is actually
+ -- crucial.
:: (CheckCombinable x z ~ 'CanCombine)
=> Props (MetaTypes x)
-> RevertableProperty (MetaTypes y) (MetaTypes z)
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index 7ee9397e..ae4fc914 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -345,7 +345,7 @@ revert (RevertableProperty p1 p2) = RevertableProperty p2 p1
-- | Apply a property to each element of a list.
applyToList
- :: (Foldable t, Functor t, IsProp p, Combines p p, p ~ CombinedType p p)
+ :: (Foldable t, Functor t, Combines p p, p ~ CombinedType p p)
=> (b -> p)
-> t b
-> p
diff --git a/src/Propellor/Property/Group.hs b/src/Propellor/Property/Group.hs
index 58e49a86..f47867c1 100644
--- a/src/Propellor/Property/Group.hs
+++ b/src/Propellor/Property/Group.hs
@@ -1,6 +1,7 @@
module Propellor.Property.Group where
import Propellor.Base
+import Propellor.Property.User (hasGroup)
type GID = Int
@@ -12,3 +13,6 @@ exists (Group group') mgid = check test (cmdProperty "addgroup" (args mgid))
test = not . elem group' . words <$> readProcess "cut" ["-d:", "-f1", groupFile]
args Nothing = [group']
args (Just gid) = ["--gid", show gid, group']
+
+hasUser :: Group -> User -> Property DebianLike
+hasUser = flip hasGroup