slidge 0.1.0rc1__tar.gz → 0.1.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- slidge-0.1.1/PKG-INFO +110 -0
- slidge-0.1.1/README.md +85 -0
- slidge-0.1.1/pyproject.toml +88 -0
- slidge-0.1.1/slidge/__init__.py +61 -0
- {slidge-0.1.0rc1 → slidge-0.1.1}/slidge/__main__.py +51 -5
- slidge-0.1.1/slidge/command/__init__.py +28 -0
- slidge-0.1.1/slidge/command/adhoc.py +258 -0
- slidge-0.1.1/slidge/command/admin.py +193 -0
- slidge-0.1.1/slidge/command/base.py +441 -0
- slidge-0.1.1/slidge/command/categories.py +3 -0
- slidge-0.1.1/slidge/command/chat_command.py +288 -0
- slidge-0.1.1/slidge/command/register.py +179 -0
- slidge-0.1.1/slidge/command/user.py +250 -0
- slidge-0.1.1/slidge/contact/__init__.py +8 -0
- slidge-0.1.1/slidge/contact/contact.py +452 -0
- slidge-0.1.1/slidge/contact/roster.py +192 -0
- {slidge-0.1.0rc1 → slidge-0.1.1}/slidge/core/__init__.py +2 -0
- slidge-0.1.1/slidge/core/cache.py +183 -0
- slidge-0.1.1/slidge/core/config.py +216 -0
- slidge-0.1.1/slidge/core/gateway/__init__.py +3 -0
- slidge-0.1.1/slidge/core/gateway/base.py +895 -0
- slidge-0.1.1/slidge/core/gateway/caps.py +63 -0
- slidge-0.1.1/slidge/core/gateway/delivery_receipt.py +52 -0
- slidge-0.1.1/slidge/core/gateway/disco.py +80 -0
- slidge-0.1.1/slidge/core/gateway/mam.py +75 -0
- slidge-0.1.1/slidge/core/gateway/muc_admin.py +35 -0
- slidge-0.1.1/slidge/core/gateway/ping.py +66 -0
- slidge-0.1.1/slidge/core/gateway/presence.py +95 -0
- slidge-0.1.1/slidge/core/gateway/registration.py +53 -0
- slidge-0.1.1/slidge/core/gateway/search.py +102 -0
- slidge-0.1.1/slidge/core/gateway/session_dispatcher.py +789 -0
- slidge-0.1.1/slidge/core/gateway/vcard_temp.py +130 -0
- {slidge-0.1.0rc1 → slidge-0.1.1}/slidge/core/mixins/__init__.py +9 -1
- slidge-0.1.1/slidge/core/mixins/attachment.py +506 -0
- slidge-0.1.1/slidge/core/mixins/avatar.py +167 -0
- slidge-0.1.1/slidge/core/mixins/base.py +31 -0
- slidge-0.1.1/slidge/core/mixins/disco.py +130 -0
- slidge-0.1.1/slidge/core/mixins/lock.py +31 -0
- slidge-0.1.1/slidge/core/mixins/message.py +398 -0
- slidge-0.1.1/slidge/core/mixins/message_maker.py +154 -0
- slidge-0.1.1/slidge/core/mixins/presence.py +217 -0
- slidge-0.1.1/slidge/core/mixins/recipient.py +43 -0
- slidge-0.1.1/slidge/core/pubsub.py +525 -0
- slidge-0.1.1/slidge/core/session.py +768 -0
- slidge-0.1.1/slidge/group/__init__.py +10 -0
- slidge-0.1.1/slidge/group/archive.py +125 -0
- slidge-0.1.1/slidge/group/bookmarks.py +163 -0
- slidge-0.1.1/slidge/group/participant.py +458 -0
- slidge-0.1.1/slidge/group/room.py +1103 -0
- slidge-0.1.1/slidge/migration.py +18 -0
- slidge-0.1.1/slidge/slixfix/__init__.py +68 -0
- {slidge-0.1.0rc1/slidge/util/xep_0050 → slidge-0.1.1/slidge/slixfix/link_preview}/__init__.py +4 -5
- slidge-0.1.1/slidge/slixfix/link_preview/link_preview.py +17 -0
- slidge-0.1.1/slidge/slixfix/link_preview/stanza.py +99 -0
- slidge-0.1.1/slidge/slixfix/roster.py +60 -0
- {slidge-0.1.0rc1/slidge/util → slidge-0.1.1/slidge/slixfix}/xep_0077/register.py +1 -2
- slidge-0.1.1/slidge/slixfix/xep_0077/stanza.py +104 -0
- {slidge-0.1.0rc1/slidge/util → slidge-0.1.1/slidge/slixfix}/xep_0100/gateway.py +17 -12
- slidge-0.1.1/slidge/slixfix/xep_0153/__init__.py +10 -0
- slidge-0.1.1/slidge/slixfix/xep_0153/stanza.py +25 -0
- slidge-0.1.1/slidge/slixfix/xep_0153/vcard_avatar.py +23 -0
- slidge-0.1.1/slidge/slixfix/xep_0264/__init__.py +5 -0
- slidge-0.1.1/slidge/slixfix/xep_0264/stanza.py +36 -0
- slidge-0.1.1/slidge/slixfix/xep_0264/thumbnail.py +23 -0
- slidge-0.1.1/slidge/slixfix/xep_0292/__init__.py +5 -0
- slidge-0.1.1/slidge/slixfix/xep_0292/vcard4.py +100 -0
- slidge-0.1.1/slidge/slixfix/xep_0313/__init__.py +12 -0
- slidge-0.1.1/slidge/slixfix/xep_0313/mam.py +262 -0
- slidge-0.1.1/slidge/slixfix/xep_0313/stanza.py +359 -0
- slidge-0.1.1/slidge/slixfix/xep_0317/__init__.py +5 -0
- slidge-0.1.1/slidge/slixfix/xep_0317/hats.py +17 -0
- slidge-0.1.1/slidge/slixfix/xep_0317/stanza.py +28 -0
- {slidge-0.1.0rc1/slidge/util → slidge-0.1.1/slidge/slixfix}/xep_0356_old/privilege.py +9 -7
- slidge-0.1.1/slidge/slixfix/xep_0424/__init__.py +9 -0
- slidge-0.1.1/slidge/slixfix/xep_0424/retraction.py +77 -0
- slidge-0.1.1/slidge/slixfix/xep_0424/stanza.py +28 -0
- slidge-0.1.1/slidge/slixfix/xep_0490/__init__.py +8 -0
- slidge-0.1.1/slidge/slixfix/xep_0490/mds.py +47 -0
- slidge-0.1.1/slidge/slixfix/xep_0490/stanza.py +17 -0
- {slidge-0.1.0rc1 → slidge-0.1.1}/slidge/util/__init__.py +4 -6
- slidge-0.1.1/slidge/util/archive_msg.py +61 -0
- {slidge-0.1.0rc1 → slidge-0.1.1}/slidge/util/conf.py +25 -4
- {slidge-0.1.0rc1 → slidge-0.1.1}/slidge/util/db.py +23 -69
- slidge-0.1.1/slidge/util/schema.sql +126 -0
- slidge-0.1.1/slidge/util/sql.py +508 -0
- {slidge-0.1.0rc1 → slidge-0.1.1}/slidge/util/test.py +136 -86
- slidge-0.1.1/slidge/util/types.py +180 -0
- slidge-0.1.1/slidge/util/util.py +295 -0
- slidge-0.1.0rc1/PKG-INFO +0 -171
- slidge-0.1.0rc1/README.md +0 -132
- slidge-0.1.0rc1/pyproject.toml +0 -65
- slidge-0.1.0rc1/setup.py +0 -69
- slidge-0.1.0rc1/slidge/__init__.py +0 -38
- slidge-0.1.0rc1/slidge/core/adhoc.py +0 -492
- slidge-0.1.0rc1/slidge/core/cache.py +0 -101
- slidge-0.1.0rc1/slidge/core/chat_command.py +0 -197
- slidge-0.1.0rc1/slidge/core/config.py +0 -111
- slidge-0.1.0rc1/slidge/core/contact.py +0 -441
- slidge-0.1.0rc1/slidge/core/disco.py +0 -59
- slidge-0.1.0rc1/slidge/core/gateway.py +0 -899
- slidge-0.1.0rc1/slidge/core/mixins/base.py +0 -44
- slidge-0.1.0rc1/slidge/core/mixins/disco.py +0 -79
- slidge-0.1.0rc1/slidge/core/mixins/message.py +0 -396
- slidge-0.1.0rc1/slidge/core/mixins/presence.py +0 -120
- slidge-0.1.0rc1/slidge/core/muc/__init__.py +0 -3
- slidge-0.1.0rc1/slidge/core/muc/bookmarks.py +0 -74
- slidge-0.1.0rc1/slidge/core/muc/participant.py +0 -152
- slidge-0.1.0rc1/slidge/core/muc/room.py +0 -348
- slidge-0.1.0rc1/slidge/core/pubsub.py +0 -366
- slidge-0.1.0rc1/slidge/core/session.py +0 -700
- slidge-0.1.0rc1/slidge/plugins/discord/__init__.py +0 -121
- slidge-0.1.0rc1/slidge/plugins/discord/client.py +0 -121
- slidge-0.1.0rc1/slidge/plugins/discord/session.py +0 -172
- slidge-0.1.0rc1/slidge/plugins/dummy.py +0 -334
- slidge-0.1.0rc1/slidge/plugins/facebook.py +0 -591
- slidge-0.1.0rc1/slidge/plugins/hackernews.py +0 -209
- slidge-0.1.0rc1/slidge/plugins/mattermost/__init__.py +0 -1
- slidge-0.1.0rc1/slidge/plugins/mattermost/api.py +0 -288
- slidge-0.1.0rc1/slidge/plugins/mattermost/gateway.py +0 -417
- slidge-0.1.0rc1/slidge/plugins/mattermost/websocket.py +0 -248
- slidge-0.1.0rc1/slidge/plugins/signal/__init__.py +0 -4
- slidge-0.1.0rc1/slidge/plugins/signal/config.py +0 -4
- slidge-0.1.0rc1/slidge/plugins/signal/contact.py +0 -104
- slidge-0.1.0rc1/slidge/plugins/signal/gateway.py +0 -379
- slidge-0.1.0rc1/slidge/plugins/signal/group.py +0 -76
- slidge-0.1.0rc1/slidge/plugins/signal/session.py +0 -515
- slidge-0.1.0rc1/slidge/plugins/signal/txt.py +0 -13
- slidge-0.1.0rc1/slidge/plugins/signal/util.py +0 -32
- slidge-0.1.0rc1/slidge/plugins/skype.py +0 -310
- slidge-0.1.0rc1/slidge/plugins/steam.py +0 -400
- slidge-0.1.0rc1/slidge/plugins/telegram/__init__.py +0 -6
- slidge-0.1.0rc1/slidge/plugins/telegram/client.py +0 -325
- slidge-0.1.0rc1/slidge/plugins/telegram/config.py +0 -21
- slidge-0.1.0rc1/slidge/plugins/telegram/contact.py +0 -154
- slidge-0.1.0rc1/slidge/plugins/telegram/gateway.py +0 -182
- slidge-0.1.0rc1/slidge/plugins/telegram/group.py +0 -184
- slidge-0.1.0rc1/slidge/plugins/telegram/session.py +0 -275
- slidge-0.1.0rc1/slidge/plugins/telegram/util.py +0 -153
- slidge-0.1.0rc1/slidge/plugins/whatsapp/__init__.py +0 -6
- slidge-0.1.0rc1/slidge/plugins/whatsapp/config.py +0 -17
- slidge-0.1.0rc1/slidge/plugins/whatsapp/contact.py +0 -33
- slidge-0.1.0rc1/slidge/plugins/whatsapp/event.go +0 -455
- slidge-0.1.0rc1/slidge/plugins/whatsapp/gateway.go +0 -156
- slidge-0.1.0rc1/slidge/plugins/whatsapp/gateway.py +0 -69
- slidge-0.1.0rc1/slidge/plugins/whatsapp/go.mod +0 -17
- slidge-0.1.0rc1/slidge/plugins/whatsapp/go.sum +0 -22
- slidge-0.1.0rc1/slidge/plugins/whatsapp/session.go +0 -371
- slidge-0.1.0rc1/slidge/plugins/whatsapp/session.py +0 -370
- slidge-0.1.0rc1/slidge/util/types.py +0 -39
- slidge-0.1.0rc1/slidge/util/util.py +0 -121
- slidge-0.1.0rc1/slidge/util/xep_0030/__init__.py +0 -13
- slidge-0.1.0rc1/slidge/util/xep_0030/disco.py +0 -811
- slidge-0.1.0rc1/slidge/util/xep_0030/stanza/__init__.py +0 -7
- slidge-0.1.0rc1/slidge/util/xep_0030/stanza/info.py +0 -270
- slidge-0.1.0rc1/slidge/util/xep_0030/stanza/items.py +0 -147
- slidge-0.1.0rc1/slidge/util/xep_0030/static.py +0 -467
- slidge-0.1.0rc1/slidge/util/xep_0050/adhoc.py +0 -631
- slidge-0.1.0rc1/slidge/util/xep_0050/stanza.py +0 -180
- slidge-0.1.0rc1/slidge/util/xep_0077/stanza.py +0 -71
- slidge-0.1.0rc1/slidge/util/xep_0292/__init__.py +0 -1
- slidge-0.1.0rc1/slidge/util/xep_0292/stanza.py +0 -167
- slidge-0.1.0rc1/slidge/util/xep_0292/vcard4.py +0 -74
- slidge-0.1.0rc1/slidge/util/xep_0356/__init__.py +0 -7
- slidge-0.1.0rc1/slidge/util/xep_0356/permissions.py +0 -35
- slidge-0.1.0rc1/slidge/util/xep_0356/privilege.py +0 -160
- slidge-0.1.0rc1/slidge/util/xep_0356/stanza.py +0 -44
- slidge-0.1.0rc1/slidge/util/xep_0461/__init__.py +0 -6
- slidge-0.1.0rc1/slidge/util/xep_0461/reply.py +0 -48
- slidge-0.1.0rc1/slidge/util/xep_0461/stanza.py +0 -80
- {slidge-0.1.0rc1 → slidge-0.1.1}/LICENSE +0 -0
- /slidge-0.1.0rc1/slidge/plugins/__init__.py → /slidge-0.1.1/slidge/py.typed +0 -0
- {slidge-0.1.0rc1/slidge/util → slidge-0.1.1/slidge/slixfix}/xep_0077/__init__.py +0 -0
- {slidge-0.1.0rc1/slidge/util → slidge-0.1.1/slidge/slixfix}/xep_0100/__init__.py +0 -0
- {slidge-0.1.0rc1/slidge/util → slidge-0.1.1/slidge/slixfix}/xep_0100/stanza.py +0 -0
- {slidge-0.1.0rc1/slidge/util → slidge-0.1.1/slidge/slixfix}/xep_0356_old/__init__.py +0 -0
- {slidge-0.1.0rc1/slidge/util → slidge-0.1.1/slidge/slixfix}/xep_0356_old/stanza.py +0 -0
slidge-0.1.1/PKG-INFO
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: slidge
|
3
|
+
Version: 0.1.1
|
4
|
+
Summary: XMPP bridging framework
|
5
|
+
Home-page: https://sr.ht/~nicoco/slidge/
|
6
|
+
License: AGPL-3.0-or-later
|
7
|
+
Author: Nicolas Cedilnik
|
8
|
+
Author-email: nicoco@nicoco.fr
|
9
|
+
Requires-Python: >=3.9,<4.0
|
10
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
15
|
+
Requires-Dist: ConfigArgParse (>=1.5.3,<2.0.0)
|
16
|
+
Requires-Dist: Pillow (>=10,<11)
|
17
|
+
Requires-Dist: aiohttp[speedups] (>=3.8.3,<4.0.0)
|
18
|
+
Requires-Dist: blurhash-python (>=1.2.1,<2.0.0)
|
19
|
+
Requires-Dist: pickle-secure (>=0.99.9,<0.100.0)
|
20
|
+
Requires-Dist: python-magic (>=0.4.27,<0.5.0)
|
21
|
+
Requires-Dist: qrcode (>=7.4.1,<8.0.0)
|
22
|
+
Requires-Dist: slixmpp (>=1.8.5,<2.0.0)
|
23
|
+
Description-Content-Type: text/markdown
|
24
|
+
|
25
|
+

