diff --git a/actions/admin/settings/131.ssl.php b/actions/admin/settings/131.ssl.php index 7dff2d50..56c27cd5 100644 --- a/actions/admin/settings/131.ssl.php +++ b/actions/admin/settings/131.ssl.php @@ -88,6 +88,15 @@ return array( 'cronmodule' => 'froxlor/letsencrypt', 'save_method' => 'storeSettingField' ), + 'system_letsencryptacmeconf' => array( + 'label' => $lng['serversettings']['letsencryptacmeconf'], + 'settinggroup' => 'system', + 'varname' => 'letsencryptacmeconf', + 'type' => 'string', + 'string_type' => 'file', + 'default' => '/etc/apache2/conf-enabled/acme.conf', + 'save_method' => 'storeSettingField', + ), 'system_letsencryptca' => array( 'label' => $lng['serversettings']['letsencryptca'], 'settinggroup' => 'system', diff --git a/install/froxlor.sql b/install/froxlor.sql index 0457bd5f..b323b917 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -534,6 +534,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'available_shells', ''), ('system', 'le_froxlor_enabled', '0'), ('system', 'le_froxlor_redirect', '0'), + ('system', 'letsencryptacmeconf', '/etc/apache2/conf-enabled/acme.conf'), ('panel', 'decimal_places', '4'), ('panel', 'adminmail', 'admin@SERVERNAME'), ('panel', 'phpmyadmin_url', ''), @@ -565,7 +566,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'password_special_char_required', '0'), ('panel', 'password_special_char', '!?<>§$%+#=@'), ('panel', 'version', '0.9.37'), - ('panel', 'db_version', '201609050'); + ('panel', 'db_version', '201609120'); DROP TABLE IF EXISTS `panel_tasks`; diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index f801cdf5..5f3c5a8b 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -3435,3 +3435,19 @@ if (isDatabaseVersion('201608260')) { updateToDbVersion('201609050'); } + +if (isDatabaseVersion('201609050')) { + + showUpdateStep("Adding new settings for acme.conf (Let's Encrypt)"); + // get user-chosen value + $websrv_default = "/etc/apache2/conf-enabled/acme.conf"; + if (Settings::Get('system.webserver') == 'nginx') { + $websrv_default = "/etc/nginx/acme.conf"; + } + $acmeconffile = isset($_POST['acmeconffile']) ? $_POST['acmeconffile'] : $websrv_default; + $acmeconffile = makeCorrectFile($acmeconffile); + Settings::AddNew("system.letsencryptacmeconf", $acmeconffile); + lastStepStatus(0); + + updateToDbVersion('201609120'); +} diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php index 403d55d3..22406220 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -679,4 +679,14 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version, $c $question .= $dnsdaemons . ''; eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } + + if (versionInUpdate($current_db_version, '201609120')) { + if (Settings::Get('system.leenabled') == 1) { + $has_preconfig = true; + $description = 'You can now customize the path to your acme.conf file (global alias for Let\'s Encrypt). If you already set up Let\'s Encrypt and the acme.conf file, please set this to the complete path to the file!

'; + $question = 'Path to the acme.conf alias-file.
'; + $question .= '
'; + eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); + } + } } diff --git a/lib/configfiles/gentoo.xml b/lib/configfiles/gentoo.xml index 871dddd6..69b4dd8d 100644 --- a/lib/configfiles/gentoo.xml +++ b/lib/configfiles/gentoo.xml @@ -64,7 +64,7 @@ ]]> - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} //service[@type='http']/general/commands - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} - + {{settings.system.leenabled}} Availble only for: %s'; $lng['serversettings']['option_unavailable'] = '
Option not availble due to other settings.'; +$lng['serversettings']['letsencryptacmeconf']['title'] = "Path to the acme.conf snippet"; +$lng['serversettings']['letsencryptacmeconf']['description'] = "File name of the config snippet which allows the web server to serve the acme challenge."; diff --git a/lng/german.lng.php b/lng/german.lng.php index 228c66a3..84c52f31 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1691,3 +1691,5 @@ $lng['serversettings']['le_froxlor_redirect']['description'] = "Wenn dies aktivi $lng['admin']['froxlorvhost'] = 'Froxlor VirtualHost Einstellungen'; $lng['serversettings']['option_unavailable_websrv'] = '
Nur verfügbar für: %s'; $lng['serversettings']['option_unavailable'] = '
Option aufgrund anderer Einstellungen nicht verfügbar.'; +$lng['serversettings']['letsencryptacmeconf']['title'] = "Pfad zu acme.conf"; +$lng['serversettings']['letsencryptacmeconf']['description'] = "Dateiname der Konfiguration, die dem Webserver erlaubt, die ACME-Challenges zu bedienen."; diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index d715f193..ac81e94b 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -464,7 +464,8 @@ class nginx extends HttpConfigBase { if (Settings::Get('system.use_ssl') == '1' && Settings::Get('system.leenabled') == '1') { - $vhost_content.= "\t".'include /etc/nginx/acme.conf;'."\n"; + $acmeConfFilename = Settings::Get('system.letsencryptacmeconf'); + $vhost_content.= "\t".'include '.$acmeConfFilename.';'."\n"; } // if the documentroot is an URL we just redirect