File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
manager/src/backend/internal Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,14 @@ const internalSsl = {
3939 // This host is due to expire in 1 day, time to renew
4040 logger . info ( 'Host ' + host . hostname + ' is due for SSL renewal' ) ;
4141
42- internalSsl . configureSsl ( host )
42+ internalSsl . renewSsl ( host )
4343 . then ( ( ) => {
44- return internalNginx . generateConfig ( host ) ;
44+ // Certificate was requested ok, update the timestamp on the host
45+ db . hosts . update ( { _id : host . _id } , { ssl_expires : timestamp . now ( '+90d' ) } , {
46+ multi : false ,
47+ upsert : false
48+ } ) ;
4549 } )
46- . then ( internalNginx . reload )
4750 . then ( next )
4851 . catch ( err => {
4952 logger . error ( err ) ;
@@ -88,6 +91,20 @@ const internalSsl = {
8891 } ) ;
8992 } ,
9093
94+ /**
95+ * @param {Object } host
96+ * @returns {Promise }
97+ */
98+ renewSsl : host => {
99+ logger . info ( 'Renewing SSL certificates for ' + host . hostname ) ;
100+
101+ return utils . exec ( '/usr/bin/letsencrypt renew --force-renewal --disable-hook-validation --cert-name "' + host . hostname + '"' )
102+ . then ( result => {
103+ logger . info ( result ) ;
104+ return result ;
105+ } ) ;
106+ } ,
107+
91108 /**
92109 * @param {Object } host
93110 * @returns {Promise }
You can’t perform that action at this time.
0 commit comments