Twitter client improvements
[astakos] / snf-astakos-app / astakos / im / settings.py
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 # OAuth2 Twitter credentials.
8 TWITTER_TOKEN = getattr(settings, 'ASTAKOS_TWITTER_TOKEN', '')
9 TWITTER_SECRET = getattr(settings, 'ASTAKOS_TWITTER_SECRET', '')
10 TWITTER_AUTH_FORCE_LOGIN = getattr(settings, 'ASTAKOS_TWITTER_AUTH_FORCE_LOGIN',
11                                   False)
12
13 DEFAULT_USER_LEVEL = getattr(settings, 'ASTAKOS_DEFAULT_USER_LEVEL', 4)
14
15 INVITATIONS_PER_LEVEL = getattr(settings, 'ASTAKOS_INVITATIONS_PER_LEVEL', {
16     0: 100,
17     1: 2,
18     2: 0,
19     3: 0,
20     4: 0
21 })
22
23 # Address to use for outgoing emails
24 DEFAULT_CONTACT_EMAIL = getattr(
25     settings, 'ASTAKOS_DEFAULT_CONTACT_EMAIL', 'support@cloud.grnet.gr')
26
27 # Identity Management enabled modules
28 # Supported modules are: 'local', 'twitter' and 'shibboleth'
29 IM_MODULES = getattr(settings, 'ASTAKOS_IM_MODULES', ['local'])
30
31 # Force user profile verification
32 FORCE_PROFILE_UPDATE = getattr(settings, 'ASTAKOS_FORCE_PROFILE_UPDATE', True)
33
34 #Enable invitations
35 INVITATIONS_ENABLED = getattr(settings, 'ASTAKOS_INVITATIONS_ENABLED', False)
36
37 COOKIE_NAME = getattr(settings, 'ASTAKOS_COOKIE_NAME', '_pithos2_a')
38 COOKIE_DOMAIN = getattr(settings, 'ASTAKOS_COOKIE_DOMAIN', None)
39 COOKIE_SECURE = getattr(settings, 'ASTAKOS_COOKIE_SECURE', True)
40
41 IM_STATIC_URL = getattr(settings, 'ASTAKOS_IM_STATIC_URL', '/static/im/')
42
43 # If set to False and invitations not enabled newly created user will be automatically accepted
44 MODERATION_ENABLED = getattr(settings, 'ASTAKOS_MODERATION_ENABLED', True)
45
46 # Set baseurl
47 BASEURL = getattr(settings, 'ASTAKOS_BASEURL', 'http://pithos.dev.grnet.gr')
48
49 # Set service name
50 SITENAME = getattr(settings, 'ASTAKOS_SITENAME', 'GRNET Cloud')
51
52 # Set recaptcha keys
53 RECAPTCHA_PUBLIC_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PUBLIC_KEY', '')
54 RECAPTCHA_PRIVATE_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PRIVATE_KEY', '')
55 RECAPTCHA_OPTIONS = getattr(settings, 'ASTAKOS_RECAPTCHA_OPTIONS',
56                             {'theme': 'custom', 'custom_theme_widget': 'okeanos_recaptcha'})
57 RECAPTCHA_USE_SSL = getattr(settings, 'ASTAKOS_RECAPTCHA_USE_SSL', True)
58 RECAPTCHA_ENABLED = getattr(settings, 'ASTAKOS_RECAPTCHA_ENABLED', False)
59
60 # set AstakosUser fields to propagate in the billing system
61 BILLING_FIELDS = getattr(settings, 'ASTAKOS_BILLING_FIELDS', ['is_active'])
62
63 # Queue for billing.
64 QUEUE_CONNECTION = getattr(settings, 'ASTAKOS_QUEUE_CONNECTION', None)  # Example: 'rabbitmq://guest:guest@localhost:5672/astakos'
65
66 # Set where the user should be redirected after logout
67 LOGOUT_NEXT = getattr(settings, 'ASTAKOS_LOGOUT_NEXT', '')
68
69 # Set user email patterns that are automatically activated
70 RE_USER_EMAIL_PATTERNS = getattr(
71     settings, 'ASTAKOS_RE_USER_EMAIL_PATTERNS', [])
72
73 # Messages to display on login page header
74 # e.g. {'warning': 'This warning message will be displayed on the top of login page'}
75 LOGIN_MESSAGES = getattr(settings, 'ASTAKOS_LOGIN_MESSAGES', [])
76
77 # Messages to display on login page header
78 # e.g. {'warning': 'This warning message will be displayed on the top of signup page'}
79 SIGNUP_MESSAGES = getattr(settings, 'ASTAKOS_SIGNUP_MESSAGES', [])
80
81 # Messages to display on login page header
82 # e.g. {'warning': 'This warning message will be displayed on the top of profile page'}
83 PROFILE_MESSAGES = getattr(settings, 'ASTAKOS_PROFILE_MESSAGES', [])
84
85 # Messages to display on all pages
86 # e.g. {'warning': 'This warning message will be displayed on the top of every page'}
87 GLOBAL_MESSAGES = getattr(settings, 'ASTAKOS_GLOBAL_MESSAGES', [])
88
89 # messages to display as extra actions in account forms
90 # e.g. {'https://cms.okeanos.grnet.gr/': 'Back to ~okeanos'}
91 PROFILE_EXTRA_LINKS = getattr(settings, 'ASTAKOS_PROFILE_EXTRA_LINKS', {})
92
93 # The number of unsuccessful login requests per minute allowed for a specific user
94 RATELIMIT_RETRIES_ALLOWED = getattr(
95     settings, 'ASTAKOS_RATELIMIT_RETRIES_ALLOWED', 3)
96
97 # If False the email change mechanism is disabled
98 EMAILCHANGE_ENABLED = getattr(settings, 'ASTAKOS_EMAILCHANGE_ENABLED', False)
99
100 # Set the expiration time (in days) of email change requests
101 EMAILCHANGE_ACTIVATION_DAYS = getattr(
102     settings, 'ASTAKOS_EMAILCHANGE_ACTIVATION_DAYS', 10)
103
104 # Set the astakos main functions logging severity (None to disable)
105 from logging import INFO
106 LOGGING_LEVEL = getattr(settings, 'ASTAKOS_LOGGING_LEVEL', INFO)
107
108 # Configurable email subjects
109 INVITATION_EMAIL_SUBJECT = getattr(
110     settings, 'ASTAKOS_INVITATION_EMAIL_SUBJECT',
111     'Invitation to %s alpha2 testing' % SITENAME)
112 GREETING_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_GREETING_EMAIL_SUBJECT',
113                                  'Welcome to %s alpha2 testing' % SITENAME)
114 FEEDBACK_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_FEEDBACK_EMAIL_SUBJECT',
115                                  'Feedback from %s alpha2 testing' % SITENAME)
116 VERIFICATION_EMAIL_SUBJECT = getattr(
117     settings, 'ASTAKOS_VERIFICATION_EMAIL_SUBJECT',
118     '%s alpha2 testing account activation is needed' % SITENAME)
119 ACCOUNT_CREATION_SUBJECT = getattr(
120     settings, 'ASTAKOS_ACCOUNT_CREATION_SUBJECT',
121     '%s alpha2 testing account created (%%(user)s)' % SITENAME)
122 GROUP_CREATION_SUBJECT = getattr(settings, 'ASTAKOS_GROUP_CREATION_SUBJECT',
123                                  '%s alpha2 testing group created (%%(group)s)' % SITENAME)
124 HELPDESK_NOTIFICATION_EMAIL_SUBJECT = getattr(
125     settings, 'ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT',
126     '%s alpha2 testing account activated (%%(user)s)' % SITENAME)
127 EMAIL_CHANGE_EMAIL_SUBJECT = getattr(
128     settings, 'ASTAKOS_EMAIL_CHANGE_EMAIL_SUBJECT',
129     'Email change on %s alpha2 testing' % SITENAME)
130 PASSWORD_RESET_EMAIL_SUBJECT = getattr(
131     settings, 'ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT',
132     'Password reset on %s alpha2 testing' % SITENAME)
133
134 # Set the quota holder component URI
135 QUOTAHOLDER_URL = getattr(settings, 'ASTAKOS_QUOTAHOLDER_URL', '')
136 QUOTAHOLDER_TOKEN = getattr(settings, 'ASTAKOS_QUOTAHOLDER_TOKEN', '')
137
138 # Set the cloud service properties
139 SERVICES = getattr(settings, 'ASTAKOS_SERVICES', {
140     'cyclades': {
141         'url': 'https://node1.example.com/ui/',
142         'resources': [{
143             'name':'vm',
144             'group':'compute',
145             'uplimit':2,
146             'desc': 'Number of virtual machines'
147             },{
148             'name':'disk',
149             'group':'compute',
150             'uplimit':30*1024*1024*1024,
151             'unit':'bytes',
152             'desc': 'Virtual machine disk size'
153             },{
154             'name':'cpu',
155             'group':'compute',
156             'uplimit':6,
157             'desc': 'Number of virtual machine processors'
158             },{
159             'name':'ram',
160             'group':'compute',
161             'uplimit':6*1024*1024*1024,
162             'unit':'bytes',
163             'desc': 'Virtual machines'
164             },{
165             'name':'network.private',
166             'group':'network',
167             'uplimit':1,
168             'desc': 'Private networks'
169             }
170         ]
171     },
172     'pithos+': {
173         'url': 'https://node2.example.com/ui/',
174         'resources':[{
175             'name':'diskspace',
176             'group':'storage',
177             'uplimit':5 * 1024 * 1024 * 1024,
178             'unit':'bytes',
179             'desc': 'Pithos account diskspace'
180             }]
181     }
182 })
183
184 # Set the billing URI
185 AQUARIUM_URL = getattr(settings, 'ASTAKOS_AQUARIUM_URL', '')
186
187 # Set how many objects should be displayed per page
188 PAGINATE_BY = getattr(settings, 'ASTAKOS_PAGINATE_BY', 8)
189
190 # Set how many objects should be displayed per page in show all groups page
191 PAGINATE_BY_ALL = getattr(settings, 'ASTAKOS_PAGINATE_BY_ALL', 15)
192
193 # Enforce token renewal on password change/reset
194 NEWPASSWD_INVALIDATE_TOKEN = getattr(
195     settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True)
196
197
198 RESOURCES_PRESENTATION_DATA = getattr(
199     settings, 'ASTAKOS_RESOURCES_PRESENTATION_DATA', {
200         'groups': {
201              'compute': {
202                 'help_text':'Compute resources (amount of VMs, CPUs, RAM, System disk) ',
203                 'is_abbreviation':False,
204                 'report_desc':'',
205                  'verbose_name':'compute',
206             },
207             'storage': {
208                 'help_text':'Storage resources (amount of space to store files on Pithos) ',
209                 'is_abbreviation':False,
210                 'report_desc':'',
211                  'verbose_name':'storage',
212             },
213             'network': {
214                 'help_text':' Network resources (amount of Private Networks)  ',
215                 'is_abbreviation':False,
216                 'report_desc':'',
217                 'verbose_name':'network',
218             },
219         },
220         'resources': {
221             'pithos+.diskspace': {
222                 'help_text':'This is the space on Pithos for storing files and VM Images. ',
223                 'help_text_input_each':'This is the total amount of space on Pithos that will be granted to each user of this Project ',
224                 'is_abbreviation':False,
225                 'report_desc':'Storage Space',
226                 'placeholder':'eg. 10GB',
227                 'verbose_name':'Storage Space',
228             },
229             'cyclades.vm': {
230                 'help_text':'These are the VMs one can create on the Cyclades UI ',
231                 'help_text_input_each':'This is the total number of VMs that will be granted to each user of this Project ',
232                 'is_abbreviation':True,
233                 'report_desc':'Virtual Machines',
234                 'placeholder':'eg. 2',
235                 'verbose_name':'vm',
236             },
237             'cyclades.disk': {
238                 'help_text':'This is the System Disk that the VMs have that run the OS ',
239                 '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)  ",
240                 'is_abbreviation':False,
241                 'report_desc':'System Disk',
242                 'placeholder':'eg. 5GB, 2GB etc',
243                 'verbose_name':'System Disk'
244             },
245             'cyclades.ram': {
246                 'help_text':'RAM used by VMs ',
247                 'help_text_input_each':'This is the total amount of RAM that will be granted to each user of this Project (on all VMs)  ',
248                 'is_abbreviation':True,
249                 'report_desc':'RAM',
250                 'placeholder':'eg. 4GB',
251                 'verbose_name':'ram'
252             },
253             'cyclades.cpu': {
254                 'help_text':'CPUs used by VMs ',
255                 'help_text_input_each':'This is the total number of CPUs that will be granted to each user of this Project (on all VMs)  ',
256                 'is_abbreviation':True,
257                 'report_desc':'CPUs',
258                 'placeholder':'eg. 1',
259                 'verbose_name':'cpu'
260             },
261             'cyclades.network.private': {
262                 'help_text':'These are the Private Networks one can create on the Cyclades UI. ',
263                 'help_text_input_each':'This is the total number of Private Networks that will be granted to each user of this Project ',
264                 'is_abbreviation':False,
265                 'report_desc':'Private Networks',
266                 'placeholder':'eg. 1',
267                 'verbose_name':'private network'
268             }
269
270         }
271
272     })
273
274 # Permit local account migration
275 ENABLE_LOCAL_ACCOUNT_MIGRATION = getattr(settings, 'ASTAKOS_ENABLE_LOCAL_ACCOUNT_MIGRATION', True)
276
277 # Strict shibboleth usage
278 SHIBBOLETH_REQUIRE_NAME_INFO = getattr(settings,
279                                        'ASTAKOS_SHIBBOLETH_REQUIRE_NAME_INFO',
280                                        False)