Beispiel #1
0
    def SECRET_KEY(self):
        """
        See: http://docs.djangoproject.com/en/1.2/ref/settings/#secret-key

        The key is obtained from ``secret_key`` configuration file that may be
        overwritten on first use (it will be regenerated when corrupted or
        missing)
        """
        pathname = self._get_pathname("secret_key")
        return get_secret_key(pathname)
Beispiel #2
0
    def SECRET_KEY(self):
        """
        See: http://docs.djangoproject.com/en/1.2/ref/settings/#secret-key

        The key is obtained from ``secret_key`` configuration file that may be
        overwritten on first use (it will be regenerated when corrupted or
        missing)
        """
        pathname = self._get_pathname("secret_key")
        return get_secret_key(pathname)
Beispiel #3
0
# Load default database from distro integration
config = ConfigFile.load("/etc/lava-server/instance.conf")
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": getattr(config, "LAVA_DB_NAME", ""),
        "USER": getattr(config, "LAVA_DB_USER", ""),
        "PASSWORD": getattr(config, "LAVA_DB_PASSWORD", ""),
        "HOST": getattr(config, "LAVA_DB_SERVER", "127.0.0.1"),
        "PORT": getattr(config, "LAVA_DB_PORT", ""),
    }
}

# Load secret key from distro integration
SECRET_KEY = get_secret_key("/etc/lava-server/secret_key.conf")

# LDAP authentication config
if AUTH_LDAP_SERVER_URI:
    INSTALLED_APPS.append("ldap")
    INSTALLED_APPS.append("django_auth_ldap")
    import ldap
    from django_auth_ldap.config import LDAPSearch, LDAPSearchUnion

    def get_ldap_group_types():
        """Return a list of all LDAP group types supported by django_auth_ldap module"""
        import django_auth_ldap.config
        import inspect

        types = []
        for name, obj in inspect.getmembers(django_auth_ldap.config):
Beispiel #4
0
    MANAGERS = tuple(tuple(v) for v in MANAGERS)
else:
    ADMINS = [tuple(v) for v in ADMINS]
    MANAGERS = [tuple(v) for v in MANAGERS]

# Load default database from distro integration
config = ConfigFile.load("/etc/lava-server/instance.conf")
DATABASES = {"default": {"ENGINE": "django.db.backends.postgresql_psycopg2",
                         "NAME": getattr(config, "LAVA_DB_NAME", ""),
                         "USER": getattr(config, "LAVA_DB_USER", ""),
                         "PASSWORD": getattr(config, "LAVA_DB_PASSWORD", ""),
                         "HOST": getattr(config, "LAVA_DB_SERVER", "127.0.0.1"),
                         "PORT": getattr(config, "LAVA_DB_PORT", ""), }}

# Load secret key from distro integration
SECRET_KEY = get_secret_key("/etc/lava-server/secret_key.conf")

# LDAP authentication config
if AUTH_LDAP_SERVER_URI:
    INSTALLED_APPS.append('ldap')
    INSTALLED_APPS.append('django_auth_ldap')
    import ldap
    from django_auth_ldap.config import (LDAPSearch, LDAPSearchUnion)

    def get_ldap_group_types():
        """Return a list of all LDAP group types supported by django_auth_ldap module"""
        import django_auth_ldap.config
        import inspect
        types = []
        for name, obj in inspect.getmembers(django_auth_ldap.config):
            if inspect.isclass(obj) and name.endswith('Type'):