瀏覽代碼

Ensure that the bundled certificate is used with redmatrix

Bob Mottram 10 年之前
父節點
當前提交
fb7c4263f2
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 4
    0
      src/freedombone
  2. 4
    0
      src/freedombone-renew-cert

+ 4
- 0
src/freedombone 查看文件

2522
       echo '    exit 759' >> /usr/bin/$RESTORE_SCRIPT_NAME
2522
       echo '    exit 759' >> /usr/bin/$RESTORE_SCRIPT_NAME
2523
       echo '  fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
2523
       echo '  fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
2524
       echo '  rm -rf /root/tempredmatrix' >> /usr/bin/$RESTORE_SCRIPT_NAME
2524
       echo '  rm -rf /root/tempredmatrix' >> /usr/bin/$RESTORE_SCRIPT_NAME
2525
+      echo '  # Ensure that the bundled SSL cert is being used' >> /usr/bin/$RESTORE_SCRIPT_NAME
2526
+      echo "  sed -i 's|$REDMATRIX_DOMAIN_NAME.crt|$REDMATRIX_DOMAIN_NAME.bundle.crt|g' /etc/nginx/sites-available/$REDMATRIX_DOMAIN_NAME" >> /usr/bin/$RESTORE_SCRIPT_NAME
2525
       echo "  chmod 777 /var/www/$REDMATRIX_DOMAIN_NAME/htdocs/store/[data]/smarty3" >> /usr/bin/$RESTORE_SCRIPT_NAME
2527
       echo "  chmod 777 /var/www/$REDMATRIX_DOMAIN_NAME/htdocs/store/[data]/smarty3" >> /usr/bin/$RESTORE_SCRIPT_NAME
2526
       echo "  chown -R www-data:www-data /var/www/$REDMATRIX_DOMAIN_NAME/htdocs/*" >> /usr/bin/$RESTORE_SCRIPT_NAME
2528
       echo "  chown -R www-data:www-data /var/www/$REDMATRIX_DOMAIN_NAME/htdocs/*" >> /usr/bin/$RESTORE_SCRIPT_NAME
2527
       echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
2529
       echo 'fi' >> /usr/bin/$RESTORE_SCRIPT_NAME
3943
       echo '    exit 759' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3945
       echo '    exit 759' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3944
       echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3946
       echo '  fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3945
       echo '  rm -rf /root/tempredmatrix' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3947
       echo '  rm -rf /root/tempredmatrix' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3948
+      echo '  # Ensure that the bundled SSL cert is being used' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3949
+      echo "  sed -i 's|$REDMATRIX_DOMAIN_NAME.crt|$REDMATRIX_DOMAIN_NAME.bundle.crt|g' /etc/nginx/sites-available/$REDMATRIX_DOMAIN_NAME" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3946
       echo "  chmod 777 /var/www/$REDMATRIX_DOMAIN_NAME/htdocs/store/[data]/smarty3" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3950
       echo "  chmod 777 /var/www/$REDMATRIX_DOMAIN_NAME/htdocs/store/[data]/smarty3" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3947
       echo "  chown -R www-data:www-data /var/www/$REDMATRIX_DOMAIN_NAME/htdocs/*" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3951
       echo "  chown -R www-data:www-data /var/www/$REDMATRIX_DOMAIN_NAME/htdocs/*" >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3948
       echo 'fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME
3952
       echo 'fi' >> /usr/bin/$RESTORE_FROM_FRIEND_SCRIPT_NAME

+ 4
- 0
src/freedombone-renew-cert 查看文件

102
 
102
 
103
         rm /etc/ssl/certs/$HOSTNAME.new.crt
103
         rm /etc/ssl/certs/$HOSTNAME.new.crt
104
         rm /etc/ssl/requests/$HOSTNAME.csr
104
         rm /etc/ssl/requests/$HOSTNAME.csr
105
+
106
+        # update your site to include the bundle
107
+        sed -i "s|$HOSTNAME.crt|$HOSTNAME.bundle.crt|g" /etc/nginx/sites-available/$HOSTNAME
108
+
105
         echo 'Certificate installed'
109
         echo 'Certificate installed'
106
         service nginx restart
110
         service nginx restart
107
         return
111
         return