Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / settings.py @ ee45eb81

History | View | Annotate | Download (12.1 kB)

1
from django.conf import settings
2

    
3
# Set the expiration time of newly created auth tokens
4
# to be this many hours after their creation time.
5
AUTH_TOKEN_DURATION = getattr(settings, 'ASTAKOS_AUTH_TOKEN_DURATION', 30 * 24)
6

    
7
# Authenticate via Twitter.
8
TWITTER_TOKEN = getattr(settings, 'ASTAKOS_TWITTER_TOKEN', '')
9
TWITTER_SECRET = getattr(settings, 'ASTAKOS_TWITTER_SECRET', '')
10

    
11
DEFAULT_USER_LEVEL = getattr(settings, 'ASTAKOS_DEFAULT_USER_LEVEL', 4)
12

    
13
INVITATIONS_PER_LEVEL = getattr(settings, 'ASTAKOS_INVITATIONS_PER_LEVEL', {
14
    0: 100,
15
    1: 2,
16
    2: 0,
17
    3: 0,
18
    4: 0
19
})
20

    
21
# Address to use for outgoing emails
22
DEFAULT_CONTACT_EMAIL = getattr(
23
    settings, 'ASTAKOS_DEFAULT_CONTACT_EMAIL', 'support@cloud.grnet.gr')
24

    
25
# Identity Management enabled modules
26
# Supported modules are: 'local', 'twitter' and 'shibboleth'
27
IM_MODULES = getattr(settings, 'ASTAKOS_IM_MODULES', ['local'])
28

    
29
# Force user profile verification
30
FORCE_PROFILE_UPDATE = getattr(settings, 'ASTAKOS_FORCE_PROFILE_UPDATE', True)
31

    
32
#Enable invitations
33
INVITATIONS_ENABLED = getattr(settings, 'ASTAKOS_INVITATIONS_ENABLED', False)
34

    
35
COOKIE_NAME = getattr(settings, 'ASTAKOS_COOKIE_NAME', '_pithos2_a')
36
COOKIE_DOMAIN = getattr(settings, 'ASTAKOS_COOKIE_DOMAIN', None)
37
COOKIE_SECURE = getattr(settings, 'ASTAKOS_COOKIE_SECURE', True)
38

    
39
IM_STATIC_URL = getattr(settings, 'ASTAKOS_IM_STATIC_URL', '/static/im/')
40

    
41
# If set to False and invitations not enabled newly created user will be automatically accepted
42
MODERATION_ENABLED = getattr(settings, 'ASTAKOS_MODERATION_ENABLED', True)
43

    
44
# Set baseurl
45
BASEURL = getattr(settings, 'ASTAKOS_BASEURL', 'http://pithos.dev.grnet.gr')
46

    
47
# Set service name
48
SITENAME = getattr(settings, 'ASTAKOS_SITENAME', 'GRNET Cloud')
49

    
50
# Set recaptcha keys
51
RECAPTCHA_PUBLIC_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PUBLIC_KEY', '')
52
RECAPTCHA_PRIVATE_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PRIVATE_KEY', '')
53
RECAPTCHA_OPTIONS = getattr(settings, 'ASTAKOS_RECAPTCHA_OPTIONS',
54
                            {'theme': 'custom', 'custom_theme_widget': 'okeanos_recaptcha'})
55
RECAPTCHA_USE_SSL = getattr(settings, 'ASTAKOS_RECAPTCHA_USE_SSL', True)
56
RECAPTCHA_ENABLED = getattr(settings, 'ASTAKOS_RECAPTCHA_ENABLED', False)
57

    
58
# set AstakosUser fields to propagate in the billing system
59
BILLING_FIELDS = getattr(settings, 'ASTAKOS_BILLING_FIELDS', ['is_active'])
60

    
61
# Queue for billing.
62
QUEUE_CONNECTION = getattr(settings, 'ASTAKOS_QUEUE_CONNECTION', None)  # Example: 'rabbitmq://guest:guest@localhost:5672/astakos'
63

    
64
# Set where the user should be redirected after logout
65
LOGOUT_NEXT = getattr(settings, 'ASTAKOS_LOGOUT_NEXT', '')
66

    
67
# Set user email patterns that are automatically activated
68
RE_USER_EMAIL_PATTERNS = getattr(
69
    settings, 'ASTAKOS_RE_USER_EMAIL_PATTERNS', [])
