- added configuration templates for FreeBSD's libnss-mysql, fixes #228
This commit is contained in:
@@ -58,7 +58,7 @@ return Array(
|
||||
'cd /usr/ports/dns/powerdns',
|
||||
'make config',
|
||||
'make install',
|
||||
'echo "add pdns_enable=\"YES\"" >> /etc/rc.conf',
|
||||
'echo "pdns_enable=\"YES\"" >> /etc/rc.conf',
|
||||
),
|
||||
'files' => Array(
|
||||
'usr_local_etc_pdns_pdns.conf' => '/usr/local/etc/pdns/pdns.conf'
|
||||
@@ -155,7 +155,7 @@ return Array(
|
||||
'set ManageSieve support (optional)',
|
||||
'set MySQL support ',
|
||||
'make install',
|
||||
'echo "add dovecot_enable=\"YES\"" >> /etc/rc.conf'
|
||||
'echo "dovecot_enable=\"YES\"" >> /etc/rc.conf'
|
||||
),
|
||||
'files' => Array(
|
||||
'usr_local_etc_dovecot.conf' => '/usr/local/etc/dovecot.conf',
|
||||
@@ -203,6 +203,25 @@ return Array(
|
||||
'files' => Array(
|
||||
'etc_awstats.model.conf' => makeCorrectFile($settings['system']['awstats_conf'].'/awstats.model.conf')
|
||||
)
|
||||
),
|
||||
'libnss' => Array(
|
||||
'label' => 'libnss (system login with mysql)',
|
||||
'commands_1' => Array(
|
||||
'cd /usr/ports/net/libnss-mysql',
|
||||
'make install clean',
|
||||
'echo "nscd_enable=\"YES\"" >> /etc/rc.conf'
|
||||
),
|
||||
'files' => Array(
|
||||
'usr_local_etc_libnss-mysql.cfg' => '/usr/local/etc/libnss-mysql.cfg',
|
||||
'usr_local_etc_libnss-mysql-root.cfg' => '/usr/local/etc/libnss-mysql-root.cfg',
|
||||
'etc_nsswitch.conf' => '/etc/nsswitch.conf'
|
||||
),
|
||||
'commands_2' => Array(
|
||||
'chmod 600 /usr/local/etc/libnss-mysql.cfg /usr/local/etc/libnss-mysql-root.cfg'
|
||||
),
|
||||
'restart' => Array(
|
||||
'sh /etc/rc.d/nscd restart'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
20
templates/misc/configfiles/freebsd/libnss/etc_nsswitch.conf
Normal file
20
templates/misc/configfiles/freebsd/libnss/etc_nsswitch.conf
Normal file
@@ -0,0 +1,20 @@
|
||||
# Make sure that `passwd`, `group` and `shadow` have mysql in their lines
|
||||
# You should place mysql at the end, so that it is queried after the other mechanisams
|
||||
#
|
||||
passwd: compat mysql
|
||||
group: compat mysql
|
||||
shadow: compat mysql
|
||||
|
||||
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
|
||||
@@ -0,0 +1,2 @@
|
||||
username <SQL_UNPRIVILEGED_USER>
|
||||
password <SQL_UNPRIVILEGED_PASSWORD>
|
||||
@@ -0,0 +1,18 @@
|
||||
getpwnam SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE username='%1$s' LIMIT 1
|
||||
getpwuid SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users WHERE uid='%1$u' LIMIT 1
|
||||
getpwent SELECT username, 'x', uid, gid, '0', '', 'MySQL User', homedir, shell, '0' FROM ftp_users
|
||||
getspnam SELECT username, password, '12345', '0', '99999', '7', '', '', '' FROM ftp_users WHERE username='%1$s' LIMIT 1
|
||||
getspent SELECT username, password, '12345', '0', '99999', '7', '', '', '' FROM ftp_users
|
||||
getgrnam SELECT groupname, '', gid FROM ftp_groups WHERE groupname='%1$s' LIMIT 1
|
||||
getgrgid SELECT groupname, '', gid FROM ftp_groups WHERE gid='%1$u' LIMIT 1
|
||||
getgrent SELECT groupname, '', gid FROM ftp_groups
|
||||
memsbygid SELECT username FROM ftp_users WHERE gid='%1$u'
|
||||
gidsbymem SELECT gid FROM ftp_users WHERE username='%1$s'
|
||||
|
||||
host <SQL_HOST>
|
||||
database <SQL_DB>
|
||||
username <SQL_UNPRIVILEGED_USER>
|
||||
password <SQL_UNPRIVILEGED_PASSWORD>
|
||||
port 3306
|
||||
timeout 10
|
||||
compress 0
|
||||
Reference in New Issue
Block a user