summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Apache.hs
diff options
context:
space:
mode:
authorJoey Hess2016-02-07 17:04:34 -0400
committerJoey Hess2016-02-07 17:04:34 -0400
commit648e1e50a015636d129bd4d7357c779688685cc0 (patch)
treee2ed0b89bedaf8f4fc14ccc15f036cd8fe00d72b /src/Propellor/Property/Apache.hs
parentc90282fc7bb77bcba19cdd4adfe96af3fb1162f8 (diff)
propellor spin
Diffstat (limited to 'src/Propellor/Property/Apache.hs')
-rw-r--r--src/Propellor/Property/Apache.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Propellor/Property/Apache.hs b/src/Propellor/Property/Apache.hs
index 5b8128a4..e841be9e 100644
--- a/src/Propellor/Property/Apache.hs
+++ b/src/Propellor/Property/Apache.hs
@@ -180,16 +180,19 @@ httpsVirtualHost' domain docroot letos addedcfg = setup
, "RewriteRule ^/(.*) https://" ++ domain ++ "/$1 [L,R,NE]"
]
certinstaller _domain certfile privkeyfile chainfile _fullchainfile =
- File.hasContent (sslconffile "letsencrypt")
- ( vhost (Port 443)
+ combineProperties (domain ++ " ssl cert installed")
+ [ File.dirExists (takeDirectory cf)
+ , File.hasContent cf $ vhost (Port 443)
[ "SSLEngine on"
, "SSLCertificateFile " ++ certfile
, "SSLCertificateKeyFile" ++ privkeyfile
, "SSLCertificateChainFile " ++ chainfile
]
- )
-- always reload; the cert has changed
- `before` reloaded
+ , reloaded
+ ]
+ where
+ cf = sslconffile "letsencrypt"
sslconffile s = "/etc/apache2/sites-available/ssl/" ++ domain ++ "/" ++ s ++ ".conf"
vhost (Port p) ls =
[ "<VirtualHost *:"++show p++">"