trac keep reload itself for each page refresh, after account manager plugin is enabled
|Reported by:||walty8||Owned by:||hasienda|
After the account manager plugin is installed, I found that Trac keep reloads after EACH page refresh. The following info sentence keeps showing up in the trac log file.
INFO: Reloading environment due to configuration change
And after hours of investigation, I found that it's mainly caused by the two places of account manager plugin. as mentioned here, the Trac would be reloaded whenever the config file is updated.
I found that in version 0.4.2 (the latest stable version), the config file is actually modified by account manager for each authentication, which is performed for every page refresh.
415 if checkIPSetting: 416 self.env.config.set('trac', 'check_auth_ip', False) 417 418 name = auth.LoginModule._get_name_for_cookie(self, req, cookie) 419 420 if checkIPSetting: 421 # Re-enable IP checking 422 self.env.config.set('trac', 'check_auth_ip', True) 423
and in guard.py:
54 def __init__(self): 55 # Adjust related values to promote a sane configuration, because the 56 # combination of some default values is not meaningful. 57 cfg = self.env.config 58 if self.login_attempt_max_count < 1 and \ 59 self.user_lock_max_time != 0: 60 cfg.set('account-manager', 'login_attempt_max_count', 0) 61 options = ['user_lock_time', 'user_lock_max_time', 62 'user_lock_time_progression'] 63 for option in options: 64 cfg.remove('account-manager', option) 65 elif self.user_lock_max_time < 1: 66 cfg.set('account-manager', 'user_lock_max_time', 67 self.env.config.defaults().get( 68 'account-manager')['user_lock_max_time'])
Now, in order to skip this problem, I have to turn off the persistent session and set a value for login_attempt_max_count.
Please help check, thanks!
Change History (6)
comment:4 in reply to: ↑ 3 Changed 9 months ago by hasienda
- Keywords environment reload added
- Resolution set to duplicate
- Status changed from new to closed
- Trac Release changed from 1.0 to 0.11