70

    
71
# Messages to display on login page header
72
# e.g. {'warning': 'This warning message will be displayed on the top of login page'}
73
LOGIN_MESSAGES = getattr(settings, 'ASTAKOS_LOGIN_MESSAGES', [])
74

    
75
# Messages to display on login page header
76
# e.g. {'warning': 'This warning message will be displayed on the top of signup page'}
77
SIGNUP_MESSAGES = getattr(settings, 'ASTAKOS_SIGNUP_MESSAGES', [])
78

    
79
# Messages to display on login page header
80
# e.g. {'warning': 'This warning message will be displayed on the top of profile page'}
81
PROFILE_MESSAGES = getattr(settings, 'ASTAKOS_PROFILE_MESSAGES', [])
82

    
83
# Messages to display on all pages
84
# e.g. {'warning': 'This warning message will be displayed on the top of every page'}
85
GLOBAL_MESSAGES = getattr(settings, 'ASTAKOS_GLOBAL_MESSAGES', [])
86

    
87
# messages to display as extra actions in account forms
88
# e.g. {'https://cms.okeanos.grnet.gr/': 'Back to ~okeanos'}
89
PROFILE_EXTRA_LINKS = getattr(settings, 'ASTAKOS_PROFILE_EXTRA_LINKS', {})
90

    
91
# The number of unsuccessful login requests per minute allowed for a specific user
92
RATELIMIT_RETRIES_ALLOWED = getattr(
93
    settings, 'ASTAKOS_RATELIMIT_RETRIES_ALLOWED', 3)
94

    
95
# If False the email change mechanism is disabled
96
EMAILCHANGE_ENABLED = getattr(settings, 'ASTAKOS_EMAILCHANGE_ENABLED', False)
97

    
98
# Set the expiration time (in days) of email change requests
99
EMAILCHANGE_ACTIVATION_DAYS = getattr(
100
    settings, 'ASTAKOS_EMAILCHANGE_ACTIVATION_DAYS', 10)
101

    
102
# Set the astakos main functions logging severity (None to disable)
103
from logging import INFO
104
LOGGING_LEVEL = getattr(settings, 'ASTAKOS_LOGGING_LEVEL', INFO)
105

    
106
# Configurable email subjects
107
INVITATION_EMAIL_SUBJECT = getattr(
108
    settings, 'ASTAKOS_INVITATION_EMAIL_SUBJECT',
109
    'Invitation to %s alpha2 testing' % SITENAME)
110
GREETING_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_GREETING_EMAIL_SUBJECT',
111
                                 'Welcome to %s alpha2 testing' % SITENAME)
112
FEEDBACK_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_FEEDBACK_EMAIL_SUBJECT',
113
                                 'Feedback from %s alpha2 testing' % SITENAME)
114
VERIFICATION_EMAIL_SUBJECT = getattr(
115
    settings, 'ASTAKOS_VERIFICATION_EMAIL_SUBJECT',
116
    '%s alpha2 testing account activation is needed' % SITENAME)
117
ACCOUNT_CREATION_SUBJECT = getattr(
118
    settings, 'ASTAKOS_ACCOUNT_CREATION_SUBJECT',
119
    '%s alpha2 testing account created (%%(user)s)' % SITENAME)
120
GROUP_CREATION_SUBJECT = getattr(
121
    settings, 'ASTAKOS_GROUP_CREATION_SUBJECT',
122
    '%s alpha2 testing group created (%%(group)s)' % SITENAME)
123
HELPDESK_NOTIFICATION_EMAIL_SUBJECT = getattr(
124
    settings, 'ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT',
125
    '%s alpha2 testing account activated (%%(user)s)' % SITENAME)
