Statistics
| Branch: | Tag: | Revision:

root / snf-pithos-app / pithos / api / settings.py @ bcfd8e6b

History | View | Annotate | Download (3.7 kB)

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

    
4
AUTHENTICATION_URL = getattr(settings, 'PITHOS_AUTHENTICATION_URL',
5
                             'https://accounts.example.synnefo.org/im/authenticate/')
6
AUTHENTICATION_USERS = getattr(settings, 'PITHOS_AUTHENTICATION_USERS', {})
7
ASTAKOS_URL = AUTHENTICATION_URL.replace("im/authenticate/", "")
8

    
9
COOKIE_NAME = getattr(settings, 'PITHOS_ASTAKOS_COOKIE_NAME', '_pithos2_a')
10

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

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

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

    
30
# Default setting for new accounts.
31
BACKEND_QUOTA = getattr(
32
    settings, 'PITHOS_BACKEND_QUOTA', 50 * 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
# Update object checksums when using hashmaps.
37
UPDATE_MD5 = getattr(settings, 'PITHOS_UPDATE_MD5', True)
38

    
39
# Service Token acquired by identity provider.
40
SERVICE_TOKEN = getattr(settings, 'PITHOS_SERVICE_TOKEN', '')
41

    
42
RADOS_STORAGE = getattr(settings, 'PITHOS_RADOS_STORAGE', False)
43
RADOS_POOL_BLOCKS= getattr(settings, 'PITHOS_RADOS_POOL_BLOCKS', 'blocks')
44
RADOS_POOL_MAPS = getattr(settings, 'PITHOS_RADOS_POOL_MAPS', 'maps')
45

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

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

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

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

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