comparison libervia/server/constants.py @ 1124:28e3eb3bb217

files reorganisation and installation rework: - files have been reorganised to follow other SàT projects and usual Python organisation (no more "/src" directory) - VERSION file is now used, as for other SàT projects - replace the overcomplicated setup.py be a more sane one. Pyjamas part is not compiled anymore by setup.py, it must be done separatly - removed check for data_dir if it's empty - installation tested working in virtual env - libervia launching script is now in bin/libervia
author Goffi <goffi@goffi.org>
date Sat, 25 Aug 2018 17:59:48 +0200
parents src/server/constants.py@cdd389ef97bc
children 9234f29053b0
comparison
equal deleted inserted replaced
1123:63a4b8fe9782 1124:28e3eb3bb217
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Libervia: a SAT frontend
5 # Copyright (C) 2009-2018 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 ..common import constants
21
22
23 class Const(constants.Const):
24
25 APP_NAME = "Libervia"
26 APP_NAME_FILE = "libervia"
27 SERVICE_PROFILE = "libervia" # the SàT profile that is used for exporting the service
28
29 SESSION_TIMEOUT = 7200 # Session's timeout, after that the user will be disconnected
30 HTML_DIR = "html/"
31 THEMES_DIR = "themes/"
32 THEMES_URL = "themes"
33 MEDIA_DIR = "media/"
34 CARDS_DIR = "games/cards/tarot"
35 PAGES_DIR = u"pages"
36
37 ERRNUM_BRIDGE_ERRBACK = 0 # FIXME
38 ERRNUM_LIBERVIA = 0 # FIXME
39
40 # Security limit for Libervia (get/set params)
41 SECURITY_LIMIT = 5
42
43 # Security limit for Libervia server_side
44 SERVER_SECURITY_LIMIT = constants.Const.NO_SECURITY_LIMIT
45
46 # keys for cache values we can get from browser
47 ALLOWED_ENTITY_DATA = {"avatar", "nick"}
48
49 STATIC_RSM_MAX_LIMIT = 100
50 STATIC_RSM_MAX_DEFAULT = 10
51 STATIC_RSM_MAX_COMMENTS_DEFAULT = 10
52
53 ## Libervia pages ##
54 PAGES_META_FILE = u"page_meta.py"
55 PAGES_ACCESS_NONE = (
56 u"none"
57 ) #  no access to this page (using its path will return a 404 error)
58 PAGES_ACCESS_PUBLIC = u"public"
59 PAGES_ACCESS_PROFILE = (
60 u"profile"
61 ) # a session with an existing profile must be started
62 PAGES_ACCESS_ADMIN = u"admin" #  only profiles set in admins_list can access the page
63 PAGES_ACCESS_ALL = (
64 PAGES_ACCESS_NONE,
65 PAGES_ACCESS_PUBLIC,
66 PAGES_ACCESS_PROFILE,
67 PAGES_ACCESS_ADMIN,
68 )
69 # names of the page to use for menu
70 DEFAULT_MENU = [
71 "login",
72 "chat",
73 "blog",
74 "forums",
75 "photos",
76 "files",
77 "events",
78 "tickets",
79 "merge-requests",
80 "app",
81 ]
82
83 ## Session flags ##
84 FLAG_CONFIRM = u"CONFIRM"
85
86 ## Data post ##
87 POST_NO_CONFIRM = u"POST_NO_CONFIRM"
88
89 ## HTTP methods ##
90 HTTP_METHOD_GET = u"GET"
91 HTTP_METHOD_POST = u"POST"
92
93 ## HTTP codes ##
94 HTTP_SEE_OTHER = 303
95 HTTP_NOT_MODIFIED = 304
96 HTTP_BAD_REQUEST = 400
97 HTTP_UNAUTHORIZED = 401
98 HTTP_NOT_FOUND = 404
99 HTTP_INTERNAL_ERROR = 500
100 HTTP_SERVICE_UNAVAILABLE = 503
101
102 ## Cache ##
103 CACHE_PUBSUB = 0
104
105 ## Date/Time ##
106 HTTP_DAYS = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
107 HTTP_MONTH = (
108 "Jan",
109 "Feb",
110 "Mar",
111 "Apr",
112 "May",
113 "Jun",
114 "Jul",
115 "Aug",
116 "Sep",
117 "Oct",
118 "Nov",
119 "Dec",
120 )