From ff7ede1a02dc1cc6aae384442939fb14274f9bae Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Tue, 20 Dec 2011 16:13:51 +0000 Subject: freeradius2 changes --- config/freeradius2/freeradius.inc | 855 ++++++++++++++++++++++++++++++++++---- 1 file changed, 780 insertions(+), 75 deletions(-) mode change 100755 => 100644 config/freeradius2/freeradius.inc (limited to 'config/freeradius2/freeradius.inc') diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc old mode 100755 new mode 100644 index 0cf53eb8..a3558cea --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -46,33 +46,40 @@ function freeradius_settings_resync() { global $config; $conf = ''; - // Definition variables for freeradiussettings $varsettings = $config['installedpackages']['freeradiussettings']['config'][0]; - $varsettingsmaxrequesttime = $varsettings['varsettingsmaxrequesttime']; - $varsettingscleanupdelay = $varsettings['varsettingscleanupdelay']; - $varsettingsmaxrequests = $varsettings['varsettingsmaxrequests']; - $varsettingslogdir = $varsettings['varsettingslogdir']; - $varsettingsstrippednames = $varsettings['varsettingsstrippednames']; - $varsettingsauth = $varsettings['varsettingsauth']; - $varsettingsauthbadpass = $varsettings['varsettingsauthbadpass']; - $varsettingsauthgoodpass = $varsettings['varsettingsauthgoodpass']; - $varsettingshostnamelookups = $varsettings['varsettingshostnamelookups']; - $varsettingsallowcoredumps = $varsettings['varsettingsallowcoredumps']; - $varsettingsregularexpressions = $varsettings['varsettingsregularexpressions']; - $varsettingsextendedexpressions = $varsettings['varsettingsextendedexpressions']; - $varsettingsmaxattributes = $varsettings['varsettingsmaxattributes']; - $varsettingsrejectdelay = $varsettings['varsettingsrejectdelay']; - $varsettingsstartservers = $varsettings['varsettingsstartservers']; - $varsettingsmaxservers = $varsettings['varsettingsmaxservers']; - $varsettingsminspareservers = $varsettings['varsettingsminspareservers']; - $varsettingsmaxspareservers = $varsettings['varsettingsmaxspareservers']; - $varsettingsmaxqueuesize = $varsettings['varsettingsmaxqueuesize']; - $varsettingsmaxrequestsperserver = $varsettings['varsettingsmaxrequestsperserver']; + + // Variables: General configuration + $varsettingsmaxrequesttime = ($varsettings['varsettingsmaxrequesttime']?$varsettings['varsettingsmaxrequesttime']:'1024'); + $varsettingscleanupdelay = ($varsettings['varsettingscleanupdelay']?$varsettings['varsettingscleanupdelay']:'30'); + $varsettingsmaxrequests = ($varsettings['varsettingsmaxrequests']?$varsettings['varsettingsmaxrequests']:'5'); + $varsettingslogdir = ($varsettings['varsettingslogdir']?$varsettings['varsettingslogdir']:'no'); + $varsettingsstrippednames = ($varsettings['varsettingsstrippednames']?$varsettings['varsettingsstrippednames']:'no'); + + // Variables: Logging options + $varsettingsauth = ($varsettings['varsettingsauth']?$varsettings['varsettingsauth']:'yes'); + $varsettingsauthbadpass = ($varsettings['varsettingsauthbadpass']?$varsettings['varsettingsauthbadpass']:'yes'); + $varsettingsauthgoodpass = ($varsettings['varsettingsauthgoodpass']?$varsettings['varsettingsauthgoodpass']:'files'); + $varsettingshostnamelookups = ($varsettings['varsettingshostnamelookups']?$varsettings['varsettingshostnamelookups']:'no'); + $varsettingsallowcoredumps = ($varsettings['varsettingsallowcoredumps']?$varsettings['varsettingsallowcoredumps']:'no'); + $varsettingsregularexpressions = ($varsettings['varsettingsregularexpressions']?$varsettings['varsettingsregularexpressions']:'no'); + $varsettingsextendedexpressions = ($varsettings['varsettingsextendedexpressions']?$varsettings['varsettingsextendedexpressions']:'no'); + + // Variables: Security + $varsettingsmaxattributes = ($varsettings['varsettingsmaxattributes']?$varsettings['varsettingsmaxattributes']:'200'); + $varsettingsrejectdelay = ($varsettings['varsettingsrejectdelay']?$varsettings['varsettingsrejectdelay']:'1'); + + // Variables: Thread Pool + $varsettingsstartservers = ($varsettings['varsettingsstartservers']?$varsettings['varsettingsstartservers']:'5'); + $varsettingsmaxservers = ($varsettings['varsettingsmaxservers']?$varsettings['varsettingsmaxservers']:'32'); + $varsettingsminspareservers = ($varsettings['varsettingsminspareservers']?$varsettings['varsettingsminspareservers']:'3'); + $varsettingsmaxspareservers = ($varsettings['varsettingsmaxspareservers']?$varsettings['varsettingsmaxspareservers']:'10'); + $varsettingsmaxqueuesize = ($varsettings['varsettingsmaxqueuesize']?$varsettings['varsettingsmaxqueuesize']:'65536'); + $varsettingsmaxrequestsperserver = ($varsettings['varsettingsmaxrequestsperserver']?$varsettings['varsettingsmaxrequestsperserver']:'0'); // These lines are uncommented in fuction "freeradius_settings_resync" to INCLUDE / enable eap.conf $sqlconf = $config['installedpackages']['freeradiussqlconf']['config'][0]; - $varsqlconfenable = $sqlconf['varsqlconfenable']; - $varsqlconfenablecounter = $sqlconf['varsqlconfenablecounter']; + $varsqlconfenable = ($sqlconf['varsqlconfenable']?$sqlconf['varsqlconfenable']:'#\$INCLUDE sql.conf'); + $varsqlconfenablecounter = ($sqlconf['varsqlconfenablecounter']?$sqlconf['varsqlconfenablecounter']:'#\$INCLUDE sql/mysql/counter.conf'); @@ -114,28 +121,60 @@ regular_expressions = $varsettingsregularexpressions extended_expressions = $varsettingsextendedexpressions EOD; - +// This activates virtual-server coa. +// A better way would be if this link would only be created if there is an interface type "coa" +// and if deleted the link will be deleted, too +exec("ln -s /usr/local/etc/raddb/sites-available/coa /usr/local/etc/raddb/sites-enabled/"); $arrinterfaces = $config['installedpackages']['freeradiusinterfaces']['config']; - if (is_array($arrinterfaces)) { + if (is_array($arrinterfaces) && !empty($arrinterfaces)) { foreach ($arrinterfaces as $item) { $varinterfaceip = $item['varinterfaceip']; $varinterfaceport = $item['varinterfaceport']; $varinterfacetype = $item['varinterfacetype']; $varinterfaceipversion = $item['varinterfaceipversion']; - $conf .= <<