@@ -818,7 +818,9 @@ const internalCertificate = {
818
818
} )
819
819
. then ( ( certificate ) => {
820
820
if ( certificate . provider === 'letsencrypt' ) {
821
- return internalCertificate . renewLetsEncryptSsl ( certificate )
821
+ let renewMethod = certificate . meta . cloudflare_use ? internalCertificate . renewLetsEncryptCloudFlareSsl : internalCertificate . renewLetsEncryptSsl ;
822
+
823
+ return renewMethod ( certificate )
822
824
. then ( ( ) => {
823
825
return internalCertificate . getCertificateInfoFromFile ( '/etc/letsencrypt/live/npm-' + certificate . id + '/fullchain.pem' ) ;
824
826
} )
@@ -872,6 +874,29 @@ const internalCertificate = {
872
874
} ) ;
873
875
} ,
874
876
877
+ /**
878
+ * @param {Object } certificate the certificate row
879
+ * @returns {Promise }
880
+ */
881
+ renewLetsEncryptCloudFlareSsl : ( certificate ) => {
882
+ logger . info ( 'Renewing Let\'sEncrypt certificates for Cert #' + certificate . id + ': ' + certificate . domain_names . join ( ', ' ) ) ;
883
+
884
+ let cmd = certbot_command + ' renew --non-interactive ' +
885
+ '--cert-name "npm-' + certificate . id + '" ' +
886
+ '--disable-hook-validation ' +
887
+ ( le_staging ? '--staging' : '' ) ;
888
+
889
+ if ( debug_mode ) {
890
+ logger . info ( 'Command:' , cmd ) ;
891
+ }
892
+
893
+ return utils . exec ( cmd )
894
+ . then ( ( result ) => {
895
+ logger . info ( result ) ;
896
+ return result ;
897
+ } ) ;
898
+ } ,
899
+
875
900
/**
876
901
* @param {Object } certificate the certificate row
877
902
* @param {Boolean } [throw_errors]
@@ -881,7 +906,6 @@ const internalCertificate = {
881
906
logger . info ( 'Revoking Let\'sEncrypt certificates for Cert #' + certificate . id + ': ' + certificate . domain_names . join ( ', ' ) ) ;
882
907
883
908
let cmd = certbot_command + ' revoke --non-interactive ' +
884
- '--config "' + le_config + '" ' +
885
909
'--cert-path "/etc/letsencrypt/live/npm-' + certificate . id + '/fullchain.pem" ' +
886
910
'--delete-after-revoke ' +
887
911
( le_staging ? '--staging' : '' ) ;
0 commit comments