root / snf-astakos-app / astakos / im / settings.py @ 67cf14bf
History | View | Annotate | Download (10 kB)
1 |
from django.conf import settings |
---|---|
2 |
from synnefo_branding import settings as synnefo_settings |
3 |
|
4 |
# Set the expiration time of newly created auth tokens
|
5 |
# to be this many hours after their creation time.
|
6 |
AUTH_TOKEN_DURATION = getattr(settings, 'ASTAKOS_AUTH_TOKEN_DURATION', 30 * 24) |
7 |
|
8 |
DEFAULT_USER_LEVEL = getattr(settings, 'ASTAKOS_DEFAULT_USER_LEVEL', 4) |
9 |
|
10 |
INVITATIONS_PER_LEVEL = getattr(settings, 'ASTAKOS_INVITATIONS_PER_LEVEL', { |
11 |
0: 100, |
12 |
1: 2, |
13 |
2: 0, |
14 |
3: 0, |
15 |
4: 0 |
16 |
}) |
17 |
|
18 |
ADMINS = getattr(settings, 'ADMINS', ()) |
19 |
MANAGERS = getattr(settings, 'MANAGERS', ADMINS) |
20 |
HELPDESK = getattr(settings, 'HELPDESK', ADMINS) |
21 |
|
22 |
CONTACT_EMAIL = settings.CONTACT_EMAIL |
23 |
SERVER_EMAIL = settings.SERVER_EMAIL |
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', False) |
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
|
42 |
# will be automatically accepted
|
43 |
MODERATION_ENABLED = getattr(settings, 'ASTAKOS_MODERATION_ENABLED', True) |
44 |
|
45 |
# Set baseurl
|
46 |
BASEURL = getattr(settings, 'ASTAKOS_BASEURL', 'https://accounts.example.synnefo.org') |
47 |
|
48 |
# Set service name
|
49 |
SITENAME = getattr(settings, 'ASTAKOS_SITENAME', synnefo_settings.SERVICE_NAME) |
50 |
|
51 |
# Set recaptcha keys
|
52 |
RECAPTCHA_PUBLIC_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PUBLIC_KEY', '') |
53 |
RECAPTCHA_PRIVATE_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PRIVATE_KEY', '') |
54 |
RECAPTCHA_OPTIONS = getattr(settings, 'ASTAKOS_RECAPTCHA_OPTIONS', |
55 |
{'theme': 'custom', 'custom_theme_widget': 'okeanos_recaptcha'}) |
56 |
RECAPTCHA_USE_SSL = getattr(settings, 'ASTAKOS_RECAPTCHA_USE_SSL', True) |
57 |
RECAPTCHA_ENABLED = getattr(settings, 'ASTAKOS_RECAPTCHA_ENABLED', False) |
58 |
|
59 |
# set AstakosUser fields to propagate in the billing system
|
60 |
BILLING_FIELDS = getattr(settings, 'ASTAKOS_BILLING_FIELDS', ['is_active']) |
61 |
|
62 |
# Queue for billing.
|
63 |
# Example: 'rabbitmq://guest:guest@localhost:5672/astakos'
|
64 |
QUEUE_CONNECTION = getattr(settings, 'ASTAKOS_QUEUE_CONNECTION', None) |
65 |
# Set where the user should be redirected after logout
|
66 |
LOGOUT_NEXT = getattr(settings, 'ASTAKOS_LOGOUT_NEXT', '') |
67 |
|
68 |
# Set user email patterns that are automatically activated
|
69 |
RE_USER_EMAIL_PATTERNS = getattr(
|
70 |
settings, 'ASTAKOS_RE_USER_EMAIL_PATTERNS', [])
|
71 |
|
72 |
# Messages to display on login page header
|
73 |
# e.g. {'warning': 'This warning message will be displayed on the top of login page'}
|
74 |
LOGIN_MESSAGES = getattr(settings, 'ASTAKOS_LOGIN_MESSAGES', []) |
75 |
|
76 |
# Messages to display on login page header
|
77 |
# e.g. {'warning': 'This warning message will be displayed on the top of signup page'}
|
78 |
SIGNUP_MESSAGES = getattr(settings, 'ASTAKOS_SIGNUP_MESSAGES', []) |
79 |
|
80 |
# Messages to display on login page header
|
81 |
# e.g. {'warning': 'This warning message will be displayed on the top of profile page'}
|
82 |
PROFILE_MESSAGES = getattr(settings, 'ASTAKOS_PROFILE_MESSAGES', []) |
83 |
|
84 |
# Messages to display on all pages
|
85 |
# e.g. {'warning': 'This warning message will be displayed on the top of every page'}
|
86 |
GLOBAL_MESSAGES = getattr(settings, 'ASTAKOS_GLOBAL_MESSAGES', []) |
87 |
|
88 |
# messages to display as extra actions in account forms
|
89 |
# e.g. {'https://www.myhomepage.com': 'Back to <service_name>'}
|
90 |
PROFILE_EXTRA_LINKS = getattr(settings, 'ASTAKOS_PROFILE_EXTRA_LINKS', {}) |
91 |
|
92 |
# The number of unsuccessful login requests per minute allowed for a specific user
|
93 |
RATELIMIT_RETRIES_ALLOWED = getattr(
|
94 |
settings, 'ASTAKOS_RATELIMIT_RETRIES_ALLOWED', 3) |
95 |
|
96 |
# If False the email change mechanism is disabled
|
97 |
EMAILCHANGE_ENABLED = getattr(settings, 'ASTAKOS_EMAILCHANGE_ENABLED', False) |
98 |
|
99 |
# Set the expiration time (in days) of email change requests
|
100 |
EMAILCHANGE_ACTIVATION_DAYS = getattr(
|
101 |
settings, 'ASTAKOS_EMAILCHANGE_ACTIVATION_DAYS', 10) |
102 |
|
103 |
# Set the astakos main functions logging severity (None to disable)
|
104 |
from logging import INFO |
105 |
LOGGING_LEVEL = getattr(settings, 'ASTAKOS_LOGGING_LEVEL', INFO) |
106 |
|
107 |
# Configurable email subjects
|
108 |
INVITATION_EMAIL_SUBJECT = getattr(
|
109 |
settings, 'ASTAKOS_INVITATION_EMAIL_SUBJECT',
|
110 |
'Invitation to %s' % SITENAME)
|
111 |
GREETING_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_GREETING_EMAIL_SUBJECT', |
112 |
'Welcome to %s' % SITENAME)
|
113 |
FEEDBACK_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_FEEDBACK_EMAIL_SUBJECT', |
114 |
'Feedback from %s' % SITENAME)
|
115 |
VERIFICATION_EMAIL_SUBJECT = getattr(
|
116 |
settings, 'ASTAKOS_VERIFICATION_EMAIL_SUBJECT',
|
117 |
'%s account activation is needed' % SITENAME)
|
118 |
ACCOUNT_CREATION_SUBJECT = getattr(
|
119 |
settings, 'ASTAKOS_ACCOUNT_CREATION_SUBJECT',
|
120 |
'%s account created (%%(user)s)' % SITENAME)
|
121 |
GROUP_CREATION_SUBJECT = getattr(
|
122 |
settings, 'ASTAKOS_GROUP_CREATION_SUBJECT',
|
123 |
'%s group created (%%(group)s)' % SITENAME)
|
124 |
HELPDESK_NOTIFICATION_EMAIL_SUBJECT = getattr(
|
125 |
settings, 'ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT',
|
126 |
'%s account activated (%%(user)s)' % SITENAME)
|
127 |
EMAIL_CHANGE_EMAIL_SUBJECT = getattr(
|
128 |
settings, 'ASTAKOS_EMAIL_CHANGE_EMAIL_SUBJECT',
|
129 |
'Email change on %s ' % SITENAME)
|
130 |
PASSWORD_RESET_EMAIL_SUBJECT = getattr(
|
131 |
settings, 'ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT',
|
132 |
'Password reset on %s ' % SITENAME)
|
133 |
PROJECT_CREATION_SUBJECT = getattr(
|
134 |
settings, 'ASTAKOS_PROJECT_CREATION_SUBJECT',
|
135 |
'%s project application created (%%(name)s)' % SITENAME)
|
136 |
PROJECT_APPROVED_SUBJECT = getattr(
|
137 |
settings, 'ASTAKOS_PROJECT_APPROVED_SUBJECT',
|
138 |
'%s project application approved (%%(name)s)' % SITENAME)
|
139 |
PROJECT_DENIED_SUBJECT = getattr(
|
140 |
settings, 'ASTAKOS_PROJECT_DENIED_SUBJECT',
|
141 |
'%s project application denied (%%(name)s)' % SITENAME)
|
142 |
PROJECT_TERMINATION_SUBJECT = getattr(
|
143 |
settings, 'ASTAKOS_PROJECT_TERMINATION_SUBJECT',
|
144 |
'%s project terminated (%%(name)s)' % SITENAME)
|
145 |
PROJECT_SUSPENSION_SUBJECT = getattr(
|
146 |
settings, 'ASTAKOS_PROJECT_SUSPENSION_SUBJECT',
|
147 |
'%s testing project suspended (%%(name)s)' % SITENAME)
|
148 |
PROJECT_MEMBERSHIP_CHANGE_SUBJECT = getattr(
|
149 |
settings, 'ASTAKOS_PROJECT_MEMBERSHIP_CHANGE_SUBJECT',
|
150 |
'%s testing project membership changed (%%(name)s)' % SITENAME)
|
151 |
PROJECT_MEMBERSHIP_ENROLL_SUBJECT = getattr(
|
152 |
settings, 'ASTAKOS_PROJECT_MEMBERSHIP_ENROLL_SUBJECT',
|
153 |
'%s testing project enrollment (%%(name)s)' % SITENAME)
|
154 |
PROJECT_MEMBERSHIP_REQUEST_SUBJECT = getattr(
|
155 |
settings, 'ASTAKOS_PROJECT_MEMBERSHIP_REQUEST_SUBJECT',
|
156 |
'%s testing project membership request (%%(name)s)' % SITENAME)
|
157 |
PROJECT_MEMBERSHIP_LEAVE_REQUEST_SUBJECT = getattr(
|
158 |
settings, 'ASTAKOS_PROJECT_MEMBERSHIP_LEAVE_REQUEST_SUBJECT',
|
159 |
'%s testing project membership leave request (%%(name)s)' % SITENAME)
|
160 |
|
161 |
# Set the quota holder component URI
|
162 |
QUOTAHOLDER_URL = getattr(settings, 'ASTAKOS_QUOTAHOLDER_URL', '') |
163 |
QUOTAHOLDER_TOKEN = getattr(settings, 'ASTAKOS_QUOTAHOLDER_TOKEN', '') |
164 |
QUOTAHOLDER_POOLSIZE = getattr(settings, 'ASTAKOS_QUOTAHOLDER_POOLSIZE', 50) |
165 |
|
166 |
# Set how many objects should be displayed per page
|
167 |
PAGINATE_BY = getattr(settings, 'ASTAKOS_PAGINATE_BY', 8) |
168 |
|
169 |
# Set how many objects should be displayed per page in show all projects page
|
170 |
PAGINATE_BY_ALL = getattr(settings, 'ASTAKOS_PAGINATE_BY_ALL', 15) |
171 |
|
172 |
# Enforce token renewal on password change/reset
|
173 |
NEWPASSWD_INVALIDATE_TOKEN = getattr(
|
174 |
settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True) |
175 |
|
176 |
USAGE_UPDATE_INTERVAL = getattr(settings, 'ASTAKOS_USAGE_UPDATE_INTERVAL', 5000) |
177 |
|
178 |
# Permit local account migration
|
179 |
ENABLE_LOCAL_ACCOUNT_MIGRATION = getattr(settings, 'ASTAKOS_ENABLE_LOCAL_ACCOUNT_MIGRATION', True) |
180 |
|
181 |
# Strict shibboleth usage
|
182 |
SHIBBOLETH_REQUIRE_NAME_INFO = getattr(settings,
|
183 |
'ASTAKOS_SHIBBOLETH_REQUIRE_NAME_INFO',
|
184 |
False)
|
185 |
|
186 |
ACTIVATION_REDIRECT_URL = getattr(settings,
|
187 |
'ASTAKOS_ACTIVATION_REDIRECT_URL',
|
188 |
"/im/landing")
|
189 |
|
190 |
# If true, this enables a ui compatibility layer for the introduction of UUIDs
|
191 |
# in identity management. WARNING: Setting to True will break your installation.
|
192 |
TRANSLATE_UUIDS = getattr(settings, 'ASTAKOS_TRANSLATE_UUIDS', False) |
193 |
|
194 |
# Users that can approve or deny project applications from the web.
|
195 |
PROJECT_ADMINS = getattr(settings, 'ASTAKOS_PROJECT_ADMINS', set()) |
196 |
|
197 |
# Maximum pending project applications per applicant.
|
198 |
# This is to reduce the volume of applications
|
199 |
# in case users abuse the mechanism.
|
200 |
PENDING_APPLICATION_LIMIT = getattr(settings,
|
201 |
'ASTAKOS_PENDING_APPLICATION_LIMIT', 0) |
202 |
|
203 |
# OAuth2 Twitter credentials.
|
204 |
TWITTER_TOKEN = getattr(settings, 'ASTAKOS_TWITTER_TOKEN', '') |
205 |
TWITTER_SECRET = getattr(settings, 'ASTAKOS_TWITTER_SECRET', '') |
206 |
TWITTER_AUTH_FORCE_LOGIN = getattr(settings, 'ASTAKOS_TWITTER_AUTH_FORCE_LOGIN', |
207 |
False)
|
208 |
|
209 |
# OAuth2 Google credentials.
|
210 |
GOOGLE_CLIENT_ID = getattr(settings, 'ASTAKOS_GOOGLE_CLIENT_ID', '') |
211 |
GOOGLE_SECRET = getattr(settings, 'ASTAKOS_GOOGLE_SECRET', '') |
212 |
|
213 |
# OAuth2 LinkedIn credentials.
|
214 |
LINKEDIN_TOKEN = getattr(settings, 'ASTAKOS_LINKEDIN_TOKEN', '') |
215 |
LINKEDIN_SECRET = getattr(settings, 'ASTAKOS_LINKEDIN_SECRET', '') |
216 |
|
217 |
# URL to redirect the user after successful login when no next parameter is set
|
218 |
LOGIN_SUCCESS_URL = getattr(settings, 'ASTAKOS_LOGIN_SUCCESS_URL','/im/landing') |
219 |
|
220 |
# Whether or not to display projects in astakos menu
|
221 |
PROJECTS_VISIBLE = getattr(settings, 'ASTAKOS_PROJECTS_VISIBLE', False) |
222 |
|
223 |
# A way to extend the services presentation metadata
|
224 |
SERVICES_META = getattr(settings, 'ASTAKOS_SERVICES_META', {}) |
225 |
|
226 |
# A way to extend the resources presentation metadata
|
227 |
RESOURCES_META = getattr(settings, 'ASTAKOS_RESOURCES_META', {}) |
228 |
|
229 |
# Do not require email verification for new users
|
230 |
SKIP_EMAIL_VERIFICATION = getattr(settings,
|
231 |
'ASTAKOS_SKIP_EMAIL_VERIFICATION', False) |