wip quotaholder client in backend
[pithos] / snf-pithos-app / pithos / api / settings.py
index 57f5a78..6731669 100644 (file)
@@ -1,10 +1,8 @@
 #coding=utf8
+from django.conf import settings
 
-USE_X_FORWARDED_HOST = False
-
-# Either set local users here, or a remote host.
-# To disable local users set to None.
-AUTHENTICATION_USERS = {
+# Set local users, or a remote host. To disable local users set them to None.
+sample_users = {
     '0000': 'test',
     '0001': 'verigak',
     '0002': 'chazapis',
@@ -17,7 +15,42 @@ AUTHENTICATION_USERS = {
     '0009': 'διογένης'
 }
 
-# Where astakos is hosted.
-AUTHENTICATION_HOST = '127.0.0.1:10000'
+AUTHENTICATION_URL = getattr(settings, 'PITHOS_AUTHENTICATION_URL',
+                             'http://127.0.0.1:8000/im/authenticate')
+AUTHENTICATION_USERS = getattr(settings, 'PITHOS_AUTHENTICATION_USERS', {})
+
+COOKIE_NAME = getattr(settings, 'ASTAKOS_COOKIE_NAME', '_pithos2_a')
+
+# SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
+BACKEND_DB_MODULE = getattr(
+    settings, 'PITHOS_BACKEND_DB_MODULE', 'pithos.backends.lib.sqlalchemy')
+BACKEND_DB_CONNECTION = getattr(settings, 'PITHOS_BACKEND_DB_CONNECTION',
+                                'sqlite:////tmp/pithos-backend.db')
+
+# Block storage.
+BACKEND_BLOCK_MODULE = getattr(
+    settings, 'PITHOS_BACKEND_BLOCK_MODULE', 'pithos.backends.lib.hashfiler')
+BACKEND_BLOCK_PATH = getattr(
+    settings, 'PITHOS_BACKEND_BLOCK_PATH', '/tmp/pithos-data/')
+BACKEND_BLOCK_UMASK = getattr(settings, 'PITHOS_BACKEND_BLOCK_UMASK', 0o022)
+
+# Queue for billing.
+BACKEND_QUEUE_MODULE = getattr(settings, 'PITHOS_BACKEND_QUEUE_MODULE',
+                               None)  # Example: 'pithos.backends.lib.rabbitmq'
+BACKEND_QUEUE_HOSTS = getattr(settings, 'PITHOS_BACKEND_QUEUE_HOSTS', None) # Example: "['amqp://guest:guest@localhost:5672']"
+BACKEND_QUEUE_EXCHANGE = getattr(settings, 'PITHOS_BACKEND_QUEUE_EXCHANGE', 'pithos')
+
+# Default setting for new accounts.
+BACKEND_QUOTA = getattr(
+    settings, 'PITHOS_BACKEND_QUOTA', 50 * 1024 * 1024 * 1024)
+BACKEND_VERSIONING = getattr(settings, 'PITHOS_BACKEND_VERSIONING', 'auto')
+
+PITHOS_QUOTAHOLDER_URL = getattr(settings,
+                                'PITHOS_QUOTAHOLDER_URL',
+                                'http://127.0.0.1/api/quotaholder/v')
+
+# Update object checksums when using hashmaps.
+UPDATE_MD5 = getattr(settings, 'PITHOS_UPDATE_MD5', True)
 
-TEST = False
+# Service Token acquired by identity provider.
+SERVICE_TOKEN = getattr(settings, 'PITHOS_SERVICE_TOKEN', '')