Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (10.5 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
DEFAULT_USER_LEVEL = getattr(settings, 'ASTAKOS_DEFAULT_USER_LEVEL', 4)
8

    
9
INVITATIONS_PER_LEVEL = getattr(settings, 'ASTAKOS_INVITATIONS_PER_LEVEL', {
10
    0: 100,
11
    1: 2,
12
    2: 0,
13
    3: 0,
14
    4: 0
15
})
16

    
17
ADMINS = getattr(settings, 'ADMINS', ())
18
MANAGERS = getattr(settings, 'MANAGERS', ADMINS)
19
HELPDESK = getattr(settings, 'HELPDESK', ADMINS)
20

    
21
CONTACT_EMAIL = settings.CONTACT_EMAIL
22
SERVER_EMAIL = settings.SERVER_EMAIL
23

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

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

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

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

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

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

    
44
# Set baseurl
45
BASEURL = getattr(settings, 'ASTAKOS_BASEURL', 'https://accounts.example.synnefo.org')
46

    
47
# Set service name
48
SITENAME = getattr(settings, 'ASTAKOS_SITENAME', 'Synnefo 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_DENIED_SUBJECT = getattr(
139
    settings, 'ASTAKOS_PROJECT_DENIED_SUBJECT',
140
    '%s alpha2 testing project application denied (%%(name)s)' % SITENAME)
141
PROJECT_TERMINATION_SUBJECT = getattr(
142
    settings, 'ASTAKOS_PROJECT_TERMINATION_SUBJECT',
143
    '%s alpha2 testing project terminated (%%(name)s)' % SITENAME)
144
PROJECT_SUSPENSION_SUBJECT = getattr(
145
    settings, 'ASTAKOS_PROJECT_SUSPENSION_SUBJECT',
146
    '%s alpha2 testing project suspended (%%(name)s)' % SITENAME)
147
PROJECT_MEMBERSHIP_CHANGE_SUBJECT = getattr(
148
    settings, 'ASTAKOS_PROJECT_MEMBERSHIP_CHANGE_SUBJECT',
149
    '%s alpha2 testing project membership changed (%%(name)s)' % SITENAME)
150
PROJECT_MEMBERSHIP_ENROLL_SUBJECT = getattr(
151
    settings, 'ASTAKOS_PROJECT_MEMBERSHIP_ENROLL_SUBJECT',
152
    '%s alpha2 testing project enrollment (%%(name)s)' % SITENAME)
153
PROJECT_MEMBERSHIP_REQUEST_SUBJECT = getattr(
154
    settings, 'ASTAKOS_PROJECT_MEMBERSHIP_REQUEST_SUBJECT',
155
    '%s alpha2 testing project membership request (%%(name)s)' % SITENAME)
156
PROJECT_MEMBERSHIP_LEAVE_REQUEST_SUBJECT = getattr(
157
    settings, 'ASTAKOS_PROJECT_MEMBERSHIP_LEAVE_REQUEST_SUBJECT',
158
    '%s alpha2 testing project membership leave request (%%(name)s)' % SITENAME)
159

    
160
# Set the quota holder component URI
161
QUOTAHOLDER_URL = getattr(settings, 'ASTAKOS_QUOTAHOLDER_URL', '')
162
QUOTAHOLDER_TOKEN = getattr(settings, 'ASTAKOS_QUOTAHOLDER_TOKEN', '')
163
QUOTAHOLDER_POOLSIZE = getattr(settings, 'ASTAKOS_QUOTAHOLDER_POOLSIZE', 50)
164

    
165
# Set the billing URI
166
AQUARIUM_URL = getattr(settings, 'ASTAKOS_AQUARIUM_URL', '')
167

    
168
# Set how many objects should be displayed per page
169
PAGINATE_BY = getattr(settings, 'ASTAKOS_PAGINATE_BY', 8)
170

    
171
# Set how many objects should be displayed per page in show all projects page
172
PAGINATE_BY_ALL = getattr(settings, 'ASTAKOS_PAGINATE_BY_ALL', 15)
173

    
174
# Enforce token renewal on password change/reset
175
NEWPASSWD_INVALIDATE_TOKEN = getattr(
176
    settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True)
177

    
178
USAGE_UPDATE_INTERVAL = getattr(settings, 'ASTAKOS_USAGE_UPDATE_INTERVAL', 5000)
179

    
180
# Permit local account migration
181
ENABLE_LOCAL_ACCOUNT_MIGRATION = getattr(settings, 'ASTAKOS_ENABLE_LOCAL_ACCOUNT_MIGRATION', True)
182

    
183
# Strict shibboleth usage
184
SHIBBOLETH_REQUIRE_NAME_INFO = getattr(settings,
185
                                       'ASTAKOS_SHIBBOLETH_REQUIRE_NAME_INFO',
186
                                       False)
187

    
188
PROJECT_MEMBER_JOIN_POLICIES = getattr(settings,
189
                                'ASTAKOS_PROJECT_MEMBER_JOIN_POLICIES',
190
                                {'1':'automatically accepted',
191
                                 '2':'owner accepts',
192
                                 '3':'closed'})
193

    
194
PROJECT_MEMBER_LEAVE_POLICIES = getattr(settings,
195
                                'ASTAKOS_PROJECT_MEMBER_LEAVE_POLICIES',
196
                                {'1':'automatically accepted',
197
                                 '2':'owner accepts',
198
                                 '3':'closed'})
199

    
200
ACTIVATION_REDIRECT_URL = getattr(settings,
201
                                  'ASTAKOS_ACTIVATION_REDIRECT_URL',
202
                                  "/im/landing")
203

    
204

    
205
# If true, this enables a ui compatibility layer for the introduction of UUIDs
206
# in identity management. WARNING: Setting to True will break your installation.
207
TRANSLATE_UUIDS = getattr(settings, 'ASTAKOS_TRANSLATE_UUIDS', False)
208

    
209
# Users that can approve or deny project applications from the web.
210
PROJECT_ADMINS = getattr(settings, 'ASTAKOS_PROJECT_ADMINS', set())
211

    
212
# Maximum pending project applications per applicant.
213
# This is to reduce the volume of applications
214
# in case users abuse the mechanism.
215
PENDING_APPLICATION_LIMIT = getattr(settings,
216
                                    'ASTAKOS_PENDING_APPLICATION_LIMIT', 0)
217

    
218
# OAuth2 Twitter credentials.
219
TWITTER_TOKEN = getattr(settings, 'ASTAKOS_TWITTER_TOKEN', '')
220
TWITTER_SECRET = getattr(settings, 'ASTAKOS_TWITTER_SECRET', '')
221
TWITTER_AUTH_FORCE_LOGIN = getattr(settings, 'ASTAKOS_TWITTER_AUTH_FORCE_LOGIN',
222
                                  False)
223

    
224
# OAuth2 Google credentials.
225
GOOGLE_CLIENT_ID = getattr(settings, 'ASTAKOS_GOOGLE_CLIENT_ID', '')
226
GOOGLE_SECRET = getattr(settings, 'ASTAKOS_GOOGLE_SECRET', '')
227

    
228
# OAuth2 LinkedIn credentials.
229
LINKEDIN_TOKEN = getattr(settings, 'ASTAKOS_LINKEDIN_TOKEN', '')
230
LINKEDIN_SECRET = getattr(settings, 'ASTAKOS_LINKEDIN_SECRET', '')
231

    
232
# URL to redirect the user after successful login when no next parameter is set
233
LOGIN_SUCCESS_URL = getattr(settings, 'ASTAKOS_LOGIN_SUCCESS_URL',
234
                            '/im/landing')
235

    
236
# Whether or not to display projects in astakos menu
237
PROJECTS_VISIBLE = getattr(settings, 'ASTAKOS_PROJECTS_VISIBLE', False)
238

    
239
# A way to extend the settings presentation metadata
240
SERVICES_META = getattr(settings, 'ASTAKOS_SERVICES_META', {})