comparison libervia/web/common/constants.py @ 1518:eb00d593801d

refactoring: rename `libervia` to `libervia.web` + update imports following backend changes
author Goffi <goffi@goffi.org>
date Fri, 02 Jun 2023 16:49:28 +0200
parents libervia/common/constants.py@42f110cab605
children 01b8d68edd70
comparison
equal deleted inserted replaced
1517:b8ed9726525b 1518:eb00d593801d
1 #!/usr/bin/env python3
2
3
4 # Libervia: a SAT frontend
5 # Copyright (C) 2009-2021 Jérôme Poisson (goffi@goffi.org)
6
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details.
16
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 from libervia.frontends.quick_frontend import constants
21 import os.path
22
23
24 class Const(constants.Const):
25
26 # XXX: we don't want to use the APP_VERSION inherited from libervia.backend.core.constants version
27 # as we use this version to check that there is not a mismatch with backend
28 APP_VERSION = "0.9.0D" # Please add 'D' at the end for dev versions
29 LIBERVIA_MAIN_PAGE = "libervia.html"
30 LIBERVIA_PAGE_START = "/login"
31
32 # REGISTRATION
33 # XXX: for now libervia forces the creation to lower case
34 # XXX: Regex patterns must be compatible with both Python and JS
35 REG_LOGIN_RE = r"^[a-z0-9_-]+$"
36 REG_EMAIL_RE = r"^.+@.+\..+"
37 PASSWORD_MIN_LENGTH = 6
38
39 # HTTP REQUEST RESULT VALUES
40 PROFILE_AUTH_ERROR = "PROFILE AUTH ERROR"
41 XMPP_AUTH_ERROR = "XMPP AUTH ERROR"
42 ALREADY_WAITING = "ALREADY WAITING"
43 SESSION_ACTIVE = "SESSION ACTIVE"
44 NOT_CONNECTED = "NOT CONNECTED"
45 PROFILE_LOGGED = "LOGGED"
46 PROFILE_LOGGED_EXT_JID = "LOGGED (REGISTERED WITH EXTERNAL JID)"
47 ALREADY_EXISTS = "ALREADY EXISTS"
48 INVALID_CERTIFICATE = "INVALID CERTIFICATE"
49 REGISTRATION_SUCCEED = "REGISTRATION"
50 INTERNAL_ERROR = "INTERNAL ERROR"
51 INVALID_INPUT = "INVALID INPUT"
52 BAD_REQUEST = "BAD REQUEST"
53 NO_REPLY = "NO REPLY"
54 NOT_ALLOWED = "NOT ALLOWED"
55 UPLOAD_OK = "UPLOAD OK"
56 UPLOAD_KO = "UPLOAD KO"
57
58 # directories
59 MEDIA_DIR = "media/"
60 CACHE_DIR = "cache"
61
62 # avatars
63 DEFAULT_AVATAR_FILE = "default_avatar.png"
64 DEFAULT_AVATAR_URL = os.path.join(MEDIA_DIR, "misc", DEFAULT_AVATAR_FILE)
65 EMPTY_AVATAR_FILE = "empty_avatar"
66 EMPTY_AVATAR_URL = os.path.join(MEDIA_DIR, "misc", EMPTY_AVATAR_FILE)
67
68 # blog
69 MAM_FILTER_CATEGORY = "http://salut-a-toi.org/protocols/mam_filter_category"