Commit 4d9563e6 authored by Florian Schaal's avatar Florian Schaal
Browse files

Merge branch 'develop' of git.ispconfig.org:ispconfig/ispconfig3 into develop

parents 3fe4e0c9 3118c93b
......@@ -1175,6 +1175,12 @@ class installer_base {
$content = strtr($content, $postconf_placeholders);
$postconf_commands = array_merge($postconf_commands, array_filter(explode("\n", $content)));
}
$configfile = 'postfix_custom.conf';
if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/' . $configfile . '.master')) {
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master');
$content = strtr($content, $postconf_placeholders);
$postconf_commands = array_merge($postconf_commands, array_filter(explode("\n", $content)));
}
// Remove comment lines, these would give fatal errors when passed to postconf.
$postconf_commands = array_filter($postconf_commands, function($line) { return preg_match('/^[^#]/', $line); });
......@@ -1528,6 +1534,10 @@ class installer_base {
} else {
copy('tpl/debian_dovecot2.conf.master', $config_dir.'/'.$configfile);
}
// Copy custom config file
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/dovecot_custom.conf.master')) {
copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/dovecot_custom.conf.master', $config_dir.'/conf.d/99-ispconfig-custom-config.conf');
}
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = webmaster@localhost', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
if(version_compare($dovecot_version, 2.1, '<')) {
......@@ -2546,7 +2556,7 @@ class installer_base {
$tpl->setVar('apps_vhost_dir',$conf['web']['website_basedir'].'/apps');
$tpl->setVar('apps_vhost_basedir',$conf['web']['website_basedir']);
$tpl->setVar('apps_vhost_servername',$apps_vhost_servername);
if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) {
if(is_file($conf['ispconfig_install_dir'].'/interface/ssl/ispserver.crt') && is_file($conf['ispconfig_install_dir'].'/interface/ssl/ispserver.key')) {
$tpl->setVar('ssl_comment','');
} else {
$tpl->setVar('ssl_comment','#');
......@@ -2629,6 +2639,15 @@ class installer_base {
// Dont just copy over the virtualhost template but add some custom settings
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/nginx_apps.vhost.master', 'tpl/nginx_apps.vhost.master');
// Enable SSL if a cert is in place.
if(is_file($conf['ispconfig_install_dir'].'/interface/ssl/ispserver.crt') && is_file($conf['ispconfig_install_dir'].'/interface/ssl/ispserver.key')) {
$content = str_replace('{ssl_on}', 'ssl', $content);
$content = str_replace('{ssl_comment}', '', $content);
} else {
$content = str_replace('{ssl_on}', '', $content);
$content = str_replace('{ssl_comment}', '#', $content);
}
if($conf['web']['apps_vhost_ip'] == '_default_'){
$apps_vhost_ip = '';
} else {
......@@ -2671,10 +2690,6 @@ class installer_base {
$content = str_replace('{use_tcp}', $use_tcp, $content);
$content = str_replace('{use_socket}', $use_socket, $content);
// SSL in apps vhost is off by default. Might change later.
$content = str_replace('{ssl_on}', '', $content);
$content = str_replace('{ssl_comment}', '#', $content);
// Fix socket path on PHP 7 systems
if(file_exists('/var/run/php/php7.0-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.0-fpm.sock', $content);
if(file_exists('/var/run/php/php7.1-fpm.sock')) $content = str_replace('/var/run/php5-fpm.sock', '/var/run/php/php7.1-fpm.sock', $content);
......
# Do not change this file, as changes will be overwritten by any ISPConfig update.
# Put your custom settings in /usr/local/ispconfig/server/conf-custom/install/dovecot_custom.conf.master.
# To start using those changes, do a force upgrade and let it reconfigure your services. (ispconfig_update.sh --force)
listen = *,[::]
protocols = imap pop3
auth_mechanisms = plain login
......@@ -88,7 +91,7 @@ protocol lmtp {
#2.3+ group = vmail
#2.3+ mode = 0660
#2.3+ }
#2.3+
#2.3+
#2.3+ unix_listener stats-writer {
#2.3+ user = vmail
#2.3+ group = vmail
......@@ -131,3 +134,4 @@ namespace inbox {
special_use = \Trash
}
}
!include_try conf.d/99-ispconfig-custom-config.conf
# Do not change this file, as changes will be overwritten by any ISPConfig update.
# Put your custom settings in /usr/local/ispconfig/server/conf-custom/install/dovecot_custom.conf.master.
# To start using those changes, do a force upgrade and let it reconfigure your services. (ispconfig_update.sh --force)
listen = *,[::]
protocols = imap pop3
auth_mechanisms = plain login
......@@ -86,7 +89,7 @@ protocol lmtp {
#2.3+ group = vmail
#2.3+ mode = 0660
#2.3+ }
#2.3+
#2.3+
#2.3+ unix_listener stats-writer {
#2.3+ user = vmail
#2.3+ group = vmail
......@@ -108,3 +111,4 @@ plugin {
quota_status_nouser = DUNNO
quota_status_overquota = "552 5.2.2 Mailbox is full"
}
!include_try conf.d/99-ispconfig-custom-config.conf
# You can use this file for custom Dovecot settings. The used settings will overrule the settings set by ISPConfig.
# Use with caution!
# Put this file in /usr/local/ispconfig/server/conf-custom/install/ and make your changes there.
# Do not change this file, as changes will be overwritten by any ISPConfig update.
# Put your custom settings in /usr/local/ispconfig/server/conf-custom/install/dovecot_custom.conf.master.
# To start using those changes, do a force upgrade and let it reconfigure your services. (ispconfig_update.sh --force)
listen = *,[::]
protocols = imap pop3
auth_mechanisms = plain login
......@@ -82,7 +85,7 @@ protocol lmtp {
#2.3+ group = vmail
#2.3+ mode = 0660
#2.3+ }
#2.3+
#2.3+
#2.3+ unix_listener stats-writer {
#2.3+ user = vmail
#2.3+ group = vmail
......@@ -125,3 +128,4 @@ namespace inbox {
special_use = \Trash
}
}
!include_try conf.d/99-ispconfig-custom-config.conf
server {
listen {apps_vhost_ip}{apps_vhost_port} {ssl_on};
listen [::]:{apps_vhost_port} {ssl_on} ipv6only=on;
listen {apps_vhost_ip}{apps_vhost_port} {ssl_on} http2;
listen [::]:{apps_vhost_port} {ssl_on} ipv6only=on http2;
{ssl_comment}ssl_protocols TLSv1.2;
{ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt;
{ssl_comment}ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key;
# redirect to https if accessed with http
{ssl_comment}error_page 497 https://$host:{vhost_port}$request_uri;
{ssl_comment}error_page 497 https://$host:{apps_vhost_port}$request_uri;
server_name {apps_vhost_servername};
......
server {
listen {vhost_port} {ssl_on};
listen [::]:{vhost_port} {ssl_on} ipv6only=on;
listen {vhost_port} {ssl_on} http2;
listen [::]:{vhost_port} {ssl_on} ipv6only=on http2;
{ssl_comment}ssl_protocols TLSv1.2;
{ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt;
......
# You can use this file for custom Postfix settings. The used settings will overrule the settings set by ISPConfig.
# Use with caution!
# Put this file in /usr/local/ispconfig/server/conf-custom/install/ and make your changes there.
......@@ -4,6 +4,6 @@ $wb['username_txt'] = 'Username';
$wb['client_id_txt'] = 'Client ID';
$wb['active_txt'] = 'Active';
$wb['add_new_record_txt'] = 'Add new user';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any user settings here. Use the Client- and Reseller settings in the Client module instead. Modifying or changing users or groups here may cause data loss!';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any client user settings here. Use the client- and reseller settings in the client module instead. Modifying or changing client users or groups here may cause data loss!';
$wb['groups_txt'] = 'Groups';
?>
......@@ -5,5 +5,5 @@ $wb['client_id_txt'] = 'User ID';
$wb['active_txt'] = 'Active';
$wb['groups_txt'] = 'Groups';
$wb['add_new_record_txt'] = 'Add new user';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any user settings here. Use the Client- and Reseller settings in the Client module instead. Modifying or changing users or groups here may cause data loss!';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any client user settings here. Use the client- and reseller settings in the client module instead. Modifying or changing client users or groups here may cause data loss!';
?>
......@@ -5,5 +5,5 @@ $wb['client_id_txt'] = 'User ID';
$wb['active_txt'] = 'Active';
$wb['groups_txt'] = 'Groups';
$wb['add_new_record_txt'] = 'Add new user';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any user settings here. Use the Client- and Reseller settings in the Client module instead. Modifying or changing users or groups here may cause data loss!';
?>
\ No newline at end of file
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any client user settings here. Use the client- and reseller settings in the client module instead. Modifying or changing client users or groups here may cause data loss!';
?>
......@@ -4,6 +4,6 @@ $wb['username_txt'] = 'ユーザー名';
$wb['client_id_txt'] = 'Client ID';
$wb['active_txt'] = 'Active';
$wb['add_new_record_txt'] = 'ユーザーを追加する';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any user settings here. Use the Client- and Reseller settings in the Client module instead. Modifying or changing users or groups here may cause data loss!';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any client user settings here. Use the client- and reseller settings in the client module instead. Modifying or changing client users or groups here may cause data loss!';
$wb['groups_txt'] = 'Groups';
?>
......@@ -4,6 +4,6 @@ $wb['username_txt'] = 'Username';
$wb['client_id_txt'] = 'Client ID';
$wb['active_txt'] = 'Active';
$wb['add_new_record_txt'] = 'Add user nou';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any user settings here. Use the Client- and Reseller settings in the Client module instead. Modifying or changing users or groups here may cause data loss!';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any client user settings here. Use the client- and reseller settings in the client module instead. Modifying or changing client users or groups here may cause data loss!';
$wb['groups_txt'] = 'Groups';
?>
......@@ -4,6 +4,6 @@ $wb['username_txt'] = 'Užívateľské meno';
$wb['client_id_txt'] = 'Client ID';
$wb['active_txt'] = 'Active';
$wb['add_new_record_txt'] = 'Pridať nového užívateľa';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any user settings here. Use the Client- and Reseller settings in the Client module instead. Modifying or changing users or groups here may cause data loss!';
$wb['warning_txt'] = '<b>WARNING:</b> Do not edit or modify any client user settings here. Use the client- and reseller settings in the client module instead. Modifying or changing client users or groups here may cause data loss!';
$wb['groups_txt'] = 'Groups';
?>
server {
listen {apps_vhost_ip}{apps_vhost_port} {ssl_on};
listen [::]:{apps_vhost_port} {ssl_on} ipv6only=on;
listen {apps_vhost_ip}{apps_vhost_port} {ssl_on} http2;
listen [::]:{apps_vhost_port} {ssl_on} ipv6only=on http2;
{ssl_comment}ssl_protocols TLSv1.2;
{ssl_comment}ssl_certificate /usr/local/ispconfig/interface/ssl/ispserver.crt;
{ssl_comment}ssl_certificate_key /usr/local/ispconfig/interface/ssl/ispserver.key;
# redirect to https if accessed with http
{ssl_comment}error_page 497 https://$host:{vhost_port}$request_uri;
{ssl_comment}error_page 497 https://$host:{apps_vhost_port}$request_uri;
server_name {apps_vhost_servername};
......
......@@ -206,16 +206,14 @@ class apps_vhost_plugin {
$use_socket = '#';
}
/* Check if SSL should be enabled: */
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
/* Check if SSL should be enabled: */
if(is_file('/usr/local/ispconfig/interface/ssl/ispserver.crt') && is_file('/usr/local/ispconfig/interface/ssl/ispserver.key')) {
$content = str_replace('{ssl_comment}', '', $content);
$content = str_replace('{ssl_on}', 'ssl', $content);
$content = str_replace('{vhost_port}', $web_config['apps_vhost_port'], $content);
} else {
} else {
$content = str_replace('{ssl_comment}', '#', $content);
$content = preg_replace('/(\s)\{ssl_on\}/', '', $content);
$content = str_replace('{vhost_port}', $web_config['apps_vhost_port'], $content);
}
}
$content = str_replace('{use_tcp}', $use_tcp, $content);
$content = str_replace('{use_socket}', $use_socket, $content);
......@@ -253,7 +251,7 @@ class apps_vhost_plugin {
file_put_contents("$vhost_conf_dir/apps.vhost", $content);
// enabled / disable apps-vhost
$vhost_symlink = $web_config['vhost_conf_enabled_dir'].'/000-apps.vhost';
$vhost_symlink = $vhost_conf_enabled_dir . '/000-apps.vhost';
if(is_link($vhost_symlink) && $web_config['apps_vhost_enabled'] == 'n') {
$app->system->unlink($vhost_symlink);
}
......
Supports Markdown
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