diff --git a/admin_configfiles.php b/admin_configfiles.php index 2742c43a..2f08d6d2 100644 --- a/admin_configfiles.php +++ b/admin_configfiles.php @@ -42,11 +42,15 @@ if ($userinfo['change_serversettings'] == '1') { // get distro from URL param $distribution = Request::get('distribution'); + $reselect = Request::get('reselect', 0); // check for possible setting if (empty($distribution)) { $distribution = Settings::Get('system.distribution') ?? ""; } + if ($reselect == 1) { + $distribution = ''; + } $distributions_select = []; @@ -130,7 +134,8 @@ if ($userinfo['change_serversettings'] == '1') { 'distribution' => [ 'type' => 'select', 'select_var' => $distributions_select, - 'label' => lng('admin.configfiles.distribution') + 'label' => lng('admin.configfiles.distribution'), + 'selected' => Settings::Get('system.distribution') ?? '' ] ] ] diff --git a/lib/Froxlor/Install/Install/Core.php b/lib/Froxlor/Install/Install/Core.php index 87166342..caa1b910 100644 --- a/lib/Froxlor/Install/Install/Core.php +++ b/lib/Froxlor/Install/Install/Core.php @@ -382,22 +382,12 @@ class Core $this->updateSetting($upd_stmt, 'apache2', 'system', 'webserver'); $this->updateSetting($upd_stmt, '1', 'system', 'apache24'); } elseif ($this->validatedData['webserver'] == "lighttpd") { - $this->updateSetting($upd_stmt, '/etc/lighttpd/conf-enabled/', 'system', 'apacheconf_vhost'); - $this->updateSetting($upd_stmt, '/etc/lighttpd/froxlor-diroptions/', 'system', 'apacheconf_diroptions'); - $this->updateSetting($upd_stmt, '/etc/lighttpd/froxlor-htpasswd/', 'system', 'apacheconf_htpasswddir'); - $this->updateSetting($upd_stmt, 'service lighttpd reload', 'system', 'apachereload_command'); $this->updateSetting($upd_stmt, '/etc/lighttpd/lighttpd.pem', 'system', 'ssl_cert_file'); $this->updateSetting($upd_stmt, '/var/run/lighttpd/', 'phpfpm', 'fastcgi_ipcdir'); - $this->updateSetting($upd_stmt, '/etc/lighttpd/acme.conf', 'system', 'letsencryptacmeconf'); } elseif ($this->validatedData['webserver'] == "nginx") { - $this->updateSetting($upd_stmt, '/etc/nginx/sites-enabled/', 'system', 'apacheconf_vhost'); - $this->updateSetting($upd_stmt, '/etc/nginx/sites-enabled/', 'system', 'apacheconf_diroptions'); - $this->updateSetting($upd_stmt, '/etc/nginx/froxlor-htpasswd/', 'system', 'apacheconf_htpasswddir'); - $this->updateSetting($upd_stmt, 'service nginx reload', 'system', 'apachereload_command'); $this->updateSetting($upd_stmt, '/etc/nginx/nginx.pem', 'system', 'ssl_cert_file'); $this->updateSetting($upd_stmt, '/var/run/', 'phpfpm', 'fastcgi_ipcdir'); $this->updateSetting($upd_stmt, 'error', 'system', 'errorlog_level'); - $this->updateSetting($upd_stmt, '/etc/nginx/acme.conf', 'system', 'letsencryptacmeconf'); } $distros = glob(FileDir::makeCorrectDir(Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml'); @@ -407,7 +397,9 @@ class Core $defaults = $dist->getDefaults(); if (!empty($defaults)) { foreach ($defaults as $property) { - $this->updateSetting($upd_stmt, $property->attributes()->value, $property->attributes()->settinggroup, $property->attributes()->varname); + if (!isset($property->attributes()->for) || (isset($property->attributes()->for) && $property->attributes()->for == $this->validatedData['webserver'])) { + $this->updateSetting($upd_stmt, $property->attributes()->value, $property->attributes()->settinggroup, $property->attributes()->varname); + } } } } diff --git a/lib/configfiles/bionic.xml b/lib/configfiles/bionic.xml index 1e1b235a..021d7423 100644 --- a/lib/configfiles/bionic.xml +++ b/lib/configfiles/bionic.xml @@ -2,6 +2,20 @@ + + + + + + + + + + + + + + diff --git a/lib/configfiles/bullseye.xml b/lib/configfiles/bullseye.xml index 6e99236a..8e43c321 100644 --- a/lib/configfiles/bullseye.xml +++ b/lib/configfiles/bullseye.xml @@ -2,6 +2,20 @@ + + + + + + + + + + + + + + diff --git a/lib/configfiles/buster.xml b/lib/configfiles/buster.xml index 6deb8b71..0c3a9be2 100644 --- a/lib/configfiles/buster.xml +++ b/lib/configfiles/buster.xml @@ -2,6 +2,20 @@ + + + + + + + + + + + + + + diff --git a/lib/configfiles/focal.xml b/lib/configfiles/focal.xml index 15d7f73e..8adca449 100644 --- a/lib/configfiles/focal.xml +++ b/lib/configfiles/focal.xml @@ -2,6 +2,20 @@ + + + + + + + + + + + + + + diff --git a/lib/configfiles/gentoo.xml b/lib/configfiles/gentoo.xml index 0fa11183..2d28e1f7 100644 --- a/lib/configfiles/gentoo.xml +++ b/lib/configfiles/gentoo.xml @@ -4,7 +4,24 @@ defaulteditor="/usr/bin/nano"> - + + + + + + + + + + + + + + + + + + @@ -3794,6 +3811,46 @@ aliases: files > /dev/null 2>&1 || true endscript } +]]> + + + + + + + + + + + + + + + + + + diff --git a/templates/Froxlor/settings/configuration.html.twig b/templates/Froxlor/settings/configuration.html.twig index 2d29a5d6..d2b83db4 100644 --- a/templates/Froxlor/settings/configuration.html.twig +++ b/templates/Froxlor/settings/configuration.html.twig @@ -9,7 +9,7 @@ {% endblock %} {% block actions %} - + {{ lng('admin.configfiles.distribution') }}: {{ distribution }}