Mercurial > libervia-web
annotate setup.py @ 1203:251eba911d4d
server (websockets): fixed websocket handling on HTTPS connections:
Original request used to retrieve a page was stored on dynamic pages, but after the end of
it, the channel was deleted, resulting in a isSecure() always returning False, and
troubles in chain leading to the the use of the wrong session object. This patch fixes
this by reworking the way original request is used, and creating a new wrapping class
allowing to keep an API similar to iweb.IRequest, with data coming from both the original
request and the websocket request.
fix 327
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 14 Jul 2019 14:45:51 +0200 |
parents | f1f03b08e1f4 |
children | ece192e6b4db |
rev | line source |
---|---|
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
1 #!/usr/bin/env python2 |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
2 # -*- coding: utf-8 -*- |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
3 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
4 # Libervia: a Salut à Toi frontend |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
5 # Copyright (C) 2011-2018 Jérôme Poisson (goffi@goffi.org) |
818 | 6 # Copyright (C) 2013-2016 Adrien Cossa (souliane@mailoo.org) |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
7 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
8 # This program is free software: you can redistribute it and/or modify |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
9 # it under the terms of the GNU Affero General Public License as published by |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
10 # the Free Software Foundation, either version 3 of the License, or |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
11 # (at your option) any later version. |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
12 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
13 # This program is distributed in the hope that it will be useful, |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
16 # GNU Affero General Public License for more details. |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
17 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
18 # You should have received a copy of the GNU Affero General Public License |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
19 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
20 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
21 from setuptools import setup |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
22 import os |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
23 |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
24 NAME = "libervia" |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
25 |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
26 install_requires = [ |
1201
f1f03b08e1f4
install: set minimal version of sat to dev one:
Goffi <goffi@goffi.org>
parents:
1197
diff
changeset
|
27 "sat>=0.7.0.dev0", |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
28 "sat-templates", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
29 "twisted", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
30 "txJSON-RPC==0.3.1", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
31 "zope.interface", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
32 "pyopenssl", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
33 "jinja2>=2.9", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
34 "shortuuid", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
35 "autobahn", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
36 ] |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
37 long_description = u"""\ |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
38 Libervia is a web frontend for Salut à Toi (SàT), a multi-frontends and multi-purposes XMPP client. |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
39 It features chat, blog, forums, events, tickets, merge requests, file sharing, photo albums, etc. |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
40 It is also a decentralized, XMPP based web framework. |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
41 """ |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
42 |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
43 with open(os.path.join(NAME, "VERSION")) as v: |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
44 VERSION = v.read().strip() |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
45 is_dev_version = VERSION.endswith("D") |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
46 |
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
47 |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
48 def libervia_dev_version(): |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
49 """Use mercurial data to compute version""" |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
50 |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
51 def version_scheme(version): |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
52 return VERSION.replace("D", ".dev0") |
360
9834136b15ed
added setup.py for the installation with setuptools
souliane <souliane@mailoo.org>
parents:
diff
changeset
|
53 |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
54 def local_scheme(version): |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
55 return "+{rev}.{distance}".format(rev=version.node[1:], distance=version.distance) |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
56 |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
57 return {"version_scheme": version_scheme, "local_scheme": local_scheme} |
449
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
58 |
981ed669d3b3
/!\ reorganize all the file hierarchy, move the code and launching script to src:
souliane <souliane@mailoo.org>
parents:
447
diff
changeset
|
59 |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
60 setup( |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
61 name=NAME, |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
62 version=VERSION, |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
63 description=u"Web frontend for Salut à Toi", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
64 long_description=long_description, |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
65 author="Association « Salut à Toi »", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
66 author_email="contact@goffi.org", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
67 url="https://www.salut-a-toi.org", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
68 classifiers=[ |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
69 "Development Status :: 3 - Alpha", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
70 "Environment :: Web Environment", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
71 "Framework :: Twisted", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
72 "License :: OSI Approved :: GNU Affero General Public License v3 " |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
73 "or later (AGPLv3+)", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
74 "Operating System :: POSIX :: Linux", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
75 "Topic :: Communications :: Chat", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
76 ], |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
77 packages=["libervia", "libervia.common", "libervia.server", "twisted.plugins"], |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
78 include_package_data=True, |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
79 data_files=[(os.path.join("share", "doc", NAME), ["COPYING", "README", "INSTALL"])] |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
80 + [ |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
81 (os.path.join("share", NAME, root), [os.path.join(root, f) for f in files]) |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
82 for root, dirs, files in os.walk(u"themes") |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
83 ], |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
84 scripts=["bin/libervia"], |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
85 zip_safe=False, |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
86 setup_requires=["setuptools_scm"] if is_dev_version else [], |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
87 use_scm_version=libervia_dev_version if is_dev_version else False, |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
88 install_requires=install_requires, |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
89 package_data={"libervia": ["VERSION"]}, |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
90 python_requires="~=2.7", |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
1121
diff
changeset
|
91 ) |