126
EMAIL_CHANGE_EMAIL_SUBJECT = getattr(
127
    settings, 'ASTAKOS_EMAIL_CHANGE_EMAIL_SUBJECT',
128
    'Email change on %s alpha2 testing' % SITENAME)
129
PASSWORD_RESET_EMAIL_SUBJECT = getattr(
130
    settings, 'ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT',
131
    'Password reset on %s alpha2 testing' % SITENAME)
132
PROJECT_CREATION_SUBJECT = getattr(
133
    settings, 'ASTAKOS_PROJECT_CREATION_SUBJECT',
134
    '%s alpha2 testing project application created (%%(name)s)' % SITENAME)
135
PROJECT_APPROVED_SUBJECT = getattr(
136
    settings, 'ASTAKOS_PROJECT_APPROVED_SUBJECT',
137
    '%s alpha2 testing project application approved (%%(name)s)' % SITENAME)
138
PROJECT_TERMINATION_SUBJECT = getattr(
139
    settings, 'ASTAKOS_PROJECT_TERMINATION_SUBJECT',
140
    '%s alpha2 testing project terminated (%%(name)s)' % SITENAME)
141
PROJECT_SUSPENSION_SUBJECT = getattr(
142
    settings, 'ASTAKOS_PROJECT_SUSPENSION_SUBJECT',
143
    '%s alpha2 testing project suspended (%%(name)s)' % SITENAME)
144
PROJECT_MEMBERSHIP_CHANGE_SUBJECT = getattr(
145
    settings, 'ASTAKOS_PROJECT_MEMBERSHIP_CHANGE_SUBJECT',
146
    '%s alpha2 testing project membership changed (%%(name)s)' % SITENAME)
147

    
148
# Set the quota holder component URI
149
QUOTAHOLDER_URL = getattr(settings, 'ASTAKOS_QUOTAHOLDER_URL', '')
150
QUOTAHOLDER_TOKEN = getattr(settings, 'ASTAKOS_QUOTAHOLDER_TOKEN', '')
151

    
152
# Set the cloud service properties
153
SERVICES = getattr(settings, 'ASTAKOS_SERVICES', {
154
    'cyclades': {
155
        'url': 'https://node1.example.com/ui/',
156
        'resources': [{
157
            'name':'vm',
158
            'group':'compute',
159
            'uplimit':2,
160
            'desc': 'Number of virtual machines'
161
            },{
162
            'name':'disk',
163
            'group':'compute',
164
            'uplimit':30*1024*1024*1024,
165
            'unit':'bytes',
166
            'desc': 'Virtual machine disk size'
167
            },{
168
            'name':'cpu',
169
            'group':'compute',
170
            'uplimit':6,
171
            'desc': 'Number of virtual machine processors'
172
            },{
173
            'name':'ram',
174
            'group':'compute',
175
            'uplimit':6*1024*1024*1024,
176
            'unit':'bytes',
177
            'desc': 'Virtual machines'
178
            },{
179
            'name':'network.private',
180
            'group':'network',
181
            'uplimit':1,
182
            'desc': 'Private networks'
183
            }
184
        ]
185
    },
186
    'pithos+': {
187
        'url': 'https://node2.example.com/ui/',
188
        'resources':[{
189
            'name':'diskspace',
190
            'group':'storage',
191
            'uplimit':5 * 1024 * 1024 * 1024,
192
            'unit':'bytes',
193
            'desc': 'Pithos account diskspace'
194
            }]
195
    }
196
})
197

    
198
# Set the billing URI
199
AQUARIUM_URL = getattr(settings, 'ASTAKOS_AQUARIUM_URL', '')
200

    
201
# Set how many objects should be displayed per page
202
PAGINATE_BY = getattr(settings, 'ASTAKOS_PAGINATE_BY', 8)
203

    
204
# Set how many objects should be displayed per page in show all groups page
205
PAGINATE_BY_ALL = getattr(settings, 'ASTAKOS_PAGINATE_BY_ALL', 15)
206

    
207
# Enforce token renewal on password change/reset
208
NEWPASSWD_INVALIDATE_TOKEN = getattr(
209
    settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True)
