enable re-selecting of system-distribution; move some distribution-related settings which are adjusted via installation to config-templates 'defaults'
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -42,11 +42,15 @@ if ($userinfo['change_serversettings'] == '1') {
|
|||||||
|
|
||||||
// get distro from URL param
|
// get distro from URL param
|
||||||
$distribution = Request::get('distribution');
|
$distribution = Request::get('distribution');
|
||||||
|
$reselect = Request::get('reselect', 0);
|
||||||
|
|
||||||
// check for possible setting
|
// check for possible setting
|
||||||
if (empty($distribution)) {
|
if (empty($distribution)) {
|
||||||
$distribution = Settings::Get('system.distribution') ?? "";
|
$distribution = Settings::Get('system.distribution') ?? "";
|
||||||
}
|
}
|
||||||
|
if ($reselect == 1) {
|
||||||
|
$distribution = '';
|
||||||
|
}
|
||||||
|
|
||||||
$distributions_select = [];
|
$distributions_select = [];
|
||||||
|
|
||||||
@@ -130,7 +134,8 @@ if ($userinfo['change_serversettings'] == '1') {
|
|||||||
'distribution' => [
|
'distribution' => [
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'select_var' => $distributions_select,
|
'select_var' => $distributions_select,
|
||||||
'label' => lng('admin.configfiles.distribution')
|
'label' => lng('admin.configfiles.distribution'),
|
||||||
|
'selected' => Settings::Get('system.distribution') ?? ''
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -382,22 +382,12 @@ class Core
|
|||||||
$this->updateSetting($upd_stmt, 'apache2', 'system', 'webserver');
|
$this->updateSetting($upd_stmt, 'apache2', 'system', 'webserver');
|
||||||
$this->updateSetting($upd_stmt, '1', 'system', 'apache24');
|
$this->updateSetting($upd_stmt, '1', 'system', 'apache24');
|
||||||
} elseif ($this->validatedData['webserver'] == "lighttpd") {
|
} 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, '/etc/lighttpd/lighttpd.pem', 'system', 'ssl_cert_file');
|
||||||
$this->updateSetting($upd_stmt, '/var/run/lighttpd/', 'phpfpm', 'fastcgi_ipcdir');
|
$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") {
|
} 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, '/etc/nginx/nginx.pem', 'system', 'ssl_cert_file');
|
||||||
$this->updateSetting($upd_stmt, '/var/run/', 'phpfpm', 'fastcgi_ipcdir');
|
$this->updateSetting($upd_stmt, '/var/run/', 'phpfpm', 'fastcgi_ipcdir');
|
||||||
$this->updateSetting($upd_stmt, 'error', 'system', 'errorlog_level');
|
$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');
|
$distros = glob(FileDir::makeCorrectDir(Froxlor::getInstallDir() . '/lib/configfiles/') . '*.xml');
|
||||||
@@ -407,7 +397,9 @@ class Core
|
|||||||
$defaults = $dist->getDefaults();
|
$defaults = $dist->getDefaults();
|
||||||
if (!empty($defaults)) {
|
if (!empty($defaults)) {
|
||||||
foreach ($defaults as $property) {
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,20 @@
|
|||||||
<froxlor>
|
<froxlor>
|
||||||
<distribution name="Ubuntu" codename="Bionic"
|
<distribution name="Ubuntu" codename="Bionic"
|
||||||
version="18.04" defaulteditor="/bin/nano" deprecated="true">
|
version="18.04" defaulteditor="/bin/nano" deprecated="true">
|
||||||
|
<!-- OS defaults to be loaded on installation -->
|
||||||
|
<defaults>
|
||||||
|
<default settinggroup="system" varname="nssextrausers" value="1"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_vhost" value="/etc/lighttpd/conf-enabled/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_diroptions" value="/etc/lighttpd/froxlor-diroptions/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/lighttpd/froxlor-htpasswd/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apachereload_command" value="service lighttpd reload"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="letsencryptacmeconf" value="/etc/lighttpd/acme.conf"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_vhost" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_diroptions" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/nginx/froxlor-htpasswd/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apachereload_command" value="service nginx reload"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="letsencryptacmeconf" value="/etc/nginx/acme.conf"></default>
|
||||||
|
</defaults>
|
||||||
<services>
|
<services>
|
||||||
<!-- HTTP -->
|
<!-- HTTP -->
|
||||||
<service type="http" title="{{lng.admin.configfiles.http}}">
|
<service type="http" title="{{lng.admin.configfiles.http}}">
|
||||||
|
|||||||
@@ -2,6 +2,20 @@
|
|||||||
<froxlor>
|
<froxlor>
|
||||||
<distribution name="Debian" codename="Bullseye"
|
<distribution name="Debian" codename="Bullseye"
|
||||||
version="11.x" defaulteditor="/bin/nano">
|
version="11.x" defaulteditor="/bin/nano">
|
||||||
|
<!-- OS defaults to be loaded on installation -->
|
||||||
|
<defaults>
|
||||||
|
<default settinggroup="system" varname="nssextrausers" value="1"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_vhost" value="/etc/lighttpd/conf-enabled/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_diroptions" value="/etc/lighttpd/froxlor-diroptions/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/lighttpd/froxlor-htpasswd/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apachereload_command" value="service lighttpd reload"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="letsencryptacmeconf" value="/etc/lighttpd/acme.conf"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_vhost" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_diroptions" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/nginx/froxlor-htpasswd/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apachereload_command" value="service nginx reload"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="letsencryptacmeconf" value="/etc/nginx/acme.conf"></default>
|
||||||
|
</defaults>
|
||||||
<services>
|
<services>
|
||||||
<!-- HTTP -->
|
<!-- HTTP -->
|
||||||
<service type="http" title="{{lng.admin.configfiles.http}}">
|
<service type="http" title="{{lng.admin.configfiles.http}}">
|
||||||
|
|||||||
@@ -2,6 +2,20 @@
|
|||||||
<froxlor>
|
<froxlor>
|
||||||
<distribution name="Debian" codename="Buster"
|
<distribution name="Debian" codename="Buster"
|
||||||
version="10.x" defaulteditor="/bin/nano" deprecated="true">
|
version="10.x" defaulteditor="/bin/nano" deprecated="true">
|
||||||
|
<!-- OS defaults to be loaded on installation -->
|
||||||
|
<defaults>
|
||||||
|
<default settinggroup="system" varname="nssextrausers" value="1"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_vhost" value="/etc/lighttpd/conf-enabled/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_diroptions" value="/etc/lighttpd/froxlor-diroptions/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/lighttpd/froxlor-htpasswd/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apachereload_command" value="service lighttpd reload"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="letsencryptacmeconf" value="/etc/lighttpd/acme.conf"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_vhost" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_diroptions" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/nginx/froxlor-htpasswd/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apachereload_command" value="service nginx reload"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="letsencryptacmeconf" value="/etc/nginx/acme.conf"></default>
|
||||||
|
</defaults>
|
||||||
<services>
|
<services>
|
||||||
<!-- HTTP -->
|
<!-- HTTP -->
|
||||||
<service type="http" title="{{lng.admin.configfiles.http}}">
|
<service type="http" title="{{lng.admin.configfiles.http}}">
|
||||||
|
|||||||
@@ -2,6 +2,20 @@
|
|||||||
<froxlor>
|
<froxlor>
|
||||||
<distribution name="Ubuntu" codename="Focal"
|
<distribution name="Ubuntu" codename="Focal"
|
||||||
version="20.04" defaulteditor="/bin/nano">
|
version="20.04" defaulteditor="/bin/nano">
|
||||||
|
<!-- OS defaults to be loaded on installation -->
|
||||||
|
<defaults>
|
||||||
|
<default settinggroup="system" varname="nssextrausers" value="1"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_vhost" value="/etc/lighttpd/conf-enabled/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_diroptions" value="/etc/lighttpd/froxlor-diroptions/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/lighttpd/froxlor-htpasswd/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apachereload_command" value="service lighttpd reload"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="letsencryptacmeconf" value="/etc/lighttpd/acme.conf"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_vhost" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_diroptions" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/nginx/froxlor-htpasswd/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apachereload_command" value="service nginx reload"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="letsencryptacmeconf" value="/etc/nginx/acme.conf"></default>
|
||||||
|
</defaults>
|
||||||
<services>
|
<services>
|
||||||
<!-- HTTP -->
|
<!-- HTTP -->
|
||||||
<service type="http" title="{{lng.admin.configfiles.http}}">
|
<service type="http" title="{{lng.admin.configfiles.http}}">
|
||||||
|
|||||||
@@ -4,7 +4,24 @@
|
|||||||
defaulteditor="/usr/bin/nano">
|
defaulteditor="/usr/bin/nano">
|
||||||
<!-- OS defaults to be loaded on installation -->
|
<!-- OS defaults to be loaded on installation -->
|
||||||
<defaults>
|
<defaults>
|
||||||
<default settinggroup="system" varname="nssextrausers" value="0"></default>
|
<default settinggroup="system" varname="nssextrausers" value="1"></default>
|
||||||
|
<default for="apache24" settinggroup="system" varname="apacheconf_vhost" value="/etc/apache2/vhosts.d/"></default>
|
||||||
|
<default for="apache24" settinggroup="system" varname="apacheconf_diroptions" value="/etc/apache2/vhosts.d/"></default>
|
||||||
|
<default for="apache24" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/apache2/froxlor-htpasswd/"></default>
|
||||||
|
<default for="apache24" settinggroup="system" varname="apachereload_command" value="/etc/init.d/apache2 reload"></default>
|
||||||
|
<!-- TODO how does this work on gentoo? -->
|
||||||
|
<default for="apache24" settinggroup="system" varname="letsencryptacmeconf" value="/etc/apache2/acme.conf"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_vhost" value="/etc/lighttpd/vhosts.d/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_diroptions" value="/etc/lighttpd/diropts.d/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/lighttpd/froxlor-htpasswd/"></default>
|
||||||
|
<default for="lighttpd" settinggroup="system" varname="apachereload_command" value="/etc/init.d/lighttpd reload"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_vhost" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_diroptions" value="/etc/nginx/sites-enabled/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apacheconf_htpasswddir" value="/etc/nginx/froxlor-htpasswd/"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="apachereload_command" value="/etc/init.d/nginx reload"></default>
|
||||||
|
<default for="nginx" settinggroup="system" varname="letsencryptacmeconf" value="/etc/nginx/acme.conf"></default>
|
||||||
|
<default settinggroup="system" varname="bindreload_command" value="/etc/init.d/named restart"></default>
|
||||||
|
<default settinggroup="system" varname="crondreload" value="/etc/init.d/cronie restart"></default>
|
||||||
</defaults>
|
</defaults>
|
||||||
<services>
|
<services>
|
||||||
<!-- HTTP -->
|
<!-- HTTP -->
|
||||||
@@ -3794,6 +3811,46 @@ aliases: files
|
|||||||
<WEBSERVER_RELOAD_CMD> > /dev/null 2>&1 || true
|
<WEBSERVER_RELOAD_CMD> > /dev/null 2>&1 || true
|
||||||
endscript
|
endscript
|
||||||
}
|
}
|
||||||
|
]]>
|
||||||
|
</content>
|
||||||
|
</file>
|
||||||
|
</daemon>
|
||||||
|
<!-- libnss-extrausers -->
|
||||||
|
<daemon name="libnssextrausers"
|
||||||
|
title="libnss-extrausers">
|
||||||
|
<install><![CDATA[emerge app-eselect/eselect-repository]]></install>
|
||||||
|
<install><![CDATA[mkdir -p /etc/portage/repos.conf]]></install>
|
||||||
|
<install><![CDATA[eselect repository add froxlor git https://github.com/Froxlor/Gentoo-Ebuild.git]]></install>
|
||||||
|
<install><![CDATA[emaint sync -r froxlor]]></install>
|
||||||
|
<install><![CDATA[emerge sys-auth/libnss-extrausers]]></install>
|
||||||
|
<commands index="1">
|
||||||
|
<command><![CDATA[mkdir -p /var/lib/extrausers]]></command>
|
||||||
|
<command><![CDATA[touch /var/lib/extrausers/passwd]]></command>
|
||||||
|
<command><![CDATA[touch /var/lib/extrausers/group]]></command>
|
||||||
|
<command><![CDATA[touch /var/lib/extrausers/shadow]]></command>
|
||||||
|
</commands>
|
||||||
|
<file name="/etc/nsswitch.conf" backup="true">
|
||||||
|
<content><![CDATA[
|
||||||
|
# Make sure that `passwd`, `group` and `shadow` have extrausers in their lines
|
||||||
|
# You should place extrausers at the end, so that it is queried after the other mechanisams
|
||||||
|
#
|
||||||
|
passwd: compat extrausers
|
||||||
|
group: compat extrausers
|
||||||
|
shadow: compat extrausers
|
||||||
|
|
||||||
|
hosts: files dns
|
||||||
|
networks: files dns
|
||||||
|
|
||||||
|
services: db files
|
||||||
|
protocols: db files
|
||||||
|
rpc: db files
|
||||||
|
ethers: db files
|
||||||
|
netmasks: files
|
||||||
|
netgroup: files
|
||||||
|
bootparams: files
|
||||||
|
|
||||||
|
automount: files
|
||||||
|
aliases: files
|
||||||
]]>
|
]]>
|
||||||
</content>
|
</content>
|
||||||
</file>
|
</file>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block actions %}
|
{% block actions %}
|
||||||
<a class="btn btn-outline-primary" href="{{ linker({'section':'configfiles'}) }}">
|
<a class="btn btn-outline-primary" href="{{ linker({'section':'configfiles','reselect':1}) }}">
|
||||||
<i class="fa-solid fa-grip me-1"></i>
|
<i class="fa-solid fa-grip me-1"></i>
|
||||||
{{ lng('admin.configfiles.distribution') }}:
|
{{ lng('admin.configfiles.distribution') }}:
|
||||||
{{ distribution }}
|
{{ distribution }}
|
||||||
|
|||||||
Reference in New Issue
Block a user