summaryrefslogtreecommitdiff
path: root/src/Propellor
AgeCommit message (Collapse)Author
2019-07-01optionally use type-errors to detect stucknessJoey Hess
Use the type-errors library to detect when the type checker gets stuck unable to reduce type-level operations on MetaTypes, and avoid displaying massive error messages in such a case. But, since type-errors is a new library not available in eg Debian yet, added a WithTypeErrors build flag. When the library is not available, cabal will automatically disable that build flag, and it will build without the type-errors library. This is most often used when combining properties of different types. If the MetaTypes don't have an OS in common, the error message used to be "Property " followed by pages of MetaTypes operations. Now it looks like this: • Cannot combine Properties: Property <unknown> Property HasInfo + Debian + Buntish + ArchLinux + FreeBSD (Property <unknown> is often due to a partially applied Property constructor, or due to passing the wrong type to a Property constructor.) Also it's used in ensureProperty to detect a case where the outer MetaTypes need to be inferred in order to check if the inner MetaTypes match, but the type checker is unable to infer it: • ensureProperty outer Property type is not able to be inferred here. Consider adding a type annotation. • When checking the inferred type writeConfig :: forall (outer :: [Propellor.Types.MetaTypes.MetaType]) t. And it's used in tightenTargets to detect when ghc is unable to infer the desired type of Property: • Unable to infer desired Property type in this use of tightenTargets. Consider adding a type annotation. • When checking the inferred type mk :: forall (tightened :: [Propellor.Types.MetaTypes.MetaType]).
2019-07-01custom type error messagesJoey Hess
* Avoid displaying an excessive amount of type error messages when many properties have been combined in a props list. * Added custom type error messages when Properties don't combine due to conflicting metatypes. * Added custom type error messages for ensureProperty and tightenTargets. * ensureProperty: The constraints have been simplified to EnsurePropertyAllowed. (API change) * ensureProperty: The contraints have been simplified to TightenTargetsAllowed. (API change) * CheckCombinable generates a Bool. (API change) This commit was sponsored by Jake Vosloo on Patreon.
2019-07-01Merge branch 'master' into joeyconfigJoey Hess
2019-07-01fixJoey Hess
2019-06-30moar watchdogJoey Hess
2019-06-15Merge branch 'joeyconfig'Joey Hess
2019-06-15Libvirt.installed: install libvirt-daemon-systemDavid Bremner
Several things recommend libvirt-daemon, but not for whatever reason libvirt-daemon-system. This means the libvirt-daemon is not started, which can cause virt-install to fail. Installing libvirt-daemon explicitly is probably overkill, but avoids problems in case the dependencies of libvirt-daemon-system change.
2019-05-13propellor spinJoey Hess
2019-05-04propellor spinJoey Hess
2019-04-22Merge branch 'joeyconfig'Joey Hess
2019-04-22fix Git.pulled always reporting a changeSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-04-18wordingJoey Hess
To me, "standardly" seemed to imply the property might be included by default, but it is not.
2019-04-17propellor spinJoey Hess
2019-04-17propellor spinJoey Hess
2019-04-17propellor spinJoey Hess
2019-04-16Ssh.userKeys, Ssh.userKeyAt: Create .ssh directory when it does not yet exist.Joey Hess
* Ssh.userKeys, Ssh.userKeyAt: Create .ssh directory when it does not yet exist. * Ssh.userKeyAt: When a relative filepath is provided, it's put inside the user's .ssh directory.
2019-04-09Add User.ownsWithPrimaryGroupSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-04-08change from inChroot to granular container capabilities infoJoey Hess
* Removed inChroot, instead use hasContainerCapability FilesystemContained. (API change) * Hostname: Properties that used to not do anything in a systemd or docker container will now change the container's hostname, since it's namespaced. More container capabilities can easily be added later, to fine grain control what properties will run in different kinds of containers. This changed CmdLine's Read instance, which should be ok, because propellor inside the container is always updated at the same time as propellor outside, so when it chains into the chroot, it will know to expect the capability list. Docker was not setting InChroot before, but now sets both container capabilities, so chroot setting will also work in it. Note that, things that used to check inChroot before would not work in docker, but things that check FilesystemContained now will. It may be that some of those properties don't really work properly in docker. And, Grub.installed used to run grub-mkconfig in a docker container before, I doubt that made sense (was it even safe?); it doesn't do it now. This commit was sponsored by Trenton Cronholm on Patreon.
2019-04-08Fix bug in File.containsShellSettingJoey Hess
It replaced whole shell conffile content with the setting if the file did not previously contain a line setting the key to some value. InsertSection is passed the whole content of the file, which does not contain the section yet (here the section is a single line). Probably this was not noticed because it's common for a shell config file to contain default values, so the buggy InsertSection rarely gets used. This commit was sponsored by Ethan Aubin.
2019-04-03remove old cron jobJoey Hess
2019-04-03remove unidiomatic parens before `func`Joey Hess
2019-04-03remove space before tab indentationJoey Hess
2019-04-03make Cron.runPropellor revertableSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-04-03add Cron.jobDroppedSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-04-03Sbuild.built applies Localdir.removed to schrootsSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-04-03add Localdir.removedSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-04-03add Mount.partialBindMountsOf functionSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-04-03rename Propellor.Property.{PropellorRepo -> Localdir}Sean Whitton
This is to accommodate a new property in that module which is about /usr/local/propellor, but not only about the git repo there. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-04-01Added Utility.FileMode to the modules exported by Propellor.UtilitiesJoey Hess
Since File.mode uses FileMode, it seems it ought to be exported by propellor somewhere. I don't want to make propellor Property modules themselves export core data types though, so this is a compromise of dubious utility.
2019-04-01sbuild: break Apt.stdSourcesList out of Sbuilt.builtSean Whitton
Apt.stdSourcesList supports only Debian, so having it inside Sbuilt.built was blocking using Sbuild.built with non-Debian schroots. Note that we cannot break out the installation of eatmydata and ccache, because Sbuild.built assumes that those are available in the schroot config files that it writes out. This is a minimal fix. If it becomes clear that there are properties which would be wanted in every Buntish schroot, say, we might replace Sbuild.osDebianStandard with an Sbuild.standard property which uses pickOS to install the right set of properties. Reported-by: David Bremner <david@tethera.net> Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-03-25propellor spinJoey Hess
2019-02-18updateJoey Hess
2019-01-20fix Libvirt.hs haddock buildSean Whitton
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
2019-01-20Revert "propellor: fix haddock markup in Propellor.Property.Libvirt"Joey Hess
This reverts commit 278ca887cc734ea60af429d545a6da446a0cc6aa.
2019-01-20propellor: fix haddock markup in Propellor.Property.LibvirtSergei Trofimovich
'cabal haddock' fails as: src/Propellor/Property/Libvirt.hs:35:1: error: parse error (possibly incorrect indentation or mismatched brackets) Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2019-01-18Fix --spin crash when ~/.ssh/ directory did not already exist.Joey Hess
2019-01-18Merge branch 'joeyconfig'Joey Hess
2019-01-18Avoid exposing the constructor of OuterMetaTypesWitness, to avoid the kind ↵Joey Hess
of mistake that led to the withOS bug.
2019-01-18avoid unnecessarily using withOS in the implementation of pickOSJoey Hess
2019-01-18Merge branch 'master' into joeyconfigJoey Hess
2019-01-18fix withOS type level bugJoey Hess
withOS had a type level bug that allowed ensureProperty to be used inside it with a Property that does not match the type of the withOS itself. Propellor.Property.Cron.runPropellor is a Property DebianLike; it was incorrectly a Property UnixLike before and that wrong type was hidden by the withOS bug. This commit was sponsored by Jack Hill on Patreon.
2018-12-30Merged Utility changes from git-annexJoey Hess
Last done in May 2017..
2018-12-30Merge branch 'master' into joeyconfigJoey Hess
2018-12-30stop importing deprecated Network.BSDJoey Hess
Luckily only the HostName type is needed, which Network.Socket still exports
2018-12-30Fix build with ghc 8.6.3Joey Hess
Ghc started complaining that the SingI constraints needs UndecidableInstances. I'm not clear why, when it used to work without that extension. UndecidableInstances were already used in MetaTypes..
2018-12-12propellor spinJoey Hess
2018-12-11updateJoey Hess
2018-12-10propellor spinJoey Hess
2018-12-04libghc-stm-dev package won't be in new versions of debianJoey Hess
In Bootstrap, still try to install the package to support bootstrapping to old systems. If it's not available the bootstrapping will still succeed. The added apt-cache check is only to avoid apt complaining when asked to install a not available package. In debian/control, depend on ghc that includes stm, although propellor still supports being used with older versions of ghc Of course this control file is not being used for the package in debian any longer afaik, so something else will be done there.
2018-12-04remove obsolete stm packageJoey Hess