root / snf-astakos-app / astakos / im / settings.py @ 4fef28ef
History | View | Annotate | Download (9.6 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_KEY = getattr(settings, 'ASTAKOS_TWITTER_KEY', '') |
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 |
IM_MODULES = getattr(settings, 'ASTAKOS_IM_MODULES', ['local', 'shibboleth']) |
27 |
|
28 |
# Force user profile verification
|
29 |
FORCE_PROFILE_UPDATE = getattr(settings, 'ASTAKOS_FORCE_PROFILE_UPDATE', True) |
30 |
|
31 |
#Enable invitations
|
32 |
INVITATIONS_ENABLED = getattr(settings, 'ASTAKOS_INVITATIONS_ENABLED', True) |
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 will be automatically accepted
|
41 |
MODERATION_ENABLED = getattr(settings, 'ASTAKOS_MODERATION_ENABLED', True) |
42 |
|
43 |
# Set baseurl
|
44 |
BASEURL = getattr(settings, 'ASTAKOS_BASEURL', 'http://pithos.dev.grnet.gr') |
45 |
|
46 |
# Set service name
|
47 |
SITENAME = getattr(settings, 'ASTAKOS_SITENAME', 'GRNET Cloud') |
48 |
|
49 |
# Set recaptcha keys
|
50 |
RECAPTCHA_PUBLIC_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PUBLIC_KEY', '') |
51 |
RECAPTCHA_PRIVATE_KEY = getattr(settings, 'ASTAKOS_RECAPTCHA_PRIVATE_KEY', '') |
52 |
RECAPTCHA_OPTIONS = getattr(settings, 'ASTAKOS_RECAPTCHA_OPTIONS', |
53 |
{'theme': 'custom', 'custom_theme_widget': 'okeanos_recaptcha'}) |
54 |
RECAPTCHA_USE_SSL = getattr(settings, 'ASTAKOS_RECAPTCHA_USE_SSL', True) |
55 |
RECAPTCHA_ENABLED = getattr(settings, 'ASTAKOS_RECAPTCHA_ENABLED', True) |
56 |
|
57 |
# set AstakosUser fields to propagate in the billing system
|
58 |
BILLING_FIELDS = getattr(settings, 'ASTAKOS_BILLING_FIELDS', ['is_active']) |
59 |
|
60 |
# Queue for billing.
|
61 |
QUEUE_CONNECTION = getattr(settings, 'ASTAKOS_QUEUE_CONNECTION', None) # Example: 'rabbitmq://guest:guest@localhost:5672/astakos' |
62 |
|
63 |
# Set where the user should be redirected after logout
|
64 |
LOGOUT_NEXT = getattr(settings, 'ASTAKOS_LOGOUT_NEXT', '') |
65 |
|
66 |
# Set user email patterns that are automatically activated
|
67 |
RE_USER_EMAIL_PATTERNS = getattr(
|
68 |
settings, 'ASTAKOS_RE_USER_EMAIL_PATTERNS', [])
|
69 |
|
70 |
# Messages to display on login page header
|
71 |
# e.g. {'warning': 'This warning message will be displayed on the top of login page'}
|
72 |
LOGIN_MESSAGES = getattr(settings, 'ASTAKOS_LOGIN_MESSAGES', []) |
73 |
|
74 |
# Messages to display on login page header
|
75 |
# e.g. {'warning': 'This warning message will be displayed on the top of signup page'}
|
76 |
SIGNUP_MESSAGES = getattr(settings, 'ASTAKOS_SIGNUP_MESSAGES', []) |
77 |
|
78 |
# Messages to display on login page header
|
79 |
# e.g. {'warning': 'This warning message will be displayed on the top of profile page'}
|
80 |
PROFILE_MESSAGES = getattr(settings, 'ASTAKOS_PROFILE_MESSAGES', []) |
81 |
|
82 |
# Messages to display on all pages
|
83 |
# e.g. {'warning': 'This warning message will be displayed on the top of every page'}
|
84 |
GLOBAL_MESSAGES = getattr(settings, 'ASTAKOS_GLOBAL_MESSAGES', []) |
85 |
|
86 |
# messages to display as extra actions in account forms
|
87 |
# e.g. {'https://cms.okeanos.grnet.gr/': 'Back to ~okeanos'}
|
88 |
PROFILE_EXTRA_LINKS = getattr(settings, 'ASTAKOS_PROFILE_EXTRA_LINKS', {}) |
89 |
|
90 |
# The number of unsuccessful login requests per minute allowed for a specific user
|
91 |
RATELIMIT_RETRIES_ALLOWED = getattr(
|
92 |
settings, 'ASTAKOS_RATELIMIT_RETRIES_ALLOWED', 3) |
93 |
|
94 |
# If False the email change mechanism is disabled
|
95 |
EMAILCHANGE_ENABLED = getattr(settings, 'ASTAKOS_EMAILCHANGE_ENABLED', False) |
96 |
|
97 |
# Set the expiration time (in days) of email change requests
|
98 |
EMAILCHANGE_ACTIVATION_DAYS = getattr(
|
99 |
settings, 'ASTAKOS_EMAILCHANGE_ACTIVATION_DAYS', 10) |
100 |
|
101 |
# Set the astakos main functions logging severity (None to disable)
|
102 |
from logging import INFO |
103 |
LOGGING_LEVEL = getattr(settings, 'ASTAKOS_LOGGING_LEVEL', INFO) |
104 |
|
105 |
# Configurable email subjects
|
106 |
INVITATION_EMAIL_SUBJECT = getattr(
|
107 |
settings, 'ASTAKOS_INVITATION_EMAIL_SUBJECT',
|
108 |
'Invitation to %s alpha2 testing' % SITENAME)
|
109 |
GREETING_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_GREETING_EMAIL_SUBJECT', |
110 |
'Welcome to %s alpha2 testing' % SITENAME)
|
111 |
FEEDBACK_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_FEEDBACK_EMAIL_SUBJECT', |
112 |
'Feedback from %s alpha2 testing' % SITENAME)
|
113 |
VERIFICATION_EMAIL_SUBJECT = getattr(
|
114 |
settings, 'ASTAKOS_VERIFICATION_EMAIL_SUBJECT',
|
115 |
'%s alpha2 testing account activation is needed' % SITENAME)
|
116 |
ACCOUNT_CREATION_SUBJECT = getattr(
|
117 |
settings, 'ASTAKOS_ACCOUNT_CREATION_SUBJECT',
|
118 |
'%s alpha2 testing account created (%%(user)s)' % SITENAME)
|
119 |
GROUP_CREATION_SUBJECT = getattr(settings, 'ASTAKOS_GROUP_CREATION_SUBJECT', |
120 |
'%s alpha2 testing group created (%%(group)s)' % SITENAME)
|
121 |
HELPDESK_NOTIFICATION_EMAIL_SUBJECT = getattr(
|
122 |
settings, 'ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT',
|
123 |
'%s alpha2 testing account activated (%%(user)s)' % SITENAME)
|
124 |
EMAIL_CHANGE_EMAIL_SUBJECT = getattr(
|
125 |
settings, 'ASTAKOS_EMAIL_CHANGE_EMAIL_SUBJECT',
|
126 |
'Email change on %s alpha2 testing' % SITENAME)
|
127 |
PASSWORD_RESET_EMAIL_SUBJECT = getattr(
|
128 |
settings, 'ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT',
|
129 |
'Password reset on %s alpha2 testing' % SITENAME)
|
130 |
|
131 |
# Set the quota holder component URI
|
132 |
QUOTA_HOLDER_URL = getattr(settings, 'ASTAKOS_QUOTA_HOLDER_URL', '') |
133 |
|
134 |
# Set the cloud service properties
|
135 |
SERVICES = getattr(settings, 'ASTAKOS_SERVICES', { |
136 |
'cyclades': {
|
137 |
'url': 'https://node1.example.com/ui/', |
138 |
'resources': [{
|
139 |
'name':'vm', |
140 |
'group':'compute', |
141 |
'uplimit':2, |
142 |
'desc': 'Number of virtual machines' |
143 |
},{ |
144 |
'name':'disk', |
145 |
'group':'compute', |
146 |
'uplimit':30*1024*1024*1024, |
147 |
'unit':'bytes', |
148 |
'desc': 'Virtual machine disk size' |
149 |
},{ |
150 |
'name':'cpu', |
151 |
'group':'compute', |
152 |
'uplimit':6, |
153 |
'desc': 'Number of virtual machine processors' |
154 |
},{ |
155 |
'name':'ram', |
156 |
'group':'compute', |
157 |
'uplimit':6*1024*1024*1024, |
158 |
'unit':'bytes', |
159 |
'desc': 'Virtual machines' |
160 |
},{ |
161 |
'name':'network.private', |
162 |
'group':'network', |
163 |
'uplimit':1, |
164 |
'desc': 'Private networks' |
165 |
} |
166 |
] |
167 |
}, |
168 |
'pithos+': {
|
169 |
'url': 'https://node2.example.com/ui/', |
170 |
'resources':[{
|
171 |
'name':'diskspace', |
172 |
'group':'storage', |
173 |
'uplimit':5 * 1024 * 1024 * 1024, |
174 |
'unit':'bytes', |
175 |
'desc': 'Pithos account diskspace' |
176 |
}] |
177 |
} |
178 |
}) |
179 |
|
180 |
# Set the billing URI
|
181 |
AQUARIUM_URL = getattr(settings, 'ASTAKOS_AQUARIUM_URL', '') |
182 |
|
183 |
# Set how many objects should be displayed per page
|
184 |
PAGINATE_BY = getattr(settings, 'ASTAKOS_PAGINATE_BY', 8) |
185 |
|
186 |
# Enforce token renewal on password change/reset
|
187 |
NEWPASSWD_INVALIDATE_TOKEN = getattr(
|
188 |
settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True) |
189 |
|
190 |
|
191 |
RESOURCES_PRESENTATION_DATA = getattr(
|
192 |
settings, 'ASTAKOS_RESOURCES_PRESENTATION_DATA', {
|
193 |
'groups': {
|
194 |
'compute': {
|
195 |
'help_text':'group compute help text', |
196 |
'is_abbreviation':False, |
197 |
'report_desc':'', |
198 |
'verbose_name':'compute', |
199 |
}, |
200 |
'storage': {
|
201 |
'help_text':'group storage help text', |
202 |
'is_abbreviation':False, |
203 |
'report_desc':'', |
204 |
'verbose_name':'storage', |
205 |
}, |
206 |
}, |
207 |
'resources': {
|
208 |
'pithos+.diskspace': {
|
209 |
'help_text':'resource pithos+.diskspace help text', |
210 |
'is_abbreviation':False, |
211 |
'report_desc':'Pithos+ Diskspace', |
212 |
'placeholder':'eg. 10GB', |
213 |
'verbose_name':'diskspace', |
214 |
}, |
215 |
'cyclades.vm': {
|
216 |
'help_text':'resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text resource cyclades.vm help text', |
217 |
'is_abbreviation':True, |
218 |
'report_desc':'Virtual Machines', |
219 |
'placeholder':'eg. 2', |
220 |
'verbose_name':'vm', |
221 |
}, |
222 |
'cyclades.disk': {
|
223 |
'help_text':'resource cyclades.disk help text', |
224 |
'is_abbreviation':False, |
225 |
'report_desc':'Disk', |
226 |
'placeholder':'eg. 5GB, 2GB etc', |
227 |
'verbose_name':'disk' |
228 |
}, |
229 |
'cyclades.ram': {
|
230 |
'help_text':'resource cyclades.ram help text', |
231 |
'is_abbreviation':True, |
232 |
'report_desc':'RAM', |
233 |
'placeholder':'eg. 4GB', |
234 |
'verbose_name':'ram' |
235 |
}, |
236 |
'cyclades.cpu': {
|
237 |
'help_text':'resource cyclades.cpu help text', |
238 |
'is_abbreviation':True, |
239 |
'report_desc':'CPUs', |
240 |
'placeholder':'eg. 1', |
241 |
'verbose_name':'cpu' |
242 |
}, |
243 |
'cyclades.network.private': {
|
244 |
'help_text':'resource cyclades.network.private help text', |
245 |
'is_abbreviation':False, |
246 |
'report_desc':'Network', |
247 |
'placeholder':'eg. 1', |
248 |
'verbose_name':'private network' |
249 |
} |
250 |
|
251 |
} |
252 |
|
253 |
}) |