Mercurial > libervia-web
annotate libervia/common/constants.py @ 1184:eee7a896cf0e
server: show BridgeException traceback on unknown registering status
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 14 May 2019 19:40:51 +0200 |
parents | 3b844004c0b4 |
children | 3f791fbc1643 |
rev | line source |
---|---|
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
1 #!/usr/bin/python |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
3 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
4 # Libervia: a SAT frontend |
1144 | 5 # Copyright (C) 2009-2019 Jérôme Poisson (goffi@goffi.org) |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
6 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
7 # This program is free software: you can redistribute it and/or modify |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
8 # it under the terms of the GNU Affero General Public License as published by |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
9 # the Free Software Foundation, either version 3 of the License, or |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
10 # (at your option) any later version. |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
11 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
12 # This program is distributed in the hope that it will be useful, |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
15 # GNU Affero General Public License for more details. |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
16 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
17 # You should have received a copy of the GNU Affero General Public License |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
19 |
624
9092e624bb27
browser_side: fixes various issues
souliane <souliane@mailoo.org>
parents:
613
diff
changeset
|
20 from sat_frontends.quick_frontend import constants |
606
7af8f4ab3675
browser side: fixed avatar getting + better DEFAULT/EMPTY avatars constants + use of jid.JID for microblog's author
Goffi <goffi@goffi.org>
parents:
483
diff
changeset
|
21 import os.path |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
22 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
23 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
24 class Const(constants.Const): |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
25 |
861
5cefc6ab302f
server: moved APP_VERSION to common.constants + avoid __init__ import in browser side, which was the source of a crash
Goffi <goffi@goffi.org>
parents:
828
diff
changeset
|
26 # XXX: we don't want to use the APP_VERSION inherited from sat.core.constants version |
5cefc6ab302f
server: moved APP_VERSION to common.constants + avoid __init__ import in browser side, which was the source of a crash
Goffi <goffi@goffi.org>
parents:
828
diff
changeset
|
27 # as we use this version to check that there is not a mismatch with backend |
1183 | 28 APP_VERSION = u"0.7.0D" # Please add 'D' at the end for dev versions |
613
deddd1cd8aa5
browser side: added a base_location property to get location of current Libervia instance
Goffi <goffi@goffi.org>
parents:
606
diff
changeset
|
29 LIBERVIA_MAIN_PAGE = "libervia.html" |
deddd1cd8aa5
browser side: added a base_location property to get location of current Libervia instance
Goffi <goffi@goffi.org>
parents:
606
diff
changeset
|
30 |
961
22fe06569b1a
server: moved logging worflow in separated method, so it can be used by Libervia Pages
Goffi <goffi@goffi.org>
parents:
914
diff
changeset
|
31 # REGISTRATION |
22fe06569b1a
server: moved logging worflow in separated method, so it can be used by Libervia Pages
Goffi <goffi@goffi.org>
parents:
914
diff
changeset
|
32 # XXX: for now libervia forces the creation to lower case |
22fe06569b1a
server: moved logging worflow in separated method, so it can be used by Libervia Pages
Goffi <goffi@goffi.org>
parents:
914
diff
changeset
|
33 # XXX: Regex patterns must be compatible with both Python and JS |
1113
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
34 REG_LOGIN_RE = r"^[a-z0-9_-]+$" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
35 REG_EMAIL_RE = r"^.+@.+\..+" |
961
22fe06569b1a
server: moved logging worflow in separated method, so it can be used by Libervia Pages
Goffi <goffi@goffi.org>
parents:
914
diff
changeset
|
36 PASSWORD_MIN_LENGTH = 6 |
481
bbdc5357dc00
browser and server sides: refactor HTTP request result values + handle "NoReply" error
souliane <souliane@mailoo.org>
parents:
462
diff
changeset
|
37 |
bbdc5357dc00
browser and server sides: refactor HTTP request result values + handle "NoReply" error
souliane <souliane@mailoo.org>
parents:
462
diff
changeset
|
38 # HTTP REQUEST RESULT VALUES |
1113
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
39 PROFILE_AUTH_ERROR = "PROFILE AUTH ERROR" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
40 XMPP_AUTH_ERROR = "XMPP AUTH ERROR" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
41 ALREADY_WAITING = "ALREADY WAITING" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
42 SESSION_ACTIVE = "SESSION ACTIVE" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
43 NOT_CONNECTED = "NOT CONNECTED" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
44 PROFILE_LOGGED = "LOGGED" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
45 PROFILE_LOGGED_EXT_JID = "LOGGED (REGISTERED WITH EXTERNAL JID)" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
46 ALREADY_EXISTS = "ALREADY EXISTS" |
1164
ef3adc3f2078
handle invalid certificate on registration + fixed error handling on registration
Goffi <goffi@goffi.org>
parents:
1163
diff
changeset
|
47 INVALID_CERTIFICATE = "INVALID CERTIFICATE" |
1113
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
48 REGISTRATION_SUCCEED = "REGISTRATION" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
49 INTERNAL_ERROR = "INTERNAL ERROR" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
50 INVALID_INPUT = "INVALID INPUT" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
51 BAD_REQUEST = "BAD REQUEST" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
52 NO_REPLY = "NO REPLY" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
53 NOT_ALLOWED = "NOT ALLOWED" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
54 UPLOAD_OK = "UPLOAD OK" |
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
55 UPLOAD_KO = "UPLOAD KO" |
483
0bbbef1d53a8
server side (blog): use user's avatar a the blog's favicon + small refactorization
souliane <souliane@mailoo.org>
parents:
481
diff
changeset
|
56 |
606
7af8f4ab3675
browser side: fixed avatar getting + better DEFAULT/EMPTY avatars constants + use of jid.JID for microblog's author
Goffi <goffi@goffi.org>
parents:
483
diff
changeset
|
57 # directories |
7af8f4ab3675
browser side: fixed avatar getting + better DEFAULT/EMPTY avatars constants + use of jid.JID for microblog's author
Goffi <goffi@goffi.org>
parents:
483
diff
changeset
|
58 MEDIA_DIR = "media/" |
914
0c0551967bdf
server, browser: partial Libervia fix
Goffi <goffi@goffi.org>
parents:
909
diff
changeset
|
59 CACHE_DIR = "cache" |
483
0bbbef1d53a8
server side (blog): use user's avatar a the blog's favicon + small refactorization
souliane <souliane@mailoo.org>
parents:
481
diff
changeset
|
60 |
606
7af8f4ab3675
browser side: fixed avatar getting + better DEFAULT/EMPTY avatars constants + use of jid.JID for microblog's author
Goffi <goffi@goffi.org>
parents:
483
diff
changeset
|
61 # avatars |
7af8f4ab3675
browser side: fixed avatar getting + better DEFAULT/EMPTY avatars constants + use of jid.JID for microblog's author
Goffi <goffi@goffi.org>
parents:
483
diff
changeset
|
62 DEFAULT_AVATAR_FILE = "default_avatar.png" |
7af8f4ab3675
browser side: fixed avatar getting + better DEFAULT/EMPTY avatars constants + use of jid.JID for microblog's author
Goffi <goffi@goffi.org>
parents:
483
diff
changeset
|
63 DEFAULT_AVATAR_URL = os.path.join(MEDIA_DIR, "misc", DEFAULT_AVATAR_FILE) |
7af8f4ab3675
browser side: fixed avatar getting + better DEFAULT/EMPTY avatars constants + use of jid.JID for microblog's author
Goffi <goffi@goffi.org>
parents:
483
diff
changeset
|
64 EMPTY_AVATAR_FILE = "empty_avatar" |
7af8f4ab3675
browser side: fixed avatar getting + better DEFAULT/EMPTY avatars constants + use of jid.JID for microblog's author
Goffi <goffi@goffi.org>
parents:
483
diff
changeset
|
65 EMPTY_AVATAR_URL = os.path.join(MEDIA_DIR, "misc", EMPTY_AVATAR_FILE) |
828
0c824ebe9d87
server (blog): implemented tag/category filtering:
Goffi <goffi@goffi.org>
parents:
823
diff
changeset
|
66 |
0c824ebe9d87
server (blog): implemented tag/category filtering:
Goffi <goffi@goffi.org>
parents:
823
diff
changeset
|
67 # blog |
1113
cdd389ef97bc
server: code style reformatting using black
Goffi <goffi@goffi.org>
parents:
1054
diff
changeset
|
68 MAM_FILTER_CATEGORY = "http://salut-a-toi.org/protocols/mam_filter_category" |