|
26
|
+
|
27
|
+
[Home](https://sr.ht/~nicoco/slidge) |
|
28
|
+
[Docs](https://slidge.im/core) |
|
29
|
+
[Source](https://sr.ht/~nicoco/slidge/sources) |
|
30
|
+
[Issues](https://sr.ht/~nicoco/slidge/trackers) |
|
31
|
+
[Patches](https://lists.sr.ht/~nicoco/public-inbox) |
|
32
|
+
[Chat](xmpp:slidge@conference.nicoco.fr?join)
|
33
|
+
|
34
|
+
[](https://builds.sr.ht/~nicoco/slidge/commits/master/ci.yml?)
|
35
|
+
[](https://slidge.im/coverage)
|
36
|
+
[](https://pypi.org/project/slidge/)
|
37
|
+
|
38
|
+
Slidge is an XMPP (puppeteer) gateway library in python.
|
39
|
+
It makes
|
40
|
+
[writing gateways to other chat networks](https://slidge.im/core/dev/tutorial.html)
|
41
|
+
(*legacy modules*) as frictionless as possible.
|
42
|
+
It supports fancy IM features, such as
|
43
|
+
[(emoji) reactions](https://xmpp.org/extensions/xep-0444.html),
|
44
|
+
[replies](https://xmpp.org/extensions/xep-0461.html), and
|
45
|
+
[retractions](https://xmpp.org/extensions/xep-0424.html).
|
46
|
+
The full list of supported XEPs in on [xmpp.org](https://xmpp.org/software/slidge/).
|
47
|
+
|
48
|
+
Slidge is meant for gateway developers, if you are an XMPP server admin and
|
49
|
+
want to install gateways on your server, you are looking for one of these projects:
|
50
|
+
|
51
|
+
- [slidgnal](https://git.sr.ht/~nicoco/slidgnal) ([Signal](https://signal.org))
|
52
|
+
- [slidge-whatsapp](https://git.sr.ht/~nicoco/slidge-whatsapp) ([Whatsapp](https://whatsapp.com))
|
53
|
+
- [slidgram](https://git.sr.ht/~nicoco/slidgram) ([Telegram](https://telegram.org))
|
54
|
+
- [slidcord](https://git.sr.ht/~nicoco/slidcord) ([Discord](https://discord.com))
|
55
|
+
- [matteridge](https://git.sr.ht/~nicoco/matteridge) ([Mattermost](https://mattermost.com))
|
56
|
+
- [sleamdge](https://git.sr.ht/~nicoco/sleamdge) ([Steam](https://steamcommunity.com/))
|
57
|
+
- [skidge](https://git.sr.ht/~nicoco/skidge) ([Skype](https://skype.com/))
|
58
|
+
- [messlidger](https://git.sr.ht/~nicoco/messlidger) ([Facebook Messenger](https://messenger.com/))
|
59
|
+
- [matridge](https://git.sr.ht/~nicoco/matridge) ([Matrix](https://matrix.org/))
|
60
|
+
- [slidgevoipms](https://codeberg.org/boxedtoast/slidgevoipms) ([voip.ms](https://voip.ms/))
|
61
|
+
|
62
|
+
If you use debian, you might also be interested in the
|
63
|
+
[slidge-debian](https://git.sr.ht/~nicoco/slidge-debian)
|
64
|
+
bundle.
|
65
|
+
|
66
|
+
Status
|
67
|
+
------
|
68
|
+
|
69
|
+
Slidge is **beta**-grade software for 1:1 chats.
|
70
|
+
Group chat support is **experimental**.
|
71
|
+
|
72
|
+
Try slidge and give us some
|
73
|
+
feedback, through the [MUC](xmpp:slidge@conference.nicoco.fr?join), the
|
74
|
+
[issue tracker](https://todo.sr.ht/~nicoco/slidge) or in the
|
75
|
+
[public inbox](https://lists.sr.ht/~nicoco/public-inbox).
|
76
|
+
Don't be shy!
|
77
|
+
|
78
|
+
Installation
|
79
|
+
------------
|
80
|
+
|
81
|
+
Slidge is available on
|
82
|
+
[docker.io](https://hub.docker.com/u/nicocool84),
|
83
|
+
[pypi](https://pypi.org/project/slidge/) and as
|
84
|
+
[debian packages](https://slidge.im/core/admin/install.html#debian).
|
85
|
+
Refer to [the docs](https://slidge.im/core/admin/install.html) for details.
|
86
|
+
|
87
|
+
About privacy
|
88
|
+
-------------
|
89
|
+
|
90
|
+
Slidge (and most if not all XMPP gateway that I know of) will break
|
91
|
+
end-to-end encryption, or more precisely one of the 'ends' become the
|
92
|
+
gateway itself. If privacy is a major concern for you, my advice would
|
93
|
+
be to:
|
94
|
+
|
95
|
+
- use XMPP + OMEMO
|
96
|
+
- self-host your gateways
|
97
|
+
- have your gateways hosted by someone you know AFK and trust
|
98
|
+
|
99
|
+
Related projects
|
100
|
+
----------------
|
101
|
+
|
102
|
+
- [Spectrum](https://www.spectrum.im/)
|
103
|
+
- [telegabber](https://dev.narayana.im/narayana/telegabber)
|
104
|
+
- [biboumi](https://biboumi.louiz.org/)
|
105
|
+
- [Bifröst](https://github.com/matrix-org/matrix-bifrost)
|
106
|
+
- [Mautrix](https://github.com/mautrix)
|
107
|
+
- [matterbridge](https://github.com/42wim/matterbridge)
|
108
|
+
|
109
|
+
Thank you, [Trung](https://trung.fun/), for the slidge logo!
|
110
|
+
|
slidge-0.1.1/README.md
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+

|
2
|
+
|
3
|
+
[Home](https://sr.ht/~nicoco/slidge) |
|
4
|
+
[Docs](https://slidge.im/core) |
|
5
|
+
[Source](https://sr.ht/~nicoco/slidge/sources) |
|
6
|
+
[Issues](https://sr.ht/~nicoco/slidge/trackers) |
|
7
|
+
[Patches](https://lists.sr.ht/~nicoco/public-inbox) |
|
8
|
+
[Chat](xmpp:slidge@conference.nicoco.fr?join)
|
9
|
+
|
10
|
+
[](https://builds.sr.ht/~nicoco/slidge/commits/master/ci.yml?)
|
11
|
+
[](https://slidge.im/coverage)
|
12
|
+
[](https://pypi.org/project/slidge/)
|
13
|
+
|
14
|
+
Slidge is an XMPP (puppeteer) gateway library in python.
|
15
|
+
It makes
|
16
|
+
[writing gateways to other chat networks](https://slidge.im/core/dev/tutorial.html)
|
17
|
+
(*legacy modules*) as frictionless as possible.
|
18
|
+
It supports fancy IM features, such as
|
19
|
+
[(emoji) reactions](https://xmpp.org/extensions/xep-0444.html),
|
20
|
+
[replies](https://xmpp.org/extensions/xep-0461.html), and
|
21
|
+
[retractions](https://xmpp.org/extensions/xep-0424.html).
|
22
|
+
The full list of supported XEPs in on [xmpp.org](https://xmpp.org/software/slidge/).
|
23
|
+
|
24
|
+
Slidge is meant for gateway developers, if you are an XMPP server admin and
|
25
|
+
want to install gateways on your server, you are looking for one of these projects:
|
26
|
+
|
27
|
+
- [slidgnal](https://git.sr.ht/~nicoco/slidgnal) ([Signal](https://signal.org))
|
28
|
+
- [slidge-whatsapp](https://git.sr.ht/~nicoco/slidge-whatsapp) ([Whatsapp](https://whatsapp.com))
|
29
|
+
- [slidgram](https://git.sr.ht/~nicoco/slidgram) ([Telegram](https://telegram.org))
|
30
|
+
- [slidcord](https://git.sr.ht/~nicoco/slidcord) ([Discord](https://discord.com))
|
31
|
+
- [matteridge](https://git.sr.ht/~nicoco/matteridge) ([Mattermost](https://mattermost.com))
|
32
|
+
- [sleamdge](https://git.sr.ht/~nicoco/sleamdge) ([Steam](https://steamcommunity.com/))
|
33
|
+
- [skidge](https://git.sr.ht/~nicoco/skidge) ([Skype](https://skype.com/))
|
34
|
+
- [messlidger](https://git.sr.ht/~nicoco/messlidger) ([Facebook Messenger](https://messenger.com/))
|
35
|
+
- [matridge](https://git.sr.ht/~nicoco/matridge) ([Matrix](https://matrix.org/))
|
36
|
+
- [slidgevoipms](https://codeberg.org/boxedtoast/slidgevoipms) ([voip.ms](https://voip.ms/))
|
37
|
+
|
38
|
+
If you use debian, you might also be interested in the
|
39
|
+
[slidge-debian](https://git.sr.ht/~nicoco/slidge-debian)
|
40
|
+
bundle.
|
41
|
+
|
42
|
+
Status
|
43
|
+
------
|
44
|
+
|
45
|
+
Slidge is **beta**-grade software for 1:1 chats.
|
46
|
+
Group chat support is **experimental**.
|
47
|
+
|
48
|
+
Try slidge and give us some
|
49
|
+
feedback, through the [MUC](xmpp:slidge@conference.nicoco.fr?join), the
|
50
|
+
[issue tracker](https://todo.sr.ht/~nicoco/slidge) or in the
|
51
|
+
[public inbox](https://lists.sr.ht/~nicoco/public-inbox).
|
52
|
+
Don't be shy!
|
53
|
+
|
54
|
+
Installation
|
55
|
+
------------
|
56
|
+
|
57
|
+
Slidge is available on
|
58
|
+
[docker.io](https://hub.docker.com/u/nicocool84),
|
59
|
+
[pypi](https://pypi.org/project/slidge/) and as
|
60
|
+
[debian packages](https://slidge.im/core/admin/install.html#debian).
|
61
|
+
Refer to [the docs](https://slidge.im/core/admin/install.html) for details.
|
62
|
+
|
63
|
+
About privacy
|
64
|
+
-------------
|
65
|
+
|
66
|
+
Slidge (and most if not all XMPP gateway that I know of) will break
|
67
|
+
end-to-end encryption, or more precisely one of the 'ends' become the
|
68
|
+
gateway itself. If privacy is a major concern for you, my advice would
|
69
|
+
be to:
|
70
|
+
|
71
|
+
- use XMPP + OMEMO
|
72
|
+
- self-host your gateways
|
73
|
+
- have your gateways hosted by someone you know AFK and trust
|
74
|
+
|
75
|
+
Related projects
|
76
|
+
----------------
|
77
|
+
|
78
|
+
- [Spectrum](https://www.spectrum.im/)
|
79
|
+
- [telegabber](https://dev.narayana.im/narayana/telegabber)
|
80
|
+
- [biboumi](https://biboumi.louiz.org/)
|
81
|
+
- [Bifröst](https://github.com/matrix-org/matrix-bifrost)
|
82
|
+
- [Mautrix](https://github.com/mautrix)
|
83
|
+
- [matterbridge](https://github.com/42wim/matterbridge)
|
84
|
+
|
85
|
+
Thank you, [Trung](https://trung.fun/), for the slidge logo!
|
@@ -0,0 +1,88 @@
|
|
1
|
+
[tool.poetry]
|
2
|
+
name = "slidge"
|
3
|
+
version = "0.1.1"
|
4
|
+
description = "XMPP bridging framework"
|
5
|
+
authors = ["Nicolas Cedilnik <nicoco@nicoco.fr>"]
|
6
|
+
readme = "README.md"
|
7
|
+
license = "AGPL-3.0-or-later"
|
8
|
+
homepage = "https://sr.ht/~nicoco/slidge/"
|
9
|
+
include = ["slidge/util/schema.sql"]
|
10
|
+
|
11
|
+
[tool.poetry.dependencies]
|
12
|
+
python = "^3.9"
|
13
|
+
qrcode = "^7.4.1"
|
14
|
+
Pillow = "^10"
|
15
|
+
aiohttp = {version = "^3.8.3", extras = ["speedups"]}
|
16
|
+
ConfigArgParse = "^1.5.3"
|
17
|
+
pickle-secure = "^0.99.9"
|
18
|
+
python-magic = "^0.4.27"
|
19
|
+
slixmpp = "^1.8.5"
|
20
|
+
blurhash-python = "^1.2.1"
|
21
|
+
|
22
|
+
[build-system]
|
23
|
+
requires = ["poetry-core>=1.0.0"]
|
24
|
+
build-backend = "poetry.core.masonry.api"
|
25
|
+
|
26
|
+
[tool.poetry.group.dev.dependencies]
|
27
|
+
pytest = "^7.2.0"
|
28
|
+
pytest-asyncio = "*"
|
29
|
+
black = { version = "*", extras = ["d"] }
|
30
|
+
Sphinx = "^7"
|
31
|
+
Pygments = "^2.8.0"
|
32
|
+
sphinx-argparse = "^0.4.0"
|
33
|
+
sphinx-autoapi = "^3.0.0"
|
34
|
+
furo = "^2023.03.27"
|
35
|
+
mypy = "^1.2"
|
36
|
+
isort = "^5.11.4"
|
37
|
+
ruff = "^0.0.259"
|
38
|
+
xmldiff = "^2.5"
|
39
|
+
types-pillow = "^9.5.0.0"
|
40
|
+
pre-commit = "^3.3.0"
|
41
|
+
coverage = "^7.2.7"
|
42
|
+
|
43
|
+
[tool.poetry.group.dev.dependencies.slidge-dev-helpers]
|
44
|
+
git = "https://git.sr.ht/~nicoco/slidge-dev-helpers"
|
45
|
+
branch = "master"
|
46
|
+
|
47
|
+
[tool.poetry.scripts]
|
48
|
+
slidge = 'slidge.__main__:main'
|
49
|
+
|
50
|
+
[tool.mypy]
|
51
|
+
check_untyped_defs = true
|
52
|
+
files = ["slidge", "superduper"]
|
53
|
+
exclude = ["tests", "slidge.slixfix.*"]
|
54
|
+
|
55
|
+
[[tool.mypy.overrides]]
|
56
|
+
module = [
|
57
|
+
"blurhash",
|
58
|
+
"configargparse",
|
59
|
+
"qrcode",
|
60
|
+
]
|
61
|
+
ignore_missing_imports = true
|
62
|
+
|
63
|
+
[tool.ruff]
|
64
|
+
line-length = 120
|
65
|
+
exclude = ["xep_*", "tests"]
|
66
|
+
|
67
|
+
[tool.isort]
|
68
|
+
profile = "black"
|
69
|
+
|
70
|
+
[tool.coverage.run]
|
71
|
+
source = ["slidge"]
|
72
|
+
|
73
|
+
[tool.coverage.report]
|
74
|
+
exclude_lines = [
|
75
|
+
"if .*TYPE_CHECKING:",
|
76
|
+
"raise NotImplementedError"
|
77
|
+
]
|
78
|
+
|
79
|
+
[tool.pytest.ini_options]
|
80
|
+
log_cli = true
|
81
|
+
log_level = "DEBUG"
|
82
|
+
asyncio_mode = "strict"
|
83
|
+
filterwarnings = [
|
84
|
+
"ignore:The object should be created within an async function:DeprecationWarning:aiohttp",
|
85
|
+
"ignore:.*pkg_resources.*:DeprecationWarning",
|
86
|
+
"ignore::UserWarning:slidge",
|
87
|
+
"ignore:coroutine 'XMLStream._end_stream_wait' was never awaited.*:RuntimeWarning"
|
88
|
+
]
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"""
|
2
|
+
The main slidge package.
|
3
|
+
|
4
|
+
Contains importable classes for a minimal function :term:`Legacy Module`.
|
5
|
+
"""
|
6
|
+
|
7
|
+
import sys
|
8
|
+
import warnings
|
9
|
+
|
10
|
+
from . import slixfix # noqa: F401
|
11
|
+
from .command import FormField, SearchResult # noqa: F401
|
12
|
+
from .contact import LegacyContact, LegacyRoster # noqa: F401
|
13
|
+
from .core import config as global_config # noqa: F401
|
14
|
+
from .core.gateway import BaseGateway # noqa: F401
|
15
|
+
from .core.session import BaseSession # noqa: F401
|
16
|
+
from .group import LegacyBookmarks, LegacyMUC, LegacyParticipant # noqa: F401
|
17
|
+
from .util.db import GatewayUser, user_store # noqa: F401
|
18
|
+
from .util.types import MucType # noqa: F401
|
19
|
+
from .util.util import addLoggingLevel
|
20
|
+
|
21
|
+
from .__main__ import main # isort: skip
|
22
|
+
|
23
|
+
|
24
|
+
def entrypoint(module_name: str) -> None:
|
25
|
+
"""
|
26
|
+
Entrypoint to be used in ``__main__.py`` of
|
27
|
+
:term:`legacy modules <Legacy Module>`.
|
28
|
+
|
29
|
+
:param module_name: An importable :term:`Legacy Module`.
|
30
|
+
"""
|
31
|
+
sys.argv.extend(["--legacy", module_name])
|
32
|
+
main()
|
33
|
+
|
34
|
+
|
35
|
+
def formatwarning(message, category, filename, lineno, line=""):
|
36
|
+
return f"{filename}:{lineno}:{category.__name__}:{message}\n"
|
37
|
+
|
38
|
+
|
39
|
+
warnings.formatwarning = formatwarning
|
40
|
+
|
41
|
+
|
42
|
+
__all__ = [
|
43
|
+
"BaseGateway",
|
44
|
+
"BaseSession",
|
45
|
+
# For backwards compatibility, these names are still importable from the
|
46
|
+
# top-level slidge module, but this is deprecated.
|
47
|
+
# "GatewayUser",
|
48
|
+
# "LegacyBookmarks",
|
49
|
+
# "LegacyMUC",
|
50
|
+
# "LegacyContact",
|
51
|
+
# "LegacyParticipant",
|
52
|
+
# "LegacyRoster",
|
53
|
+
# "MucType",
|
54
|
+
# "FormField",
|
55
|
+
# "SearchResult",
|
56
|
+
"entrypoint",
|
57
|
+
"user_store",
|
58
|
+
"global_config",
|
59
|
+
]
|
60
|
+
|
61
|
+
addLoggingLevel()
|
@@ -1,9 +1,22 @@
|
|
1
1
|
"""
|
2
2
|
Slidge can be configured via CLI args, environment variables and/or INI files.
|
3
|
+
|
3
4
|
To use env vars, use this convention: ``--home-dir`` becomes ``HOME_DIR``.
|
5
|
+
|
6
|
+
Everything in ``/etc/slidge/conf.d/*`` is automatically used.
|
7
|
+
To use a plugin-specific INI file, put it in another dir,
|
8
|
+
and launch slidge with ``-c /path/to/plugin-specific.conf``.
|
9
|
+
Use the long version of the CLI arg without the double dash prefix inside this
|
10
|
+
INI file, eg ``debug=true``.
|
11
|
+
|
12
|
+
An example configuration file is available at
|
13
|
+
https://git.sr.ht/~nicoco/slidge/tree/master/item/dev/confs/slidge-example.ini
|
4
14
|
"""
|
15
|
+
|
16
|
+
import asyncio
|
5
17
|
import importlib
|
6
18
|
import logging
|
19
|
+
import os
|
7
20
|
import signal
|
8
21
|
from pathlib import Path
|
9
22
|
|
@@ -12,13 +25,22 @@ import configargparse
|
|
12
25
|
from slidge import BaseGateway
|
13
26
|
from slidge.core import config
|
14
27
|
from slidge.core.cache import avatar_cache
|
28
|
+
from slidge.migration import migrate
|
15
29
|
from slidge.util.conf import ConfigModule
|
16
30
|
from slidge.util.db import user_store
|
31
|
+
from slidge.util.util import get_version # noqa: F401
|
17
32
|
|
18
33
|
|
19
34
|
class MainConfig(ConfigModule):
|
20
35
|
def update_dynamic_defaults(self, args):
|
21
|
-
|
36
|
+
# force=True is needed in case we call a logger before this is reached,
|
37
|
+
# or basicConfig has no effect
|
38
|
+
logging.basicConfig(
|
39
|
+
level=args.loglevel,
|
40
|
+
filename=args.log_file,
|
41
|
+
force=True,
|
42
|
+
format=args.log_format,
|
43
|
+
)
|
22
44
|
|
23
45
|
if args.home_dir is None:
|
24
46
|
args.home_dir = Path("/var/lib/slidge") / str(args.jid)
|
@@ -33,7 +55,10 @@ class SigTermInterrupt(Exception):
|
|
33
55
|
|
34
56
|
def get_configurator():
|
35
57
|
p = configargparse.ArgumentParser(
|
36
|
-
default_config_files=
|
58
|
+
default_config_files=os.getenv(
|
59
|
+
"SLIDGE_CONF_DIR", "/etc/slidge/conf.d/*.conf"
|
60
|
+
).split(":"),
|
61
|
+
description=__doc__,
|
37
62
|
)
|
38
63
|
p.add_argument(
|
39
64
|
"-c",
|
@@ -61,6 +86,11 @@ def get_configurator():
|
|
61
86
|
const=logging.DEBUG,
|
62
87
|
env_var="SLIDGE_DEBUG",
|
63
88
|
)
|
89
|
+
p.add_argument(
|
90
|
+
"--version",
|
91
|
+
action="version",
|
92
|
+
version=f"%(prog)s {__version__}",
|
93
|
+
)
|
64
94
|
configurator = MainConfig(config, p)
|
65
95
|
return configurator
|
66
96
|
|
@@ -80,7 +110,7 @@ def configure():
|
|
80
110
|
db_file = config.HOME_DIR / "slidge.db"
|
81
111
|
user_store.set_file(db_file, args.secret_key)
|
82
112
|
|
83
|
-
avatar_cache.set_dir(h / "
|
113
|
+
avatar_cache.set_dir(h / "slidge_avatars_v2")
|
84
114
|
|
85
115
|
config.UPLOAD_REQUESTER = config.UPLOAD_REQUESTER or config.JID.bare
|
86
116
|
|
@@ -96,8 +126,15 @@ def main():
|
|
96
126
|
signal.signal(signal.SIGTERM, handle_sigterm)
|
97
127
|
|
98
128
|
unknown_argv = configure()
|
129
|
+
logging.info("Starting slidge version %s", __version__)
|
99
130
|
|
100
131
|
legacy_module = importlib.import_module(config.LEGACY_MODULE)
|
132
|
+
logging.debug("Legacy module: %s", dir(legacy_module))
|
133
|
+
logging.info(
|
134
|
+
"Starting legacy module: '%s' version %s",
|
135
|
+
config.LEGACY_MODULE,
|
136
|
+
getattr(legacy_module, "__version__", "No version"),
|
137
|
+
)
|
101
138
|
|
102
139
|
if plugin_config_obj := getattr(
|
103
140
|
legacy_module, "config", getattr(legacy_module, "Config", None)
|
@@ -112,7 +149,10 @@ def main():
|
|
112
149
|
if unknown_argv:
|
113
150
|
raise RuntimeError("Some arguments have not been recognized", unknown_argv)
|
114
151
|
|
115
|
-
|
152
|
+
migrate()
|
153
|
+
|
154
|
+
gateway: BaseGateway = BaseGateway.get_unique_subclass()()
|
155
|
+
avatar_cache.http = gateway.http
|
116
156
|
gateway.connect()
|
117
157
|
|
118
158
|
return_code = 0
|
@@ -136,17 +176,23 @@ def main():
|
|
136
176
|
return_code = 3
|
137
177
|
if gateway.is_connected():
|
138
178
|
logging.debug("Gateway is connected, cleaning up")
|
139
|
-
gateway.shutdown()
|
179
|
+
gateway.loop.run_until_complete(asyncio.gather(*gateway.shutdown()))
|
140
180
|
gateway.disconnect()
|
141
181
|
gateway.loop.run_until_complete(gateway.disconnected)
|
142
182
|
else:
|
143
183
|
logging.debug("Gateway is not connected, no need to clean up")
|
144
184
|
user_store.close()
|
145
185
|
avatar_cache.close()
|
186
|
+
gateway.loop.run_until_complete(gateway.http.close())
|
146
187
|
logging.info("Successful clean shut down")
|
147
188
|
logging.debug("Exiting with code %s", return_code)
|
148
189
|
exit(return_code)
|
149
190
|
|
150
191
|
|
192
|
+
# this should be modified before publish, but if someone cloned from the repo,
|
193
|
+
# it can help
|
194
|
+
__version__ = get_version()
|
195
|
+
|
196
|
+
|
151
197
|
if __name__ == "__main__":
|
152
198
|
main()
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"""
|
2
|
+
This module implements an unified API to define :term:`adhoc <Ad-hoc Command>`
|
3
|
+
or :term:`chatbot <Chatbot Command>` commands. Just subclass a :class:`Command`,
|
4
|
+
and make sures it is imported in your legacy module's ``__init__.py``.
|
5
|
+
"""
|
6
|
+
|
7
|
+
from . import admin, register, user # noqa: F401
|
8
|
+
from .base import (
|
9
|
+
Command,
|
10
|
+
CommandAccess,
|
11
|
+
CommandResponseType,
|
12
|
+
Confirmation,
|
13
|
+
Form,
|
14
|
+
FormField,
|
15
|
+
SearchResult,
|
16
|
+
TableResult,
|
17
|
+
)
|
18
|
+
|
19
|
+
__all__ = (
|
20
|
+
"Command",
|
21
|
+
"CommandAccess",
|
22
|
+
"CommandResponseType",
|
23
|
+
"Confirmation",
|
24
|
+
"Form",
|
25
|
+
"FormField",
|
26
|
+
"SearchResult",
|
27
|
+
"TableResult",
|
28
|
+
)
|