Statistics
| Branch: | Tag: | Revision:

root / snf-pithos-app / pithos / api / settings.py @ 19ddd41b

History | View | Annotate | Download (3.7 kB)

1
#coding=utf8
2
from django.conf import settings
3

    
4
ASTAKOS_URL = getattr(settings, "ASTAKOS_URL",
5
                      "https://accounts.example.synnefo.org/")
6

    
7
COOKIE_NAME = getattr(settings, 'PITHOS_ASTAKOS_COOKIE_NAME', '_pithos2_a')
8

    
9
# SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
10
BACKEND_DB_MODULE = getattr(
11
    settings, 'PITHOS_BACKEND_DB_MODULE', 'pithos.backends.lib.sqlalchemy')
12
BACKEND_DB_CONNECTION = getattr(settings, 'PITHOS_BACKEND_DB_CONNECTION',
13
                                'sqlite:////tmp/pithos-backend.db')
14

    
15
# Block storage.
16
BACKEND_BLOCK_MODULE = getattr(
17
    settings, 'PITHOS_BACKEND_BLOCK_MODULE', 'pithos.backends.lib.hashfiler')
18
BACKEND_BLOCK_PATH = getattr(
19
    settings, 'PITHOS_BACKEND_BLOCK_PATH', '/tmp/pithos-data/')
20
BACKEND_BLOCK_UMASK = getattr(settings, 'PITHOS_BACKEND_BLOCK_UMASK', 0o022)
21

    
22
# Queue for billing.
23
BACKEND_QUEUE_MODULE = getattr(settings, 'PITHOS_BACKEND_QUEUE_MODULE',
24
                               None)  # Example: 'pithos.backends.lib.rabbitmq'
25
BACKEND_QUEUE_HOSTS = getattr(settings, 'PITHOS_BACKEND_QUEUE_HOSTS', None) # Example: "['amqp://guest:guest@localhost:5672']"
26
BACKEND_QUEUE_EXCHANGE = getattr(settings, 'PITHOS_BACKEND_QUEUE_EXCHANGE', 'pithos')
27

    
28
# Default setting for new accounts.
29
BACKEND_ACCOUNT_QUOTA = getattr(
30
    settings, 'PITHOS_BACKEND_ACCOUNT_QUOTA', 50 * 1024 * 1024 * 1024)
31
BACKEND_CONTAINER_QUOTA = getattr(
32
    settings, 'PITHOS_BACKEND_CONTAINER_QUOTA', 50 * 1024 * 1024 * 1024 * 1024)
33
BACKEND_VERSIONING = getattr(settings, 'PITHOS_BACKEND_VERSIONING', 'auto')
34
BACKEND_FREE_VERSIONING = getattr(settings, 'PITHOS_BACKEND_FREE_VERSIONING', True)
35

    
36
# Default backend pool size
37
BACKEND_POOL_SIZE = getattr(settings, 'PITHOS_BACKEND_POOL_SIZE', 5)
38

    
39
# Update object checksums.
40
UPDATE_MD5 = getattr(settings, 'PITHOS_UPDATE_MD5', False)
41

    
42
# Service Token acquired by identity provider.
43
SERVICE_TOKEN = getattr(settings, 'PITHOS_SERVICE_TOKEN', '')
44

    
45
RADOS_STORAGE = getattr(settings, 'PITHOS_RADOS_STORAGE', False)
46
RADOS_POOL_BLOCKS= getattr(settings, 'PITHOS_RADOS_POOL_BLOCKS', 'blocks')
47
RADOS_POOL_MAPS = getattr(settings, 'PITHOS_RADOS_POOL_MAPS', 'maps')
48

    
49
# This enables a ui compatibility layer for the introduction of UUIDs in
50
# identity management.  WARNING: Setting to True will break your installation.
51
TRANSLATE_UUIDS = getattr(settings, 'PITHOS_TRANSLATE_UUIDS', False)
52

    
53
# Set PROXY_USER_SERVICES to True to have snf-pithos-app handle all Astakos
54
# user-visible services (feedback, login, etc.) by proxying them to a running
55
# Astakos.
56
# Set to False if snf astakos-app is running on the same machine, so it handles
57
# the requests on its own.
58
PROXY_USER_SERVICES = getattr(settings, 'PITHOS_PROXY_USER_SERVICES', True)
59

    
60
USER_CATALOG_URL = getattr(settings, 'PITHOS_USER_CATALOG_URL',
61
                           'https://accounts.example.synnefo.org/user_catalogs/')
62
USER_FEEDBACK_URL = getattr(settings, 'PITHOS_USER_FEEDBACK_URL',
63
                            'https://accounts.example.synnefo.org/feedback/')
64
USER_LOGIN_URL = getattr(settings, 'PITHOS_USER_LOGIN_URL',
65
                         'https://accounts.example.synnefo.org/login/')
66

    
67
# Set the quota holder component URI
68
USE_QUOTAHOLDER = getattr(settings, 'PITHOS_USE_QUOTAHOLDER', False)
69
QUOTAHOLDER_URL = getattr(settings, 'PITHOS_QUOTAHOLDER_URL', '')
70
QUOTAHOLDER_TOKEN = getattr(settings, 'PITHOS_QUOTAHOLDER_TOKEN', '')
71
QUOTAHOLDER_POOLSIZE = getattr(settings, 'PITHOS_QUOTAHOLDER_POOLSIZE', 200)
72

    
73
# Set how many random bytes to use for constructing the URL of Pithos public files
74
PUBLIC_URL_SECURITY =  getattr(settings, 'PITHOS_PUBLIC_URL_SECURITY', 16)
75
# Set the alphabet to use for constructing the URL of Pithos public files
76
PUBLIC_URL_ALPHABET =  getattr(
77
    settings,
78
    'PITHOS_PUBLIC_URL_ALPHABET',
79
    '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
80
)