summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog12
-rw-r--r--doc/news/version_4.0.1.mdwn6
-rw-r--r--doc/news/version_4.0.2.mdwn12
-rw-r--r--doc/todo/bug_in_diskimage_finalization.mdwn2
-rw-r--r--joeyconfig.hs19
-rw-r--r--propellor.cabal2
-rw-r--r--src/Propellor/Property/Chroot.hs16
-rw-r--r--src/Propellor/Property/DiskImage.hs2
-rw-r--r--src/Propellor/Property/Partition.hs24
-rw-r--r--src/Propellor/Property/Systemd.hs2
10 files changed, 57 insertions, 40 deletions
diff --git a/debian/changelog b/debian/changelog
index ed0e2422..c3ae1903 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,17 @@
-propellor (4.0.2) UNRELEASED; urgency=medium
+propellor (4.0.2) unstable; urgency=medium
* Apt.mirror can be used to set the preferred apt mirror of a host,
overriding the default CDN. This info is used by
Apt.stdSourcesList and Sbuild.builtFor.
Thanks, Sean Whitton.
-
- -- Joey Hess <id@joeyh.name> Sun, 19 Mar 2017 16:37:27 -0400
+ * Property.Partition: Update kpartx output parser, as its output format
+ changed around version 0.6. Both output formats are supported now.
+ * Fix bug when using setContainerProps with a chroot that prevented
+ properties added to a chroot that way from being seen when propellor
+ was running inside the chroot. This affected disk image creation, and
+ possibly other things that use chroots.
+
+ -- Joey Hess <id@joeyh.name> Fri, 24 Mar 2017 14:04:50 -0400
propellor (4.0.1) unstable; urgency=medium
diff --git a/doc/news/version_4.0.1.mdwn b/doc/news/version_4.0.1.mdwn
deleted file mode 100644
index e870a510..00000000
--- a/doc/news/version_4.0.1.mdwn
+++ /dev/null
@@ -1,6 +0,0 @@
-propellor 4.0.1 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
- * Fix build with pre-AMP ghc.
- * Tor: Restart daemon after installing private key.
- * Tor.named, Tor.torPrivKey: Include the new ed25519 public/private key
- pair in addition to the old secret\_id\_key."""]] \ No newline at end of file
diff --git a/doc/news/version_4.0.2.mdwn b/doc/news/version_4.0.2.mdwn
new file mode 100644
index 00000000..b955c579
--- /dev/null
+++ b/doc/news/version_4.0.2.mdwn
@@ -0,0 +1,12 @@
+propellor 4.0.2 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+ * Apt.mirror can be used to set the preferred apt mirror of a host,
+ overriding the default CDN. This info is used by
+ Apt.stdSourcesList and Sbuild.builtFor.
+ Thanks, Sean Whitton.
+ * Property.Partition: Update kpartx output parser, as its output format
+ changed around version 0.6. Both output formats are supported now.
+ * Fix bug when using setContainerProps with a chroot that prevented
+ properties added to a chroot that way from being seen when propellor
+ was running inside the chroot. This affected disk image creation, and
+ possibly other things that use chroots."""]] \ No newline at end of file
diff --git a/doc/todo/bug_in_diskimage_finalization.mdwn b/doc/todo/bug_in_diskimage_finalization.mdwn
index 288e96f2..3dc9c437 100644
--- a/doc/todo/bug_in_diskimage_finalization.mdwn
+++ b/doc/todo/bug_in_diskimage_finalization.mdwn
@@ -9,3 +9,5 @@ ensure.
I have not yet been able to determine what broke it -- I'm sure it used to
work. --[[Joey]]
+
+> Figured it out, fixed [[done]] --[[Joey]]
diff --git a/joeyconfig.hs b/joeyconfig.hs
index 6fb05be1..3414d80e 100644
--- a/joeyconfig.hs
+++ b/joeyconfig.hs
@@ -126,18 +126,12 @@ clam = host "clam.kitenet.net" $ props
& Apt.unattendedUpgrades
& Network.ipv6to4
& Systemd.persistentJournal
- & Journald.systemMaxUse "500MiB"
+ & Journald.systemMaxUse "50MiB"
& Tor.isRelay
& Tor.named "kite1"
& Tor.bandwidthRate (Tor.PerMonth "400 GB")
- & Systemd.nspawned webserver
- & File.dirExists "/var/www/html"
- & File.notPresent "/var/www/index.html"
- & "/var/www/html/index.html" `File.hasContent` ["hello, world"]
- & alias "helloworld.kitenet.net"
-
& Systemd.nspawned oldusenetShellBox
& JoeySites.scrollBox
@@ -174,6 +168,7 @@ oyster = host "oyster.kitenet.net" $ props
& Network.ipv6to4
& Systemd.persistentJournal
& Journald.systemMaxUse "500MiB"
+ & Apt.serviceInstalledRunning "swapspace"
& Tor.isRelay
& Tor.named "kite4"
@@ -540,13 +535,6 @@ keysafe = host "keysafe.joeyh.name" $ props
--------------------------- \____, o ,' ----------------------------
---------------------------- '--,___________,' -----------------------------
--- Simple web server, publishing the outside host's /var/www
-webserver :: Systemd.Container
-webserver = Systemd.debContainer "webserver" $ props
- & standardContainer (Stable "jessie")
- & Systemd.bind "/var/www"
- & Apache.installed
-
-- My own openid provider. Uses php, so containerized for security
-- and administrative sanity.
openidProvider :: Systemd.Container
@@ -659,9 +647,6 @@ monsters = -- but do want to track their public keys etc.
& Ssh.hostPubKey SshEcdsa "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY="
, host "ns6.gandi.net" $ props
& ipv4 "217.70.177.40"
- , host "turtle.kitenet.net" $ props
- & ipv4 "67.223.19.96"
- & ipv6 "2001:4978:f:2d9::2"
, host "mouse.kitenet.net" $ props
& ipv6 "2001:4830:1600:492::2"
& ipv4 "67.223.19.96"
diff --git a/propellor.cabal b/propellor.cabal
index 7319af23..e682cbd1 100644
--- a/propellor.cabal
+++ b/propellor.cabal
@@ -1,5 +1,5 @@
Name: propellor
-Version: 4.0.1
+Version: 4.0.2
Cabal-Version: >= 1.8
License: BSD2
Maintainer: Joey Hess <id@joeyh.name>
diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs
index 920a46d4..7738d97e 100644
--- a/src/Propellor/Property/Chroot.hs
+++ b/src/Propellor/Property/Chroot.hs
@@ -46,7 +46,9 @@ data Chroot where
instance IsContainer Chroot where
containerProperties (Chroot _ _ _ h) = containerProperties h
containerInfo (Chroot _ _ _ h) = containerInfo h
- setContainerProperties (Chroot loc b p h) ps = Chroot loc b p (setContainerProperties h ps)
+ setContainerProperties (Chroot loc b p h) ps =
+ let h' = setContainerProperties h ps
+ in Chroot loc b p h'
chrootSystem :: Chroot -> Maybe System
chrootSystem = fromInfoVal . fromInfo . containerInfo
@@ -118,7 +120,7 @@ debootstrapped conf = bootstrapped (Debootstrapped conf)
bootstrapped :: ChrootBootstrapper b => b -> FilePath -> Props metatypes -> Chroot
bootstrapped bootstrapper location ps = c
where
- c = Chroot location bootstrapper (propagateChrootInfo c) (host location ps)
+ c = Chroot location bootstrapper propagateChrootInfo (host location ps)
-- | Ensures that the chroot exists and is provisioned according to its
-- properties.
@@ -134,7 +136,7 @@ provisioned'
-> Bool
-> RevertableProperty (HasInfo + Linux) Linux
provisioned' c@(Chroot loc bootstrapper infopropigator _) systemdonly =
- (infopropigator normalContainerInfo $ setup `describe` chrootDesc c "exists")
+ (infopropigator c normalContainerInfo $ setup `describe` chrootDesc c "exists")
<!>
(teardown `describe` chrootDesc c "removed")
where
@@ -153,9 +155,9 @@ provisioned' c@(Chroot loc bootstrapper infopropigator _) systemdonly =
property ("removed " ++ loc) $
makeChange (removeChroot loc)
-type InfoPropagator = (PropagateInfo -> Bool) -> Property Linux -> Property (HasInfo + Linux)
+type InfoPropagator = Chroot -> (PropagateInfo -> Bool) -> Property Linux -> Property (HasInfo + Linux)
-propagateChrootInfo :: Chroot -> InfoPropagator
+propagateChrootInfo :: InfoPropagator
propagateChrootInfo c@(Chroot location _ _ _) pinfo p =
propagateContainer location c pinfo $
p `setInfoProperty` chrootInfo c
@@ -302,12 +304,12 @@ hostChroot :: ChrootBootstrapper bootstrapper => Host -> bootstrapper -> FilePat
hostChroot h bootstrapper d = chroot
where
chroot = Chroot d bootstrapper pinfo h
- pinfo = propagateHostChrootInfo h chroot
+ pinfo = propagateHostChrootInfo h
-- This is different than propagateChrootInfo in that Info using
-- HostContext is not made to use the name of the chroot as its context,
-- but instead uses the hostname of the Host.
-propagateHostChrootInfo :: Host -> Chroot -> InfoPropagator
+propagateHostChrootInfo :: Host -> InfoPropagator
propagateHostChrootInfo h c pinfo p =
propagateContainer (hostName h) c pinfo $
p `setInfoProperty` chrootInfo c
diff --git a/src/Propellor/Property/DiskImage.hs b/src/Propellor/Property/DiskImage.hs
index 06d0694e..90b7010b 100644
--- a/src/Propellor/Property/DiskImage.hs
+++ b/src/Propellor/Property/DiskImage.hs
@@ -140,7 +140,7 @@ imageBuilt' rebuild img mkchroot tabletype final partspec =
& cachesCleaned
-- Only propagate privdata Info from this chroot, nothing else.
propprivdataonly (Chroot.Chroot d b ip h) =
- Chroot.Chroot d b (const $ ip onlyPrivData) h
+ Chroot.Chroot d b (\c _ -> ip c onlyPrivData) h
-- | This property is automatically added to the chroot when building a
-- disk image. It cleans any caches of information that can be omitted;
diff --git a/src/Propellor/Property/Partition.hs b/src/Propellor/Property/Partition.hs
index 2bf5b927..679675b7 100644
--- a/src/Propellor/Property/Partition.hs
+++ b/src/Propellor/Property/Partition.hs
@@ -9,6 +9,7 @@ import Utility.Applicative
import System.Posix.Files
import Data.List
+import Data.Char
-- | Filesystems etc that can be used for a partition.
data Fs = EXT2 | EXT3 | EXT4 | BTRFS | REISERFS | XFS | FAT | VFAT | NTFS | LinuxSwap
@@ -81,11 +82,26 @@ kpartx diskimage mkprop = go `requires` Apt.installed ["kpartx"]
return r
cleanup = void $ liftIO $ boolSystem "kpartx" [Param "-d", File diskimage]
+-- kpartx's output includes the device for the loop partition, and some
+-- information about the whole disk loop device. In earlier versions,
+-- this was simply the path to the loop device. But, in kpartx 0.6,
+-- this changed to the major:minor of the block device. Either is handled
+-- by this parser.
kpartxParse :: String -> [LoopDev]
kpartxParse = mapMaybe (finddev . words) . lines
where
- finddev ("add":"map":ld:_:_:_:_:wd:_) = Just $ LoopDev
- { partitionLoopDev = "/dev/mapper/" ++ ld
- , wholeDiskLoopDev = wd
- }
+ finddev ("add":"map":ld:_:_:_:_:s:_) = do
+ wd <- if isAbsolute s
+ then Just s
+ -- A loop partition name loop0pn corresponds to
+ -- /dev/loop0. It would be more robust to check
+ -- that the major:minor matches, but haskell's
+ -- unix library lacks a way to do that.
+ else case takeWhile isDigit (dropWhile (not . isDigit) ld) of
+ [] -> Nothing
+ n -> Just $ "/dev" </> "loop" ++ n
+ Just $ LoopDev
+ { partitionLoopDev = "/dev/mapper/" ++ ld
+ , wholeDiskLoopDev = wd
+ }
finddev _ = Nothing
diff --git a/src/Propellor/Property/Systemd.hs b/src/Propellor/Property/Systemd.hs
index 8f9c3beb..7c40bd16 100644
--- a/src/Propellor/Property/Systemd.hs
+++ b/src/Propellor/Property/Systemd.hs
@@ -281,7 +281,7 @@ nspawned c@(Container name (Chroot.Chroot loc builder _ _) h) =
<!>
doNothing
- chroot = Chroot.Chroot loc builder (Chroot.propagateChrootInfo chroot) h
+ chroot = Chroot.Chroot loc builder Chroot.propagateChrootInfo h
-- | Sets up the service file for the container, and then starts
-- it running.