From c7c9c47d724c710b698d3301637001c056a2c0e3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 24 Nov 2015 10:18:26 -0400 Subject: Added User.hasDesktopGroups property. Based on a property in spwhitton's config, but rewritten. --- debian/changelog | 1 + src/Propellor/Property/User.hs | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/debian/changelog b/debian/changelog index b530c7b8..3fe62a73 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ propellor (2.14.0) UNRELEASED; urgency=medium Thanks, Félix Sipma. * Added Git.repoConfigured and Git.repoAcceptsNonFFs properties. Thanks, Sean Whitton + * Added User.hasDesktopGroups property. -- Joey Hess Wed, 11 Nov 2015 13:37:00 -0400 diff --git a/src/Propellor/Property/User.hs b/src/Propellor/Property/User.hs index 78e606ac..f3842892 100644 --- a/src/Propellor/Property/User.hs +++ b/src/Propellor/Property/User.hs @@ -107,6 +107,29 @@ hasGroup (User user) (Group group') = check test $ cmdProperty "adduser" where test = not . elem group' . words <$> readProcess "groups" [user] +-- | Gives a user access to the secondary groups, including audio and +-- video, that the OS installer normally gives a desktop user access to. +hasDesktopGroups :: User -> Property NoInfo +hasDesktopGroups user@(User u) = combineProperties desc $ + map (hasGroup user . Group) desktopgroups + where + desc = "user " ++ u ++ " is in standard desktop groups" + -- This list comes from user-setup's debconf + -- template named "passwd/user-default-groups" + desktopgroups = + [ "audio" + , "cdrom" + , "dip" + , "floppy" + , "video" + , "plugdev" + , "netdev" + , "scanner" + , "bluetooth" + , "debian-tor" + , "lpadmin" + ] + -- | Controls whether shadow passwords are enabled or not. shadowConfig :: Bool -> Property NoInfo shadowConfig True = check (not <$> shadowExists) $ -- cgit v1.3-2-g0d8e From a6d48cc36eb635a913a44d0a645bcf2147e973e4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 24 Nov 2015 16:04:19 -0400 Subject: prep release --- debian/changelog | 4 ++-- propellor.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3fe62a73..6b358633 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -propellor (2.14.0) UNRELEASED; urgency=medium +propellor (2.14.0) unstable; urgency=medium * Add Propellor.Property.PropellorRepo.hasOriginUrl, an explicit way to set the git repository url normally implicitly set when using --spin. @@ -13,7 +13,7 @@ propellor (2.14.0) UNRELEASED; urgency=medium Thanks, Sean Whitton * Added User.hasDesktopGroups property. - -- Joey Hess Wed, 11 Nov 2015 13:37:00 -0400 + -- Joey Hess Tue, 24 Nov 2015 16:03:55 -0400 propellor (2.13.0) unstable; urgency=medium diff --git a/propellor.cabal b/propellor.cabal index 45ded769..f5a91e3a 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,5 +1,5 @@ Name: propellor -Version: 2.13.0 +Version: 2.14.0 Cabal-Version: >= 1.8 License: BSD3 Maintainer: Joey Hess -- cgit v1.3-2-g0d8e From 6f949b35602f7b2095b7248981dce7381a09852d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 24 Nov 2015 16:35:46 -0400 Subject: haddock improvements --- src/Propellor.hs | 1 - src/Propellor/Property/DiskImage.hs | 24 ++++++++++++++---------- src/Propellor/Types.hs | 1 + 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/Propellor.hs b/src/Propellor.hs index 9d45c376..53b209ca 100644 --- a/src/Propellor.hs +++ b/src/Propellor.hs @@ -31,7 +31,6 @@ module Propellor ( Host(..) , Property , RevertableProperty - , () , module Propellor.Types -- * Config file , defaultMain diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs index 4878c365..2e0ec661 100644 --- a/src/Propellor/Property/DiskImage.hs +++ b/src/Propellor/Property/DiskImage.hs @@ -52,17 +52,21 @@ type DiskImage = FilePath -- > import Propellor.Property.DiskImage -- -- > let chroot d = Chroot.debootstrapped (System (Debian Unstable) "amd64") mempty d --- > & Apt.installed ["linux-image-amd64"] --- > & ... +-- > & Apt.installed ["linux-image-amd64"] +-- > & User.hasPassword (User "root") +-- > & User.accountFor (User "demo") +-- > & User.hasPassword (User "demo") +-- > & User.hasDesktopGroups (User "demo") +-- > & ... -- > in imageBuilt "/srv/images/foo.img" chroot --- > MSDOS (grubBooted PC) --- > [ partition EXT2 `mountedAt` "/boot" --- > `setFlag` BootFlag --- > , partition EXT4 `mountedAt` "/" --- > `addFreeSpace` MegaBytes 100 --- > `mountOpt` errorReadonly --- > , swapPartition (MegaBytes 256) --- > ] +-- > MSDOS (grubBooted PC) +-- > [ partition EXT2 `mountedAt` "/boot" +-- > `setFlag` BootFlag +-- > , partition EXT4 `mountedAt` "/" +-- > `addFreeSpace` MegaBytes 100 +-- > `mountOpt` errorReadonly +-- > , swapPartition (MegaBytes 256) +-- > ] -- -- Note that the disk image file is reused if it already exists, -- to avoid expensive IO to generate a new one. And, it's updated in-place, diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index 3d2fbf14..58e86247 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -27,6 +27,7 @@ module Propellor.Types , IsProp(..) , Combines(..) , CombinedType + , ResultCombiner , Propellor(..) , LiftPropellor(..) , EndAction(..) -- cgit v1.3-2-g0d8e