Skip to content

Commit 80198b3

Browse files
author
Marius Burkard
committed
- letsencrypt changes merged to nginx plugin
- fixed some smaller things in plugins for apache and nginx
1 parent 4bba7dd commit 80198b3

File tree

2 files changed

+78
-104
lines changed

2 files changed

+78
-104
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,7 @@ function update($event_name, $data) {
12561256
//* check is been correctly created
12571257
if(file_exists($crt_tmp_file)) {
12581258
$date = date("YmdHis");
1259+
//* TODO: check if is a symlink, if target same keep it, either remove it
12591260
if(is_file($key_file)) {
12601261
$app->system->copy($key_file, $key_file.'.old'.$date);
12611262
$app->system->chmod($key_file.'.old.'.$date, 0400);
@@ -1396,10 +1397,10 @@ function update($event_name, $data) {
13961397
$alias_seo_redirects = array();
13971398
switch($data['new']['subdomain']) {
13981399
case 'www':
1399-
$server_alias[] .= 'www.'.$data['new']['domain'].' ';
1400+
$server_alias[] = 'www.'.$data['new']['domain'].' ';
14001401
break;
14011402
case '*':
1402-
$server_alias[] .= '*.'.$data['new']['domain'].' ';
1403+
$server_alias[] = '*.'.$data['new']['domain'].' ';
14031404
break;
14041405
}
14051406
if(is_array($aliases)) {
@@ -3010,7 +3011,7 @@ private function hhvm_update($data, $web_config) {
30103011
}
30113012

30123013
if($data['new']['php'] == 'hhvm' && $data['old']['php'] != 'hhvm' || (isset($data['old']['custom_php_ini']) && $data['new']['custom_php_ini'] != $data['old']['custom_php_ini'])) {
3013-
3014+
30143015
// Custom php.ini settings
30153016
$custom_php_ini_settings = trim($data['new']['custom_php_ini']);
30163017
if(intval($data['new']['directive_snippets_id']) > 0){
@@ -3039,7 +3040,7 @@ private function hhvm_update($data, $web_config) {
30393040
} else {
30403041
if($data['old']['system_user'] != '' && is_file('/etc/hhvm/'.$data['old']['system_user'].'.ini')) unlink('/etc/hhvm/'.$data['old']['system_user'].'.ini');
30413042
}
3042-
3043+
30433044
$content = str_replace('{SYSTEM_USER}', $data['new']['system_user'], $content);
30443045
file_put_contents('/etc/init.d/hhvm_' . $data['new']['system_user'], $content);
30453046
exec('chmod +x /etc/init.d/hhvm_' . $data['new']['system_user'] . ' >/dev/null 2>&1');
@@ -3061,12 +3062,12 @@ private function hhvm_update($data, $web_config) {
30613062
if(is_file('/etc/hhvm/'.$data['old']['system_user'].'.ini')) unlink('/etc/hhvm/'.$data['old']['system_user'].'.ini');
30623063
}
30633064

3064-
if(is_file('/etc/monit/conf.d/hhvm_' . $data['new']['system_user']) || is_file('/etc/monit/conf.d/00-hhvm_' . $data['new']['system_user'])){
3065-
if(is_file('/etc/monit/conf.d/hhvm_' . $data['new']['system_user'])){
3066-
unlink('/etc/monit/conf.d/hhvm_' . $data['new']['system_user']);
3065+
if(is_file('/etc/monit/conf.d/hhvm_' . $data['old']['system_user']) || is_file('/etc/monit/conf.d/00-hhvm_' . $data['old']['system_user'])){
3066+
if(is_file('/etc/monit/conf.d/hhvm_' . $data['old']['system_user'])){
3067+
unlink('/etc/monit/conf.d/hhvm_' . $data['old']['system_user']);
30673068
}
3068-
if(is_file('/etc/monit/conf.d/00-hhvm_' . $data['new']['system_user'])){
3069-
unlink('/etc/monit/conf.d/00-hhvm_' . $data['new']['system_user']);
3069+
if(is_file('/etc/monit/conf.d/00-hhvm_' . $data['old']['system_user'])){
3070+
unlink('/etc/monit/conf.d/00-hhvm_' . $data['old']['system_user']);
30703071
}
30713072
exec('/etc/init.d/monit restart >/dev/null 2>&1');
30723073
}
@@ -3224,9 +3225,9 @@ private function php_fpm_pool_update ($data, $web_config, $pool_dir, $pool_name,
32243225
}
32253226
}
32263227
}
3227-
3228+
32283229
$tpl->setVar('custom_session_save_path', ($custom_session_save_path ? 'y' : 'n'));
3229-
3230+
32303231
$tpl->setLoop('custom_php_ini_settings', $final_php_ini_settings);
32313232

32323233
$app->system->file_put_contents($pool_dir.$pool_name.'.conf', $tpl->grab());

0 commit comments

Comments
 (0)