diff options
| author | Joey Hess <joey@kitenet.net> | 2014-08-22 13:01:54 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-08-22 13:01:54 -0400 |
| commit | 59f94154b5c3dba9e045cd246429443372582ea5 (patch) | |
| tree | c64139194c285204fb6e439013ebb2e8118eae80 /src | |
| parent | 1c6245cef81570e561dca4f5320950cff213ed3c (diff) | |
| parent | 3cb9a60f89a21d4d0a423db60d9c32eca2ef38bb (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/SiteSpecific/JoeySites.hs | 5 | ||||
| -rw-r--r-- | src/Propellor/Property/Ssh.hs | 18 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index fa8773de..6fe10c02 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -312,6 +312,11 @@ twitRss = combineProperties "twitter rss" feed url desc = Cron.job desc crontime "joey" dir $ "./twitRss " ++ shellEscape url ++ " > " ++ shellEscape ("../" ++ desc ++ ".rss") +-- Work around for expired ssl cert. +pumpRss :: Property +pumpRss = Cron.job "pump rss" "15 * * * *" "joey" "/srv/web/tmp.kitenet.net/" + "wget https://pump2rss.com/feed/joeyh@identi.ca.atom -O pump.atom --no-check-certificate 2>/dev/null" + ircBouncer :: Property ircBouncer = propertyList "IRC bouncer" [ Apt.installed ["znc"] diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs index 5a260476..41b93089 100644 --- a/src/Propellor/Property/Ssh.hs +++ b/src/Propellor/Property/Ssh.hs @@ -9,7 +9,8 @@ module Propellor.Property.Ssh ( hostKey, keyImported, knownHost, - authorizedKeys + authorizedKeys, + listenPort ) where import Propellor @@ -164,3 +165,18 @@ authorizedKeys user context = withPrivData (SshAuthorizedKeys user) context $ \g [ File.ownerGroup f user user , File.ownerGroup (takeDirectory f) user user ] + +-- | Makes the ssh server listen on a given port, in addition to any other +-- ports it is configured to listen on. +-- +-- Revert to prevent it listening on a particular port. +listenPort :: Int -> RevertableProperty +listenPort port = RevertableProperty enable disable + where + portline = "Port " ++ show port + enable = sshdConfig `File.containsLine` portline + `describe` ("ssh listening on " ++ portline) + `onChange` restartSshd + disable = sshdConfig `File.lacksLine` portline + `describe` ("ssh not listening on " ++ portline) + `onChange` restartSshd |
