Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (3.6 kB)

1
#coding=utf8
2
from django.conf import settings
3
from synnefo.lib import parse_base_url
4

    
5
# Top-level URL for Pithos. Must set.
6
BASE_URL = getattr(settings, 'PITHOS_BASE_URL',
7
                   "https://pithos.example.synnefo.org/")
8

    
9
BASE_HOST, BASE_PATH = parse_base_url(BASE_URL)
10

    
11
ASTAKOS_BASE_URL = getattr(settings, 'ASTAKOS_BASE_URL',
12
                           "https://accounts.example.synnefo.org/")
13

    
14
ASTAKOS_BASE_HOST, ASTAKOS_BASE_PATH = parse_base_url(ASTAKOS_BASE_URL)
15

    
16
BASE_ASTAKOS_PROXY_PATH = getattr(settings, 'PITHOS_BASE_ASTAKOS_PROXY_PATH',
17
                                  ASTAKOS_BASE_PATH)
18

    
19
ASTAKOS_ACCOUNTS_PREFIX = getattr(settings, 'ASTAKOS_ACCOUNTS_PREFIX',
20
                                  'accounts')
21

    
22
ASTAKOSCLIENT_POOLSIZE = getattr(settings, 'PITHOS_ASTAKOSCLIENT_POOLSIZE', 200)
23

    
24
COOKIE_NAME = getattr(settings, 'PITHOS_ASTAKOS_COOKIE_NAME', '_pithos2_a')
25

    
26
# SQLAlchemy (choose SQLite/MySQL/PostgreSQL).
27
BACKEND_DB_MODULE = getattr(
28
    settings, 'PITHOS_BACKEND_DB_MODULE', 'pithos.backends.lib.sqlalchemy')
29
BACKEND_DB_CONNECTION = getattr(settings, 'PITHOS_BACKEND_DB_CONNECTION',
30
                                'sqlite:////tmp/pithos-backend.db')
31

    
32
# Block storage.
33
BACKEND_BLOCK_MODULE = getattr(
34
    settings, 'PITHOS_BACKEND_BLOCK_MODULE', 'pithos.backends.lib.hashfiler')
35
BACKEND_BLOCK_PATH = getattr(
36
    settings, 'PITHOS_BACKEND_BLOCK_PATH', '/tmp/pithos-data/')
37
BACKEND_BLOCK_UMASK = getattr(settings, 'PITHOS_BACKEND_BLOCK_UMASK', 0o022)
38

    
39
# Queue for billing.
40
BACKEND_QUEUE_MODULE = getattr(settings, 'PITHOS_BACKEND_QUEUE_MODULE',
41
                               None)  # Example: 'pithos.backends.lib.rabbitmq'
42
BACKEND_QUEUE_HOSTS = getattr(settings, 'PITHOS_BACKEND_QUEUE_HOSTS', None) # Example: "['amqp://guest:guest@localhost:5672']"
43
BACKEND_QUEUE_EXCHANGE = getattr(settings, 'PITHOS_BACKEND_QUEUE_EXCHANGE', 'pithos')
44

    
45
# Default setting for new accounts.
46
BACKEND_ACCOUNT_QUOTA = getattr(
47
    settings, 'PITHOS_BACKEND_ACCOUNT_QUOTA', 50 * 1024 * 1024 * 1024)
48
BACKEND_CONTAINER_QUOTA = getattr(
49
    settings, 'PITHOS_BACKEND_CONTAINER_QUOTA', 0)
50
BACKEND_VERSIONING = getattr(settings, 'PITHOS_BACKEND_VERSIONING', 'auto')
51
BACKEND_FREE_VERSIONING = getattr(settings, 'PITHOS_BACKEND_FREE_VERSIONING', True)
52

    
53
# Default backend pool size
54
BACKEND_POOL_SIZE = getattr(settings, 'PITHOS_BACKEND_POOL_SIZE', 5)
55

    
56
# Update object checksums.
57
UPDATE_MD5 = getattr(settings, 'PITHOS_UPDATE_MD5', False)
58

    
59
# Service Token acquired by identity provider.
60
SERVICE_TOKEN = getattr(settings, 'PITHOS_SERVICE_TOKEN', '')
61

    
62
RADOS_STORAGE = getattr(settings, 'PITHOS_RADOS_STORAGE', False)
63
RADOS_POOL_BLOCKS= getattr(settings, 'PITHOS_RADOS_POOL_BLOCKS', 'blocks')
64
RADOS_POOL_MAPS = getattr(settings, 'PITHOS_RADOS_POOL_MAPS', 'maps')
65

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

    
70
# Set PROXY_USER_SERVICES to True to have snf-pithos-app handle all Astakos
71
# user-visible services (feedback, login, etc.) by proxying them to a running
72
# Astakos.
73
# Set to False if snf astakos-app is running on the same machine, so it handles
74
# the requests on its own.
75
PROXY_USER_SERVICES = getattr(settings, 'PITHOS_PROXY_USER_SERVICES', True)
76

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