=== modified file 'lava_server/settings/common.py'
@@ -16,6 +16,7 @@
# You should have received a copy of the GNU Affero General Public License
# along with LAVA Server. If not, see <http://www.gnu.org/licenses/>.
+import lava_server.settings.crowd as crowd
# Administrator contact, used for sending
# emergency email when something breaks
@@ -120,11 +121,16 @@
'linaro_django_xmlrpc',
'lava_markitup', # Support app for MarkItUp in LAVA
'south',
- # Uncomment to enable Atlassian Crowd auth support.
- #'crowdrest',
'google_analytics',
]
+if crowd.enabled:
+ try:
+ import crowdrest
+ INSTALLED_APPS.append('crowdrest')
+ except ImportError:
+ pass
+
try:
import devserver
INSTALLED_APPS += ['devserver']
@@ -163,9 +169,9 @@
# Configuration settings for crowdrest.backend.CrowdRestBackend
# Alternatively, can be set in production config for particular installed
# instance.
-#AUTH_CROWD_APPLICATION_USER = 'appname'
-#AUTH_CROWD_APPLICATION_PASSWORD = 'apppass'
-#AUTH_CROWD_SERVER_REST_URI = 'https://crowd-server/crowd/rest/usermanagement/1'
+AUTH_CROWD_APPLICATION_USER = crowd.settings.get('username', 'appname')
+AUTH_CROWD_APPLICATION_PASSWORD = crowd.settings.get('password', 'apppass')
+AUTH_CROWD_SERVER_REST_URI = crowd.settings.get('apiurl', 'https://crowd-server/crowd/rest/usermanagement/1')
RESTRUCTUREDTEXT_FILTER_SETTINGS = {"initial_header_level": 4}
=== added file 'lava_server/settings/crowd.py'
@@ -0,0 +1,24 @@
+import os
+import yaml
+
+search_path = [
+ '/etc/lava-server/crowd.yaml'
+]
+
+if "VIRTUAL_ENV" in os.environ:
+ search_path.insert(0, os.path.join(os.environ["VIRTUAL_ENV"],
+ 'etc/lava-server/crowd.yaml'))
+
+config_file = None
+
+for f in search_path:
+ if os.path.exists(f):
+ config_file = f
+ break
+
+enabled = (config_file is not None)
+
+settings = {}
+
+if config_file:
+ settings = yaml.load(open(config_file))
=== modified file 'setup.py'
@@ -73,10 +73,9 @@
'south >= 0.7.3',
'versiontools >= 1.8',
'markdown >= 2.0.3',
- # Disabled by default, as most people don't need
- # Atlassian Crowd auth. Handled on the level of
- # buildout.cfg instead.
- #'django-crowd-rest-backend >= 0.3',
+
+ # optional dependency; for authentication with Attlassian Crowd SSO
+ # 'django-crowd-rest-backend >= 0.3,
],
setup_requires=[
'versiontools >= 1.8',