Commit f86d6323 authored by Florian Schaal's avatar Florian Schaal

global option to enable pagespeed with nginx - allows to enable pagespeed even...

global option to enable pagespeed with nginx - allows to enable pagespeed even if no webserver-config is selected
parent 71b48fd9
......@@ -814,6 +814,12 @@ $form["tabs"]['web'] = array(
'width' => '40',
'maxlength' => '255'
),
'nginx_enable_pagespeed' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n',1 => 'y')
),
'nginx_vhost_conf_dir' => array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
......
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Hora do backup';
$wb['skip_le_check_txt'] = 'Ignorar verificação do Lets Encrypt';
$wb['migration_mode_txt'] = 'Habilitar modo de migração do servidor';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['apps_vhost_enabled_txt'] = 'Apps-vhost enabled';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['hostname_error_regex'] = 'Neplatný název hostitele.';
$wb['backup_time_txt'] = 'Spustit zálohovaní v';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -286,4 +286,5 @@ $wb['xmpp_port_pastebin_txt'] = 'Pastebin';
$wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['disable_bind_log_txt'] = 'Disable bind9 messages for Loglevel WARN';
$wb['apps_vhost_enabled_txt'] = 'Apps-vhost enabled';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -287,4 +287,5 @@ $wb["disable_bind_log_txt"] = "Disable bind9 messages for Loglevel WARN";
$wb["apps_vhost_enabled_txt"] = "Apps-vhost enabled";
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_use_ipv6_txt'] = 'Usar IPv6';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['apps_vhost_enabled_txt'] = 'Apps-vhost enabled';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['apps_vhost_enabled_txt'] = 'Apps-vhost enabled';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Время копирования';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['xmpp_port_bosh_txt'] = 'BOSH';
$wb['backup_time_txt'] = 'Backup time';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -283,4 +283,5 @@ $wb['disable_bind_log_txt'] = 'Disable bind9 messages for Loglevel WARN';
$wb['apps_vhost_enabled_txt'] = 'Apps-vhost enabled';
$wb['skip_le_check_txt'] = 'Skip Lets Encrypt Check';
$wb['migration_mode_txt'] = 'Server Migration Mode';
$wb['nginx_enable_pagespeed_txt'] = 'Makes Pagespeed available';
?>
......@@ -60,6 +60,9 @@
<div class="form-group apache">
<label for="vhost_conf_enabled_dir" class="col-sm-3 control-label">{tmpl_var name='vhost_conf_enabled_dir_txt'}</label>
<div class="col-sm-9"><input type="text" name="vhost_conf_enabled_dir" id="vhost_conf_enabled_dir" value="{tmpl_var name='vhost_conf_enabled_dir'}" class="form-control" /></div></div>
<div class="form-group nginx">
<label for="nginx_enable_pagespeed" class="col-sm-3 control-label">{tmpl_var name='nginx_enable_pagespeed_txt'}</label>
<div class="col-sm-9">{tmpl_var name='nginx_enable_pagespeed'}</div></div>
<div class="form-group nginx">
<label for="nginx_vhost_conf_dir" class="col-sm-3 control-label">{tmpl_var name='nginx_vhost_conf_dir_txt'}</label>
<div class="col-sm-9"><input type="text" name="nginx_vhost_conf_dir" id="nginx_vhost_conf_dir" value="{tmpl_var name='nginx_vhost_conf_dir'}" class="form-control" /></div></div>
......
......@@ -237,6 +237,13 @@
{tmpl_var name='directive_snippets_id'}
</select></div>
</div></tmpl_if>
<tmpl_if name="is_pagespeed_enabled" op="==" value="y">
<div class="form-group nginx pagespeed">
<label class="col-sm-3 control-label">{tmpl_var name='enable_pagespeed_txt'}</label>
<div class="col-sm-9">{tmpl_var name="enable_pagespeed"}</div>
</div>
</tmpl_if>
<!--
{tmpl_hook name="field_enable_pagespeed"}
<div class="form-group nginx pagespeed">
<label class="col-sm-3 control-label">{tmpl_var name='enable_pagespeed_txt'}</label>
......@@ -244,6 +251,7 @@
{tmpl_var name="enable_pagespeed"}
</div>
</div>
-->
{tmpl_hook name="field_active"}
<div class="form-group">
<label class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
......@@ -319,7 +327,8 @@
});
// new Vhostsubdomains/Vhostaliasdomains
if(serverId == '') jQuery('#parent_domain_id').trigger('change');
/*
if(jQuery('#directive_snippets_id').val() > 0){
jQuery('.pagespeed').show();
} else {
......@@ -332,6 +341,7 @@
jQuery('.pagespeed').hide();
}
});
*/
function reloadServerId(noFormChange) {
var parentWebId = jQuery('#parent_domain_id').val();
......@@ -349,6 +359,7 @@
var selected = jQuery('#php').val();
jQuery('.apache').hide();
jQuery('.nginx').show();
/*
if(jQuery('#directive_snippets_id').val() > 0){
jQuery('.pagespeed').show();
} else {
......@@ -361,6 +372,7 @@
jQuery('.pagespeed').hide();
}
});
*/
if(selected != "no" && selected != "php-fpm" && selected != "hhvm") {
jQuery('#php option[value="php-fpm"]').attr('selected', 'selected').val('php-fpm');
}
......
......@@ -836,6 +836,7 @@ class page_action extends tform_actions {
$app->tpl->setVar('vhostdomain_type', $this->_vhostdomain_type, true);
$app->tpl->setVar('is_spdy_enabled', ($web_config['enable_spdy'] === 'y'));
$app->tpl->setVar('is_pagespeed_enabled', ($web_config['nginx_enable_pagespeed'] === 'y'));
$app->tpl->setVar("is_admin", $is_admin);
if($this->id > 0) {
......@@ -1308,7 +1309,7 @@ class page_action extends tform_actions {
if($web_config['enable_spdy'] === 'n') {
unset($app->tform->formDef["tabs"]['ssl']['fields']['enable_spdy']);
}
if($this->dataRecord["directive_snippets_id"] < 1) $this->dataRecord["enable_pagespeed"] = 'n';
// if($this->dataRecord["directive_snippets_id"] < 1) $this->dataRecord["enable_pagespeed"] = 'n';
//print_r($_POST['folder_directive_snippets']);
//print_r($_POST['folder_directive_snippets_id']);
......
......@@ -1149,6 +1149,16 @@ class nginx_plugin {
// Custom nginx directives
$final_nginx_directives = array();
if($data['new']['enable_pagespeed'] == 'y'){
// if PageSpeed is already enabled, don't add configuration again
if(stripos($nginx_directives, 'pagespeed') !== false){
$vhost_data['enable_pagespeed'] = false;
} else {
$vhost_data['enable_pagespeed'] = true;
}
} else {
$vhost_data['enable_pagespeed'] = false;
}
if(intval($data['new']['directive_snippets_id']) > 0){
$snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'nginx' AND active = 'y' AND customer_viewable = 'y'", $data['new']['directive_snippets_id']);
if(isset($snippet['snippet'])){
......@@ -1156,6 +1166,7 @@ class nginx_plugin {
} else {
$nginx_directives = $data['new']['nginx_directives'];
}
/*
if($data['new']['enable_pagespeed'] == 'y'){
// if PageSpeed is already enabled, don't add configuration again
if(stripos($nginx_directives, 'pagespeed') !== false){
......@@ -1166,9 +1177,10 @@ class nginx_plugin {
} else {
$vhost_data['enable_pagespeed'] = false;
}
*/
} else {
$nginx_directives = $data['new']['nginx_directives'];
$vhost_data['enable_pagespeed'] = false;
// $vhost_data['enable_pagespeed'] = false;
}
// folder_directive_snippets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment