root / snf-pithos-app / pithos / api / settings.py @ a5fbc00d
History | View | Annotate | Download (3.5 kB)
1 |
#coding=utf8
|
---|---|
2 |
from django.conf import settings |
3 |
from urlparse import urljoin |
4 |
|
5 |
ASTAKOS_URL = getattr(settings, "ASTAKOS_URL", |
6 |
"https://accounts.example.synnefo.org/")
|
7 |
|
8 |
COOKIE_NAME = getattr(settings, 'PITHOS_ASTAKOS_COOKIE_NAME', '_pithos2_a') |
9 |
|
10 |
# SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
|
11 |
BACKEND_DB_MODULE = getattr(
|
12 |
settings, 'PITHOS_BACKEND_DB_MODULE', 'pithos.backends.lib.sqlalchemy') |
13 |
BACKEND_DB_CONNECTION = getattr(settings, 'PITHOS_BACKEND_DB_CONNECTION', |
14 |
'sqlite:////tmp/pithos-backend.db')
|
15 |
|
16 |
# Block storage.
|
17 |
BACKEND_BLOCK_MODULE = getattr(
|
18 |
settings, 'PITHOS_BACKEND_BLOCK_MODULE', 'pithos.backends.lib.hashfiler') |
19 |
BACKEND_BLOCK_PATH = getattr(
|
20 |
settings, 'PITHOS_BACKEND_BLOCK_PATH', '/tmp/pithos-data/') |
21 |
BACKEND_BLOCK_UMASK = getattr(settings, 'PITHOS_BACKEND_BLOCK_UMASK', 0o022) |
22 |
|
23 |
# Queue for billing.
|
24 |
BACKEND_QUEUE_MODULE = getattr(settings, 'PITHOS_BACKEND_QUEUE_MODULE', |
25 |
None) # Example: 'pithos.backends.lib.rabbitmq' |
26 |
BACKEND_QUEUE_HOSTS = getattr(settings, 'PITHOS_BACKEND_QUEUE_HOSTS', None) # Example: "['amqp://guest:guest@localhost:5672']" |
27 |
BACKEND_QUEUE_EXCHANGE = getattr(settings, 'PITHOS_BACKEND_QUEUE_EXCHANGE', 'pithos') |
28 |
|
29 |
# Default setting for new accounts.
|
30 |
BACKEND_ACCOUNT_QUOTA = getattr(
|
31 |
settings, 'PITHOS_BACKEND_ACCOUNT_QUOTA', 50 * 1024 * 1024 * 1024) |
32 |
BACKEND_CONTAINER_QUOTA = getattr(
|
33 |
settings, 'PITHOS_BACKEND_CONTAINER_QUOTA', 0) |
34 |
BACKEND_VERSIONING = getattr(settings, 'PITHOS_BACKEND_VERSIONING', 'auto') |
35 |
BACKEND_FREE_VERSIONING = getattr(settings, 'PITHOS_BACKEND_FREE_VERSIONING', True) |
36 |
|
37 |
# Default backend pool size
|
38 |
BACKEND_POOL_SIZE = getattr(settings, 'PITHOS_BACKEND_POOL_SIZE', 5) |
39 |
|
40 |
# Update object checksums.
|
41 |
UPDATE_MD5 = getattr(settings, 'PITHOS_UPDATE_MD5', False) |
42 |
|
43 |
# Service Token acquired by identity provider.
|
44 |
SERVICE_TOKEN = getattr(settings, 'PITHOS_SERVICE_TOKEN', '') |
45 |
|
46 |
RADOS_STORAGE = getattr(settings, 'PITHOS_RADOS_STORAGE', False) |
47 |
RADOS_POOL_BLOCKS= getattr(settings, 'PITHOS_RADOS_POOL_BLOCKS', 'blocks') |
48 |
RADOS_POOL_MAPS = getattr(settings, 'PITHOS_RADOS_POOL_MAPS', 'maps') |
49 |
|
50 |
# This enables a ui compatibility layer for the introduction of UUIDs in
|
51 |
# identity management. WARNING: Setting to True will break your installation.
|
52 |
TRANSLATE_UUIDS = getattr(settings, 'PITHOS_TRANSLATE_UUIDS', False) |
53 |
|
54 |
# Set PROXY_USER_SERVICES to True to have snf-pithos-app handle all Astakos
|
55 |
# user-visible services (feedback, login, etc.) by proxying them to a running
|
56 |
# Astakos.
|
57 |
# Set to False if snf astakos-app is running on the same machine, so it handles
|
58 |
# the requests on its own.
|
59 |
PROXY_USER_SERVICES = getattr(settings, 'PITHOS_PROXY_USER_SERVICES', True) |
60 |
|
61 |
USER_CATALOG_URL = urljoin(ASTAKOS_URL, "user_catalogs")
|
62 |
USER_FEEDBACK_URL = urljoin(ASTAKOS_URL, "feedback")
|
63 |
USER_LOGIN_URL = urljoin(ASTAKOS_URL, "login")
|
64 |
|
65 |
# Set the quota holder component URI
|
66 |
USE_QUOTAHOLDER = getattr(settings, 'PITHOS_USE_QUOTAHOLDER', False) |
67 |
QUOTAHOLDER_URL = getattr(settings, 'PITHOS_QUOTAHOLDER_URL', '') |
68 |
QUOTAHOLDER_TOKEN = getattr(settings, 'PITHOS_QUOTAHOLDER_TOKEN', '') |
69 |
QUOTAHOLDER_POOLSIZE = getattr(settings, 'PITHOS_QUOTAHOLDER_POOLSIZE', 200) |
70 |
|
71 |
# Set how many random bytes to use for constructing the URL of Pithos public files
|
72 |
PUBLIC_URL_SECURITY = getattr(settings, 'PITHOS_PUBLIC_URL_SECURITY', 16) |
73 |
# Set the alphabet to use for constructing the URL of Pithos public files
|
74 |
PUBLIC_URL_ALPHABET = getattr(
|
75 |
settings, |
76 |
'PITHOS_PUBLIC_URL_ALPHABET',
|
77 |
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
78 |
) |