Is there any way to change the timeout of the cobbler web session?
David J. Bolles Systems Administrator 471-0447
The only way at this time is to modify the timeout setting in the remote.py file. I have been meaning to make this configurable for some time, so if you want to tackle adding that to the settings feel free.
On Wed, Aug 14, 2013 at 10:17 AM, Bolles, David J < d.bolles@austin.utexas.edu> wrote:
Is there any way to change the timeout of the cobbler web session? ****
David J. Bolles****
Systems Administrator****
471-0447****
cobbler mailing list cobbler@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/cobbler
Thanks, I was able to change the session timeout from that. I wouldn't know how to make this more configurable, but I appreciate the help.
David B.
The only way at this time is to modify the timeout setting in the remote.py file. I have been meaning to make this configurable for some time, so if you want to tackle adding that to the settings feel free. On Wed, Aug 14, 2013 at 10:17 AM, Bolles, David J <d.bolles@austin.utexas.edumailto:d.bolles@austin.utexas.edu> wrote: Is there any way to change the timeout of the cobbler web session?
_______________________________________________ cobbler mailing list cobbler@lists.fedorahosted.orgmailto:cobbler@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/cobbler
On 08/14/2013 10:45 AM, James Cammarata wrote:
The only way at this time is to modify the timeout setting in the remote.py file. I have been meaning to make this configurable for some time, so if you want to tackle adding that to the settings feel free.
I started to take a look at this, but it seems fairly complicated. I'm not even sure how the CobblerXMLRPCInterface class is initialized elsewhere to see how to pass in the needed configuration.
The CobblerXMLRPCInterface class is instantiated with an api object, which has access to the settings. So what would be required is:
1) add the setting to settings.py (and a default value in the config/settings file) 2) modify remote.py to use self.api.settings().the_new_var_name instead of TOKEN_TIMEOUT.
Removing the other hard-coded _TIMEOUT settings would be nice too (though no one ever complains about those).
On Thu, Aug 15, 2013 at 10:45 AM, Orion Poplawski orion@cora.nwra.comwrote:
On 08/14/2013 10:45 AM, James Cammarata wrote:
The only way at this time is to modify the timeout setting in the remote.py file. I have been meaning to make this configurable for some time, so if you want to tackle adding that to the settings feel free.
I started to take a look at this, but it seems fairly complicated. I'm not even sure how the CobblerXMLRPCInterface class is initialized elsewhere to see how to pass in the needed configuration.
-- Orion Poplawski Technical Manager 303-415-9701 x222 NWRA, Boulder/CoRA Office FAX: 303-415-9702 3380 Mitchell Lane orion@nwra.com Boulder, CO 80301 http://www.nwra.com ______________________________**_________________ cobbler mailing list cobbler@lists.fedorahosted.org https://lists.fedorahosted.**org/mailman/listinfo/cobblerhttps://lists.fedorahosted.org/mailman/listinfo/cobbler
On 08/15/2013 09:55 AM, James Cammarata wrote:
The CobblerXMLRPCInterface class is instantiated with an api object, which has access to the settings. So what would be required is:
- add the setting to settings.py (and a default value in the config/settings
file) 2) modify remote.py to use self.api.settings().the_new_var_name instead of TOKEN_TIMEOUT.
How does this seem?
diff --git a/cobbler/remote.py b/cobbler/remote.py index dded424..042c311 100644 --- a/cobbler/remote.py +++ b/cobbler/remote.py @@ -49,8 +49,6 @@ import utils from utils import _ import configgen
-# FIXME: make configurable? -TOKEN_TIMEOUT = 60*60 # 60 minutes EVENT_TIMEOUT = 7*24*60*60 # 1 week CACHE_TIMEOUT = 10*60 # 10 minutes
@@ -1710,7 +1708,7 @@ class CobblerXMLRPCInterface: timenow = time.time() for token in self.token_cache.keys(): (tokentime, user) = self.token_cache[token] - if (timenow > tokentime + TOKEN_TIMEOUT): + if (timenow > tokentime + self.api.settings().auth_token_expiration): self._log("expiring token",token=token,debug=True) del self.token_cache[token] # and also expired objects diff --git a/cobbler/settings.py b/cobbler/settings.py index ba5c953..393018c 100644 --- a/cobbler/settings.py +++ b/cobbler/settings.py @@ -39,6 +39,7 @@ DEFAULTS = { "allow_duplicate_macs" : [0,"bool"], "allow_duplicate_ips" : [0,"bool"], "allow_dynamic_settings" : [0,"bool"], + "auth_token_expiration" : [3600,"int"], "bind_chroot_path" : ["","str"], "bind_master" : ["127.0.0.1","str"], "build_reporting_enabled" : [0,"bool"], diff --git a/config/settings b/config/settings index 9f04362..d5d4a12 100644 --- a/config/settings +++ b/config/settings @@ -39,6 +39,9 @@ anamon_enabled: 0 # The default value is "login". authn_pam_service: "login"
+# How long the authentication token is valid for, in seconds +auth_token_expiration: 3600 + # Email out a report when cobbler finishes installing a system. # enabled: set to 1 to turn this feature on # sender: optional
I can make a pull request if this seems reasonable.
Removing the other hard-coded _TIMEOUT settings would be nice too (though no one ever complains about those).
Yeah, I was wondering about that.
Yep that looks about right. Go ahead and send a pull request and I'll test it out.
On Thu, Aug 15, 2013 at 12:22 PM, Orion Poplawski orion@cora.nwra.comwrote:
On 08/15/2013 09:55 AM, James Cammarata wrote:
The CobblerXMLRPCInterface class is instantiated with an api object, which has access to the settings. So what would be required is:
- add the setting to settings.py (and a default value in the
config/settings file) 2) modify remote.py to use self.api.settings().the_new_**var_name instead of TOKEN_TIMEOUT.
How does this seem?
diff --git a/cobbler/remote.py b/cobbler/remote.py index dded424..042c311 100644 --- a/cobbler/remote.py +++ b/cobbler/remote.py @@ -49,8 +49,6 @@ import utils from utils import _ import configgen
-# FIXME: make configurable? -TOKEN_TIMEOUT = 60*60 # 60 minutes EVENT_TIMEOUT = 7*24*60*60 # 1 week CACHE_TIMEOUT = 10*60 # 10 minutes
@@ -1710,7 +1708,7 @@ class CobblerXMLRPCInterface: timenow = time.time() for token in self.token_cache.keys(): (tokentime, user) = self.token_cache[token]
if (timenow > tokentime + TOKEN_TIMEOUT):
if (timenow > tokentime + self.api.settings().auth_**
token_expiration): self._log("expiring token",token=token,debug=True) del self.token_cache[token] # and also expired objects diff --git a/cobbler/settings.py b/cobbler/settings.py index ba5c953..393018c 100644 --- a/cobbler/settings.py +++ b/cobbler/settings.py @@ -39,6 +39,7 @@ DEFAULTS = { "allow_duplicate_macs" : [0,"bool"], "allow_duplicate_ips" : [0,"bool"], "allow_dynamic_settings" : [0,"bool"],
- "auth_token_expiration" : [3600,"int"], "bind_chroot_path" : ["","str"], "bind_master" : ["127.0.0.1","str"], "build_reporting_enabled" : [0,"bool"],
diff --git a/config/settings b/config/settings index 9f04362..d5d4a12 100644 --- a/config/settings +++ b/config/settings @@ -39,6 +39,9 @@ anamon_enabled: 0 # The default value is "login". authn_pam_service: "login"
+# How long the authentication token is valid for, in seconds +auth_token_expiration: 3600
# Email out a report when cobbler finishes installing a system. # enabled: set to 1 to turn this feature on # sender: optional
I can make a pull request if this seems reasonable.
Removing the other hard-coded _TIMEOUT settings would be nice too (though
no one ever complains about those).
Yeah, I was wondering about that.
-- Orion Poplawski Technical Manager 303-415-9701 x222 NWRA, Boulder/CoRA Office FAX: 303-415-9702 3380 Mitchell Lane orion@nwra.com Boulder, CO 80301 http://www.nwra.com ______________________________**_________________ cobbler mailing list cobbler@lists.fedorahosted.org https://lists.fedorahosted.**org/mailman/listinfo/cobblerhttps://lists.fedorahosted.org/mailman/listinfo/cobbler
cobbler@lists.fedorahosted.org