210

    
211

    
212
RESOURCES_PRESENTATION_DATA = getattr(
213
    settings, 'ASTAKOS_RESOURCES_PRESENTATION_DATA', {
214
        'groups': {
215
             'compute': {
216
                'help_text':'Compute resources (amount of VMs, CPUs, RAM, System disk) ',
217
                'is_abbreviation':False,
218
                'report_desc':'',
219
                 'verbose_name':'compute',
220
            },
221
            'storage': {
222
                'help_text':'Storage resources (amount of space to store files on Pithos) ',
223
                'is_abbreviation':False,
224
                'report_desc':'',
225
                 'verbose_name':'storage',
226
            },
227
            'network': {
228
                'help_text':' Network resources (amount of Private Networks)  ',
229
                'is_abbreviation':False,
230
                'report_desc':'',
231
                'verbose_name':'network',
232
            },
233
        },
234
        'resources': {
235
            'pithos+.diskspace': {
236
                'help_text':'This is the space on Pithos for storing files and VM Images. ',
237
                'help_text_input_each':'This is the total amount of space on Pithos that will be granted to each user of this Project ',
238
                'is_abbreviation':False,
239
                'report_desc':'Storage Space',
240
                'placeholder':'eg. 10GB',
241
                'verbose_name':'Storage Space',
242
            },
243
            'cyclades.vm': {
244
                'help_text':'These are the VMs one can create on the Cyclades UI ',
245
                'help_text_input_each':'This is the total number of VMs that will be granted to each user of this Project ',
246
                'is_abbreviation':True,
247
                'report_desc':'Virtual Machines',
248
                'placeholder':'eg. 2',
249
                'verbose_name':'vm',
250
            },
251
            'cyclades.disk': {
252
                'help_text':'This is the System Disk that the VMs have that run the OS ',
253
                'help_text_input_each':"This is the total amount of System Disk that will be granted to each user of this Project (this refers to the total System Disk of all VMs, not each VM's System Disk)  ",
254
                'is_abbreviation':False,
255
                'report_desc':'System Disk',
256
                'placeholder':'eg. 5GB, 2GB etc',
257
                'verbose_name':'System Disk'
258
            },
259
            'cyclades.ram': {
260
                'help_text':'RAM used by VMs ',
261
                'help_text_input_each':'This is the total amount of RAM that will be granted to each user of this Project (on all VMs)  ',
262
                'is_abbreviation':True,
263
                'report_desc':'RAM',
264
                'placeholder':'eg. 4GB',
265
                'verbose_name':'ram'
266
            },
267
            'cyclades.cpu': {
268
                'help_text':'CPUs used by VMs ',
269
                'help_text_input_each':'This is the total number of CPUs that will be granted to each user of this Project (on all VMs)  ',
270
                'is_abbreviation':True,
271
                'report_desc':'CPUs',
272
                'placeholder':'eg. 1',
273
                'verbose_name':'cpu'
274
            },
275
            'cyclades.network.private': {
276
                'help_text':'These are the Private Networks one can create on the Cyclades UI. ',
277
                'help_text_input_each':'This is the total number of Private Networks that will be granted to each user of this Project ',
278
                'is_abbreviation':False,
279
                'report_desc':'Private Networks',
280
                'placeholder':'eg. 1',
281
                'verbose_name':'private network'
282
            }
283

    
284
        }
285

    
286
    })
287

    
288
# Permit local account migration
289
ENABLE_LOCAL_ACCOUNT_MIGRATION = getattr(settings, 'ASTAKOS_ENABLE_LOCAL_ACCOUNT_MIGRATION', True)
290

    
291
# Strict shibboleth usage
292
SHIBBOLETH_REQUIRE_NAME_INFO = getattr(settings,
293
                                       'ASTAKOS_SHIBBOLETH_REQUIRE_NAME_INFO',
294
                                       False)