propellor-5.18: property-based host configuration management in haskell

Safe Haskell | None
Language | Haskell2010

Propellor.Property.User

Synopsis

- data Eep = YesReallyDeleteHome
- accountFor :: User -> Property DebianLike
- systemAccountFor :: User -> Property DebianLike
- systemAccountFor' :: User -> Maybe FilePath -> Maybe Group -> Property DebianLike
- systemGroup :: Group -> Property UnixLike
- nuked :: User -> Eep -> Property Linux
- hasSomePassword :: User -> Property (HasInfo + DebianLike)
- hasSomePassword' :: IsContext c => User -> c -> Property (HasInfo + DebianLike)
- hasPassword :: User -> Property (HasInfo + DebianLike)
- hasPassword' :: IsContext c => User -> c -> Property (HasInfo + DebianLike)
- setPassword :: (((PrivDataField, PrivData) -> Propellor Result) -> Propellor Result) -> Propellor Result
- hasInsecurePassword :: User -> String -> Property DebianLike
- chpasswd :: User -> String -> [String] -> Propellor Result
- lockedPassword :: User -> Property DebianLike
- data PasswordStatus
  - = NoPassword
  - | LockedPassword
  - | HasPassword
- getPasswordStatus :: User -> IO PasswordStatus
- isLockedPassword :: User -> IO Bool
- homedir :: User -> IO FilePath
- primaryGroup :: User -> IO Group
- hasGroup :: User -> Group -> Property DebianLike
- hasDesktopGroups :: User -> Property DebianLike
- ownsWithPrimaryGroup :: User -> FilePath -> Property UnixLike
- shadowConfig :: Bool -> Property DebianLike
- shadowExists :: IO Bool
- hasLoginShell :: User -> FilePath -> Property DebianLike
- shellSetTo :: User -> FilePath -> Property DebianLike
- shellEnabled :: FilePath -> Property DebianLike

# Documentation

data Eep Source #

Constructors

YesReallyDeleteHome |

accountFor :: User -> Property DebianLike Source #

systemAccountFor :: User -> Property DebianLike Source #

systemAccountFor' :: User -> Maybe FilePath -> Maybe Group -> Property DebianLike Source #

systemGroup :: Group -> Property UnixLike Source #

nuked :: User -> Eep -> Property Linux Source #

Removes user home directory!! Use with caution.

hasSomePassword :: User -> Property (HasInfo + DebianLike) Source #

Only ensures that the user has some password set. It may or may not be a password from the PrivData.

hasSomePassword' :: IsContext c => User -> c -> Property (HasInfo + DebianLike) Source #

While hasSomePassword uses the name of the host as context, this allows specifying a different context. This is useful when you want to use the same password on multiple hosts, for example.

hasPassword :: User -> Property (HasInfo + DebianLike) Source #

Ensures that a user's password is set to a password from the PrivData. (Will change any existing password.)

A user's password can be stored in the PrivData in either of two forms; the full cleartext Password or a CryptPassword hash. The latter is obviously more secure.

hasPassword' :: IsContext c => User -> c -> Property (HasInfo + DebianLike) Source #

setPassword :: (((PrivDataField, PrivData) -> Propellor Result) -> Propellor Result) -> Propellor Result Source #

hasInsecurePassword :: User -> String -> Property DebianLike Source #

Makes a user's password be the passed String. Highly insecure: The password is right there in your config file for anyone to see!

chpasswd :: User -> String -> [String] -> Propellor Result Source #

lockedPassword :: User -> Property DebianLike Source #

data PasswordStatus Source #

Constructors

NoPassword |
LockedPassword |
HasPassword |

#### Instances

Instances details

Eq PasswordStatus Source # |
Instance details Defined in Propellor.Property.User Methods (==) :: PasswordStatus -> PasswordStatus -> Bool (/=) :: PasswordStatus -> PasswordStatus -> Bool

getPasswordStatus :: User -> IO PasswordStatus Source #

isLockedPassword :: User -> IO Bool Source #

homedir :: User -> IO FilePath Source #

primaryGroup :: User -> IO Group Source #

hasGroup :: User -> Group -> Property DebianLike Source #

hasDesktopGroups :: User -> Property DebianLike Source #

Gives a user access to the secondary groups, including audio and video, that the OS installer normally gives a desktop user access to.

Note that some groups may only exit after installation of other software. When a group does not exist yet, the user won't be added to it.

ownsWithPrimaryGroup :: User -> FilePath -> Property UnixLike Source #

Ensures that a file is owned by a user, and also by that user's primary group.

shadowConfig :: Bool -> Property DebianLike Source #

Controls whether shadow passwords are enabled or not.

shadowExists :: IO Bool Source #

hasLoginShell :: User -> FilePath -> Property DebianLike Source #

Ensures that a user has a specified login shell, and that the shell is enabled in etcshells.

shellSetTo :: User -> FilePath -> Property DebianLike Source #

shellEnabled :: FilePath -> Property DebianLike Source #

Ensures that etcshells contains a shell.