Added enable self-signed SSL

This commit is contained in:
zeldaroot 2020-04-16 03:05:38 +03:00
parent f4f7de96d5
commit 87b2e21d50
2 changed files with 4 additions and 2 deletions

View file

@ -2022,7 +2022,8 @@ docker_speed_off() {
"/home/${CP_DOMAIN}/config/production/nginx/conf.d/default.conf"
}
docker_ssl_on() {
if [ -d "/home/${CP_DOMAIN}/config/production/nginx/ssl.d/live/${CP_DOMAIN}/" ]; then
if [ -d "/home/${CP_DOMAIN}/config/production/nginx/ssl.d/live/${CP_DOMAIN}/" ] || \
[ -d "/home/${CP_DOMAIN}/config/production/nginx/ssl.d/self-signed/${CP_DOMAIN}/" ]; then
sed -Ei "s/ #ssl include \/home\/${CP_DOMAIN}\/config\/production\/nginx\/ssl\.d\/default\.conf;/ include \/home\/${CP_DOMAIN}\/config\/production\/nginx\/ssl.d\/default.conf;/" \
"/home/${CP_DOMAIN}/config/production/nginx/conf.d/default.conf"
fi

View file

@ -80,6 +80,7 @@ var config_default = require(path.join(__dirname, '..', 'default', 'config.js'))
var modules_default = require(path.join(__dirname, '..', 'default', 'modules.js'));
var prt = fs.existsSync(path.join(__dirname, '..', 'production', 'nginx', 'ssl.d', 'live', config.domain));
var prt2 = fs.existsSync(path.join(__dirname, '..', 'production', 'nginx', 'ssl.d', 'self-signed', config.domain));
var thm = config.theme !== 'default' && fs.existsSync(path.join(__dirname, '..', '..', 'themes', config.theme))
? config.theme
@ -133,7 +134,7 @@ async.series(
config: function(callback) {
var c = objAdd(objReplace(config_default, config), config);
c.theme = thm;
c.protocol = prt ? 'https://' : config.protocol;
c.protocol = prt || prt2 ? 'https://' : config.protocol;
c.database = config_default.database
? config_default.database
: c.database;