From 3ad2a84d555e0024b701803674c21607cdfd6ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez?= Date: Thu, 23 Jan 2014 06:01:29 +0000 Subject: [PATCH] changed security var "allow web access" to a simpler one that can easily be used from command line --- server/src/uds/core/util/Config.py | 2 +- server/src/uds/migrations/0018_security_config.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/src/uds/core/util/Config.py b/server/src/uds/core/util/Config.py index 602a4712..f3881a5d 100644 --- a/server/src/uds/core/util/Config.py +++ b/server/src/uds/core/util/Config.py @@ -204,7 +204,7 @@ class GlobalConfig(object): # Superuser password (do not need to be at database!!!) SUPER_USER_PASS = Config.section(SECURITY_SECTION).valueCrypt('rootPass', 'udsmam0') # Idle time before closing session on admin - SUPER_USER_ALLOW_WEBACCESS = Config.section(SECURITY_SECTION).value('Allow root web access', '1') + SUPER_USER_ALLOW_WEBACCESS = Config.section(SECURITY_SECTION).value('allowRootWebAccess', '1') # Time an admi session can be idle before being "logged out" ADMIN_IDLE_TIME = Config.section(GLOBAL_SECTION).value('adminIdleTime', '14400') # Defaults to 4 hous # Time betwen checks of unused services by os managers diff --git a/server/src/uds/migrations/0018_security_config.py b/server/src/uds/migrations/0018_security_config.py index 29f36891..8ebb5c2e 100644 --- a/server/src/uds/migrations/0018_security_config.py +++ b/server/src/uds/migrations/0018_security_config.py @@ -6,6 +6,8 @@ from django.db import models from uds.core.util.Config import GLOBAL_SECTION, SECURITY_SECTION +configKeys = ['superUser', 'rootPass', 'adminIdleTime', 'allowRootWebAccess', 'userSessionLength' ] + class Migration(DataMigration): def forwards(self, orm): @@ -15,15 +17,15 @@ class Migration(DataMigration): # and orm['appname.ModelName'] for models in other applications. if not db.dry_run: # Remove existing secirity values if they exists before "migrating" global ones - orm.Config.objects.filter(section=SECURITY_SECTION,key__in=['superUser', 'rootPass', 'adminIdleTime', 'Allow root web access', 'userSessionLength' ]).delete() - orm.Config.objects.filter(section=GLOBAL_SECTION,key__in=['superUser', 'rootPass', 'adminIdleTime', 'Allow root web access', 'userSessionLength' ]).update(section=SECURITY_SECTION) + orm.Config.objects.filter(section=SECURITY_SECTION,key__in=configKeys).delete() + orm.Config.objects.filter(section=GLOBAL_SECTION,key__in=configKeys).update(section=SECURITY_SECTION) def backwards(self, orm): "Write your backwards methods here." if not db.dry_run: # Remove existing global existing values if they exists before "migrating back" security ones - orm.Config.objects.filter(section=GLOBAL_SECTION,key__in=['superUser', 'rootPass', 'adminIdleTime', 'Allow root web access', 'userSessionLength' ]).delete() - orm.Config.objects.filter(section=SECURITY_SECTION,key__in=['superUser', 'rootPass', 'adminIdleTime', 'Allow root web access', 'userSessionLength' ]).update(section=GLOBAL_SECTION) + orm.Config.objects.filter(section=GLOBAL_SECTION,key__in=configKeys).delete() + orm.Config.objects.filter(section=SECURITY_SECTION,key__in=configKeys).update(section=GLOBAL_SECTION) models = { u'uds.authenticator': {