From 432926110caad5e07bd8d1073a7eb79980bff18f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 9 Oct 2018 11:49:04 -0400 Subject: propellor spin --- joeyconfig.hs | 9 ++++-- src/Propellor/Property/SiteSpecific/Branchable.hs | 36 +++++++++++------------ src/Propellor/Property/SiteSpecific/JoeySites.hs | 8 ----- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/joeyconfig.hs b/joeyconfig.hs index 9f1f9ca6..ac5d3b3d 100644 --- a/joeyconfig.hs +++ b/joeyconfig.hs @@ -304,6 +304,12 @@ kite = host "kite.kitenet.net" $ props & alias "nntp.olduse.net" & JoeySites.oldUseNetServer hosts & Systemd.nspawned oldusenetShellBox + + & alias "znc.kitenet.net" + & JoeySites.ircBouncer + + & alias "kgb.kitenet.net" + & JoeySites.kgbServer & JoeySites.scrollBox & alias "scroll.joeyh.name" @@ -330,6 +336,7 @@ kite = host "kite.kitenet.net" $ props , "domain kitenet.net" , "search kitenet.net" ] + & alias "debug-me.joeyh.name" & Apt.installed ["debug-me"] & Systemd.enabled "debug-me" @@ -405,8 +412,6 @@ beaver = host "beaver.kitenet.net" $ props & Ssh.hostPubKey SshDsa "ssh-dss AAAAB3NzaC1kc3MAAACBAIrLX260fY0Jjj/p0syNhX8OyR8hcr6feDPGOj87bMad0k/w/taDSOzpXe0Wet7rvUTbxUjH+Q5wPd4R9zkaSDiR/tCb45OdG6JsaIkmqncwe8yrU+pqSRCxttwbcFe+UU+4AAcinjVedZjVRDj2rRaFPc9BXkPt7ffk8GwEJ31/AAAAFQCG/gOjObsr86vvldUZHCteaJttNQAAAIB5nomvcqOk/TD07DLaWKyG7gAcW5WnfY3WtnvLRAFk09aq1EuiJ6Yba99Zkb+bsxXv89FWjWDg/Z3Psa22JMyi0HEDVsOevy/1sEQ96AGH5ijLzFInfXAM7gaJKXASD7hPbVdjySbgRCdwu0dzmQWHtH+8i1CMVmA2/a5Y/wtlJAAAAIAUZj2US2D378jBwyX1Py7e4sJfea3WSGYZjn4DLlsLGsB88POuh32aOChd1yzF6r6C2sdoPBHQcWBgNGXcx4gF0B5UmyVHg3lIX2NVSG1ZmfuLNJs9iKNu4cHXUmqBbwFYQJBvB69EEtrOw4jSbiTKwHFmqdA/mw1VsMB+khUaVw==" & Tor.installed & Tor.hiddenServiceAvailable "ssh" (Port 22) - & alias "usbackup.kitenet.net" - & JoeySites.backupsBackedupFrom hosts "eubackup.kitenet.net" "/home/joey/lib/backup" & Apt.serviceInstalledRunning "anacron" & Cron.niceJob "system disk backed up" Cron.Weekly (User "root") "/" "rsync -a -x / /home/joey/lib/backup/beaver.kitenet.net/" diff --git a/src/Propellor/Property/SiteSpecific/Branchable.hs b/src/Propellor/Property/SiteSpecific/Branchable.hs index 7675fc35..4f8c3ad6 100644 --- a/src/Propellor/Property/SiteSpecific/Branchable.hs +++ b/src/Propellor/Property/SiteSpecific/Branchable.hs @@ -9,6 +9,7 @@ import qualified Propellor.Property.Postfix as Postfix import qualified Propellor.Property.Sudo as Sudo import qualified Propellor.Property.Borg as Borg import qualified Propellor.Property.Cron as Cron +import Propellor.Property.SiteSpecific.JoeySites (rsyncNetBorgRepo) server :: [Host] -> Property (HasInfo + DebianLike) server hosts = propertyList "branchable server" $ props @@ -38,27 +39,26 @@ server hosts = propertyList "branchable server" $ props & Postfix.installed & Postfix.mainCf ("mailbox_command", "procmail -a \"$EXTENSION\"") - & Borg.backup "/" (Borg.BorgRepo "joey@eubackup.kitenet.net:/home/joey/lib/backup/branchable/pell.borg") Cron.Daily - [ "--exclude=/proc/*" - , "--exclude=/sys/*" - , "--exclude=/run/*" - , "--exclude=/tmp/*" - , "--exclude=/var/tmp/*" - , "--exclude=/var/backups/ikiwiki-hosting-web/*" - , "--exclude=/var/cache/*" - , "--exclude=/home/*/source/*" - , "--exclude=/home/*/public_html/*" - , "--exclude=/home/*/.git/*" - ] - [ Borg.KeepDays 7 - , Borg.KeepWeeks 5 - , Borg.KeepMonths 12 - , Borg.KeepYears 1 - ] + -- & Borg.backup "/" (rsyncNetBorgRepo "pell.borg" []) Cron.Daily + -- [ "--exclude=/proc/*" + -- , "--exclude=/sys/*" + -- , "--exclude=/run/*" + -- , "--exclude=/tmp/*" + -- , "--exclude=/var/tmp/*" + -- , "--exclude=/var/backups/ikiwiki-hosting-web/*" + -- , "--exclude=/var/cache/*" + -- , "--exclude=/home/*/source/*" + -- , "--exclude=/home/*/public_html/*" + -- , "--exclude=/home/*/.git/*" + -- ] + -- [ Borg.KeepDays 7 + -- , Borg.KeepWeeks 5 + -- , Borg.KeepMonths 12 + -- , Borg.KeepYears 1 + -- ] & Ssh.userKeys (User "root") (Context "branchable.com") [ (SshRsa, "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2PqTSupwncqeffNwZQXacdEWp7L+TxllIxH7WjfRMb3U74mQxWI0lwqLVW6Fox430DvhSqF1y5rJBvTHh4i49Tc9lZ7mwAxA6jNOP6bmdfteaKKYmUw5qwtJW0vISBFu28qBO11Nq3uJ1D3Oj6N+b3mM/0D3Y3NoGgF8+2dLdi81u9+l6AQ5Jsnozi2Ni/Osx2oVGZa+IQDO6gX8VEP4OrcJFNJe8qdnvItcGwoivhjbIfzaqNNvswKgGzhYLOAS5KT8HsjvIpYHWkyQ5QUX7W/lqGSbjP+6B8C3tkvm8VLXbmaD+aSkyCaYbuoXC2BoJdS7Jh8phKMwPJmdYVepn") ] - & Ssh.knownHost hosts "eubackup.kitenet.net" (User "root") & Ssh.knownHost hosts "usw-s002.rsync.net" (User "root") & adminuser "joey" diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 0267e971..a18e4367 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -413,14 +413,6 @@ rsyncNetBackup hosts = Cron.niceJob "rsync.net copied in daily" (Cron.Times "30 (User "joey") "/home/joey/lib/backup" "mkdir -p rsync.net && rsync --delete -az 2318@usw-s002.rsync.net: rsync.net" `requires` Ssh.knownHost hosts "usw-s002.rsync.net" (User "joey") -backupsBackedupFrom :: [Host] -> HostName -> FilePath -> Property DebianLike -backupsBackedupFrom hosts srchost destdir = Cron.niceJob desc - (Cron.Times "@reboot") (User "joey") "/" cmd - `requires` Ssh.knownHost hosts srchost (User "joey") - where - desc = "backups copied from " ++ srchost ++ " on boot" - cmd = "sleep 30m && rsync -az --bwlimit=300K --partial --delete " ++ srchost ++ ":lib/backup/ " ++ destdir srchost - podcatcher :: Property DebianLike podcatcher = Cron.niceJob "podcatcher run hourly" (Cron.Times "55 * * * *") (User "joey") "/home/joey/lib/sound/podcasts" -- cgit v1.2.3