Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c88328322d |
@@ -299,7 +299,7 @@ if(isFroxlorVersion('0.9.1'))
|
|||||||
&& (int)$result['latestguid'] > 0
|
&& (int)$result['latestguid'] > 0
|
||||||
&& $result['latestguid'] != $settings['system']['lastguid']
|
&& $result['latestguid'] != $settings['system']['lastguid']
|
||||||
) {
|
) {
|
||||||
checkLastGuid();
|
checkLastGuid($result['latestguid']);
|
||||||
lastStepStatus(1, 'fixed');
|
lastStepStatus(1, 'fixed');
|
||||||
} else {
|
} else {
|
||||||
lastStepStatus(0);
|
lastStepStatus(0);
|
||||||
|
|||||||
@@ -1,168 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This file is part of the Froxlor project.
|
|
||||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the COPYING
|
|
||||||
* file that was distributed with this source code. You can also view the
|
|
||||||
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
|
||||||
*
|
|
||||||
* @copyright (c) the authors
|
|
||||||
* @author Froxlor team <team@froxlor.org> (2010-)
|
|
||||||
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
|
||||||
* @package Configfiles
|
|
||||||
* @version $Id$
|
|
||||||
*/
|
|
||||||
|
|
||||||
return Array(
|
|
||||||
'freebsd' => Array(
|
|
||||||
'label' => 'FreeBSD',
|
|
||||||
'services' => Array(
|
|
||||||
'http' => Array(
|
|
||||||
'label' => $lng['admin']['configfiles']['http'],
|
|
||||||
'daemons' => Array(
|
|
||||||
'apache2' => Array(
|
|
||||||
'label' => 'Apache2 Webserver',
|
|
||||||
'commands' => Array(
|
|
||||||
'cd /usr/ports/www/apache22',
|
|
||||||
'make config',
|
|
||||||
'make install',
|
|
||||||
'touch ' . $settings['system']['apacheconf_vhost'],
|
|
||||||
'chown root:0 ' . $settings['system']['apacheconf_vhost'],
|
|
||||||
'chmod 0600 ' . $settings['system']['apacheconf_vhost'],
|
|
||||||
'touch ' . $settings['system']['apacheconf_diroptions'],
|
|
||||||
'chown root:0 ' . $settings['system']['apacheconf_diroptions'],
|
|
||||||
'chmod 0600 ' . $settings['system']['apacheconf_diroptions'],
|
|
||||||
'mkdir -p ' . $settings['system']['documentroot_prefix'],
|
|
||||||
'mkdir -p ' . $settings['system']['logfiles_directory'],
|
|
||||||
'mkdir -p ' . $settings['system']['mod_fcgid_tmpdir'],
|
|
||||||
'chmod 1777 ' . $settings['system']['mod_fcgid_tmpdir'],
|
|
||||||
'echo "accf_http_load=\"YES\"" >> /boot/loader.conf',
|
|
||||||
'echo "accf_data_load=\"YES\"" >> /boot/loader.conf',
|
|
||||||
'echo "apache22_enable=\"YES\"" >> /etc/rc.conf',
|
|
||||||
),
|
|
||||||
'restart' => Array(
|
|
||||||
'sh /usr/local/etc/rc.d/apache22 restart'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'dns' => Array(
|
|
||||||
'label' => $lng['admin']['configfiles']['dns'],
|
|
||||||
'daemons' => Array(
|
|
||||||
'powerdns' => Array(
|
|
||||||
'label' => 'PowerDNS',
|
|
||||||
'commands_1' => Array(
|
|
||||||
'cd /usr/ports/dns/powerdns',
|
|
||||||
'make config',
|
|
||||||
'make install',
|
|
||||||
'echo "add pdns_enable=\"YES\"" >> /etc/rc.conf',
|
|
||||||
),
|
|
||||||
'files' => Array(
|
|
||||||
'usr_local_etc_pdns_pdns.conf' => '/usr/local/etc/pdns/pdns.conf'
|
|
||||||
),
|
|
||||||
'commands' => Array(
|
|
||||||
'touch ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
|
||||||
'chown root:0 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf',
|
|
||||||
'chmod 0600 ' . $settings['system']['bindconf_directory'] . 'froxlor_bind.conf'
|
|
||||||
),
|
|
||||||
'restart' => Array(
|
|
||||||
'sh /usr/local/etc/rc.d/pdns restart'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'smtp' => Array(
|
|
||||||
'label' => $lng['admin']['configfiles']['smtp'],
|
|
||||||
'daemons' => Array(
|
|
||||||
'postfix' => Array(
|
|
||||||
'label' => 'Postfix',
|
|
||||||
'commands_1' => Array(
|
|
||||||
'cd /usr/ports/mail/postfix',
|
|
||||||
'make config',
|
|
||||||
'set Dovecot SASL authentication method',
|
|
||||||
'set Enable SSL and TLS support',
|
|
||||||
'set MySQL maps (choose version with WITH_MYSQL_VER)',
|
|
||||||
'make install'
|
|
||||||
),
|
|
||||||
'commands_2' => Array(
|
|
||||||
'pw groupadd vmail -g 5001 ',
|
|
||||||
'pw useradd vmail -u 5001 -g 5001 -s/sbin/nologin -d/dev/null',
|
|
||||||
'mkdir -p ' . $settings['system']['vmail_homedir'],
|
|
||||||
'chown -R vmail:vmail ' . $settings['system']['vmail_homedir'],
|
|
||||||
'chmod 0750 ' . $settings['system']['vmail_homedir']
|
|
||||||
),
|
|
||||||
'commands_3' => Array(
|
|
||||||
'echo "sendmail_enable=\"NO\"" >> /etc/rc.conf',
|
|
||||||
'echo "sendmail_submit_enable=\"NO\"" >> /etc/rc.conf',
|
|
||||||
'echo "sendmail_outbound_enable=\"NO\"" >> /etc/rc.conf',
|
|
||||||
'echo "sendmail_msp_queue_enable=\"NO\"" >> /etc/rc.conf',
|
|
||||||
'echo "postfix_enable=\"YES\"" >> /etc/rc.conf'
|
|
||||||
),
|
|
||||||
'files' => Array(
|
|
||||||
'etc_periodic.conf' => '/etc/periodic.conf',
|
|
||||||
'etc_postfix_main.cf' => '/etc/postfix/main.cf',
|
|
||||||
'etc_postfix_mysql-virtual_alias_maps.cf' => '/etc/postfix/mysql-virtual_alias_maps.cf',
|
|
||||||
'etc_postfix_mysql-virtual_mailbox_domains.cf' => '/etc/postfix/mysql-virtual_mailbox_domains.cf',
|
|
||||||
'etc_postfix_mysql-virtual_mailbox_maps.cf' => '/etc/postfix/mysql-virtual_mailbox_maps.cf'
|
|
||||||
),
|
|
||||||
'restart' => Array(
|
|
||||||
'sh /usr/local/etc/rc.d/postfix restart'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'mail' => Array(
|
|
||||||
'label' => $lng['admin']['configfiles']['mail'],
|
|
||||||
'daemons' => Array(
|
|
||||||
'dovecot' => Array(
|
|
||||||
'label' => 'Dovecot',
|
|
||||||
'commands_1' => Array(
|
|
||||||
'cd /usr/ports/mail/dovecot',
|
|
||||||
'make config',
|
|
||||||
'set kqueue(2) support ',
|
|
||||||
'set SSL support ',
|
|
||||||
'set ManageSieve support (optional)',
|
|
||||||
'set MySQL support ',
|
|
||||||
'make install',
|
|
||||||
'echo "add dovecot_enable=\"YES\"" >> /etc/rc.conf'
|
|
||||||
),
|
|
||||||
'files' => Array(
|
|
||||||
'usr_local_etc_dovecot.conf' => '/usr/local/etc/dovecot.conf',
|
|
||||||
'usr_local_etc_dovecot-sql.conf' => '/usr/local/etc/dovecot-sql.conf'
|
|
||||||
),
|
|
||||||
'commands_2' => Array(
|
|
||||||
'echo "dovecot unix - n n - - pipe
|
|
||||||
flags=DRhu user=vmail:vmail argv=/usr/local/libexec/dovecot/deliver -f ${sender} -d ${recipient}" >> /usr/local/etc/postfix/master.cf'
|
|
||||||
),
|
|
||||||
'restart' => Array(
|
|
||||||
'sh /usr/local/etc/rc.d/dovecot restart'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'ftp' => Array(
|
|
||||||
'label' => $lng['admin']['configfiles']['ftp'],
|
|
||||||
'daemons' => Array(
|
|
||||||
'proftpd' => Array(
|
|
||||||
'label' => 'ProFTPd',
|
|
||||||
'files' => Array(
|
|
||||||
'etc_proftpd_proftpd.conf' => '/etc/proftpd/proftpd.conf'
|
|
||||||
),
|
|
||||||
'commands' => Array(
|
|
||||||
'touch /etc/proftpd/proftpd.conf',
|
|
||||||
'chown root:0 /etc/proftpd/proftpd.conf',
|
|
||||||
'chmod 0600 /etc/proftpd/proftpd.conf'
|
|
||||||
),
|
|
||||||
'restart' => Array(
|
|
||||||
'/etc/init.d/proftpd restart'
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -29,25 +29,14 @@
|
|||||||
*
|
*
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function checkLastGuid()
|
function checkLastGuid($froxlor_guid = 0)
|
||||||
{
|
{
|
||||||
global $log, $cronlog, $db, $settings;
|
global $cronlog;
|
||||||
|
|
||||||
$mylog = null;
|
|
||||||
if (isset($cronlog) && $cronlog instanceof FroxlorLogger) {
|
|
||||||
$mylog = $cronlog;
|
|
||||||
} else {
|
|
||||||
$mylog = $log;
|
|
||||||
}
|
|
||||||
|
|
||||||
$group_lines = array();
|
$group_lines = array();
|
||||||
$group_guids = array();
|
$group_guids = array();
|
||||||
$update_to_guid = 0;
|
$update_to_guid = 0;
|
||||||
|
|
||||||
$froxlor_guid = 0;
|
|
||||||
$result = $db->query_first("SELECT MAX(`guid`) as `fguid` FROM `".TABLE_PANEL_CUSTOMERS."`");
|
|
||||||
$froxlor_guid = $result['fguid'];
|
|
||||||
|
|
||||||
$g_file = '/etc/group';
|
$g_file = '/etc/group';
|
||||||
|
|
||||||
if(file_exists($g_file))
|
if(file_exists($g_file))
|
||||||
@@ -77,32 +66,27 @@ function checkLastGuid()
|
|||||||
|
|
||||||
$guid = isset($group[2]) ? (int)$group[2] : 0;
|
$guid = isset($group[2]) ? (int)$group[2] : 0;
|
||||||
|
|
||||||
if($guid > $update_to_guid)
|
if($guid > $froxlor_guid)
|
||||||
{
|
{
|
||||||
$update_to_guid = $guid;
|
$update_to_guid = $guid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($update_to_guid < $froxlor_guid)
|
if($update_to_guid > $froxlor_guid)
|
||||||
{
|
{
|
||||||
$update_to_guid = $froxlor_guid;
|
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Updating froxlor last guid to '.$update_to_guid);
|
||||||
|
|
||||||
if ($update_to_guid != $settings['system']['lastguid'])
|
|
||||||
{
|
|
||||||
$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'Updating froxlor last guid to '.$update_to_guid);
|
|
||||||
saveSetting('system', 'lastguid', $update_to_guid);
|
saveSetting('system', 'lastguid', $update_to_guid);
|
||||||
$settings['system']['lastguid'] = $update_to_guid;
|
$settings['system']['lastguid'] = $update_to_guid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ fwrite($debugHandler, 'Cronfiles have been included' . "\n");
|
|||||||
* so users in the database don't conflict with system users
|
* so users in the database don't conflict with system users
|
||||||
*/
|
*/
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Checking system\'s last guid');
|
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Checking system\'s last guid');
|
||||||
checkLastGuid();
|
checkLastGuid($settings['system']['lastguid']);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* shutdown cron
|
* shutdown cron
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
daily_clean_hoststat_enable="NO"
|
|
||||||
daily_status_mail_rejects_enable="NO"
|
|
||||||
daily_status_include_submit_mailq="NO"
|
|
||||||
daily_submit_queuerun="NO"
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
allow-axfr-ips=<SLAVE DNS SERVER>
|
|
||||||
allow-recursion=127.0.0.1
|
|
||||||
daemon=yes
|
|
||||||
guardian=yes
|
|
||||||
launch=bind
|
|
||||||
lazy-recursion=yes
|
|
||||||
recursor=<IP DNSRECURSION>
|
|
||||||
master=yes
|
|
||||||
bind-config=/etc/namedb/froxlor_bind.conf
|
|
||||||
bind-check-interval=180
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
# Server settings
|
|
||||||
ServerName "<SERVERNAME> FTP Server"
|
|
||||||
ServerType standalone
|
|
||||||
DefaultServer on
|
|
||||||
Port 21
|
|
||||||
UseIPv6 off
|
|
||||||
Umask 022
|
|
||||||
SyslogLevel emerg
|
|
||||||
SystemLog /var/log/xferlog
|
|
||||||
LogFormat auth "%v [%P] %h %t \"%r\" %s"
|
|
||||||
ExtendedLog /var/log/xferlog AUTH auth
|
|
||||||
|
|
||||||
# General settings
|
|
||||||
DeferWelcome off
|
|
||||||
MultilineRFC2228 on
|
|
||||||
ShowSymlinks on
|
|
||||||
TimeoutNoTransfer 600
|
|
||||||
TimeoutStalled 600
|
|
||||||
TimeoutIdle 1200
|
|
||||||
DisplayLogin welcome.msg
|
|
||||||
DisplayChdir .message
|
|
||||||
ListOptions "-l"
|
|
||||||
DenyFilter \*.*/
|
|
||||||
MaxInstances 30
|
|
||||||
CommandBufferSize 512
|
|
||||||
User nobody
|
|
||||||
Group nogroup
|
|
||||||
AllowOverwrite on
|
|
||||||
|
|
||||||
<IfModule mod_quotatab.c>
|
|
||||||
QuotaEngine off
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
<IfModule mod_ratio.c>
|
|
||||||
Ratios off
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
<IfModule mod_delay.c>
|
|
||||||
DelayEngine off
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
<IfModule mod_sql.c>
|
|
||||||
DefaultRoot ~
|
|
||||||
RequireValidShell off
|
|
||||||
AuthOrder mod_sql.c
|
|
||||||
SQLBackend mysql
|
|
||||||
SQLEngine on
|
|
||||||
SQLAuthenticate on
|
|
||||||
SQLAuthTypes Crypt
|
|
||||||
SQLAuthenticate users* groups*
|
|
||||||
SQLConnectInfo <SQL_DB>@<SQL_HOST> <SQL_UNPRIVILEGED_USER> <SQL_UNPRIVILEGED_PASSWORD>
|
|
||||||
SQLUserInfo ftp_users username password uid gid homedir shell
|
|
||||||
SQLGroupInfo ftp_groups groupname gid members
|
|
||||||
SQLUserWhereClause "login_enabled = 'y'"
|
|
||||||
|
|
||||||
SQLLog PASS login
|
|
||||||
SQLNamedQuery login UPDATE "last_login=now(), login_count=login_count+1 WHERE username='%u'" ftp_users
|
|
||||||
|
|
||||||
SQLLog RETR download
|
|
||||||
SQLNamedQuery download UPDATE "down_count=down_count+1, down_bytes=down_bytes+%b WHERE username='%u'" ftp_users
|
|
||||||
|
|
||||||
SQLLog STOR upload
|
|
||||||
SQLNamedQuery upload UPDATE "up_count=up_count+1, up_bytes=up_bytes+%b WHERE username='%u'" ftp_users
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
|
|
||||||
#<IfModule mod_tls.c>
|
|
||||||
# TLSEngine on
|
|
||||||
# TLSLog /var/log/xferlog
|
|
||||||
# TLSProtocol SSLv23
|
|
||||||
# TLSRequired off
|
|
||||||
# TLSRSACertificateFile /etc/ssl/cert.pem
|
|
||||||
# TLSRSACertificateKeyFile /etc/ssl/key.pem
|
|
||||||
# TLSVerifyClient off
|
|
||||||
# TLSRenegotiate required off
|
|
||||||
#</IfModule>
|
|
||||||
Reference in New Issue
Block a user