Matridge 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- matridge-0.3.2/.copier-answers.yml +16 -0
- {matridge-0.3.1 → matridge-0.3.2}/.woodpecker/container.yaml +41 -11
- {matridge-0.3.1 → matridge-0.3.2}/.woodpecker/docs.yaml +0 -2
- {matridge-0.3.1 → matridge-0.3.2}/.woodpecker/package.yaml +0 -2
- {matridge-0.3.1 → matridge-0.3.2}/.woodpecker/test.yaml +0 -1
- {matridge-0.3.1 → matridge-0.3.2}/CONTRIBUTING.md +1 -1
- {matridge-0.3.1 → matridge-0.3.2}/Dockerfile +11 -6
- {matridge-0.3.1/matridge.egg-info → matridge-0.3.2}/PKG-INFO +4 -4
- {matridge-0.3.1 → matridge-0.3.2}/README.md +1 -1
- {matridge-0.3.1 → matridge-0.3.2}/doap.xml +4 -11
- matridge-0.3.2/docs/source/admin/attachments.rst +153 -0
- matridge-0.3.2/docs/source/admin/config.rst +75 -0
- matridge-0.3.2/docs/source/admin/examples/ejabberd.yaml +58 -0
- matridge-0.3.2/docs/source/admin/examples/index.rst +42 -0
- matridge-0.3.2/docs/source/admin/examples/prosody-noupload.cfg.lua +33 -0
- matridge-0.3.2/docs/source/admin/examples/prosody-upload.cfg.lua +38 -0
- matridge-0.3.2/docs/source/admin/index.rst +25 -0
- matridge-0.3.2/docs/source/admin/install-custom.rst +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/docs/source/admin/install.rst +24 -17
- matridge-0.3.2/docs/source/admin/privileges.rst +104 -0
- matridge-0.3.2/docs/source/admin/quickstart.rst +71 -0
- {matridge-0.3.1 → matridge-0.3.2}/docs/source/conf.py +11 -14
- matridge-0.3.2/docs/source/contributing.rst +1 -0
- {matridge-0.3.1 → matridge-0.3.2}/docs/source/index.rst +7 -10
- matridge-0.3.2/docs/source/user/features.rst +15 -0
- matridge-0.3.2/docs/source/user/index.rst +19 -0
- matridge-0.3.2/docs/source/user/registration.rst +23 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge/config.py +0 -20
- {matridge-0.3.1 → matridge-0.3.2}/matridge/gateway.py +7 -3
- {matridge-0.3.1 → matridge-0.3.2}/matridge/matrix.py +5 -7
- {matridge-0.3.1 → matridge-0.3.2}/matridge/reactions.py +1 -1
- {matridge-0.3.1 → matridge-0.3.2}/matridge/session.py +0 -1
- {matridge-0.3.1 → matridge-0.3.2}/matridge/util.py +10 -4
- {matridge-0.3.1 → matridge-0.3.2/matridge.egg-info}/PKG-INFO +4 -4
- {matridge-0.3.1 → matridge-0.3.2}/matridge.egg-info/SOURCES.txt +8 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge.egg-info/requires.txt +1 -1
- {matridge-0.3.1 → matridge-0.3.2}/pyproject.toml +7 -14
- matridge-0.3.2/uv.lock +2405 -0
- matridge-0.3.1/.copier-answers.yml +0 -54
- matridge-0.3.1/docs/source/admin/config.rst +0 -51
- matridge-0.3.1/docs/source/admin/index.rst +0 -15
- matridge-0.3.1/docs/source/contributing.rst +0 -5
- matridge-0.3.1/docs/source/user/features.rst +0 -12
- matridge-0.3.1/docs/source/user/index.rst +0 -14
- matridge-0.3.1/docs/source/user/registration.rst +0 -16
- matridge-0.3.1/uv.lock +0 -2040
- {matridge-0.3.1 → matridge-0.3.2}/.gitignore +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/.pre-commit-config.yaml +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/LICENSE +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/assets/matrix_outline.png +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/assets/matrix_outline.svg +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/commitlint.config.js +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/docker-compose.yml +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/docs/Makefile +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/docs/source/codeberg.svg +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/docs/source/user/usage.rst +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge/__init__.py +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge/__main__.py +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge/command.py +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge/contact.py +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge/group.py +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge.egg-info/dependency_links.txt +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge.egg-info/entry_points.txt +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/matridge.egg-info/top_level.txt +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/setup.cfg +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/tests/test_base.py +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/tests/test_conversion.py +0 -0
- {matridge-0.3.1 → matridge-0.3.2}/tests/test_reactions.py +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Do not edit manually!
|
|
2
|
+
# Changes here will be overwritten by copier.
|
|
3
|
+
# https://copier.readthedocs.io/
|
|
4
|
+
_commit: 8876a2e
|
|
5
|
+
_src_path: git+https://codeberg.org/slidge/legacy-module-template
|
|
6
|
+
debian_bundle: true
|
|
7
|
+
native_build: false
|
|
8
|
+
project_name: matridge
|
|
9
|
+
repology: slidge-matridge
|
|
10
|
+
silo:
|
|
11
|
+
hostile: false
|
|
12
|
+
lib:
|
|
13
|
+
name: nio
|
|
14
|
+
url: https://matrix-nio.readthedocs.io/
|
|
15
|
+
name: Matrix
|
|
16
|
+
url: https://matrix.org
|
|
@@ -26,6 +26,20 @@ variables:
|
|
|
26
26
|
cache_images:
|
|
27
27
|
- codeberg.org/${CI_REPO_OWNER}/matridge:buildcache
|
|
28
28
|
platforms: linux/amd64,linux/arm64
|
|
29
|
+
- &paths
|
|
30
|
+
- "matridge/**"
|
|
31
|
+
- Dockerfile
|
|
32
|
+
- pyproject.toml
|
|
33
|
+
- .woodpecker/container.yaml
|
|
34
|
+
|
|
35
|
+
when:
|
|
36
|
+
- event: tag
|
|
37
|
+
- event: push
|
|
38
|
+
path: *paths
|
|
39
|
+
- event: cron
|
|
40
|
+
cron: container-main
|
|
41
|
+
- event: cron
|
|
42
|
+
cron: container-latest
|
|
29
43
|
|
|
30
44
|
steps:
|
|
31
45
|
build-tag:
|
|
@@ -34,6 +48,8 @@ steps:
|
|
|
34
48
|
event: [tag]
|
|
35
49
|
settings:
|
|
36
50
|
<<: *settings
|
|
51
|
+
build_args:
|
|
52
|
+
SLIDGE_USE_LOCKFILE: "1"
|
|
37
53
|
tags:
|
|
38
54
|
- latest
|
|
39
55
|
- ${CI_COMMIT_TAG}
|
|
@@ -41,32 +57,46 @@ steps:
|
|
|
41
57
|
build-branch:
|
|
42
58
|
when:
|
|
43
59
|
- event: push
|
|
44
|
-
path:
|
|
45
|
-
- "matridge/**"
|
|
46
|
-
- Dockerfile
|
|
47
|
-
- pyproject.toml
|
|
48
|
-
- .woodpecker/container.yaml
|
|
60
|
+
path: *paths
|
|
49
61
|
- event: cron
|
|
50
62
|
cron: container-main
|
|
51
63
|
image: woodpeckerci/plugin-docker-buildx:6.0.2
|
|
52
64
|
settings:
|
|
53
65
|
<<: *settings
|
|
66
|
+
build_args:
|
|
67
|
+
SLIDGE_PRERELEASE: "1"
|
|
54
68
|
tags:
|
|
55
69
|
- ${CI_COMMIT_BRANCH}
|
|
56
70
|
|
|
57
71
|
build-ci:
|
|
58
72
|
when:
|
|
59
|
-
|
|
60
|
-
path:
|
|
61
|
-
- "matridge/**"
|
|
62
|
-
- Dockerfile
|
|
63
|
-
- pyproject.toml
|
|
64
|
-
- .woodpecker/container.yaml
|
|
73
|
+
path: *paths
|
|
65
74
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
66
75
|
image: woodpeckerci/plugin-docker-buildx:6.0.2
|
|
67
76
|
settings:
|
|
68
77
|
<<: *settings
|
|
78
|
+
build_args:
|
|
79
|
+
SLIDGE_USE_LOCKFILE: "1"
|
|
69
80
|
target: ci
|
|
70
81
|
tag: ci
|
|
71
82
|
cache_images:
|
|
72
83
|
- codeberg.org/${CI_REPO_OWNER}/matridge:buildcache-ci
|
|
84
|
+
|
|
85
|
+
checkout-latest-tag:
|
|
86
|
+
image: woodpeckerci/plugin-git
|
|
87
|
+
when:
|
|
88
|
+
- event: cron
|
|
89
|
+
cron: container-latest
|
|
90
|
+
commands:
|
|
91
|
+
- export TAG=$(git describe --tags --abbrev=0)
|
|
92
|
+
- git checkout $TAG
|
|
93
|
+
- git reset --hard
|
|
94
|
+
- echo latest > .tags
|
|
95
|
+
|
|
96
|
+
rebuild-tag:
|
|
97
|
+
image: woodpeckerci/plugin-docker-buildx:6.0.2
|
|
98
|
+
when:
|
|
99
|
+
- event: cron
|
|
100
|
+
cron: container-latest
|
|
101
|
+
settings:
|
|
102
|
+
<<: *settings
|
|
@@ -8,14 +8,12 @@ when:
|
|
|
8
8
|
steps:
|
|
9
9
|
build:
|
|
10
10
|
image: codeberg.org/${CI_REPO_OWNER}/matridge:ci
|
|
11
|
-
pull: true
|
|
12
11
|
commands:
|
|
13
12
|
- uv sync --all-groups --all-extras
|
|
14
13
|
- cd docs && make html
|
|
15
14
|
|
|
16
15
|
publish:
|
|
17
16
|
image: codeberg.org/slidge/woodpecker-publish-pages
|
|
18
|
-
pull: true
|
|
19
17
|
when:
|
|
20
18
|
event: [push, tag]
|
|
21
19
|
settings:
|
|
@@ -34,7 +34,7 @@ certificate to your local store. In debian, you can do that with:
|
|
|
34
34
|
# download the certificate
|
|
35
35
|
curl https://codeberg.org/slidge/prosody-dev-container/raw/branch/main/localhost.crt | sudo tee /usr/local/share/ca-certificates/localhost.crt
|
|
36
36
|
# set the right perms
|
|
37
|
-
chmod 600 /usr/local/share/ca-certificates/localhost.crt
|
|
37
|
+
sudo chmod 600 /usr/local/share/ca-certificates/localhost.crt
|
|
38
38
|
# import it
|
|
39
39
|
sudo update-ca-certificates
|
|
40
40
|
```
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
ARG PYTHONVERSION=3.13
|
|
2
|
+
ARG DEBIANVERSION=trixie
|
|
3
3
|
|
|
4
4
|
# Builder
|
|
5
5
|
# *******
|
|
6
|
-
FROM ghcr.io/astral-sh/uv:
|
|
6
|
+
FROM ghcr.io/astral-sh/uv:python$PYTHONVERSION-$DEBIANVERSION-slim AS builder
|
|
7
7
|
|
|
8
8
|
# install git for setuptools scm
|
|
9
9
|
RUN apt-get update -y && \
|
|
@@ -19,12 +19,16 @@ WORKDIR /build
|
|
|
19
19
|
ENV UV_PROJECT_ENVIRONMENT=/venv
|
|
20
20
|
ENV PATH="/venv/bin:/root/.cargo/bin:$PATH"
|
|
21
21
|
RUN uv venv $UV_PROJECT_ENVIRONMENT
|
|
22
|
-
COPY pyproject.toml README.md .
|
|
22
|
+
COPY pyproject.toml uv.lock README.md .
|
|
23
23
|
COPY matridge matridge
|
|
24
|
+
ARG SLIDGE_USE_LOCKFILE=
|
|
25
|
+
RUN [ -z "$SLIDGE_USE_LOCKFILE" ] && rm uv.lock || true
|
|
24
26
|
# install dependencies in /venv
|
|
25
27
|
# .git/ needs to be mounted for setuptools-scm to set the version
|
|
26
28
|
RUN --mount=source=.git,target=/build/.git,type=bind \
|
|
27
29
|
uv sync --no-dev
|
|
30
|
+
ARG SLIDGE_PRERELEASE
|
|
31
|
+
RUN [ ! -z "$SLIDGE_PRERELEASE" ] && uv pip install slidge --upgrade --prerelease allow || true
|
|
28
32
|
|
|
29
33
|
# CI container
|
|
30
34
|
# ************
|
|
@@ -69,8 +73,9 @@ ENTRYPOINT ["watchmedo", "auto-restart", \
|
|
|
69
73
|
|
|
70
74
|
# Prod container
|
|
71
75
|
# **************
|
|
72
|
-
FROM docker.io/python
|
|
76
|
+
FROM docker.io/python:$PYTHONVERSION-slim-$DEBIANVERSION AS matridge
|
|
73
77
|
|
|
78
|
+
ARG PYTHONVERSION
|
|
74
79
|
ENV PYTHONUNBUFFERED=1
|
|
75
80
|
ENV PATH="/venv/bin:$PATH"
|
|
76
81
|
STOPSIGNAL SIGINT
|
|
@@ -87,5 +92,5 @@ RUN addgroup --system --gid 10000 slidge
|
|
|
87
92
|
RUN adduser --system --uid 10000 --ingroup slidge --home /var/lib/slidge slidge
|
|
88
93
|
USER slidge
|
|
89
94
|
COPY --from=builder /venv /venv
|
|
90
|
-
COPY --from=builder /build/matridge /venv/lib/
|
|
95
|
+
COPY --from=builder /build/matridge /venv/lib/python$PYTHONVERSION/site-packages/matridge
|
|
91
96
|
ENTRYPOINT ["matridge"]
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: matridge
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: A Matrix/XMPP gateway
|
|
5
5
|
Author-email: Nicolas Cedilnik <nicoco@nicoco.fr>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
7
7
|
Project-URL: Homepage, https://codeberg.org/slidge/matridge
|
|
8
8
|
Project-URL: Issues, https://codeberg.org/slidge/matridge/issues
|
|
9
9
|
Project-URL: Repository, https://codeberg.org/slidge/matridge
|
|
10
|
-
Project-URL: Chat room, https://slidge.im/xmpp-web/#/guest?join=
|
|
10
|
+
Project-URL: Chat room, https://slidge.im/xmpp-web/#/guest?join=support@rooms.slidge.im
|
|
11
11
|
Project-URL: Documentation, https://slidge.im/docs/matridge/main
|
|
12
12
|
Project-URL: changelog, https://codeberg.org/slidge/matridge/releases
|
|
13
13
|
Keywords: xmpp,gateway,bridge,instant messaging,chat,matrix
|
|
@@ -19,7 +19,7 @@ Requires-Dist: matrix-nio[e2e]<0.26,>=0.25
|
|
|
19
19
|
Requires-Dist: beautifulsoup4<5,>=4.12.2
|
|
20
20
|
Requires-Dist: async-lru<3,>=2.0.3
|
|
21
21
|
Requires-Dist: slidge-style-parser>=0.1.6
|
|
22
|
-
Requires-Dist: slidge<0.4,>=0.3.
|
|
22
|
+
Requires-Dist: slidge<0.4,>=0.3.3
|
|
23
23
|
Dynamic: license-file
|
|
24
24
|
|
|
25
25
|
# matridge
|
|
@@ -33,7 +33,7 @@ A
|
|
|
33
33
|
[nio](https://matrix-nio.readthedocs.io/).
|
|
34
34
|
|
|
35
35
|
[](https://ci.codeberg.org/repos/14069)
|
|
36
|
-
[](https://slidge.im/xmpp-web/#/guest?join=support@rooms.slidge.im)
|
|
37
37
|
[](https://pypi.org/project/matridge/)
|
|
38
38
|
|
|
39
39
|
[](https://repology.org/project/slidge-matridge/versions)
|
|
@@ -9,7 +9,7 @@ A
|
|
|
9
9
|
[nio](https://matrix-nio.readthedocs.io/).
|
|
10
10
|
|
|
11
11
|
[](https://ci.codeberg.org/repos/14069)
|
|
12
|
-
[](https://slidge.im/xmpp-web/#/guest?join=support@rooms.slidge.im)
|
|
13
13
|
[](https://pypi.org/project/matridge/)
|
|
14
14
|
|
|
15
15
|
[](https://repology.org/project/slidge-matridge/versions)
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<homepage rdf:resource="https://codeberg.org/slidge/matridge" />
|
|
10
10
|
<download-page rdf:resource="https://codeberg.org/slidge/matridge/releases" />
|
|
11
11
|
<bug-database rdf:resource="https://codeberg.org/slidge/matridge/issues" />
|
|
12
|
-
<developer-forum rdf:resource="xmpp:
|
|
13
|
-
<support-forum rdf:resource="xmpp:
|
|
12
|
+
<developer-forum rdf:resource="xmpp:dev@rooms.slidge.im?join" />
|
|
13
|
+
<support-forum rdf:resource="xmpp:support@rooms.slidge.im?join" />
|
|
14
14
|
|
|
15
15
|
<license
|
|
16
16
|
rdf:resource="https://codeberg.org/slidge/matridge/src/branch/main/LICENSE" />
|
|
@@ -67,21 +67,18 @@
|
|
|
67
67
|
<xmpp:SupportedXep>
|
|
68
68
|
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0201.html" />
|
|
69
69
|
<xmpp:status>complete</xmpp:status>
|
|
70
|
-
|
|
71
70
|
</xmpp:SupportedXep>
|
|
72
71
|
</implements>
|
|
73
72
|
<implements>
|
|
74
73
|
<xmpp:SupportedXep>
|
|
75
74
|
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0245.html" />
|
|
76
75
|
<xmpp:status>complete</xmpp:status>
|
|
77
|
-
|
|
78
76
|
</xmpp:SupportedXep>
|
|
79
77
|
</implements>
|
|
80
78
|
<implements>
|
|
81
79
|
<xmpp:SupportedXep>
|
|
82
80
|
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0319.html" />
|
|
83
81
|
<xmpp:status>complete</xmpp:status>
|
|
84
|
-
|
|
85
82
|
</xmpp:SupportedXep>
|
|
86
83
|
</implements>
|
|
87
84
|
<implements>
|
|
@@ -109,7 +106,7 @@
|
|
|
109
106
|
<xmpp:SupportedXep>
|
|
110
107
|
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0393.html" />
|
|
111
108
|
<xmpp:status>partial</xmpp:status>
|
|
112
|
-
<xmpp:note>Message received from XMPP
|
|
109
|
+
<xmpp:note>Message received from XMPP have their bodies parsed for Message Styling tags, plus "||spoiler||". Messages received from Matrix use their plaintext fallback.</xmpp:note>
|
|
113
110
|
</xmpp:SupportedXep>
|
|
114
111
|
</implements>
|
|
115
112
|
<implements>
|
|
@@ -123,24 +120,20 @@
|
|
|
123
120
|
<xmpp:SupportedXep>
|
|
124
121
|
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0425.html" />
|
|
125
122
|
<xmpp:status>complete</xmpp:status>
|
|
126
|
-
<xmpp:note>Matrix's redacted events are mapped to
|
|
123
|
+
<xmpp:note>Matrix's redacted events are mapped to moderation when the sender and the redacter do not match.</xmpp:note>
|
|
127
124
|
</xmpp:SupportedXep>
|
|
128
125
|
</implements>
|
|
129
126
|
<implements>
|
|
130
127
|
<xmpp:SupportedXep>
|
|
131
128
|
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0444.html" />
|
|
132
129
|
<xmpp:status>complete</xmpp:status>
|
|
133
|
-
|
|
134
130
|
</xmpp:SupportedXep>
|
|
135
131
|
</implements>
|
|
136
132
|
<implements>
|
|
137
133
|
<xmpp:SupportedXep>
|
|
138
134
|
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0461.html" />
|
|
139
135
|
<xmpp:status>complete</xmpp:status>
|
|
140
|
-
|
|
141
136
|
</xmpp:SupportedXep>
|
|
142
137
|
</implements>
|
|
143
|
-
|
|
144
|
-
|
|
145
138
|
</Project>
|
|
146
139
|
</rdf:RDF>
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
.. GENERATED FILE, DO NOT EDIT DIRECTLY
|
|
2
|
+
|
|
3
|
+
This file is automatically generated using https://codeberg.org/slidge/legacy-module-template/
|
|
4
|
+
Its source is at:
|
|
5
|
+
https://codeberg.org/slidge/legacy-module-template/src/branch/main/docs/source/admin/attachments.rst.jinja
|
|
6
|
+
Open a pull request for this repository instead, to benefit the documentation of all slidge-based gateways.
|
|
7
|
+
|
|
8
|
+
.. _attachments:
|
|
9
|
+
|
|
10
|
+
===========
|
|
11
|
+
Attachments
|
|
12
|
+
===========
|
|
13
|
+
|
|
14
|
+
.. note::
|
|
15
|
+
|
|
16
|
+
Attachments from XMPP to Matrix require no special configuration.
|
|
17
|
+
|
|
18
|
+
For matridge to bridge attachments from Matrix to XMPP, you have two options:
|
|
19
|
+
|
|
20
|
+
- **HTTP Upload**: matridge will use your XMPP server's upload component (:xep:`0363`).
|
|
21
|
+
- **No upload**: matridge will copy attachments to a path it can write to. You then need to serve these files from via an HTTP server (eg nginx,
|
|
22
|
+
prosody's `http_files <https://prosody.im/doc/modules/mod_http_files>`_, etc.).
|
|
23
|
+
|
|
24
|
+
.. _upload:
|
|
25
|
+
|
|
26
|
+
HTTP Upload
|
|
27
|
+
===========
|
|
28
|
+
|
|
29
|
+
matridge can use the HTTP Upload component (:xep:`0363`) of your XMPP server,
|
|
30
|
+
if you configure it with ``upload-service=upload.example.org`` (see :ref:`generic-config`).
|
|
31
|
+
In this setting, matridge will upload files just like any normal user of your server.
|
|
32
|
+
|
|
33
|
+
Example 1: prosody's mod_http_file_share
|
|
34
|
+
----------------------------------------
|
|
35
|
+
|
|
36
|
+
In matridge's :ref:`configuration file <config-file>`, use ``upload-service=upload.example.org``
|
|
37
|
+
|
|
38
|
+
.. code-block:: lua
|
|
39
|
+
|
|
40
|
+
modules_enabled = {
|
|
41
|
+
-- make sure http_file_share is listed here
|
|
42
|
+
"http_file_share";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Component "upload.example.org" "http_file_share"
|
|
46
|
+
-- allow matridge to use the upload component
|
|
47
|
+
http_file_share_access = { "matrix.example.org" }
|
|
48
|
+
|
|
49
|
+
More info: `mod_http_file_share <https://prosody.im/doc/modules/mod_http_file_share>`_.
|
|
50
|
+
|
|
51
|
+
Example 2: ejabberd mod_http_upload
|
|
52
|
+
-----------------------------------
|
|
53
|
+
|
|
54
|
+
In matridge's :ref:`configuration file <config-file>`, use ``upload-service=example.org``
|
|
55
|
+
|
|
56
|
+
The subdomain's FQDN (example.org) should be listed under the top level 'hosts'.
|
|
57
|
+
|
|
58
|
+
.. code-block:: yaml
|
|
59
|
+
|
|
60
|
+
hosts:
|
|
61
|
+
- "example.org"
|
|
62
|
+
|
|
63
|
+
acl:
|
|
64
|
+
slidge_acl:
|
|
65
|
+
server:
|
|
66
|
+
- "matrix.example.org"
|
|
67
|
+
|
|
68
|
+
listen:
|
|
69
|
+
-
|
|
70
|
+
port: 5443
|
|
71
|
+
module: ejabberd_http
|
|
72
|
+
tls: true
|
|
73
|
+
request_handlers:
|
|
74
|
+
/upload: mod_http_upload
|
|
75
|
+
|
|
76
|
+
modules:
|
|
77
|
+
mod_http_upload:
|
|
78
|
+
# Any path that ejabberd has read and write access to
|
|
79
|
+
docroot: /ejabberd/upload
|
|
80
|
+
put_url: "https://@HOST@:5443/upload"
|
|
81
|
+
access:
|
|
82
|
+
- allow: local
|
|
83
|
+
- allow: slidge_acl
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
To get more information about component configuration, see `ejabberd's docs
|
|
87
|
+
<https://docs.ejabberd.im/admin/configuration/modules/#mod-http-upload>`_.
|
|
88
|
+
|
|
89
|
+
.. _no-upload:
|
|
90
|
+
|
|
91
|
+
No upload
|
|
92
|
+
=========
|
|
93
|
+
|
|
94
|
+
You need to set up ``no-upload-path`` to point to a directory, and ``no-upload-url-prefix`` to an URL prefix pointing to files in that directory (see :ref:`generic-config` for more detail).
|
|
95
|
+
Example: ``no-upload-path=/var/www/matridge-attachments/`` and ``no-upload-url-prefix=https://example.org/matridge/`` means that ``/var/www/matridge-attachments/some-image.jpg`` is accessible at ``https://example.org/matridge/some-image.jpg``
|
|
96
|
+
|
|
97
|
+
Make sure that ``no-upload-path`` is writeable by matridge and readable by
|
|
98
|
+
your HTTP server. You may use ``no-upload-file-read-others=true`` to do that easily,
|
|
99
|
+
but you might want to restrict which users can read this directory.
|
|
100
|
+
|
|
101
|
+
.. warning::
|
|
102
|
+
|
|
103
|
+
matridge will not take care of removing old files, so you should set up a cronjob,
|
|
104
|
+
a systemd timer, or something similar, to regularly delete files, eg.
|
|
105
|
+
``find . -mtime +7 -delete && find . -depth -type d -empty -delete``
|
|
106
|
+
to clean up files older than a week.
|
|
107
|
+
|
|
108
|
+
For the following examples, in matridge's config,
|
|
109
|
+
you would have ``no-upload-path=/var/lib/matridge/attachments``.
|
|
110
|
+
|
|
111
|
+
Example 1: prosody's http_files
|
|
112
|
+
-------------------------------
|
|
113
|
+
|
|
114
|
+
Here, ``no-upload-url-prefix`` would be ``https://example.org:5281/files/``,
|
|
115
|
+
as per the `mod_http_files documentation <https://prosody.im/doc/modules/mod_http_files>`_.
|
|
116
|
+
|
|
117
|
+
.. code-block:: lua
|
|
118
|
+
|
|
119
|
+
modules_enabled = {
|
|
120
|
+
-- make sure http_files is listed here
|
|
121
|
+
"http_files";
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
-- Must be the same value as matridge's no-upload-path
|
|
125
|
+
http_files_dir = "/var/lib/matridge/attachments"
|
|
126
|
+
|
|
127
|
+
.. _nginx-no-upload:
|
|
128
|
+
|
|
129
|
+
Example 2: nginx
|
|
130
|
+
----------------
|
|
131
|
+
|
|
132
|
+
Here, ``no-upload-url-prefix`` would be ``https://example.org/matridge/``.
|
|
133
|
+
|
|
134
|
+
.. code-block:: nginx
|
|
135
|
+
|
|
136
|
+
server {
|
|
137
|
+
listen 80;
|
|
138
|
+
server_name example.org;
|
|
139
|
+
root /var/www/html; # if you already have nginx serving files…
|
|
140
|
+
|
|
141
|
+
# the section below is for matridge
|
|
142
|
+
location /matridge {
|
|
143
|
+
# Must be the same value as matridge's no-upload-path
|
|
144
|
+
alias /var/lib/matridge/attachments/;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
See the `nginx docs <https://docs.nginx.com/nginx/admin-guide/web-server/serving-static-content/>`_ for more info.
|
|
149
|
+
|
|
150
|
+
Next steps
|
|
151
|
+
==========
|
|
152
|
+
|
|
153
|
+
To make your matridge install top notch, set up its :ref:`privileges <privileges>`.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.. GENERATED FILE, DO NOT EDIT DIRECTLY
|
|
2
|
+
|
|
3
|
+
This file is automatically generated using https://codeberg.org/slidge/legacy-module-template/
|
|
4
|
+
Its source is at:
|
|
5
|
+
https://codeberg.org/slidge/legacy-module-template/src/branch/main/docs/source/admin/config.rst.jinja
|
|
6
|
+
Open a pull request for this repository instead, to benefit the documentation of all slidge-based gateways.
|
|
7
|
+
|
|
8
|
+
.. _config:
|
|
9
|
+
|
|
10
|
+
Configuration
|
|
11
|
+
=============
|
|
12
|
+
|
|
13
|
+
.. _config-file:
|
|
14
|
+
|
|
15
|
+
Config file location
|
|
16
|
+
********************
|
|
17
|
+
|
|
18
|
+
By default, matridge uses all config files found in ``/etc/slidge/conf.d/*``.
|
|
19
|
+
You can change this using the ``SLIDGE_CONF_DIR`` env var, eg ``SLIDGE_CONF_DIR=/path/dir1:/path/dir2:/path/dir3``.
|
|
20
|
+
|
|
21
|
+
It is recommended to use ``/etc/slidge/conf.d/`` to store configuration options
|
|
22
|
+
common to all slidge components (eg, attachment handling, logging options,
|
|
23
|
+
etc.), and to specify a plugin-specific file on startup, eg:
|
|
24
|
+
|
|
25
|
+
.. code-block:: bash
|
|
26
|
+
|
|
27
|
+
slidge -c /etc/slidge/superduper.conf
|
|
28
|
+
|
|
29
|
+
matridge-specific config
|
|
30
|
+
************************
|
|
31
|
+
|
|
32
|
+
matridge provides the component-wide options displayed in the table below.
|
|
33
|
+
They can be used:
|
|
34
|
+
|
|
35
|
+
* as ``key=value`` in a :ref:`config file <config-file>`;
|
|
36
|
+
* as command line arguments, prepended with ``--``, e.g., ``--some-option=value``;
|
|
37
|
+
* as environment variables, upper case, prepended with ``MATRIDGE_``, and with dashes substituted with underscores, e.g., ``MATRIDGE_SOME_OPTION=value``.
|
|
38
|
+
|
|
39
|
+
.. config-obj:: matridge.config
|
|
40
|
+
|
|
41
|
+
.. _generic-config:
|
|
42
|
+
|
|
43
|
+
Generic slidge config
|
|
44
|
+
*********************
|
|
45
|
+
|
|
46
|
+
.. warning::
|
|
47
|
+
|
|
48
|
+
Because of an ugly mess that will soon™ be fixed, it is impossible to use
|
|
49
|
+
the config file to turn off boolean arguments that are true by default.
|
|
50
|
+
As a workaround, use CLI args instead, e.g., ``--some-opt=false``.
|
|
51
|
+
|
|
52
|
+
The following options can be used:
|
|
53
|
+
|
|
54
|
+
* as ``key=value`` in a :ref:`config file <config-file>`;
|
|
55
|
+
* as command line arguments, prepended with ``--``, e.g., ``--some-option=value``;
|
|
56
|
+
* as environment variables, upper case, prepended with ``SLIDGE_``,
|
|
57
|
+
and with dashes substituted with underscores, e.g., ``SLIDGE_SOME_OPTION=value``.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
.. note::
|
|
61
|
+
|
|
62
|
+
The following options are for slidge version |slidge_version|.
|
|
63
|
+
Depending on how you installed matridge, you might have a different version of slidge.
|
|
64
|
+
Use ``matridge --help`` for the exact list of options you can use.
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
.. config-obj:: slidge.core.config
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
Advanced logging configuration
|
|
71
|
+
******************************
|
|
72
|
+
|
|
73
|
+
To customize the output of the slidge, you can use the command line argument ``--log-config``
|
|
74
|
+
to specify a `logging configuration file
|
|
75
|
+
<https://docs.python.org/3/library/logging.config.html#configuration-file-format>`_.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
listen:
|
|
2
|
+
-
|
|
3
|
+
ip: 127.0.0.1
|
|
4
|
+
port: 5347
|
|
5
|
+
module: ejabberd_service
|
|
6
|
+
# The next line is required if you're settings up multiple bridges
|
|
7
|
+
global_routes: false
|
|
8
|
+
hosts:
|
|
9
|
+
- "superduper.example.org":
|
|
10
|
+
password: secret
|
|
11
|
+
- "other-walled-garden.example.org":
|
|
12
|
+
password: some-other-secret
|
|
13
|
+
# repeat for other slidge plugins…
|
|
14
|
+
|
|
15
|
+
# HTTP upload service (XEP-0363)
|
|
16
|
+
-
|
|
17
|
+
port: 5443
|
|
18
|
+
module: ejabberd_http
|
|
19
|
+
tls: true
|
|
20
|
+
request_handlers:
|
|
21
|
+
/upload: mod_http_upload
|
|
22
|
+
|
|
23
|
+
acl:
|
|
24
|
+
slidge_acl:
|
|
25
|
+
server:
|
|
26
|
+
- "superduper.example.org"
|
|
27
|
+
- "other-walled-garden.example.org"
|
|
28
|
+
# repeat for other slidge plugins you added in the listen section above
|
|
29
|
+
|
|
30
|
+
access_rules:
|
|
31
|
+
slidge_rule:
|
|
32
|
+
- allow: slidge_acl
|
|
33
|
+
|
|
34
|
+
modules:
|
|
35
|
+
mod_http_upload:
|
|
36
|
+
# A path that ejabberd has Read and Write access to
|
|
37
|
+
docroot: /ejabberd/upload
|
|
38
|
+
put_url: "https://@HOST@:5443/upload"
|
|
39
|
+
access:
|
|
40
|
+
- allow: local
|
|
41
|
+
- allow: slidge_acl
|
|
42
|
+
|
|
43
|
+
# for roster auto-fill and "carbons from legacy apps"
|
|
44
|
+
# (broken in ejabberd when this was written, hopefully fixed since)
|
|
45
|
+
mod_privilege:
|
|
46
|
+
roster:
|
|
47
|
+
both: slidge_rule
|
|
48
|
+
message:
|
|
49
|
+
outgoing: slidge_rule
|
|
50
|
+
iq:
|
|
51
|
+
"http://jabber.org/protocol/pubsub":
|
|
52
|
+
both: slidge_rule
|
|
53
|
+
"http://jabber.org/protocol/pubsub#owner":
|
|
54
|
+
set: slidge_rule
|
|
55
|
+
"urn:xmpp:http:upload:0":
|
|
56
|
+
get: slidge_rule
|
|
57
|
+
mod_roster:
|
|
58
|
+
versioning: true
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
.. GENERATED FILE, DO NOT EDIT DIRECTLY
|
|
2
|
+
|
|
3
|
+
This file is automatically generated using https://codeberg.org/slidge/legacy-module-template/
|
|
4
|
+
Its source is at:
|
|
5
|
+
https://codeberg.org/slidge/legacy-module-template/src/branch/main/docs/source/admin/examples/index.rst.jinja
|
|
6
|
+
Open a pull request for this repository instead, to benefit the documentation of all slidge-based gateways.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
============================
|
|
10
|
+
XMPP server configs examples
|
|
11
|
+
============================
|
|
12
|
+
|
|
13
|
+
.. note::
|
|
14
|
+
|
|
15
|
+
These examples are not meant to be complete, but rather show the relevant
|
|
16
|
+
parts for slidge.
|
|
17
|
+
|
|
18
|
+
prosody/upload
|
|
19
|
+
==============
|
|
20
|
+
|
|
21
|
+
.. literalinclude:: prosody-upload.cfg.lua
|
|
22
|
+
:language: lua
|
|
23
|
+
:linenos:
|
|
24
|
+
|
|
25
|
+
prosody/no-upload
|
|
26
|
+
=================
|
|
27
|
+
|
|
28
|
+
.. literalinclude:: prosody-noupload.cfg.lua
|
|
29
|
+
:language: lua
|
|
30
|
+
:linenos:
|
|
31
|
+
|
|
32
|
+
ejabberd/upload
|
|
33
|
+
===============
|
|
34
|
+
|
|
35
|
+
.. note::
|
|
36
|
+
This example does not cover the `No upload` option for attachments (see :ref:`config`).
|
|
37
|
+
For 'no upload' with ejabberd, you need an external HTTP server, eg
|
|
38
|
+
:ref:`nginx-no-upload`.
|
|
39
|
+
|
|
40
|
+
.. literalinclude:: ejabberd.yaml
|
|
41
|
+
:language: yaml
|
|
42
|
+
:linenos:
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
modules_enabled = {
|
|
2
|
+
-- [...]
|
|
3
|
+
"http_files"; -- to serve "no upload" attachments
|
|
4
|
+
"privilege"; -- for roster sync and 'legacy carbons'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
-- in slidge's config: no-upload-path=/var/lib/slidge/attachments
|
|
8
|
+
http_files_dir = "/var/lib/slidge/attachments"
|
|
9
|
+
|
|
10
|
+
local _privileges = {
|
|
11
|
+
roster = "both";
|
|
12
|
+
message = "outgoing";
|
|
13
|
+
iq = {
|
|
14
|
+
["http://jabber.org/protocol/pubsub"] = "both";
|
|
15
|
+
["http://jabber.org/protocol/pubsub#owner"] = "set";
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
VirtualHost "example.org"
|
|
20
|
+
-- for roster sync and 'legacy carbons'
|
|
21
|
+
privileged_entities = {
|
|
22
|
+
["matrix.example.org"] =_privileges,
|
|
23
|
+
["other-walled-garden.example.org"] = _privileges,
|
|
24
|
+
-- repeat for other slidge plugins…
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
Component "matrix.example.org"
|
|
28
|
+
component_secret = "secret"
|
|
29
|
+
modules_enabled = {"privilege"}
|
|
30
|
+
|
|
31
|
+
Component "other-walled-garden.example.org"
|
|
32
|
+
component_secret = "some-other-secret"
|
|
33
|
+
modules_enabled = {"privilege"}
|