{-# LANGUAGE FlexibleContexts, TypeFamilies #-}
module Propellor.Property.SiteSpecific.JoeySites where
import Propellor.Base
import qualified Propellor.Property.Apt as Apt
import qualified Propellor.Property.File as File
import qualified Propellor.Property.ConfFile as ConfFile
import qualified Propellor.Property.Gpg as Gpg
import qualified Propellor.Property.Ssh as Ssh
import qualified Propellor.Property.Git as Git
import qualified Propellor.Property.Cron as Cron
import qualified Propellor.Property.Service as Service
import qualified Propellor.Property.User as User
import qualified Propellor.Property.Group as Group
import qualified Propellor.Property.Sudo as Sudo
import qualified Propellor.Property.Borg as Borg
import qualified Propellor.Property.Apache as Apache
import qualified Propellor.Property.Postfix as Postfix
import qualified Propellor.Property.Systemd as Systemd
import qualified Propellor.Property.Network as Network
import qualified Propellor.Property.Fail2Ban as Fail2Ban
import qualified Propellor.Property.LetsEncrypt as LetsEncrypt
import qualified Propellor.Property.Mount as Mount
import Utility.Split
import Data.List
import System.Posix.Files
scrollBox :: Property (HasInfo + DebianLike)
scrollBox :: Property (HasInfo + DebianLike)
scrollBox = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"scroll server" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> Property DebianLike
User.accountFor ([Char] -> User
User [Char]
"scroll")
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> [Char] -> [Char] -> Maybe [Char] -> Property DebianLike
Git.cloned ([Char] -> User
User [Char]
"scroll") [Char]
"git://git.kitenet.net/scroll" ([Char]
d [Char] -> [Char] -> [Char]
</> [Char]
"scroll") Maybe [Char]
forall a. Maybe a
Nothing
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"ghc", [Char]
"make", [Char]
"cabal-install", [Char]
"libghc-vector-dev",
[Char]
"libghc-bytestring-dev", [Char]
"libghc-mtl-dev", [Char]
"libghc-ncurses-dev",
[Char]
"libghc-random-dev", [Char]
"libghc-monad-loops-dev", [Char]
"libghc-text-dev",
[Char]
"libghc-ifelse-dev", [Char]
"libghc-case-insensitive-dev",
[Char]
"libghc-data-default-dev", [Char]
"libghc-optparse-applicative-dev"]
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> [[Char]] -> UncheckedProperty UnixLike
userScriptProperty ([Char] -> User
User [Char]
"scroll")
[ [Char]
"cd " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d [Char] -> [Char] -> [Char]
</> [Char]
"scroll"
, [Char]
"git pull"
, [Char]
"cabal configure"
, [Char]
"make"
]
UncheckedProperty UnixLike -> Result -> Property UnixLike
forall (p :: * -> *) i.
Checkable p i =>
p i -> Result -> Property i
`assume` Result
MadeChange
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
s [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"#!/bin/sh"
, [Char]
"set -e"
, [Char]
"echo Preparing to run scroll!"
, [Char]
"cd " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d
, [Char]
"mkdir -p tmp"
, [Char]
"TMPDIR= t=$(tempfile -d tmp)"
, [Char]
"export t"
, [Char]
"rm -f \"$t\""
, [Char]
"mkdir \"$t\""
, [Char]
"cd \"$t\""
, [Char]
"echo"
, [Char]
"echo Note that games on this server are time-limited to 2 hours"
, [Char]
"echo 'Need more time? Run scroll locally instead!'"
, [Char]
"echo"
, [Char]
"echo Press Enter to start the game."
, [Char]
"read me"
, [Char]
"SHELL=/bin/sh script --timing=timing -c " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
g
] Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` ([Char]
s [Char] -> FileMode -> Property UnixLike
`File.mode` ([FileMode] -> FileMode
combineModes (FileMode
ownerWriteModeFileMode -> [FileMode] -> [FileMode]
forall a. a -> [a] -> [a]
:[FileMode]
readModes [FileMode] -> [FileMode] -> [FileMode]
forall a. [a] -> [a] -> [a]
++ [FileMode]
executeModes)))
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
g [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"#!/bin/sh"
, [Char]
"if ! timeout --kill-after 1m --foreground 2h ../../scroll/scroll; then"
, [Char]
"echo Scroll seems to have ended unexpectedly. Possibly a bug.."
, [Char]
"else"
, [Char]
"echo Thanks for playing scroll! https://joeyh.name/code/scroll/"
, [Char]
"fi"
, [Char]
"echo Your game was recorded, as ID:$(basename \"$t\")"
, [Char]
"echo if you would like to talk about how it went, email scroll@joeyh.name"
, [Char]
"read line"
] Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` ([Char]
g [Char] -> FileMode -> Property UnixLike
`File.mode` ([FileMode] -> FileMode
combineModes (FileMode
ownerWriteModeFileMode -> [FileMode] -> [FileMode]
forall a. a -> [a] -> [a]
:[FileMode]
readModes [FileMode] -> [FileMode] -> [FileMode]
forall a. [a] -> [a] -> [a]
++ [FileMode]
executeModes)))
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
Ssh.sshdConfig [Char] -> [Char] -> Property UnixLike
`File.containsLine` ([Char]
"DenyUsers scroll")
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
Ssh.restarted
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> [Char] -> Property DebianLike
User.shellSetTo ([Char] -> User
User [Char]
"scroll") [Char]
s
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> Property (HasInfo + DebianLike)
User.hasPassword ([Char] -> User
User [Char]
"scroll")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.removed [[Char]
"telnetd"]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"shellinabox"]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> Property UnixLike
File.hasContent [Char]
"/etc/default/shellinabox"
[ [Char]
"# Deployed by propellor"
, [Char]
"SHELLINABOX_DAEMON_START=1"
, [Char]
"SHELLINABOX_PORT=4242"
, [Char]
"SHELLINABOX_ARGS=\"--disable-ssl --no-beep --service=:scroll:scroll:" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
":" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
s [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"\""
]
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"shellinabox"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Service.running [Char]
"shellinabox"
where
d :: [Char]
d = [Char]
"/home/scroll"
s :: [Char]
s = [Char]
d [Char] -> [Char] -> [Char]
</> [Char]
"login.sh"
g :: [Char]
g = [Char]
d [Char] -> [Char] -> [Char]
</> [Char]
"game.sh"
kgbServer :: Property (HasInfo + DebianLike)
kgbServer :: Property (HasInfo + DebianLike)
kgbServer = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
desc (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"kgb-bot"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/default/kgb-bot" [Char] -> [Char] -> Property UnixLike
`File.containsLine` [Char]
"BOT_ENABLED=1"
Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"kgb bot enabled"
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.running [Char]
"kgb-bot"
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContent [Char]
"/etc/kgb-bot/kgb.conf" Context
anyContext
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property DebianLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
(Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"kgb-bot"
where
desc :: [Char]
desc = [Char]
"kgb.kitenet.net setup"
gitServer :: [Host] -> Property (HasInfo + DebianLike)
gitServer :: [Host] -> Property (HasInfo + DebianLike)
gitServer [Host]
hosts = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"git.kitenet.net setup" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> BorgRepo
-> Times
-> [[Char]]
-> [KeepPolicy]
-> Property DebianLike
Borg.backup [Char]
"/srv/git" BorgRepo
borgrepo
([Char] -> Times
Cron.Times [Char]
"33 3 * * *")
[]
[Int -> KeepPolicy
Borg.KeepDays Int
30]
Property DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> CombinedType
(Property DebianLike)
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Maybe [Char]
-> User
-> Context
-> (SshKeyType, [Char])
-> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
Maybe [Char]
-> User
-> c
-> (SshKeyType, [Char])
-> Property (HasInfo + UnixLike)
Ssh.userKeyAt ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
sshkey)
([Char] -> User
User [Char]
"root")
([Char] -> Context
Context [Char]
"git.kitenet.net")
(SshKeyType
SshEd25519, [Char]
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOvgBVYP6srImGbJ+kg1K68HeUQqxHEBQswMWSqu9WOu root@kite")
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
(Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Host] -> [Char] -> User -> Property UnixLike
Ssh.knownHost [Host]
hosts [Char]
"usw-s002.rsync.net" ([Char] -> User
User [Char]
"root")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> Context -> Property (HasInfo + UnixLike)
forall c. IsContext c => User -> c -> Property (HasInfo + UnixLike)
Ssh.authorizedKeys ([Char] -> User
User [Char]
"family") ([Char] -> Context
Context [Char]
"git.kitenet.net")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> Property DebianLike
User.accountFor ([Char] -> User
User [Char]
"family")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"git", [Char]
"rsync", [Char]
"cgit"]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"git-annex"]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"kgb-client"]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContentExposed [Char]
"/etc/kgb-bot/kgb-client.conf" Context
anyContext
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property UnixLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
(Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Char] -> Property UnixLike
File.dirExists [Char]
"/etc/kgb-bot/"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> RevertableProperty DebianLike DebianLike
Git.daemonRunning [Char]
"/srv/git"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/cgitrc" [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"clone-url=https://git.joeyh.name/git/$CGIT_REPO_URL git://git.joeyh.name/$CGIT_REPO_URL"
, [Char]
"css=/cgit-css/cgit.css"
, [Char]
"logo=/cgit-css/cgit.png"
, [Char]
"enable-http-clone=1"
, [Char]
"root-title=Joey's git repositories"
, [Char]
"root-desc="
, [Char]
"enable-index-owner=0"
, [Char]
"snapshots=tar.gz"
, [Char]
"enable-git-config=1"
, [Char]
"scan-path=/srv/git"
]
Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"cgit configured"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> [Char] -> [Char] -> Maybe [Char] -> Property DebianLike
Git.cloned ([Char] -> User
User [Char]
"joey") [Char]
"/srv/git/joey/git.kitenet.net.git" [Char]
"/srv/web/git.kitenet.net" Maybe [Char]
forall a. Maybe a
Nothing
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} {k} (x :: [a]) (z :: [a]) (y :: k).
CheckCombinableNote x z (NoteFor ('Text "!")) =>
Props (MetaTypes x)
-> RevertableProperty (MetaTypes y) (MetaTypes z)
-> Props (MetaTypes (Combine x z))
! [Char] -> RevertableProperty DebianLike DebianLike
Apache.confEnabled [Char]
"cgit"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> RevertableProperty DebianLike DebianLike
website [Char]
"git.kitenet.net"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> RevertableProperty DebianLike DebianLike
website [Char]
"git.joeyh.name"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> RevertableProperty DebianLike DebianLike
Apache.modEnabled [Char]
"cgi"
where
sshkey :: [Char]
sshkey = [Char]
"/root/.ssh/git.kitenet.net.key"
borgrepo :: BorgRepo
borgrepo = [Char] -> [BorgRepoOpt] -> BorgRepo
rsyncNetBorgRepo [Char]
"git.kitenet.net.borg" [[Char] -> BorgRepoOpt
Borg.UseSshKey [Char]
sshkey]
website :: [Char] -> RevertableProperty DebianLike DebianLike
website [Char]
hn = [Char]
-> [Char]
-> AgreeTOS
-> [[Char]]
-> RevertableProperty DebianLike DebianLike
Apache.httpsVirtualHost' [Char]
hn [Char]
"/srv/web/git.kitenet.net/" AgreeTOS
letos
[ [Char]
Apache.iconDir
, [Char]
" <Directory /srv/web/git.kitenet.net/>"
, [Char]
" Options Indexes ExecCGI FollowSymlinks"
, [Char]
" AllowOverride None"
, [Char]
" AddHandler cgi-script .cgi"
, [Char]
" DirectoryIndex index.cgi"
, [Char]
Apache.allowAll
, [Char]
" </Directory>"
, [Char]
""
, [Char]
" ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/"
, [Char]
" <Directory /usr/lib/cgi-bin>"
, [Char]
" SetHandler cgi-script"
, [Char]
" Options ExecCGI"
, [Char]
" </Directory>"
]
type AnnexUUID = String
annexWebSite :: Git.RepoUrl -> HostName -> AnnexUUID -> [(String, Git.RepoUrl)] -> Property (HasInfo + DebianLike)
annexWebSite :: [Char]
-> [Char]
-> [Char]
-> [([Char], [Char])]
-> Property (HasInfo + DebianLike)
annexWebSite [Char]
origin [Char]
hn [Char]
uuid [([Char], [Char])]
remotes = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList ([Char]
hn [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
" website using git-annex") (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> [Char] -> [Char] -> Maybe [Char] -> Property DebianLike
Git.cloned ([Char] -> User
User [Char]
"joey") [Char]
origin [Char]
dir Maybe [Char]
forall a. Maybe a
Nothing
Property DebianLike
-> Property UnixLike
-> CombinedType (Property DebianLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property UnixLike
setup
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property (HasInfo + UnixLike)
alias [Char]
hn
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
postupdatehook [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"#!/bin/sh"
, [Char]
"exec git update-server-info"
] Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange`
([Char]
postupdatehook [Char] -> FileMode -> Property UnixLike
`File.mode` ([FileMode] -> FileMode
combineModes (FileMode
ownerWriteModeFileMode -> [FileMode] -> [FileMode]
forall a. a -> [a] -> [a]
:[FileMode]
readModes [FileMode] -> [FileMode] -> [FileMode]
forall a. [a] -> [a] -> [a]
++ [FileMode]
executeModes)))
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& RevertableProperty DebianLike DebianLike
setupapache
where
dir :: [Char]
dir = [Char]
"/srv/web/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
hn
postupdatehook :: [Char]
postupdatehook = [Char]
dir [Char] -> [Char] -> [Char]
</> [Char]
".git/hooks/post-update"
setup :: Property UnixLike
setup = User -> [[Char]] -> UncheckedProperty UnixLike
userScriptProperty ([Char] -> User
User [Char]
"joey") [[Char]]
setupscript
UncheckedProperty UnixLike -> Result -> Property UnixLike
forall (p :: * -> *) i.
Checkable p i =>
p i -> Result -> Property i
`assume` Result
MadeChange
setupscript :: [[Char]]
setupscript =
[ [Char]
"cd " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char] -> [Char]
shellEscape [Char]
dir
, [Char]
"git annex reinit " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char] -> [Char]
shellEscape [Char]
uuid
] [[Char]] -> [[Char]] -> [[Char]]
forall a. [a] -> [a] -> [a]
++ (([Char], [Char]) -> [Char]) -> [([Char], [Char])] -> [[Char]]
forall a b. (a -> b) -> [a] -> [b]
map ([Char], [Char]) -> [Char]
addremote [([Char], [Char])]
remotes [[Char]] -> [[Char]] -> [[Char]]
forall a. [a] -> [a] -> [a]
++
[ [Char]
"git annex get"
, [Char]
"git update-server-info"
]
addremote :: ([Char], [Char]) -> [Char]
addremote ([Char]
name, [Char]
url) = [Char]
"git remote add " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char] -> [Char]
shellEscape [Char]
name [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char] -> [Char]
shellEscape [Char]
url
setupapache :: RevertableProperty DebianLike DebianLike
setupapache = [Char]
-> [Char]
-> AgreeTOS
-> [[Char]]
-> RevertableProperty DebianLike DebianLike
Apache.httpsVirtualHost' [Char]
hn [Char]
dir AgreeTOS
letos
[ [Char]
" ServerAlias www."[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
hn
, [Char]
Apache.iconDir
, [Char]
" <Directory "[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
dir[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
">"
, [Char]
" Options Indexes FollowSymLinks ExecCGI"
, [Char]
" AllowOverride None"
, [Char]
" AddHandler cgi-script .cgi"
, [Char]
" DirectoryIndex index.html index.cgi"
, [Char]
Apache.allowAll
, [Char]
" </Directory>"
]
letos :: LetsEncrypt.AgreeTOS
letos :: AgreeTOS
letos = Maybe [Char] -> AgreeTOS
LetsEncrypt.AgreeTOS ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"id@joeyh.name")
apacheSite :: HostName -> Apache.ConfigFile -> RevertableProperty DebianLike DebianLike
apacheSite :: [Char] -> [[Char]] -> RevertableProperty DebianLike DebianLike
apacheSite [Char]
hn [[Char]]
middle = [Char] -> [[Char]] -> RevertableProperty DebianLike DebianLike
Apache.siteEnabled [Char]
hn ([[Char]] -> RevertableProperty DebianLike DebianLike)
-> [[Char]] -> RevertableProperty DebianLike DebianLike
forall a b. (a -> b) -> a -> b
$ [Char] -> [[Char]] -> [[Char]]
apachecfg [Char]
hn [[Char]]
middle
apachecfg :: HostName -> Apache.ConfigFile -> Apache.ConfigFile
apachecfg :: [Char] -> [[Char]] -> [[Char]]
apachecfg [Char]
hn [[Char]]
middle =
[ [Char]
"<VirtualHost *:" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Port -> [Char]
forall t. ConfigurableValue t => t -> [Char]
val Port
port [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
">"
, [Char]
" ServerAdmin grue@joeyh.name"
, [Char]
" ServerName "[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
hn[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++[Char]
":" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Port -> [Char]
forall t. ConfigurableValue t => t -> [Char]
val Port
port
]
[[Char]] -> [[Char]] -> [[Char]]
forall a. [a] -> [a] -> [a]
++ [[Char]]
middle [[Char]] -> [[Char]] -> [[Char]]
forall a. [a] -> [a] -> [a]
++
[ [Char]
""
, [Char]
" ErrorLog /var/log/apache2/error.log"
, [Char]
" LogLevel warn"
, [Char]
" CustomLog /var/log/apache2/access.log combined"
, [Char]
" ServerSignature On"
, [Char]
" "
, [Char]
Apache.iconDir
, [Char]
"</VirtualHost>"
]
where
port :: Port
port = Int -> Port
Port Int
80
gitAnnexDistributor :: Property (HasInfo + DebianLike)
gitAnnexDistributor :: Property (HasInfo + DebianLike)
gitAnnexDistributor = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
combineProperties [Char]
"git-annex distributor, including rsync server and signer" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"rsync"]
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContent [Char]
"/etc/rsyncd.conf" ([Char] -> Context
Context [Char]
"git-annex distributor")
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property DebianLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
(Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"rsync"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContent [Char]
"/etc/rsyncd.secrets" ([Char] -> Context
Context [Char]
"git-annex distributor")
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property DebianLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
(Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"rsync"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/default/rsync" [Char] -> [Char] -> Property UnixLike
`File.containsLine` [Char]
"RSYNC_ENABLE=true"
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.running [Char]
"rsync"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.enabled [Char]
"rsync"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property UnixLike
endpoint [Char]
"/srv/web/downloads.kitenet.net/git-annex/autobuild"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property UnixLike
endpoint [Char]
"/srv/web/downloads.kitenet.net/git-annex/autobuild/x86_64-apple-yosemite"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property UnixLike
endpoint [Char]
"/srv/web/downloads.kitenet.net/git-annex/autobuild/windows"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& GpgKeyId -> User -> Property (HasInfo + DebianLike)
Gpg.keyImported ([Char] -> GpgKeyId
Gpg.GpgKeyId [Char]
"89C809CB") ([Char] -> User
User [Char]
"joey")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"rpm", [Char]
"createrepo-c"]
where
endpoint :: [Char] -> Property UnixLike
endpoint [Char]
d = [Char] -> Props UnixLike -> Property UnixLike
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
combineProperties ([Char]
"endpoint " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d) (Props UnixLike -> Property UnixLike)
-> Props UnixLike -> Property UnixLike
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property UnixLike
File.dirExists [Char]
d
Props UnixLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> User -> Group -> Property UnixLike
File.ownerGroup [Char]
d ([Char] -> User
User [Char]
"joey") ([Char] -> Group
Group [Char]
"joey")
downloads :: Property (HasInfo + DebianLike)
downloads :: Property (HasInfo + DebianLike)
downloads = [Char]
-> [Char]
-> [Char]
-> [([Char], [Char])]
-> Property (HasInfo + DebianLike)
annexWebSite [Char]
"/srv/git/downloads.git"
[Char]
"downloads.kitenet.net"
[Char]
"840760dc-08f0-11e2-8c61-576b7e66acfd"
[]
tmp :: Property (HasInfo + DebianLike)
tmp :: Property (HasInfo + DebianLike)
tmp = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"tmp.joeyh.name" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> [Char]
-> [Char]
-> [([Char], [Char])]
-> Property (HasInfo + DebianLike)
annexWebSite [Char]
"/srv/git/joey/tmp.git"
[Char]
"tmp.joeyh.name"
[Char]
"26fd6e38-1226-11e2-a75f-ff007033bdba"
[]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Times -> Property UnixLike
Cron.jobDropped [Char]
"pump rss" ([Char] -> Times
Cron.Times [Char]
"15 * * * *")
ircBouncer :: Property (HasInfo + DebianLike)
ircBouncer :: Property (HasInfo + DebianLike)
ircBouncer = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"IRC bouncer" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"znc"]
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> Property DebianLike
User.accountFor ([Char] -> User
User [Char]
"znc")
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property UnixLike
File.dirExists ([Char] -> [Char]
takeDirectory [Char]
conf)
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContent [Char]
conf Context
anyContext
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> User -> Group -> Property UnixLike
File.ownerGroup [Char]
conf ([Char] -> User
User [Char]
"znc") ([Char] -> Group
Group [Char]
"znc")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Times -> User -> [Char] -> [Char] -> Property DebianLike
Cron.job [Char]
"znconboot" ([Char] -> Times
Cron.Times [Char]
"@reboot") ([Char] -> User
User [Char]
"znc") [Char]
"~" [Char]
"znc"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> [[Char]] -> UncheckedProperty UnixLike
userScriptProperty ([Char] -> User
User [Char]
"znc") [[Char]
"znc || true"]
UncheckedProperty UnixLike -> Result -> Property UnixLike
forall (p :: * -> *) i.
Checkable p i =>
p i -> Result -> Property i
`assume` Result
NoChange
Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"znc running"
where
conf :: [Char]
conf = [Char]
"/home/znc/.znc/configs/znc.conf"
githubBackup :: Property (HasInfo + DebianLike)
githubBackup :: Property (HasInfo + DebianLike)
githubBackup = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"github-backup box" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"github-backup", [Char]
"moreutils"]
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
Property (HasInfo + UnixLike)
githubKeys
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Times -> User -> [Char] -> [Char] -> Property DebianLike
Cron.niceJob [Char]
"github-backup run" ([Char] -> Times
Cron.Times [Char]
"30 4 * * *") ([Char] -> User
User [Char]
"joey")
[Char]
"/home/joey/lib/backup" [Char]
backupcmd
where
backupcmd :: [Char]
backupcmd = [Char] -> [[Char]] -> [Char]
forall a. [a] -> [[a]] -> [a]
intercalate [Char]
"&&" ([[Char]] -> [Char]) -> [[Char]] -> [Char]
forall a b. (a -> b) -> a -> b
$
[ [Char]
"mkdir -p github"
, [Char]
"cd github"
, [Char]
". $HOME/.github-keys"
, [Char]
"github-backup joeyh"
]
githubKeys :: Property (HasInfo + UnixLike)
githubKeys :: Property (HasInfo + UnixLike)
githubKeys =
let f :: [Char]
f = [Char]
"/home/joey/.github-keys"
in [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContent [Char]
f Context
anyContext
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property UnixLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
(Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> User -> Group -> Property UnixLike
File.ownerGroup [Char]
f ([Char] -> User
User [Char]
"joey") ([Char] -> Group
Group [Char]
"joey")
rsyncNetBackup :: [Host] -> Property DebianLike
rsyncNetBackup :: [Host] -> Property DebianLike
rsyncNetBackup [Host]
hosts = [Char] -> Times -> User -> [Char] -> [Char] -> Property DebianLike
Cron.niceJob [Char]
"rsync.net copied in daily" ([Char] -> Times
Cron.Times [Char]
"30 5 * * *")
([Char] -> User
User [Char]
"joey") [Char]
"/home/joey/lib/backup" [Char]
"mkdir -p rsync.net && rsync --delete -az 2318@usw-s002.rsync.net: rsync.net"
Property DebianLike
-> Property UnixLike
-> CombinedType (Property DebianLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Host] -> [Char] -> User -> Property UnixLike
Ssh.knownHost [Host]
hosts [Char]
"usw-s002.rsync.net" ([Char] -> User
User [Char]
"joey")
podcatcher :: Property DebianLike
podcatcher :: Property DebianLike
podcatcher = [Char] -> Times -> User -> [Char] -> [Char] -> Property DebianLike
Cron.niceJob [Char]
"podcatcher run hourly" ([Char] -> Times
Cron.Times [Char]
"55 * * * *")
([Char] -> User
User [Char]
"joey") [Char]
"/home/joey/lib/sound/podcasts"
[Char]
"xargs git-annex importfeed -c annex.genmetadata=true < feeds; mr --quiet update"
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [[Char]] -> Property DebianLike
Apt.installed [[Char]
"git-annex", [Char]
"myrepos"]
spamdEnabled :: Property DebianLike
spamdEnabled :: Property DebianLike
spamdEnabled = Property UnixLike -> Property DebianLike
forall (p :: * -> *) (untightened :: [MetaType])
(tightened :: [MetaType]).
(TightenTargets p, TightenTargetsAllowed untightened tightened,
SingI tightened) =>
p (MetaTypes untightened) -> p (MetaTypes tightened)
tightenTargets (Property UnixLike -> Property DebianLike)
-> Property UnixLike -> Property DebianLike
forall a b. (a -> b) -> a -> b
$
[Char] -> [[Char]] -> UncheckedProperty UnixLike
cmdProperty [Char]
"update-rc.d" [[Char]
"spamassassin", [Char]
"enable"]
UncheckedProperty UnixLike -> Result -> Property UnixLike
forall (p :: * -> *) i.
Checkable p i =>
p i -> Result -> Property i
`assume` Result
MadeChange
spamassassinConfigured :: Property DebianLike
spamassassinConfigured :: Property DebianLike
spamassassinConfigured = [Char] -> Props DebianLike -> Property DebianLike
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"spamassassin configured" (Props DebianLike -> Property DebianLike)
-> Props DebianLike -> Property DebianLike
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"spamassassin"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/default/spamassassin" [Char] -> [[Char]] -> Property UnixLike
`File.containsLines`
[ [Char]
"# Propellor deployed"
, [Char]
"OPTIONS=\"--create-prefs --max-children 5 --helper-home-dir\""
, [Char]
"CRON=1"
, [Char]
"NICE=\"--nicelevel 15\""
]
Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"spamd configured"
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
spamdEnabled
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"spamassassin"
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"cron"
kiteMailServer :: Property (HasInfo + DebianLike)
kiteMailServer :: Property (HasInfo + DebianLike)
kiteMailServer = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"kitenet.net mail server" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property DebianLike
Postfix.installed
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"postfix-pcre"]
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"postgrey"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property DebianLike
spamassassinConfigured
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"spamass-milter"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/default/spamass-milter" [Char] -> [Char] -> Property UnixLike
`File.containsLine`
[Char]
"OPTIONS=\"-m -u spamass-milter -i 127.0.0.1\""
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"spamass-milter"
Property DebianLike -> [Char] -> Property DebianLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"spamass-milter configured"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"amavisd-milter"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/default/amavisd-milter" [Char] -> [[Char]] -> Property UnixLike
`File.containsLines`
[ [Char]
"# Propellor deployed"
, [Char]
"MILTERSOCKET=/var/spool/postfix/amavis/amavis.sock"
, [Char]
"MILTERSOCKETOWNER=\"postfix:postfix\""
, [Char]
"MILTERSOCKETMODE=\"0660\""
]
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"amavisd-milter"
Property DebianLike -> [Char] -> Property DebianLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"amavisd-milter configured for postfix"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"clamav-freshclam"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Times -> User -> [Char] -> [Char] -> Property DebianLike
Cron.niceJob [Char]
"amavis-expire" Times
Cron.Daily ([Char] -> User
User [Char]
"root") [Char]
"/"
[Char]
"find /var/lib/amavis/virusmails/ -type f -ctime +2 -delete"
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
Property (HasInfo + DebianLike)
dkimInstalled
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property DebianLike
Postfix.saslAuthdInstalled
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property DebianLike
Fail2Ban.installed
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Fail2Ban.jailEnabled [Char]
"postfix-sasl"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/default/saslauthd" [Char] -> [Char] -> Property UnixLike
`File.containsLine` [Char]
"MECHANISMS=sasldb"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> User -> Property (HasInfo + UnixLike)
Postfix.saslPasswdSet [Char]
"kitenet.net" ([Char] -> User
User [Char]
"errol")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> User -> Property (HasInfo + UnixLike)
Postfix.saslPasswdSet [Char]
"kitenet.net" ([Char] -> User
User [Char]
"joey")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"maildrop"]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/maildroprc" [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"# Global maildrop filter file (deployed with propellor)"
, [Char]
"DEFAULT=\"$HOME/Maildir\""
, [Char]
"MAILBOX=\"$DEFAULT/.\""
, [Char]
"# Filter spam to a spam folder, unless .keepspam exists"
, [Char]
"if (/^X-Spam-Status: Yes/)"
, [Char]
"{"
, [Char]
" `test -e \"$HOME/.keepspam\"`"
, [Char]
" if ( $RETURNCODE != 0 )"
, [Char]
" to ${MAILBOX}spam"
, [Char]
"}"
]
Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"maildrop configured"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/aliases" [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
`File.hasPrivContentExposed` Context
ctx
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property UnixLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
(Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property UnixLike
Postfix.newaliases
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Context -> Property (HasInfo + UnixLike)
hasPostfixCert Context
ctx
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/postfix/mydomain" [Char] -> [[Char]] -> Property UnixLike
`File.containsLines`
[ [Char]
"/.*\\.kitenet\\.net/\tOK"
, [Char]
"/ikiwiki\\.info/\tOK"
, [Char]
"/joeyh\\.name/\tOK"
]
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
Postfix.reloaded
Property DebianLike -> [Char] -> Property DebianLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"postfix mydomain file configured"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/postfix/obscure_client_relay.pcre" [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"/^Received: from ([^.]+)\\.kitenet\\.net.*using TLS.*by kitenet\\.net \\(([^)]+)\\) with (E?SMTPS?A?) id ([A-F[:digit:]]+)(.*)/ IGNORE"
, [Char]
"/^Received: by ([^.]+)\\.kitenet\\.net.*/ REPLACE X-Question: 42"
]
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
Postfix.reloaded
Property DebianLike -> [Char] -> Property DebianLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"postfix obscure_client_relay file configured"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> ([Char] -> Property UnixLike)
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x.
Combines (Property x) (Property UnixLike) =>
[Char]
-> ([Char] -> Property x)
-> CombinedType (Property x) (Property UnixLike)
Postfix.mappedFile [Char]
"/etc/postfix/virtual"
(([Char] -> [[Char]] -> Property UnixLike)
-> [[Char]] -> [Char] -> Property UnixLike
forall a b c. (a -> b -> c) -> b -> a -> c
flip [Char] -> [[Char]] -> Property UnixLike
File.containsLines
[ [Char]
"# *@joeyh.name to joey"
, [Char]
"@joeyh.name\tjoey"
]
) Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"postfix virtual file configured"
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
Postfix.reloaded
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> ([Char]
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
(Property UnixLike)
forall x.
Combines (Property x) (Property UnixLike) =>
[Char]
-> ([Char] -> Property x)
-> CombinedType (Property x) (Property UnixLike)
Postfix.mappedFile [Char]
"/etc/postfix/relay_clientcerts"
(([Char]
-> Context
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
-> Context
-> [Char]
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
forall a b c. (a -> b -> c) -> b -> a -> c
flip [Char]
-> Context
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContentExposed Context
ctx)
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
Postfix.mainCfFile [Char] -> [[Char]] -> Property UnixLike
`File.containsLines`
[ [Char]
"myhostname = kitenet.net"
, [Char]
"mydomain = $myhostname"
, [Char]
"append_dot_mydomain = no"
, [Char]
"myorigin = kitenet.net"
, [Char]
"mydestination = $myhostname, localhost.$mydomain, $mydomain, kite.$mydomain., localhost, regexp:$config_directory/mydomain"
, [Char]
"mailbox_command = maildrop"
, [Char]
"virtual_alias_maps = hash:/etc/postfix/virtual"
, [Char]
"# Allow clients with trusted certs to relay mail through."
, [Char]
"relay_clientcerts = hash:/etc/postfix/relay_clientcerts"
, [Char]
"smtpd_relay_restrictions = permit_mynetworks,permit_tls_clientcerts,permit_sasl_authenticated,reject_unauth_destination"
, [Char]
"# Filter out client relay lines from headers."
, [Char]
"header_checks = pcre:$config_directory/obscure_client_relay.pcre"
, [Char]
"# Password auth for relaying"
, [Char]
"smtpd_sasl_auth_enable = yes"
, [Char]
"smtpd_sasl_security_options = noanonymous"
, [Char]
"smtpd_sasl_local_domain = kitenet.net"
, [Char]
"# Enable postgrey and sasl auth and client certs."
, [Char]
"smtpd_recipient_restrictions = permit_tls_clientcerts,permit_sasl_authenticated,,permit_mynetworks,reject_unauth_destination,check_policy_service inet:127.0.0.1:10023"
, [Char]
"# Enable spamass-milter, amavis-milter (opendkim is not enabled because it causes mails forwarded from eg gmail to be rejected)"
, [Char]
"smtpd_milters = unix:/spamass/spamass.sock unix:amavis/amavis.sock"
, [Char]
"# opendkim is used for outgoing mail"
, [Char]
"non_smtpd_milters = inet:localhost:8891"
, [Char]
"milter_connect_macros = j {daemon_name} v {if_name} _"
, [Char]
"# If a milter is broken, fall back to just accepting mail."
, [Char]
"milter_default_action = accept"
, [Char]
"# TLS setup -- server"
, [Char]
"smtpd_tls_CAfile = /etc/ssl/certs/joeyca.pem"
, [Char]
"smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem"
, [Char]
"smtpd_tls_key_file = /etc/ssl/private/postfix.pem"
, [Char]
"smtpd_tls_loglevel = 1"
, [Char]
"smtpd_tls_received_header = yes"
, [Char]
"smtpd_use_tls = yes"
, [Char]
"smtpd_tls_ask_ccert = yes"
, [Char]
"smtpd_tls_session_cache_database = sdbm:/etc/postfix/smtpd_scache"
, [Char]
"# TLS setup -- client"
, [Char]
"smtp_tls_CAfile = /etc/ssl/certs/joeyca.pem"
, [Char]
"smtp_tls_cert_file = /etc/ssl/certs/postfix.pem"
, [Char]
"smtp_tls_key_file = /etc/ssl/private/postfix.pem"
, [Char]
"smtp_tls_loglevel = 1"
, [Char]
"smtp_use_tls = yes"
, [Char]
"smtp_tls_session_cache_database = sdbm:/etc/postfix/smtp_scache"
, [Char]
"# Allow larger attachments, up to 200 mb."
, [Char]
"# (Avoid setting too high; the postfix queue must have"
, [Char]
"# 1.5 times this much space free, or postfix will reject"
, [Char]
"# ALL mail!)"
, [Char]
"message_size_limit = 204800000"
, [Char]
"virtual_mailbox_limit = 20480000"
]
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property UnixLike
Postfix.dedupMainCf
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
Postfix.reloaded
Property DebianLike -> [Char] -> Property DebianLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"postfix configured"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"dovecot-imapd"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"dovecot-pop3d"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/dovecot/conf.d/10-mail.conf" [Char] -> [Char] -> Property UnixLike
`File.containsLine`
[Char]
"mail_location = maildir:~/Maildir"
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.reloaded [Char]
"dovecot"
Property DebianLike -> [Char] -> Property DebianLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"dovecot mail.conf"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/dovecot/conf.d/10-auth.conf" [Char] -> [Char] -> Property UnixLike
`File.containsLine`
[Char]
"!include auth-passwdfile.conf.ext"
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"dovecot"
Property DebianLike -> [Char] -> Property DebianLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"dovecot auth.conf"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContent [Char]
dovecotusers Context
ctx
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property UnixLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
(Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` ([Char]
dovecotusers [Char] -> FileMode -> Property UnixLike
`File.mode`
[FileMode] -> FileMode
combineModes [FileMode
ownerReadMode, FileMode
groupReadMode])
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> User -> Group -> Property UnixLike
File.ownerGroup [Char]
dovecotusers ([Char] -> User
User [Char]
"root") ([Char] -> Group
Group [Char]
"dovecot")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"mutt", [Char]
"bsd-mailx", [Char]
"alpine"]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
pinescript [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"#!/bin/sh"
, [Char]
"# deployed with propellor"
, [Char]
"set -e"
, [Char]
"exec alpine \"$@\""
]
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` ([Char]
pinescript [Char] -> FileMode -> Property UnixLike
`File.mode`
[FileMode] -> FileMode
combineModes ([FileMode]
readModes [FileMode] -> [FileMode] -> [FileMode]
forall a. [a] -> [a] -> [a]
++ [FileMode]
executeModes))
Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"pine wrapper script"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/pine.conf" [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"# deployed with propellor"
, [Char]
"inbox-path={localhost}inbox"
, [Char]
"rsh-command=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
imapalpinescript
]
Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"pine configured to use local imap server"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
imapalpinescript [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"#!/bin/sh"
, [Char]
"# deployed with propellor"
, [Char]
"set -e"
, [Char]
"exec /usr/lib/dovecot/imap 2>/dev/null"
]
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` ([Char]
imapalpinescript [Char] -> FileMode -> Property UnixLike
`File.mode`
[FileMode] -> FileMode
combineModes ([FileMode]
readModes [FileMode] -> [FileMode] -> [FileMode]
forall a. [a] -> [a] -> [a]
++ [FileMode]
executeModes))
Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"imap script for pine"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/mailman/mm_cfg.py" [Char] -> [Char] -> Property UnixLike
`File.containsLine`
[Char]
"DEFAULT_URL_PATTERN = 'https://%s/cgi-bin/mailman/'"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Service -> RevertableProperty DebianLike DebianLike
Postfix.service Service
ssmtp
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"fetchmail"]
where
ctx :: Context
ctx = [Char] -> Context
Context [Char]
"kitenet.net"
pinescript :: [Char]
pinescript = [Char]
"/usr/local/bin/pine"
imapalpinescript :: [Char]
imapalpinescript = [Char]
"/usr/local/bin/imap-for-alpine"
dovecotusers :: [Char]
dovecotusers = [Char]
"/etc/dovecot/users"
ssmtp :: Service
ssmtp = ServiceType -> [Char] -> ServiceOpts -> Service
Postfix.Service
(Maybe [Char] -> [Char] -> ServiceType
Postfix.InetService Maybe [Char]
forall a. Maybe a
Nothing [Char]
"ssmtp")
[Char]
"smtpd" ServiceOpts
Postfix.defServiceOpts
dkimMilter :: Property (HasInfo + DebianLike)
dkimMilter :: Property (HasInfo + DebianLike)
dkimMilter = [Char]
Postfix.mainCfFile [Char] -> [[Char]] -> Property UnixLike
`File.containsLines`
[ [Char]
"smtpd_milters = inet:localhost:8891"
, [Char]
"non_smtpd_milters = inet:localhost:8891"
, [Char]
"milter_default_action = accept"
]
Property UnixLike -> [Char] -> Property UnixLike
forall p. IsProp p => p -> [Char] -> p
`describe` [Char]
"postfix dkim milter"
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property UnixLike
Postfix.dedupMainCf
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
Postfix.reloaded
Property DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> CombinedType
(Property DebianLike)
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
Property (HasInfo + DebianLike)
dkimInstalled
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
(Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property DebianLike
Postfix.installed
dkimInstalled :: Property (HasInfo + DebianLike)
dkimInstalled :: Property (HasInfo + DebianLike)
dkimInstalled = Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
go Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
(Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"opendkim"
where
go :: Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
go = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"opendkim installed" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"opendkim"
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property UnixLike
File.dirExists [Char]
"/etc/mail"
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContent [Char]
"/etc/mail/dkim.key" ([Char] -> Context
Context [Char]
"kitenet.net")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> User -> Group -> Property UnixLike
File.ownerGroup [Char]
"/etc/mail/dkim.key" ([Char] -> User
User [Char]
"root") ([Char] -> Group
Group [Char]
"root")
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/default/opendkim" [Char] -> [Char] -> Property UnixLike
`File.containsLine`
[Char]
"SOCKET=\"inet:8891@localhost\""
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange`
([Char] -> [[Char]] -> UncheckedProperty UnixLike
cmdProperty [Char]
"/lib/opendkim/opendkim.service.generate" []
UncheckedProperty UnixLike -> Result -> Property UnixLike
forall (p :: * -> *) i.
Checkable p i =>
p i -> Result -> Property i
`assume` Result
MadeChange)
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"opendkim"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/opendkim.conf" [Char] -> [[Char]] -> Property UnixLike
`File.containsLines`
[ [Char]
"KeyFile /etc/mail/dkim.key"
, [Char]
"SubDomains yes"
, [Char]
"Domain *"
, [Char]
"Selector mail"
]
domainKey :: (BindDomain, Record)
domainKey :: (BindDomain, Record)
domainKey = ([Char] -> BindDomain
RelDomain [Char]
"mail._domainkey", [Char] -> Record
TXT [Char]
"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCc+/rfzNdt5DseBBmfB3C6sVM7FgVvf4h1FeCfyfwPpVcmPdW6M2I+NtJsbRkNbEICxiP6QY2UM0uoo9TmPqLgiCCG2vtuiG6XMsS0Y/gGwqKM7ntg/7vT1Go9vcquOFFuLa5PnzpVf8hB9+PMFdS4NPTvWL2c5xxshl/RJzICnQIDAQAB")
postfixSaslPasswordClient :: Property (HasInfo + DebianLike)
postfixSaslPasswordClient :: Property (HasInfo + DebianLike)
postfixSaslPasswordClient = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
combineProperties [Char]
"postfix uses SASL password to authenticate with smarthost" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> ([Char]
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
(Property UnixLike)
forall x.
Combines (Property x) (Property UnixLike) =>
[Char]
-> ([Char] -> Property x)
-> CombinedType (Property x) (Property UnixLike)
Postfix.mappedFile [Char]
"/etc/postfix/sasl_passwd"
([Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
`File.hasPrivContent` ([Char] -> Context
Context [Char]
"kitenet.net"))
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
Postfix.mainCfFile [Char] -> [[Char]] -> Property UnixLike
`File.containsLines`
[ [Char]
"# TLS setup for SASL auth to kite"
, [Char]
"smtp_sasl_auth_enable = yes"
, [Char]
"smtp_tls_security_level = encrypt"
, [Char]
"smtp_sasl_tls_security_options = noanonymous"
, [Char]
"relayhost = [kitenet.net]"
, [Char]
"smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd"
]
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
Postfix.reloaded
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property DebianLike
Postfix.satellite
hasPostfixCert :: Context -> Property (HasInfo + UnixLike)
hasPostfixCert :: Context -> Property (HasInfo + UnixLike)
hasPostfixCert Context
ctx = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
combineProperties [Char]
"postfix tls cert installed" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/ssl/certs/postfix.pem" [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
`File.hasPrivContentExposed` Context
ctx
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/ssl/private/postfix.pem" [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
`File.hasPrivContent` Context
ctx
legacyWebSites :: Property (HasInfo + DebianLike)
legacyWebSites :: Property (HasInfo + DebianLike)
legacyWebSites = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"legacy web sites" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"apache2"
Props DebianLike
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> RevertableProperty DebianLike DebianLike
Apache.modEnabled [Char]
"rewrite"
Props DebianLike
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> RevertableProperty DebianLike DebianLike
Apache.modEnabled [Char]
"cgi"
Props DebianLike
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> RevertableProperty DebianLike DebianLike
Apache.modEnabled [Char]
"speling"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property DebianLike
userDirHtml
Props DebianLike
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> [Char]
-> AgreeTOS
-> [[Char]]
-> RevertableProperty DebianLike DebianLike
Apache.httpsVirtualHost' [Char]
"kitenet.net" [Char]
"/var/www" AgreeTOS
letos [[Char]]
kitenetcfg
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property (HasInfo + UnixLike)
alias [Char]
"anna.kitenet.net"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> RevertableProperty DebianLike DebianLike
apacheSite [Char]
"anna.kitenet.net"
[ [Char]
"DocumentRoot /home/anna/html"
, [Char]
"<Directory /home/anna/html/>"
, [Char]
" Options Indexes ExecCGI"
, [Char]
" AllowOverride None"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property (HasInfo + UnixLike)
alias [Char]
"sows-ear.kitenet.net"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property (HasInfo + UnixLike)
alias [Char]
"www.sows-ear.kitenet.net"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> RevertableProperty DebianLike DebianLike
apacheSite [Char]
"sows-ear.kitenet.net"
[ [Char]
"ServerAlias www.sows-ear.kitenet.net"
, [Char]
"DocumentRoot /srv/web/sows-ear.kitenet.net"
, [Char]
"<Directory /srv/web/sows-ear.kitenet.net>"
, [Char]
" Options FollowSymLinks"
, [Char]
" AllowOverride None"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
, [Char]
"RewriteEngine On"
, [Char]
"RewriteRule .* http://www.sowsearpoetry.org/ [L]"
]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property (HasInfo + UnixLike)
alias [Char]
"wortroot.kitenet.net"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property (HasInfo + UnixLike)
alias [Char]
"www.wortroot.kitenet.net"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> RevertableProperty DebianLike DebianLike
apacheSite [Char]
"wortroot.kitenet.net"
[ [Char]
"ServerAlias www.wortroot.kitenet.net"
, [Char]
"DocumentRoot /srv/web/wortroot.kitenet.net"
, [Char]
"<Directory /srv/web/wortroot.kitenet.net>"
, [Char]
" Options FollowSymLinks"
, [Char]
" AllowOverride None"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property (HasInfo + UnixLike)
alias [Char]
"creeksidepress.com"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> RevertableProperty DebianLike DebianLike
apacheSite [Char]
"creeksidepress.com"
[ [Char]
"ServerAlias www.creeksidepress.com"
, [Char]
"DocumentRoot /srv/web/www.creeksidepress.com"
, [Char]
"<Directory /srv/web/www.creeksidepress.com>"
, [Char]
" Options FollowSymLinks"
, [Char]
" AllowOverride None"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property (HasInfo + UnixLike)
alias [Char]
"joey.kitenet.net"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> RevertableProperty DebianLike DebianLike
apacheSite [Char]
"joey.kitenet.net"
[ [Char]
"DocumentRoot /var/www"
, [Char]
"<Directory /var/www/>"
, [Char]
" Options Indexes ExecCGI"
, [Char]
" AllowOverride None"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
, [Char]
"RewriteEngine On"
, [Char]
"# Old ikiwiki filenames for joey's wiki."
, [Char]
"rewritecond $1 !.*/index$"
, [Char]
"rewriterule (.+).html$ http://joeyh.name/$1/ [l]"
, [Char]
"rewritecond $1 !.*/index$"
, [Char]
"rewriterule (.+).rss$ http://joeyh.name/$1/index.rss [l]"
, [Char]
"# Redirect all to joeyh.name."
, [Char]
"rewriterule (.*) http://joeyh.name$1 [r]"
]
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property (HasInfo + UnixLike)
alias [Char]
"house.joeyh.name"
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> RevertableProperty DebianLike DebianLike
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> RevertableProperty DebianLike DebianLike
apacheSite [Char]
"house.joeyh.name"
[ [Char]
"DocumentRoot /srv/web/house.joeyh.name"
, [Char]
"<Directory /srv/web/house.joeyh.name>"
, [Char]
" Options Indexes ExecCGI"
, [Char]
" AllowOverride None"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
]
where
kitenetcfg :: [[Char]]
kitenetcfg =
[ [Char]
"DocumentRoot /var/www"
, [Char]
"<Directory /var/www>"
, [Char]
" Options Indexes FollowSymLinks MultiViews ExecCGI Includes"
, [Char]
" AllowOverride None"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
, [Char]
"ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/"
, [Char]
"<Directory /usr/lib/cgi-bin>"
, [Char]
" AllowOverride None"
, [Char]
" Options ExecCGI"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
, [Char]
"Alias /pipermail/ /var/lib/mailman/archives/public/"
, [Char]
"<Directory /var/lib/mailman/archives/public/>"
, [Char]
" Options Indexes MultiViews FollowSymlinks"
, [Char]
" AllowOverride None"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
, [Char]
"Alias /images/ /usr/share/images/"
, [Char]
"<Directory /usr/share/images/>"
, [Char]
" Options Indexes MultiViews"
, [Char]
" AllowOverride None"
, [Char]
Apache.allowAll
, [Char]
"</Directory>"
, [Char]
"RewriteEngine On"
, [Char]
"# Force hostname to kitenet.net"
, [Char]
"RewriteCond %{HTTP_HOST} !^kitenet\\.net [NC]"
, [Char]
"RewriteCond %{HTTP_HOST} !^$"
, [Char]
"RewriteRule ^/(.*) http://kitenet\\.net/$1 [L,R]"
, [Char]
"# Moved pages"
, [Char]
"RewriteRule /programs/debhelper http://joeyh.name/code/debhelper/ [L]"
, [Char]
"RewriteRule /programs/satutils http://joeyh.name/code/satutils/ [L]"
, [Char]
"RewriteRule /programs/filters http://joeyh.name/code/filters/ [L]"
, [Char]
"RewriteRule /programs/ticker http://joeyh.name/code/ticker/ [L]"
, [Char]
"RewriteRule /programs/pdmenu http://joeyh.name/code/pdmenu/ [L]"
, [Char]
"RewriteRule /programs/sleepd http://joeyh.name/code/sleepd/ [L]"
, [Char]
"RewriteRule /programs/Lingua::EN::Words2Nums http://joeyh.name/code/Words2Nums/ [L]"
, [Char]
"RewriteRule /programs/wmbattery http://joeyh.name/code/wmbattery/ [L]"
, [Char]
"RewriteRule /programs/dpkg-repack http://joeyh.name/code/dpkg-repack/ [L]"
, [Char]
"RewriteRule /programs/debconf http://joeyh.name/code/debconf/ [L]"
, [Char]
"RewriteRule /programs/perlmoo http://joeyh.name/code/perlmoo/ [L]"
, [Char]
"RewriteRule /programs/alien http://joeyh.name/code/alien/ [L]"
, [Char]
"RewriteRule /~joey/blog/entry/(.+)-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9].html http://joeyh.name/blog/entry/$1/ [L]"
, [Char]
"RewriteRule /~anna/.* http://waldeneffect\\.org/ [R]"
, [Char]
"RewriteRule /~anna/.* http://waldeneffect\\.org/ [R]"
, [Char]
"RewriteRule /~anna http://waldeneffect\\.org/ [R]"
, [Char]
"RewriteRule /simpleid/ http://openid.kitenet.net:8086/simpleid/"
, [Char]
"# Even the kite home page is not here any more!"
, [Char]
"RewriteRule ^/$ http://www.kitenet.net/ [R]"
, [Char]
"RewriteRule ^/index.html http://www.kitenet.net/ [R]"
, [Char]
"RewriteRule ^/joey http://www.kitenet.net/joey/ [R]"
, [Char]
"RewriteRule ^/joey/index.html http://www.kitenet.net/joey/ [R]"
, [Char]
"RewriteRule ^/wifi http://www.kitenet.net/wifi/ [R]"
, [Char]
"RewriteRule ^/wifi/index.html http://www.kitenet.net/wifi/ [R]"
, [Char]
"# Old ikiwiki filenames for kitenet.net wiki."
, [Char]
"rewritecond $1 !^/~"
, [Char]
"rewritecond $1 !^/doc/"
, [Char]
"rewritecond $1 !^/pipermail/"
, [Char]
"rewritecond $1 !^/cgi-bin/"
, [Char]
"rewritecond $1 !.*/index$"
, [Char]
"rewriterule (.+).html$ $1/ [r]"
, [Char]
"# Old ikiwiki filenames for joey's wiki."
, [Char]
"rewritecond $1 ^/~joey/"
, [Char]
"rewritecond $1 !.*/index$"
, [Char]
"rewriterule (.+).html$ http://kitenet.net/$1/ [L,R]"
, [Char]
"# ~joey to joeyh.name"
, [Char]
"rewriterule /~joey/(.*) http://joeyh.name/$1 [L]"
, [Char]
"# Old familywiki location."
, [Char]
"rewriterule /~family/(.*).html http://family.kitenet.net/$1 [L]"
, [Char]
"rewriterule /~family/(.*).rss http://family.kitenet.net/$1/index.rss [L]"
, [Char]
"rewriterule /~family(.*) http://family.kitenet.net$1 [L]"
, [Char]
"rewriterule /~kyle/bywayofscience(.*) http://bywayofscience.branchable.com$1 [L]"
, [Char]
"rewriterule /~kyle/family/wiki/(.*).html http://macleawiki.branchable.com/$1 [L]"
, [Char]
"rewriterule /~kyle/family/wiki/(.*).rss http://macleawiki.branchable.com/$1/index.rss [L]"
, [Char]
"rewriterule /~kyle/family/wiki(.*) http://macleawiki.branchable.com$1 [L]"
]
userDirHtml :: Property DebianLike
userDirHtml :: Property DebianLike
userDirHtml = [Char] -> ([[Char]] -> [[Char]]) -> [Char] -> Property UnixLike
forall c.
(FileContent c, Eq c) =>
[Char] -> (c -> c) -> [Char] -> Property UnixLike
File.fileProperty [Char]
"apache userdir is html" (([Char] -> [Char]) -> [[Char]] -> [[Char]]
forall a b. (a -> b) -> [a] -> [b]
map [Char] -> [Char]
munge) [Char]
conf
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
Apache.reloaded
Property DebianLike
-> RevertableProperty DebianLike DebianLike
-> CombinedType
(Property DebianLike) (RevertableProperty DebianLike DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Char] -> RevertableProperty DebianLike DebianLike
Apache.modEnabled [Char]
"userdir"
where
munge :: [Char] -> [Char]
munge = [Char] -> [Char] -> [Char] -> [Char]
forall a. Eq a => [a] -> [a] -> [a] -> [a]
replace [Char]
"public_html" [Char]
"html"
conf :: [Char]
conf = [Char]
"/etc/apache2/mods-available/userdir.conf"
alarmClock :: String -> User -> String -> Property Linux
alarmClock :: [Char] -> User -> [Char] -> Property Linux
alarmClock [Char]
oncalendar (User [Char]
user) [Char]
command = [Char] -> Props Linux -> Property Linux
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
combineProperties [Char]
"goodmorning timer installed" (Props Linux -> Property Linux) -> Props Linux -> Property Linux
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/systemd/system/goodmorning.timer" [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"[Unit]"
, [Char]
"Description=good morning"
, [Char]
""
, [Char]
"[Timer]"
, [Char]
"Unit=goodmorning.service"
, [Char]
"OnCalendar=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
oncalendar
, [Char]
"WakeSystem=true"
, [Char]
"Persistent=false"
, [Char]
""
, [Char]
"[Install]"
, [Char]
"WantedBy=multi-user.target"
]
Property UnixLike
-> Property Linux
-> CombinedType (Property UnixLike) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` (Property Linux
Systemd.daemonReloaded
Property Linux
-> Property Linux -> CombinedType (Property Linux) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`before` [Char] -> Property Linux
Systemd.restarted [Char]
"goodmorning.timer")
Props Linux
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/systemd/system/goodmorning.service" [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"[Unit]"
, [Char]
"Description=good morning"
, [Char]
"RefuseManualStart=true"
, [Char]
"RefuseManualStop=true"
, [Char]
"ConditionACPower=true"
, [Char]
"StopWhenUnneeded=yes"
, [Char]
""
, [Char]
"[Service]"
, [Char]
"Type=oneshot"
, [Char]
"ExecStart=/bin/systemd-inhibit --what=handle-lid-switch --why=goodmorning /bin/su " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
user [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" -c \"" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
command [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"\""
]
Property UnixLike
-> Property Linux
-> CombinedType (Property UnixLike) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property Linux
Systemd.daemonReloaded
Props Linux
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.enabled [Char]
"goodmorning.timer"
Props Linux
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.started [Char]
"goodmorning.timer"
Props Linux
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/systemd/logind.conf" [Char] -> ([Char], [Char], [Char]) -> Property UnixLike
`ConfFile.containsIniSetting`
([Char]
"Login", [Char]
"LidSwitchIgnoreInhibited", [Char]
"no")
house :: IsContext c => User -> [Host] -> c -> (SshKeyType, Ssh.PubKeyText) -> Property (HasInfo + DebianLike)
house :: forall c.
IsContext c =>
User
-> [Host]
-> c
-> (SshKeyType, [Char])
-> Property (HasInfo + DebianLike)
house User
user [Host]
hosts c
ctx (SshKeyType, [Char])
sshkey = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"home automation" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property DebianLike
Apache.installed
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"libmodbus-dev", [Char]
"rrdtool", [Char]
"rsync"]
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> [Char] -> [Char] -> Maybe [Char] -> Property DebianLike
Git.cloned User
user [Char]
"https://git.joeyh.name/git/joey/house.git" [Char]
d Maybe [Char]
forall a. Maybe a
Nothing
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> [Char] -> [Char] -> Maybe [Char] -> Property DebianLike
Git.cloned User
user [Char]
"https://git.joeyh.name/git/reactive-banana-automation.git" ([Char]
d [Char] -> [Char] -> [Char]
</> [Char]
"reactive-banana-automation") Maybe [Char]
forall a. Maybe a
Nothing
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> [Char] -> [Char] -> Maybe [Char] -> Property DebianLike
Git.cloned User
user [Char]
"https://git.joeyh.name/git/haskell-libmodbus.git" ([Char]
d [Char] -> [Char] -> [Char]
</> [Char]
"haskell-libmodbus") Maybe [Char]
forall a. Maybe a
Nothing
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property UnixLike
websitesymlink
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Property DebianLike
build
Props DebianLike
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.enabled [Char]
setupservicename
Property Linux
-> Property UnixLike
-> CombinedType (Property Linux) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property UnixLike
setupserviceinstalled
Property Linux
-> Property Linux -> CombinedType (Property Linux) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property Linux
Systemd.started [Char]
setupservicename
Props DebianLike
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.enabled [Char]
pollerservicename
Property Linux
-> Property UnixLike
-> CombinedType (Property Linux) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property UnixLike
pollerserviceinstalled
Property Linux
-> Property Linux -> CombinedType (Property Linux) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property Linux
Systemd.started [Char]
pollerservicename
Props DebianLike
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.enabled [Char]
controllerservicename
Property Linux
-> Property UnixLike
-> CombinedType (Property Linux) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property UnixLike
controllerserviceinstalled
Property Linux
-> Property Linux -> CombinedType (Property Linux) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property Linux
Systemd.started [Char]
controllerservicename
Props DebianLike
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.enabled [Char]
watchdogservicename
Property Linux
-> Property UnixLike
-> CombinedType (Property Linux) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property UnixLike
watchdogserviceinstalled
Property Linux
-> Property Linux -> CombinedType (Property Linux) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property Linux
Systemd.started [Char]
watchdogservicename
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
Apt.serviceInstalledRunning [Char]
"watchdog"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> Group -> Property DebianLike
User.hasGroup User
user ([Char] -> Group
Group [Char]
"dialout")
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& Group -> Maybe Int -> Property UnixLike
Group.exists ([Char] -> Group
Group [Char]
"gpio") Maybe Int
forall a. Maybe a
Nothing
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> Group -> Property DebianLike
User.hasGroup User
user ([Char] -> Group
Group [Char]
"gpio")
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"i2c-tools"]
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& User -> Group -> Property DebianLike
User.hasGroup User
user ([Char] -> Group
Group [Char]
"i2c")
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/modules-load.d/house.conf" [Char] -> [[Char]] -> Property UnixLike
`File.hasContent` [[Char]
"i2c-dev"]
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Times -> User -> [Char] -> [Char] -> Property DebianLike
Cron.niceJob [Char]
"house upload"
([Char] -> Times
Cron.Times [Char]
"1 * * * *") User
user [Char]
d [Char]
rsynccommand
Property DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> CombinedType
(Property DebianLike)
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Maybe [Char]
-> User
-> c
-> (SshKeyType, [Char])
-> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
Maybe [Char]
-> User
-> c
-> (SshKeyType, [Char])
-> Property (HasInfo + UnixLike)
Ssh.userKeyAt ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
sshkeyfile) User
user c
ctx (SshKeyType, [Char])
sshkey
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
(Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Char] -> User -> Group -> Property UnixLike
File.ownerGroup ([Char] -> [Char]
takeDirectory [Char]
sshkeyfile)
User
user (User -> Group
userGroup User
user)
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
(Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Char] -> Property UnixLike
File.dirExists ([Char] -> [Char]
takeDirectory [Char]
sshkeyfile)
Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property UnixLike
-> CombinedType
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
(Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Host] -> [Char] -> User -> Property UnixLike
Ssh.knownHost [Host]
hosts [Char]
"kitenet.net" User
user
Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> Props
(MetaTypes
(Combine
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContentExposed [Char]
"/etc/darksky-forecast-url" Context
anyContext
where
d :: [Char]
d = [Char]
"/home/joey/house"
sshkeyfile :: [Char]
sshkeyfile = [Char]
d [Char] -> [Char] -> [Char]
</> [Char]
".ssh/key"
build :: Property DebianLike
build = IO Bool -> Property DebianLike -> Property DebianLike
forall (p :: * -> *) i (m :: * -> *).
(Checkable p i, LiftPropellor m) =>
m Bool -> p i -> Property i
check (Bool -> Bool
not (Bool -> Bool) -> IO Bool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Char] -> IO Bool
doesFileExist ([Char]
d [Char] -> [Char] -> [Char]
</> [Char]
"controller")) (Property DebianLike -> Property DebianLike)
-> Property DebianLike -> Property DebianLike
forall a b. (a -> b) -> a -> b
$
User -> [[Char]] -> UncheckedProperty UnixLike
userScriptProperty ([Char] -> User
User [Char]
"joey")
[ [Char]
"cd " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d [Char] -> [Char] -> [Char]
</> [Char]
"reactive-banana-automation"
, [Char]
"cabal install"
, [Char]
"cd " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d [Char] -> [Char] -> [Char]
</> [Char]
"haskell-libmodbus"
, [Char]
"cabal install"
, [Char]
"cd " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d
, [Char]
"make"
]
UncheckedProperty UnixLike -> Result -> Property UnixLike
forall (p :: * -> *) i.
Checkable p i =>
p i -> Result -> Property i
`assume` Result
MadeChange
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [[Char]] -> Property DebianLike
Apt.installed
[ [Char]
"ghc", [Char]
"cabal-install", [Char]
"make"
, [Char]
"libghc-http-types-dev"
, [Char]
"libghc-aeson-dev"
, [Char]
"libghc-wai-dev"
, [Char]
"libghc-warp-dev"
, [Char]
"libghc-http-client-dev"
, [Char]
"libghc-http-client-tls-dev"
, [Char]
"libghc-reactive-banana-dev"
, [Char]
"libghc-hinotify-dev"
]
pollerservicename :: [Char]
pollerservicename = [Char]
"house-poller"
pollerservicefile :: [Char]
pollerservicefile = [Char]
"/etc/systemd/system/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
pollerservicename [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
".service"
pollerserviceinstalled :: Property UnixLike
pollerserviceinstalled = [Char]
pollerservicefile [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"[Unit]"
, [Char]
"Description=house poller"
, [Char]
""
, [Char]
"[Service]"
, [Char]
"ExecStart=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"/poller"
, [Char]
"WorkingDirectory=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d
, [Char]
"User=joey"
, [Char]
"Group=joey"
, [Char]
"Restart=always"
, [Char]
""
, [Char]
"[Install]"
, [Char]
"WantedBy=multi-user.target"
, [Char]
"WantedBy=house-controller.target"
]
controllerservicename :: [Char]
controllerservicename = [Char]
"house-controller"
controllerservicefile :: [Char]
controllerservicefile = [Char]
"/etc/systemd/system/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
controllerservicename [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
".service"
controllerserviceinstalled :: Property UnixLike
controllerserviceinstalled = [Char]
controllerservicefile [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"[Unit]"
, [Char]
"Description=house controller"
, [Char]
""
, [Char]
"[Service]"
, [Char]
"ExecStart=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"/controller"
, [Char]
"WorkingDirectory=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d
, [Char]
"User=joey"
, [Char]
"Group=joey"
, [Char]
"Restart=always"
, [Char]
""
, [Char]
"[Install]"
, [Char]
"WantedBy=multi-user.target"
]
watchdogservicename :: [Char]
watchdogservicename = [Char]
"house-watchdog"
watchdogservicefile :: [Char]
watchdogservicefile = [Char]
"/etc/systemd/system/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
watchdogservicename [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
".service"
watchdogserviceinstalled :: Property UnixLike
watchdogserviceinstalled = [Char]
watchdogservicefile [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"[Unit]"
, [Char]
"Description=house watchdog"
, [Char]
""
, [Char]
"[Service]"
, [Char]
"ExecStart=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"/watchdog"
, [Char]
"WorkingDirectory=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d
, [Char]
"User=root"
, [Char]
"Group=root"
, [Char]
"Restart=always"
, [Char]
""
, [Char]
"[Install]"
, [Char]
"WantedBy=multi-user.target"
]
setupservicename :: [Char]
setupservicename = [Char]
"house-setup"
setupservicefile :: [Char]
setupservicefile = [Char]
"/etc/systemd/system/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
setupservicename [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
".service"
setupserviceinstalled :: Property UnixLike
setupserviceinstalled = [Char]
setupservicefile [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"[Unit]"
, [Char]
"Description=house setup"
, [Char]
""
, [Char]
"[Service]"
, [Char]
"ExecStart=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"/setup"
, [Char]
"WorkingDirectory=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d
, [Char]
"User=root"
, [Char]
"Group=root"
, [Char]
"Type=oneshot"
, [Char]
""
, [Char]
"[Install]"
, [Char]
"WantedBy=multi-user.target"
, [Char]
"WantedBy=house-poller.target"
, [Char]
"WantedBy=house-controller.target"
, [Char]
"WantedBy=house-watchdog.target"
]
rsynccommand :: [Char]
rsynccommand = [Char]
"rsync -e 'ssh -i" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
sshkeyfile [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"' -avz rrds/ joey@kitenet.net:/srv/web/house.joeyh.name/rrds/ >/dev/null 2>&1"
websitesymlink :: Property UnixLike
websitesymlink :: Property UnixLike
websitesymlink = IO Bool -> Property UnixLike -> Property UnixLike
forall (p :: * -> *) i (m :: * -> *).
(Checkable p i, LiftPropellor m) =>
m Bool -> p i -> Property i
check (Bool -> Bool
not (Bool -> Bool) -> (FileStatus -> Bool) -> FileStatus -> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FileStatus -> Bool
isSymbolicLink (FileStatus -> Bool) -> IO FileStatus -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Char] -> IO FileStatus
getSymbolicLinkStatus [Char]
"/var/www/html")
([Char] -> Propellor Result -> Property UnixLike
forall {k} (metatypes :: k).
SingI metatypes =>
[Char] -> Propellor Result -> Property (MetaTypes metatypes)
property [Char]
"website symlink" (Propellor Result -> Property UnixLike)
-> Propellor Result -> Property UnixLike
forall a b. (a -> b) -> a -> b
$ IO () -> Propellor Result
makeChange (IO () -> Propellor Result) -> IO () -> Propellor Result
forall a b. (a -> b) -> a -> b
$ do
[Char] -> IO ()
removeDirectoryRecursive [Char]
"/var/www/html"
[Char] -> [Char] -> IO ()
createSymbolicLink [Char]
d [Char]
"/var/www/html"
)
homerouterWifiInterface :: String
homerouterWifiInterface :: [Char]
homerouterWifiInterface = [Char]
"wlx9cefd5fcd6f3"
homerouterWifiInterfaceOld :: String
homerouterWifiInterfaceOld :: [Char]
homerouterWifiInterfaceOld = [Char]
"wlx7cdd90753b9f"
homeRouter :: Property (HasInfo + DebianLike)
homeRouter :: Property (HasInfo + DebianLike)
homeRouter = [Char]
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"home router" (Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
-> Props
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property UnixLike
File.notPresent ([Char] -> [Char]
Network.interfaceDFile [Char]
homerouterWifiInterfaceOld)
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> IPAddr -> Maybe Gateway -> Property DebianLike
Network.static [Char]
homerouterWifiInterface ([Char] -> IPAddr
IPv4 [Char]
"10.1.1.1") Maybe Gateway
forall a. Maybe a
Nothing
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property DebianLike
Network.cleanInterfacesFile
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"hostapd"]
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> Property UnixLike
File.hasContent [Char]
"/etc/hostapd/hostapd.conf"
[ [Char]
"interface=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
homerouterWifiInterface
, [Char]
"ssid=house"
, [Char]
"hw_mode=g"
, [Char]
"channel=8"
]
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Char] -> Property UnixLike
File.dirExists [Char]
"/etc/hostapd"
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Char] -> [[Char]] -> Property UnixLike
File.hasContent [Char]
"/etc/default/hostapd"
[ [Char]
"DAEMON_CONF=/etc/hostapd/hostapd.conf" ]
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.running [Char]
"hostapd"
Props DebianLike
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.enabled [Char]
"hostapd"
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> Property UnixLike
File.hasContent [Char]
"/etc/resolv.conf"
[ [Char]
"domain kitenet.net"
, [Char]
"search kitenet.net"
, [Char]
"nameserver 8.8.8.8"
, [Char]
"nameserver 8.8.4.4"
]
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"dnsmasq"]
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> Property UnixLike
File.hasContent [Char]
"/etc/dnsmasq.conf"
[ [Char]
"domain-needed"
, [Char]
"bogus-priv"
, [Char]
"interface=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
homerouterWifiInterface
, [Char]
"interface=eth0"
, [Char]
"domain=kitenet.net"
, [Char]
"dhcp-range=10.1.1.100,10.1.1.150,10m"
, [Char]
"no-hosts"
, [Char]
"address=/honeybee.kitenet.net/10.1.1.1"
, [Char]
"address=/house.kitenet.net/10.1.1.1"
, [Char]
"dhcp-host=0c:98:38:80:6a:f9,10.1.1.134,android-kodama"
]
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> Property DebianLike
Service.restarted [Char]
"dnsmasq"
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property DebianLike
ipmasq [Char]
homerouterWifiInterface
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> IPAddr
-> Maybe Gateway
-> [([Char], [Char])]
-> Property DebianLike
Network.static' [Char]
"eth0" ([Char] -> IPAddr
IPv4 [Char]
"192.168.1.100")
(Gateway -> Maybe Gateway
forall a. a -> Maybe a
Just (IPAddr -> Gateway
Network.Gateway ([Char] -> IPAddr
IPv4 [Char]
"192.168.1.1")))
[ ([Char]
"pre-up", [Char]
"poff -a || true")
, ([Char]
"post-down", [Char]
"pon")
, ([Char]
"ethernet-autoneg", [Char]
"off")
, ([Char]
"link-speed", [Char]
"100")
, ([Char]
"link-duplex", [Char]
"full")
]
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property DebianLike
Network.cleanInterfacesFile
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [[Char]] -> Property DebianLike
Apt.installed [[Char]
"ethtool"]
Props DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish])
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"ppp"]
Property DebianLike
-> Property UnixLike
-> CombinedType (Property DebianLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`before` [Char] -> [[Char]] -> Property UnixLike
File.hasContent [Char]
"/etc/ppp/peers/provider"
[ [Char]
"user \"joeyh@arczip.com\""
, [Char]
"connect \"/usr/sbin/chat -v -f /etc/chatscripts/pap -T 3825441\""
, [Char]
"/dev/ttyACM0"
, [Char]
"115200"
, [Char]
"noipdefault"
, [Char]
"defaultroute"
, [Char]
"persist"
, [Char]
"noauth"
]
Property DebianLike
-> Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD])
-> CombinedType
(Property DebianLike)
(Property
(MetaTypes
'[ 'WithInfo, 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall x y. Combines x y => x -> y -> CombinedType x y
`before` [Char] -> Context -> Property (HasInfo + UnixLike)
forall c.
IsContext c =>
[Char] -> c -> Property (HasInfo + UnixLike)
File.hasPrivContent [Char]
"/etc/ppp/pap-secrets" ([Char] -> Context
Context [Char]
"joeyh@arczip.com")
ipmasq :: String -> Property DebianLike
ipmasq :: [Char] -> Property DebianLike
ipmasq [Char]
intif = [Char] -> [[Char]] -> Property UnixLike
File.hasContent [Char]
ifupscript
[ [Char]
"#!/bin/sh"
, [Char]
"INTIF=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
intif
, [Char]
"if [ \"$IFACE\" = $INTIF ] || [ \"$IFACE\" = lo ]; then"
, [Char]
"exit 0"
, [Char]
"fi"
, [Char]
"iptables -F"
, [Char]
"iptables -A FORWARD -i $IFACE -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT"
, [Char]
"iptables -A FORWARD -i $INTIF -o $IFACE -j ACCEPT"
, [Char]
"iptables -t nat -A POSTROUTING -o $IFACE -j MASQUERADE"
, [Char]
"echo 1 > /proc/sys/net/ipv4/ip_forward"
]
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`before` [Char] -> Property UnixLike
scriptmode [Char]
ifupscript
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`before` [Char] -> Property UnixLike
File.dirExists ([Char] -> [Char]
takeDirectory [Char]
pppupscript)
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`before` [Char] -> [[Char]] -> Property UnixLike
File.hasContent [Char]
pppupscript
[ [Char]
"#!/bin/sh"
, [Char]
"IFACE=$PPP_IFACE " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
ifupscript
]
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`before` [Char] -> Property UnixLike
scriptmode [Char]
pppupscript
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [[Char]] -> Property DebianLike
Apt.installed [[Char]
"iptables"]
where
ifupscript :: [Char]
ifupscript = [Char]
"/etc/network/if-up.d/ipmasq"
pppupscript :: [Char]
pppupscript = [Char]
"/etc/ppp/ip-up.d/ipmasq"
scriptmode :: [Char] -> Property UnixLike
scriptmode [Char]
f = [Char]
f [Char] -> FileMode -> Property UnixLike
`File.mode` [FileMode] -> FileMode
combineModes ([FileMode]
readModes [FileMode] -> [FileMode] -> [FileMode]
forall a. [a] -> [a] -> [a]
++ [FileMode]
executeModes)
laptopSoftware :: Property DebianLike
laptopSoftware :: Property DebianLike
laptopSoftware = [[Char]] -> Property DebianLike
Apt.installed
[ [Char]
"intel-microcode", [Char]
"acpi"
, [Char]
"procmeter3", [Char]
"xfce4", [Char]
"procmeter3", [Char]
"unclutter-xfixes"
, [Char]
"mplayer", [Char]
"fbreader", [Char]
"firefox", [Char]
"chromium"
, [Char]
"libdatetime-event-sunrise-perl", [Char]
"libtime-duration-perl"
, [Char]
"network-manager", [Char]
"network-manager-openvpn-gnome", [Char]
"openvpn"
, [Char]
"gtk-redshift", [Char]
"powertop"
, [Char]
"gimp", [Char]
"gthumb", [Char]
"inkscape", [Char]
"sozi", [Char]
"xzgv", [Char]
"hugin"
, [Char]
"mpc", [Char]
"mpd", [Char]
"ncmpc", [Char]
"sonata", [Char]
"mpdtoys"
, [Char]
"bsdgames", [Char]
"nethack-console"
, [Char]
"xmonad", [Char]
"libghc-xmonad-dev", [Char]
"libghc-xmonad-contrib-dev"
, [Char]
"ttf-bitstream-vera", [Char]
"fonts-symbola", [Char]
"fonts-noto-color-emoji"
, [Char]
"mairix", [Char]
"offlineimap", [Char]
"mutt", [Char]
"slrn"
, [Char]
"mtr", [Char]
"nmap", [Char]
"whois", [Char]
"wireshark", [Char]
"tcpdump", [Char]
"iftop"
, [Char]
"pmount", [Char]
"tree", [Char]
"pv"
, [Char]
"arbtt", [Char]
"hledger", [Char]
"bc"
, [Char]
"apache2", [Char]
"ikiwiki", [Char]
"libhighlight-perl"
, [Char]
"avahi-daemon", [Char]
"avahi-discover"
, [Char]
"pal"
, [Char]
"yeahconsole", [Char]
"xkbset", [Char]
"xinput"
, [Char]
"assword", [Char]
"pumpa"
, [Char]
"vorbis-tools", [Char]
"audacity"
, [Char]
"ekiga"
, [Char]
"bluez-firmware", [Char]
"blueman", [Char]
"pulseaudio-module-bluetooth"
, [Char]
"fwupd"
, [Char]
"xul-ext-ublock-origin", [Char]
"xul-ext-pdf.js", [Char]
"xul-ext-status4evar"
, [Char]
"vim-syntastic", [Char]
"vim-fugitive"
, [Char]
"adb", [Char]
"gthumb"
, [Char]
"w3m", [Char]
"sm", [Char]
"weechat"
, [Char]
"borgbackup", [Char]
"wipe", [Char]
"smartmontools", [Char]
"libgfshare-bin"
, [Char]
"units"
, [Char]
"virtualbox", [Char]
"virtualbox-guest-additions-iso", [Char]
"qemu-kvm"
]
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property DebianLike
baseSoftware
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property DebianLike
devSoftware
baseSoftware :: Property DebianLike
baseSoftware :: Property DebianLike
baseSoftware = [[Char]] -> Property DebianLike
Apt.installed
[ [Char]
"bash", [Char]
"bash-completion", [Char]
"vim", [Char]
"screen", [Char]
"less", [Char]
"moreutils"
, [Char]
"git", [Char]
"mr", [Char]
"etckeeper", [Char]
"git-annex", [Char]
"ssh", [Char]
"vim-vimoutliner"
]
devSoftware :: Property DebianLike
devSoftware :: Property DebianLike
devSoftware = [[Char]] -> Property DebianLike
Apt.installed
[ [Char]
"build-essential", [Char]
"debhelper", [Char]
"devscripts"
, [Char]
"ghc", [Char]
"cabal-install", [Char]
"haskell-stack"
, [Char]
"hothasktags", [Char]
"hdevtools", [Char]
"hlint"
, [Char]
"gdb", [Char]
"time"
, [Char]
"dpkg-repack", [Char]
"lintian"
, [Char]
"pristine-tar", [Char]
"github-backup"
]
cubieTruckOneWire :: Property DebianLike
cubieTruckOneWire :: Property DebianLike
cubieTruckOneWire = Property UnixLike
utilitysetup
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property UnixLike
dtsinstalled
Property UnixLike
-> Property DebianLike
-> CombinedType (Property UnixLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` Property DebianLike
utilityinstalled
where
dtsinstalled :: CombinedType (Property UnixLike) (Property UnixLike)
dtsinstalled = [Char] -> [[Char]] -> Property UnixLike
File.hasContent [Char]
"/etc/easy-peasy-devicetree-squeezy/my.dts" [[Char]]
mydts
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Char] -> Property UnixLike
File.dirExists [Char]
"/etc/easy-peasy-devicetree-squeezy"
utilityinstalled :: CombinedType (Property DebianLike) (Property DebianLike)
utilityinstalled = User -> [Char] -> [Char] -> Maybe [Char] -> Property DebianLike
Git.cloned ([Char] -> User
User [Char]
"root") [Char]
"https://git.joeyh.name/git/easy-peasy-devicetree-squeezy.git" [Char]
"/usr/local/easy-peasy-devicetree-squeezy" Maybe [Char]
forall a. Maybe a
Nothing
Property DebianLike
-> RevertableProperty UnixLike UnixLike
-> CombinedType
(Property DebianLike) (RevertableProperty UnixLike UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` [Char] -> LinkTarget -> RevertableProperty UnixLike UnixLike
File.isSymlinkedTo [Char]
"/usr/local/bin/easy-peasy-devicetree-squeezy" ([Char] -> LinkTarget
File.LinkTarget [Char]
"/usr/local/easy-peasy-devicetree-squeezy/easy-peasy-devicetree-squeezy")
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [[Char]] -> Property DebianLike
Apt.installed [[Char]
"pv", [Char]
"device-tree-compiler", [Char]
"cpp", [Char]
"linux-source"]
utilitysetup :: Property UnixLike
utilitysetup = IO Bool -> Property UnixLike -> Property UnixLike
forall (p :: * -> *) i (m :: * -> *).
(Checkable p i, LiftPropellor m) =>
m Bool -> p i -> Property i
check (Bool -> Bool
not (Bool -> Bool) -> IO Bool -> IO Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Char] -> IO Bool
doesFileExist [Char]
dtb) (Property UnixLike -> Property UnixLike)
-> Property UnixLike -> Property UnixLike
forall a b. (a -> b) -> a -> b
$
[Char] -> [[Char]] -> UncheckedProperty UnixLike
cmdProperty [Char]
"easy-peasy-devicetree-squeezy"
[[Char]
"--debian", [Char]
"sun7i-a20-cubietruck"]
UncheckedProperty UnixLike -> Result -> Property UnixLike
forall (p :: * -> *) i.
Checkable p i =>
p i -> Result -> Property i
`assume` Result
MadeChange
dtb :: [Char]
dtb = [Char]
"/etc/flash-kernel/dtbs/sun7i-a20-cubietruck.dtb"
mydts :: [[Char]]
mydts =
[ [Char]
"/* Device tree addition enabling onewire sensors on CubieTruck GPIO pin PC21 */"
, [Char]
"#include <dt-bindings/gpio/gpio.h>"
, [Char]
""
, [Char]
"/ {"
, [Char]
"\tonewire_device {"
, [Char]
"\t\tcompatible = \"w1-gpio\";"
, [Char]
"\t\tgpios = <&pio 2 21 GPIO_ACTIVE_HIGH>; /* PC21 */"
, [Char]
"\t\tpinctrl-names = \"default\";"
, [Char]
"\t\tpinctrl-0 = <&my_w1_pin>;"
, [Char]
"\t};"
, [Char]
"};"
, [Char]
""
, [Char]
"&pio {"
, [Char]
"\tmy_w1_pin: my_w1_pin@0 {"
, [Char]
"\t\tallwinner,pins = \"PC21\";"
, [Char]
"\t\tallwinner,function = \"gpio_in\";"
, [Char]
"\t};"
, [Char]
"};"
]
homeNAS :: Property DebianLike
homeNAS :: Property DebianLike
homeNAS = [Char] -> Props DebianLike -> Property DebianLike
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
"home NAS" (Props DebianLike -> Property DebianLike)
-> Props DebianLike -> Property DebianLike
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"uhubctl"]
Props DebianLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
"/etc/udev/rules.d/52-startech-hub.rules" [Char] -> [[Char]] -> Property UnixLike
`File.hasContent`
[ [Char]
"# let users power control startech hub with uhubctl"
, [Char]
"ATTR{idVendor}==\"" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
hubvendor [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"\", ATTR{idProduct}==\"005a\", MODE=\"0666\""
]
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> USBHubPort -> USBDriveId -> Maybe [Char] -> Property DebianLike
autoMountDrivePort [Char]
"archive-10"
([Char] -> Int -> USBHubPort
USBHubPort [Char]
hubvendor Int
1)
([Char] -> [Char] -> USBDriveId
USBDriveId [Char]
wd [Char]
"1230")
([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"archive-oldest")
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> USBHubPort -> USBDriveId -> Maybe [Char] -> Property DebianLike
autoMountDrivePort [Char]
"archive-11"
([Char] -> Int -> USBHubPort
USBHubPort [Char]
hubvendor Int
2)
([Char] -> [Char] -> USBDriveId
USBDriveId [Char]
wd [Char]
"25ee")
([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"archive-older")
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> USBHubPort -> USBDriveId -> Maybe [Char] -> Property DebianLike
autoMountDrivePort [Char]
"archive-12"
([Char] -> Int -> USBHubPort
USBHubPort [Char]
hubvendor Int
3)
([Char] -> [Char] -> USBDriveId
USBDriveId [Char]
seagate [Char]
"3322")
([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"archive-old")
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> USBHubPort -> USBDriveId -> Maybe [Char] -> Property DebianLike
autoMountDrivePort [Char]
"archive-13"
([Char] -> Int -> USBHubPort
USBHubPort [Char]
hubvendor Int
4)
([Char] -> [Char] -> USBDriveId
USBDriveId [Char]
wd [Char]
"25a3")
([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
"archive")
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char]
-> USBHubPort -> USBDriveId -> Maybe [Char] -> Property DebianLike
autoMountDrivePort [Char]
"archive-14"
([Char] -> Int -> USBHubPort
USBHubPort [Char]
hubvendor Int
2)
([Char] -> [Char] -> USBDriveId
USBDriveId [Char]
wd [Char]
"25a3")
Maybe [Char]
forall a. Maybe a
Nothing
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Maybe [Char] -> Property DebianLike
autoMountDrive [Char]
"passport" Maybe [Char]
forall a. Maybe a
Nothing
Props DebianLike
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> Property DebianLike
Apt.installed [[Char]
"git-annex", [Char]
"borgbackup"]
where
hubvendor :: [Char]
hubvendor = [Char]
"0409"
wd :: [Char]
wd = [Char]
"1058"
seagate :: [Char]
seagate = [Char]
"0bc2"
data USBHubPort = USBHubPort
{ USBHubPort -> [Char]
hubVendor :: String
, USBHubPort -> Int
hubPort :: Int
}
data USBDriveId = USBDriveId
{ USBDriveId -> [Char]
driveVendorId :: String
, USBDriveId -> [Char]
driveProductId :: String
}
autoMountDrivePort :: Mount.Label -> USBHubPort -> USBDriveId -> Maybe FilePath -> Property DebianLike
autoMountDrivePort :: [Char]
-> USBHubPort -> USBDriveId -> Maybe [Char] -> Property DebianLike
autoMountDrivePort [Char]
label USBHubPort
hp USBDriveId
drive Maybe [Char]
malias = [Char] -> Props DebianLike -> Property DebianLike
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
desc (Props DebianLike -> Property DebianLike)
-> Props DebianLike -> Property DebianLike
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> Property UnixLike
File.hasContent ([Char]
"/etc/systemd/system/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
hub)
[ [Char]
"[Unit]"
, [Char]
"Description=Startech usb hub port " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Int -> [Char]
forall a. Show a => a -> [Char]
show (USBHubPort -> Int
hubPort USBHubPort
hp) [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" vendor " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ USBDriveId -> [Char]
driveVendorId USBDriveId
drive [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" driveid " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ USBDriveId -> [Char]
driveProductId USBDriveId
drive
, [Char]
"PartOf=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
mount
, [Char]
"[Service]"
, [Char]
"Type=oneshot"
, [Char]
"RemainAfterExit=true"
, [Char]
"ExecStart=/bin/sh -c 'uhubctl -a on " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
selecthubport [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"'"
, [Char]
"ExecStop=/bin/sh -c 'uhubctl -a off " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
selecthubport
[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"; udevadm trigger --action=remove " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
devfile [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
" || true'"
, [Char]
"[Install]"
, [Char]
"WantedBy="
]
Property UnixLike
-> Property Linux
-> CombinedType (Property UnixLike) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property Linux
Systemd.daemonReloaded
Props Linux
-> Property DebianLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [[Char]] -> [Char] -> Maybe [Char] -> Property DebianLike
autoMountDrive'
[ [Char]
"Requires=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
hub
, [Char]
"After=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
hub
] [Char]
label Maybe [Char]
malias
where
devfile :: [Char]
devfile = [Char]
"/dev/disk/by-label/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
label
mountpoint :: [Char]
mountpoint = [Char]
"/media/joey/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
label
desc :: [Char]
desc = [Char]
"auto mount with hub port power control " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
mountpoint
hub :: [Char]
hub = [Char]
"startech-hub-port-" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ Int -> [Char]
forall a. Show a => a -> [Char]
show (USBHubPort -> Int
hubPort USBHubPort
hp) [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"-vendor-" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ USBDriveId -> [Char]
driveVendorId USBDriveId
drive [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"-drivedid-" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ USBDriveId -> [Char]
driveProductId USBDriveId
drive [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
".service"
mount :: [Char]
mount = [Char]
svcbase [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
".mount"
svcbase :: [Char]
svcbase = [Char] -> [Char]
Systemd.escapePath [Char]
mountpoint
selecthubport :: [Char]
selecthubport = [[Char]] -> [Char]
unwords
[ [Char]
"-p", Int -> [Char]
forall a. Show a => a -> [Char]
show (USBHubPort -> Int
hubPort USBHubPort
hp)
, [Char]
"-n", USBHubPort -> [Char]
hubVendor USBHubPort
hp
, [Char]
"-l", [[Char]] -> [Char]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat
[ [Char]
"$(lsusb -tvv | perl -lne \"if (\\\\$h && m!/sys/bus/usb/devices/(.*?) !) {\\\\$v=\\\\$1}; if (m/Hub/) { \\\\$h=1 } else { \\\\$h=0 }; if (/"
, USBDriveId -> [Char]
driveVendorId USBDriveId
drive [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
":" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ USBDriveId -> [Char]
driveProductId USBDriveId
drive
[Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
"/) { print \\\\$v; last}\")"
]
]
autoMountDrive :: Mount.Label -> Maybe FilePath -> Property DebianLike
autoMountDrive :: [Char] -> Maybe [Char] -> Property DebianLike
autoMountDrive = [[Char]] -> [Char] -> Maybe [Char] -> Property DebianLike
autoMountDrive' []
autoMountDrive' :: [String] -> Mount.Label -> Maybe FilePath -> Property DebianLike
autoMountDrive' :: [[Char]] -> [Char] -> Maybe [Char] -> Property DebianLike
autoMountDrive' [[Char]]
mountunitadd [Char]
label Maybe [Char]
malias = [Char] -> Props DebianLike -> Property DebianLike
forall {k} (metatypes :: k).
SingI metatypes =>
[Char]
-> Props (MetaTypes metatypes) -> Property (MetaTypes metatypes)
propertyList [Char]
desc (Props DebianLike -> Property DebianLike)
-> Props DebianLike -> Property DebianLike
forall a b. (a -> b) -> a -> b
$ Props UnixLike
props
Props UnixLike
-> Property UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> User -> Group -> Property UnixLike
File.ownerGroup [Char]
mountpoint ([Char] -> User
User [Char]
"joey") ([Char] -> Group
Group [Char]
"joey")
Property UnixLike
-> Property UnixLike
-> CombinedType (Property UnixLike) (Property UnixLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`requires` [Char] -> Property UnixLike
File.dirExists [Char]
mountpoint
Props UnixLike
-> RevertableProperty UnixLike UnixLike
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& case Maybe [Char]
malias of
Just [Char]
t -> ([Char]
"/media/joey/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
t) [Char] -> LinkTarget -> RevertableProperty UnixLike UnixLike
`File.isSymlinkedTo`
[Char] -> LinkTarget
File.LinkTarget [Char]
mountpoint
Maybe [Char]
Nothing -> Property UnixLike
forall {k} (t :: k). SingI t => Property (MetaTypes t)
doNothing Property UnixLike
-> Property UnixLike -> RevertableProperty UnixLike UnixLike
forall setupmetatypes undometatypes.
Property setupmetatypes
-> Property undometatypes
-> RevertableProperty setupmetatypes undometatypes
<!> Property UnixLike
forall {k} (t :: k). SingI t => Property (MetaTypes t)
doNothing
Props UnixLike
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux, 'Targeting 'OSFreeBSD]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> Property UnixLike
File.hasContent ([Char]
"/etc/systemd/system/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
mount)
([ [Char]
"[Unit]"
, [Char]
"Description=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
label
] [[Char]] -> [[Char]] -> [[Char]]
forall a. [a] -> [a] -> [a]
++ [[Char]]
mountunitadd [[Char]] -> [[Char]] -> [[Char]]
forall a. [a] -> [a] -> [a]
++
[ [Char]
"[Mount]"
, [Char]
"Options=noauto"
, [Char]
"What=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
devfile
, [Char]
"Where=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
mountpoint
, [Char]
"[Install]"
, [Char]
"WantedBy="
])
Property UnixLike
-> Property Linux
-> CombinedType (Property UnixLike) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property Linux
Systemd.daemonReloaded
Props Linux
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> Property UnixLike
File.hasContent ([Char]
"/etc/systemd/system/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
automount)
[ [Char]
"[Unit]"
, [Char]
"Description=Automount " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
label
, [Char]
"[Automount]"
, [Char]
"Where=" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
mountpoint
, [Char]
"TimeoutIdleSec=300"
, [Char]
"[Install]"
, [Char]
"WantedBy=multi-user.target"
]
Property UnixLike
-> Property Linux
-> CombinedType (Property UnixLike) (Property Linux)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property Linux
Systemd.daemonReloaded
Props Linux
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.enabled [Char]
automount
Props Linux
-> Property Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> Property Linux
Systemd.started [Char]
automount
Props Linux
-> RevertableProperty DebianLike Linux
-> Props
(MetaTypes
(Combine
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish,
'Targeting 'OSArchLinux]
'[ 'Targeting 'OSDebian, 'Targeting 'OSBuntish]))
forall {a} p (y :: [a]) (x :: [a]).
(IsProp p, MetaTypes y ~ GetMetaTypes p,
CheckCombinableNote x y (NoteFor ('Text "&"))) =>
Props (MetaTypes x) -> p -> Props (MetaTypes (Combine x y))
& [Char] -> [[Char]] -> RevertableProperty DebianLike Linux
Sudo.sudoersDFile ([Char]
"automount-" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
label)
[ [Char]
"joey ALL= NOPASSWD: " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
sudocommands
]
where
devfile :: [Char]
devfile = [Char]
"/dev/disk/by-label/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
label
mountpoint :: [Char]
mountpoint = [Char]
"/media/joey/" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
label
desc :: [Char]
desc = [Char]
"auto mount " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
mountpoint
automount :: [Char]
automount = [Char]
svcbase [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
".automount"
mount :: [Char]
mount = [Char]
svcbase [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
".mount"
svcbase :: [Char]
svcbase = [Char] -> [Char]
Systemd.escapePath [Char]
mountpoint
sudocommands :: [Char]
sudocommands = [Char] -> [[Char]] -> [Char]
forall a. [a] -> [[a]] -> [a]
intercalate [Char]
" , " ([[Char]] -> [Char]) -> [[Char]] -> [Char]
forall a b. (a -> b) -> a -> b
$ ([Char] -> [Char]) -> [[Char]] -> [[Char]]
forall a b. (a -> b) -> [a] -> [b]
map (\[Char]
c -> [Char]
"/bin/systemctl " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
c)
[ [Char]
"stop " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
mountpoint
, [Char]
"start " [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
mountpoint
]
rsyncNetBorgRepo :: String -> [Borg.BorgRepoOpt] -> Borg.BorgRepo
rsyncNetBorgRepo :: [Char] -> [BorgRepoOpt] -> BorgRepo
rsyncNetBorgRepo [Char]
d [BorgRepoOpt]
os = [BorgRepoOpt] -> [Char] -> BorgRepo
Borg.BorgRepoUsing [BorgRepoOpt]
os' ([Char]
"2318@usw-s002.rsync.net:" [Char] -> [Char] -> [Char]
forall a. [a] -> [a] -> [a]
++ [Char]
d)
where
os' :: [BorgRepoOpt]
os' = ([Char], [Char]) -> BorgRepoOpt
Borg.UsesEnvVar ([Char]
"BORG_REMOTE_PATH", [Char]
"borg1") BorgRepoOpt -> [BorgRepoOpt] -> [BorgRepoOpt]
forall a. a -> [a] -> [a]
: [BorgRepoOpt]
os
noExim :: Property DebianLike
noExim :: Property DebianLike
noExim = [[Char]] -> Property DebianLike
Apt.removed [[Char]
"exim4", [Char]
"exim4-base", [Char]
"exim4-daemon-light"]
Property DebianLike
-> Property DebianLike
-> CombinedType (Property DebianLike) (Property DebianLike)
forall x y. Combines x y => x -> y -> CombinedType x y
`onChange` Property DebianLike
Apt.autoRemove