Compare commits
572 Commits
release-v1
...
erikj/test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa2fe082ae | ||
|
|
a7882f9887 | ||
|
|
31c5382d7a | ||
|
|
758ed5f1bc | ||
|
|
12ec55bfaa | ||
|
|
939ef657ce | ||
|
|
ccfafac882 | ||
|
|
b249f002b8 | ||
|
|
2506074ef0 | ||
|
|
7a43482f19 | ||
|
|
c55e62548c | ||
|
|
42a8e81370 | ||
|
|
b5120f09f1 | ||
|
|
7447f19702 | ||
|
|
eee6fcf5fa | ||
|
|
1fa15b74e0 | ||
|
|
937b849a2e | ||
|
|
818bf313bc | ||
|
|
f81d02d75b | ||
|
|
4c37d2acd5 | ||
|
|
adabf328ac | ||
|
|
933f258967 | ||
|
|
d5349959f4 | ||
|
|
1b37107cac | ||
|
|
c8e6e05842 | ||
|
|
7e072d38b1 | ||
|
|
e51b2f3f91 | ||
|
|
0cd2938bc8 | ||
|
|
620ecf13b0 | ||
|
|
a5b9c87ac6 | ||
|
|
6c0dfd2e8e | ||
|
|
fa50e4bf4d | ||
|
|
5b8ee181b7 | ||
|
|
74ced7d070 | ||
|
|
3005a2816c | ||
|
|
72822e60be | ||
|
|
fa842a9866 | ||
|
|
47d48a5853 | ||
|
|
94549771f7 | ||
|
|
73b03722f4 | ||
|
|
de45bf5b5b | ||
|
|
6633a4015a | ||
|
|
f08ef64926 | ||
|
|
2b467d0b61 | ||
|
|
02070c69fa | ||
|
|
a8703819eb | ||
|
|
de1f8de319 | ||
|
|
883d4e6f2b | ||
|
|
b5dea8702d | ||
|
|
350d9923cd | ||
|
|
2de7e263ed | ||
|
|
9de6b94117 | ||
|
|
3e4cdfe5d9 | ||
|
|
74dd906041 | ||
|
|
9ffac2bef1 | ||
|
|
d34c6e1279 | ||
|
|
0dd2649c12 | ||
|
|
4575ad0b1e | ||
|
|
20af310889 | ||
|
|
14950a45d6 | ||
|
|
1a08e0cdab | ||
|
|
d2479c6870 | ||
|
|
659c415ed4 | ||
|
|
631dd06f2c | ||
|
|
7036e24e98 | ||
|
|
21a296cd5a | ||
|
|
12702be951 | ||
|
|
26d10331e5 | ||
|
|
420031906a | ||
|
|
5310808d3b | ||
|
|
233c8b9fce | ||
|
|
d02e4b2825 | ||
|
|
aee8e6a95d | ||
|
|
ef410232f3 | ||
|
|
dc3c83a933 | ||
|
|
d1eb1b96e8 | ||
|
|
7cc9509eca | ||
|
|
98a64b7f7f | ||
|
|
aa4d8c1f9a | ||
|
|
ebd534b58d | ||
|
|
891c925b88 | ||
|
|
f7478d5cc6 | ||
|
|
bc4bf7b384 | ||
|
|
429c339de8 | ||
|
|
3dd6ba135e | ||
|
|
7a2e9b549d | ||
|
|
6d91e6ca5f | ||
|
|
789d9ebad3 | ||
|
|
e385c8b473 | ||
|
|
723b19748a | ||
|
|
fa6deb298b | ||
|
|
0f8945e166 | ||
|
|
2ec8ca5e60 | ||
|
|
b161528fcc | ||
|
|
c9195744a4 | ||
|
|
42d3a28d8b | ||
|
|
1315a2e8be | ||
|
|
671138f658 | ||
|
|
4e04435bda | ||
|
|
63f4990298 | ||
|
|
2fb1c2b6e6 | ||
|
|
7db2622d30 | ||
|
|
c21d8f1c1d | ||
|
|
ef0388a648 | ||
|
|
bce0c91d9a | ||
|
|
a03d71dc9d | ||
|
|
12f79da587 | ||
|
|
d32870ffa5 | ||
|
|
fa5f5cbc74 | ||
|
|
195adf4025 | ||
|
|
23a59d24ae | ||
|
|
b530eaa262 | ||
|
|
5e99a94502 | ||
|
|
e34df813ce | ||
|
|
63593134a1 | ||
|
|
9066c2fd7f | ||
|
|
a458e2866e | ||
|
|
8a910f97a4 | ||
|
|
bbd04441ed | ||
|
|
23d701864f | ||
|
|
3fc2399dbe | ||
|
|
1d5c021a45 | ||
|
|
8d3d264052 | ||
|
|
eee3c3c52f | ||
|
|
1b4d5d6acf | ||
|
|
0312266ee3 | ||
|
|
8f08021e86 | ||
|
|
62b5f13768 | ||
|
|
0248409bfa | ||
|
|
bde6705ad1 | ||
|
|
2fe0fb21f6 | ||
|
|
37eaf9c272 | ||
|
|
c027a199f3 | ||
|
|
06fefe0bb1 | ||
|
|
9dde9c9f01 | ||
|
|
111b673fc1 | ||
|
|
d2c616a413 | ||
|
|
31b1905e13 | ||
|
|
1c9a850562 | ||
|
|
a685bbb018 | ||
|
|
0eccf53146 | ||
|
|
168ba00d01 | ||
|
|
b7c580e333 | ||
|
|
637282bb50 | ||
|
|
b8591899ab | ||
|
|
9999eb2d02 | ||
|
|
14a7371375 | ||
|
|
cfcf5541b4 | ||
|
|
68bb26da69 | ||
|
|
d0c3c24eb2 | ||
|
|
a802606475 | ||
|
|
4218473f9e | ||
|
|
56e00ca85e | ||
|
|
d781a81e69 | ||
|
|
5e7d75daa2 | ||
|
|
28877fade9 | ||
|
|
5d4c330ed9 | ||
|
|
4136255d3c | ||
|
|
a7a913918c | ||
|
|
70586aa63e | ||
|
|
f1db20b5a5 | ||
|
|
14eab1b4d2 | ||
|
|
c9c1c9d82f | ||
|
|
f2783fc201 | ||
|
|
4c33796b20 | ||
|
|
c07022303e | ||
|
|
35be260090 | ||
|
|
7932d4e9f7 | ||
|
|
06006058d7 | ||
|
|
ff5c4da128 | ||
|
|
e1b8e37f93 | ||
|
|
44b7d4c6d6 | ||
|
|
bd30cfe86a | ||
|
|
7a332850e6 | ||
|
|
651e1ae534 | ||
|
|
3ad699cc65 | ||
|
|
be2db93b3c | ||
|
|
757b5a0bf6 | ||
|
|
8388a7fb3a | ||
|
|
c1883f042d | ||
|
|
2dd2e90e2b | ||
|
|
c9dd47d668 | ||
|
|
ed61fe4ada | ||
|
|
394516ad1b | ||
|
|
ac2acf1524 | ||
|
|
5bcf6e8289 | ||
|
|
0378581c13 | ||
|
|
7eebe4b3fc | ||
|
|
01333681bc | ||
|
|
b3a4b53587 | ||
|
|
6d02eb22df | ||
|
|
1619802228 | ||
|
|
895e04319b | ||
|
|
f14428b25c | ||
|
|
5d34f40d49 | ||
|
|
a8eceb01e5 | ||
|
|
3af0672350 | ||
|
|
0a34cdfc66 | ||
|
|
1d55c7b567 | ||
|
|
dc016c66ae | ||
|
|
80a992d7b9 | ||
|
|
c64002e1c1 | ||
|
|
1821f7cc26 | ||
|
|
a5f7aff5e5 | ||
|
|
344ab0b53a | ||
|
|
6ff34e00d9 | ||
|
|
43bf3c5178 | ||
|
|
a4a5c7a35e | ||
|
|
3e8292d483 | ||
|
|
cf7d3c90d6 | ||
|
|
9bbbb11ac2 | ||
|
|
57068eae75 | ||
|
|
fd83debcc0 | ||
|
|
320e8c8064 | ||
|
|
adfc9cb53d | ||
|
|
1cec3d1457 | ||
|
|
9b26a4ac87 | ||
|
|
0eb9b2f866 | ||
|
|
3ce2f303f1 | ||
|
|
cd9e72b185 | ||
|
|
1a9553045c | ||
|
|
ab7a24cc6b | ||
|
|
36ba73f53d | ||
|
|
025fa06fc7 | ||
|
|
ff1f0ee094 | ||
|
|
1f3748f033 | ||
|
|
92d87c6882 | ||
|
|
02e588856a | ||
|
|
96358cb424 | ||
|
|
df4b1e9c74 | ||
|
|
b774c555d8 | ||
|
|
df3e6a23a7 | ||
|
|
112f6bd49e | ||
|
|
2602514f34 | ||
|
|
693dab487c | ||
|
|
22c6c19f91 | ||
|
|
295c209cdd | ||
|
|
6e4f71c057 | ||
|
|
cf3b8156be | ||
|
|
66f75c5b74 | ||
|
|
269ba1bc84 | ||
|
|
ed5172852a | ||
|
|
f347f0cd58 | ||
|
|
935732768c | ||
|
|
0bac276890 | ||
|
|
92ce4a5258 | ||
|
|
b751624ff8 | ||
|
|
c834f1d67a | ||
|
|
76469898ee | ||
|
|
90cf1eec44 | ||
|
|
7ea85302f3 | ||
|
|
30fba62108 | ||
|
|
c5b6abd53d | ||
|
|
693516e756 | ||
|
|
0fed46ebe5 | ||
|
|
c4675e1b24 | ||
|
|
e41720d85f | ||
|
|
c67af840aa | ||
|
|
53b12688dd | ||
|
|
8388384a64 | ||
|
|
c21bdc813f | ||
|
|
d3ed93504b | ||
|
|
edb3d3f827 | ||
|
|
4d9496559d | ||
|
|
9edff901d1 | ||
|
|
3f0cba657c | ||
|
|
89f7930730 | ||
|
|
ddc4343683 | ||
|
|
09ac0569fe | ||
|
|
d1be293f00 | ||
|
|
59e18a1333 | ||
|
|
9f0f274fe0 | ||
|
|
f8d13ca13d | ||
|
|
17fa58bdd1 | ||
|
|
ca60822b34 | ||
|
|
a090b86209 | ||
|
|
856eab606b | ||
|
|
5cbe8d93fe | ||
|
|
1cd356765e | ||
|
|
382b4e83f1 | ||
|
|
7c43447477 | ||
|
|
14f81a6d24 | ||
|
|
3f0ff53158 | ||
|
|
2b110dda2a | ||
|
|
d963c69ba5 | ||
|
|
968939bdac | ||
|
|
4fd222ad70 | ||
|
|
f38676d161 | ||
|
|
b08dc7effe | ||
|
|
97b35ee259 | ||
|
|
e3d7806704 | ||
|
|
6fde6aa9c0 | ||
|
|
7127855741 | ||
|
|
59a995f38d | ||
|
|
8ca120df7c | ||
|
|
476b8c0ae6 | ||
|
|
1091bcea3e | ||
|
|
79bfe966e0 | ||
|
|
53a6f5ddf0 | ||
|
|
950bb0305f | ||
|
|
51338491c9 | ||
|
|
03e392f787 | ||
|
|
d356588339 | ||
|
|
b690542a34 | ||
|
|
244bff4edd | ||
|
|
0285885bab | ||
|
|
59c8f4f0db | ||
|
|
ef366720d5 | ||
|
|
c087f68053 | ||
|
|
deff8f628d | ||
|
|
ee382025b0 | ||
|
|
e487d9fabc | ||
|
|
473dfec1e5 | ||
|
|
f737368a26 | ||
|
|
0ce31ef614 | ||
|
|
acfe3b3065 | ||
|
|
be8fa65d0b | ||
|
|
129ae841e5 | ||
|
|
1f41422c98 | ||
|
|
3dc1871219 | ||
|
|
f125895475 | ||
|
|
c3e3552ec4 | ||
|
|
4f76eef0e8 | ||
|
|
bebfb9a97b | ||
|
|
791d7cd6f0 | ||
|
|
ebc405446e | ||
|
|
0d33c53534 | ||
|
|
cfd895a22e | ||
|
|
70c0d47989 | ||
|
|
9debe657a3 | ||
|
|
d3523e3e97 | ||
|
|
f1de4bb58b | ||
|
|
e8d0853739 | ||
|
|
34226ec761 | ||
|
|
0a5185495b | ||
|
|
4a54b821bb | ||
|
|
023f791143 | ||
|
|
68fc0dcb5a | ||
|
|
69147ed158 | ||
|
|
427ede619f | ||
|
|
1b15a3d92c | ||
|
|
4cb00d297f | ||
|
|
c2d4467cd4 | ||
|
|
41a389934e | ||
|
|
5829872bec | ||
|
|
89700dfb8c | ||
|
|
eedaf90c84 | ||
|
|
4c7587ef99 | ||
|
|
c059413001 | ||
|
|
2a6b685294 | ||
|
|
fb56dfdccd | ||
|
|
c3119d1536 | ||
|
|
e4676bd877 | ||
|
|
6abb1ad0be | ||
|
|
4fda58ddd2 | ||
|
|
243d427fbc | ||
|
|
4b09b7438e | ||
|
|
d04c2d19b3 | ||
|
|
e89bd3ea92 | ||
|
|
59cc2472b3 | ||
|
|
ca39e67f3d | ||
|
|
1eb9de90c0 | ||
|
|
11fd90a2b7 | ||
|
|
26b46796ea | ||
|
|
305545682d | ||
|
|
7a0fd6f98d | ||
|
|
f27a789697 | ||
|
|
b176f1036a | ||
|
|
aef8514193 | ||
|
|
b4289795ea | ||
|
|
1b831f2bec | ||
|
|
90c900a8ff | ||
|
|
b37aa1643b | ||
|
|
8f1aefa694 | ||
|
|
cbc82aa09f | ||
|
|
fd7c743445 | ||
|
|
46f4be94b4 | ||
|
|
4504151546 | ||
|
|
ef2d627015 | ||
|
|
70269fbd18 | ||
|
|
8b42a4eefd | ||
|
|
f21e24ffc2 | ||
|
|
22eeb6bc54 | ||
|
|
0073fe914a | ||
|
|
56f0ee78a9 | ||
|
|
00b24aa545 | ||
|
|
9a7e0d2ea6 | ||
|
|
c97da1e45d | ||
|
|
e80eb69887 | ||
|
|
b6ca69e4f1 | ||
|
|
31d721fbf6 | ||
|
|
2239813278 | ||
|
|
29ce6d43b5 | ||
|
|
a6ea1a957e | ||
|
|
aff1eb7c67 | ||
|
|
e90fad5cba | ||
|
|
88e1d0c52b | ||
|
|
f49c2093b5 | ||
|
|
a699c044b6 | ||
|
|
4215a3acd4 | ||
|
|
0c7f9cb81f | ||
|
|
9b7c28283a | ||
|
|
24229fac05 | ||
|
|
fedfdfd750 | ||
|
|
2e380f0f18 | ||
|
|
10f45d85bb | ||
|
|
66e6801c3e | ||
|
|
6c9ab61df5 | ||
|
|
49d72dea2a | ||
|
|
f6a3859a73 | ||
|
|
4ac3a8c5dc | ||
|
|
cf9a17a2b3 | ||
|
|
191f2e5d5d | ||
|
|
f40a4ba08e | ||
|
|
7a3adbd7af | ||
|
|
ff7f0e8a14 | ||
|
|
9e0f5a0ac4 | ||
|
|
e8dbbcb64c | ||
|
|
73d8209694 | ||
|
|
913f8a06e4 | ||
|
|
7b13780c54 | ||
|
|
5eda018561 | ||
|
|
437a99fb99 | ||
|
|
2b7c180879 | ||
|
|
34a5696f93 | ||
|
|
c850dd9a8e | ||
|
|
db9ef792f0 | ||
|
|
f28756bb40 | ||
|
|
4fb7a68a65 | ||
|
|
054a6b9538 | ||
|
|
514a240aed | ||
|
|
5065048110 | ||
|
|
88b8b8403c | ||
|
|
b19b63e6b4 | ||
|
|
a622e1ed9f | ||
|
|
ec0e9c4695 | ||
|
|
a9f90fa73a | ||
|
|
2ac908f377 | ||
|
|
b28aaeb3a5 | ||
|
|
15d5553d9e | ||
|
|
c13820bcee | ||
|
|
2b3af01791 | ||
|
|
9146a8a691 | ||
|
|
6d3905c7c7 | ||
|
|
1f4269700c | ||
|
|
7b71695388 | ||
|
|
70259d8c8c | ||
|
|
20a67aa70d | ||
|
|
654cc9470e | ||
|
|
de5cafe980 | ||
|
|
9e0f22874f | ||
|
|
84c0e46cce | ||
|
|
74f29284aa | ||
|
|
a312e890f5 | ||
|
|
626b8f0846 | ||
|
|
96e7d3c4a0 | ||
|
|
34c20493b9 | ||
|
|
21bb50ca3f | ||
|
|
8f27b7fde1 | ||
|
|
903d11c43a | ||
|
|
c356b4bf42 | ||
|
|
85c56445fb | ||
|
|
1fcdbeb3ab | ||
|
|
97647b33c2 | ||
|
|
79c1f973ce | ||
|
|
0afd83584b | ||
|
|
d6094176d1 | ||
|
|
1b70662be9 | ||
|
|
c8e9dc4cf4 | ||
|
|
6d7b22041d | ||
|
|
995cc615a0 | ||
|
|
402213bf41 | ||
|
|
0ec0bc3886 | ||
|
|
3ee17585cd | ||
|
|
da0090fdff | ||
|
|
5649669c3c | ||
|
|
6b5a115c0a | ||
|
|
c276bd9969 | ||
|
|
654e239b25 | ||
|
|
74976a8e43 | ||
|
|
9b8a53c7b9 | ||
|
|
a7d4985a6b | ||
|
|
f30f12a839 | ||
|
|
f49708dee3 | ||
|
|
9991aaa49c | ||
|
|
3a337f6d27 | ||
|
|
20fa83f374 | ||
|
|
8075504a60 | ||
|
|
0a08cd1065 | ||
|
|
1f39155071 | ||
|
|
4433d01519 | ||
|
|
27cfd712b3 | ||
|
|
470dedd266 | ||
|
|
4182bb812f | ||
|
|
9f87da0a84 | ||
|
|
7eff59ec91 | ||
|
|
19b15d63e8 | ||
|
|
618d405a32 | ||
|
|
1cf4a68108 | ||
|
|
9e66f3761c | ||
|
|
1264c8ac89 | ||
|
|
921a3f8a59 | ||
|
|
3ee97a2748 | ||
|
|
ec606ea9e3 | ||
|
|
d9dc6185d3 | ||
|
|
a34b17e492 | ||
|
|
091e9482af | ||
|
|
898196f1cc | ||
|
|
617e8a4653 | ||
|
|
d9d86c2996 | ||
|
|
123711ed19 | ||
|
|
d59378d86b | ||
|
|
629a951b49 | ||
|
|
b2486f6656 | ||
|
|
a9a8f29729 | ||
|
|
58e583eac1 | ||
|
|
b76f53bb79 | ||
|
|
a06b7a5d94 | ||
|
|
bc203c962f | ||
|
|
8de3703d21 | ||
|
|
6905f5751a | ||
|
|
d35a451399 | ||
|
|
9789b1fba5 | ||
|
|
ca2db5dd0c | ||
|
|
1781bbe319 | ||
|
|
66ac4b1e34 | ||
|
|
5009ffcaa4 | ||
|
|
fe0f4a3591 | ||
|
|
c9c0ad5e20 | ||
|
|
a93f3121f8 | ||
|
|
a97cec18bb | ||
|
|
7859c4d079 | ||
|
|
719474cae0 | ||
|
|
b28bfd905d | ||
|
|
1baa895310 | ||
|
|
e4f72ddc44 | ||
|
|
8dbf62fada | ||
|
|
ae5b2a72c0 | ||
|
|
52a50e8686 | ||
|
|
b460a088c6 | ||
|
|
9ca6341969 | ||
|
|
d373ec2f72 | ||
|
|
4cb44a1585 | ||
|
|
43c622885c | ||
|
|
4f0637346a | ||
|
|
01f82bfe32 | ||
|
|
903fcd2d35 | ||
|
|
3cd78bbe9e | ||
|
|
a024461130 | ||
|
|
9c0b168cff | ||
|
|
3e58ce72b4 | ||
|
|
785437dc0d | ||
|
|
4cd1448d0e | ||
|
|
103f72929a | ||
|
|
e775b5bb5b | ||
|
|
fd0282201e | ||
|
|
2ee302d016 | ||
|
|
b520a1bf5a | ||
|
|
da11cc22be | ||
|
|
0991a2da93 | ||
|
|
f31f8e6319 | ||
|
|
f64c6aae68 | ||
|
|
c5251c6fbd | ||
|
|
e3debf9682 | ||
|
|
ec10bdd32b | ||
|
|
62894673e6 | ||
|
|
462e681c79 | ||
|
|
3bd2a2cbb1 | ||
|
|
6c5d5e507e | ||
|
|
05ee048f2c | ||
|
|
0b68577ed6 | ||
|
|
4ff0201e62 |
@@ -15,6 +15,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from synapse.storage.engines import create_engine
|
from synapse.storage.engines import create_engine
|
||||||
|
|
||||||
logger = logging.getLogger("create_postgres_db")
|
logger = logging.getLogger("create_postgres_db")
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y python3.5 python3.5-dev python3-pip libxml2-dev libxslt-dev zlib1g-dev tox
|
apt-get install -y python3.5 python3.5-dev python3-pip libxml2-dev libxslt-dev xmlsec1 zlib1g-dev tox
|
||||||
|
|
||||||
export LANG="C.UTF-8"
|
export LANG="C.UTF-8"
|
||||||
|
|
||||||
exec tox -e py35-old,combine
|
|
||||||
Binary file not shown.
@@ -1,41 +1,10 @@
|
|||||||
# This file serves as a blacklist for SyTest tests that we expect will fail in
|
# This file serves as a blacklist for SyTest tests that we expect will fail in
|
||||||
# Synapse when run under worker mode. For more details, see sytest-blacklist.
|
# Synapse when run under worker mode. For more details, see sytest-blacklist.
|
||||||
|
|
||||||
Message history can be paginated
|
|
||||||
|
|
||||||
Can re-join room if re-invited
|
Can re-join room if re-invited
|
||||||
|
|
||||||
The only membership state included in an initial sync is for all the senders in the timeline
|
|
||||||
|
|
||||||
Local device key changes get to remote servers
|
|
||||||
|
|
||||||
If remote user leaves room we no longer receive device updates
|
|
||||||
|
|
||||||
Forgotten room messages cannot be paginated
|
|
||||||
|
|
||||||
Inbound federation can get public room list
|
|
||||||
|
|
||||||
Members from the gap are included in gappy incr LL sync
|
|
||||||
|
|
||||||
Leaves are present in non-gapped incremental syncs
|
|
||||||
|
|
||||||
Old leaves are present in gapped incremental syncs
|
|
||||||
|
|
||||||
User sees updates to presence from other users in the incremental sync.
|
|
||||||
|
|
||||||
Gapped incremental syncs include all state changes
|
|
||||||
|
|
||||||
Old members are included in gappy incr LL sync if they start speaking
|
|
||||||
|
|
||||||
# new failures as of https://github.com/matrix-org/sytest/pull/732
|
# new failures as of https://github.com/matrix-org/sytest/pull/732
|
||||||
Device list doesn't change if remote server is down
|
Device list doesn't change if remote server is down
|
||||||
Remote servers cannot set power levels in rooms without existing powerlevels
|
|
||||||
Remote servers should reject attempts by non-creators to set the power levels
|
|
||||||
|
|
||||||
# https://buildkite.com/matrix-dot-org/synapse/builds/6134#6f67bf47-e234-474d-80e8-c6e1868b15c5
|
# https://buildkite.com/matrix-dot-org/synapse/builds/6134#6f67bf47-e234-474d-80e8-c6e1868b15c5
|
||||||
Server correctly handles incoming m.device_list_update
|
Server correctly handles incoming m.device_list_update
|
||||||
|
|
||||||
# this fails reliably with a torture level of 100 due to https://github.com/matrix-org/synapse/issues/6536
|
|
||||||
Outbound federation requests missing prev_events and then asks for /state_ids and resolves the state
|
|
||||||
|
|
||||||
Can get rooms/{roomId}/members at a given point
|
|
||||||
|
|||||||
@@ -1,22 +1,35 @@
|
|||||||
version: 2
|
version: 2.1
|
||||||
jobs:
|
jobs:
|
||||||
dockerhubuploadrelease:
|
dockerhubuploadrelease:
|
||||||
machine: true
|
docker:
|
||||||
|
- image: docker:git
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:${CIRCLE_TAG} .
|
- docker_prepare
|
||||||
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
|
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
|
||||||
- run: docker push matrixdotorg/synapse:${CIRCLE_TAG}
|
# for release builds, we want to get the amd64 image out asap, so first
|
||||||
|
# we do an amd64-only build, before following up with a multiarch build.
|
||||||
|
- docker_build:
|
||||||
|
tag: -t matrixdotorg/synapse:${CIRCLE_TAG}
|
||||||
|
platforms: linux/amd64
|
||||||
|
- docker_build:
|
||||||
|
tag: -t matrixdotorg/synapse:${CIRCLE_TAG}
|
||||||
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
|
|
||||||
dockerhubuploadlatest:
|
dockerhubuploadlatest:
|
||||||
machine: true
|
docker:
|
||||||
|
- image: docker:git
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: docker build -f docker/Dockerfile --label gitsha1=${CIRCLE_SHA1} -t matrixdotorg/synapse:latest .
|
- docker_prepare
|
||||||
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
|
- run: docker login --username $DOCKER_HUB_USERNAME --password $DOCKER_HUB_PASSWORD
|
||||||
- run: docker push matrixdotorg/synapse:latest
|
# for `latest`, we don't want the arm images to disappear, so don't update the tag
|
||||||
|
# until all of the platforms are built.
|
||||||
|
- docker_build:
|
||||||
|
tag: -t matrixdotorg/synapse:latest
|
||||||
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
|
||||||
build:
|
build:
|
||||||
jobs:
|
jobs:
|
||||||
- dockerhubuploadrelease:
|
- dockerhubuploadrelease:
|
||||||
@@ -29,3 +42,37 @@ workflows:
|
|||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only: master
|
||||||
|
|
||||||
|
commands:
|
||||||
|
docker_prepare:
|
||||||
|
description: Sets up a remote docker server, downloads the buildx cli plugin, and enables multiarch images
|
||||||
|
parameters:
|
||||||
|
buildx_version:
|
||||||
|
type: string
|
||||||
|
default: "v0.4.1"
|
||||||
|
steps:
|
||||||
|
- setup_remote_docker:
|
||||||
|
# 19.03.13 was the most recent available on circleci at the time of
|
||||||
|
# writing.
|
||||||
|
version: 19.03.13
|
||||||
|
- run: apk add --no-cache curl
|
||||||
|
- run: mkdir -vp ~/.docker/cli-plugins/ ~/dockercache
|
||||||
|
- run: curl --silent -L "https://github.com/docker/buildx/releases/download/<< parameters.buildx_version >>/buildx-<< parameters.buildx_version >>.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
|
||||||
|
- run: chmod a+x ~/.docker/cli-plugins/docker-buildx
|
||||||
|
# install qemu links in /proc/sys/fs/binfmt_misc on the docker instance running the circleci job
|
||||||
|
- run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
|
||||||
|
# create a context named `builder` for the builds
|
||||||
|
- run: docker context create builder
|
||||||
|
# create a buildx builder using the new context, and set it as the default
|
||||||
|
- run: docker buildx create builder --use
|
||||||
|
|
||||||
|
docker_build:
|
||||||
|
description: Builds and pushed images to dockerhub using buildx
|
||||||
|
parameters:
|
||||||
|
platforms:
|
||||||
|
type: string
|
||||||
|
default: linux/amd64
|
||||||
|
tag:
|
||||||
|
type: string
|
||||||
|
steps:
|
||||||
|
- run: docker buildx build -f docker/Dockerfile --push --platform << parameters.platforms >> --label gitsha1=${CIRCLE_SHA1} << parameters.tag >> --progress=plain .
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -12,15 +12,18 @@
|
|||||||
_trial_temp/
|
_trial_temp/
|
||||||
_trial_temp*/
|
_trial_temp*/
|
||||||
/out
|
/out
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
# stuff that is likely to exist when you run a server locally
|
# stuff that is likely to exist when you run a server locally
|
||||||
/*.db
|
/*.db
|
||||||
/*.log
|
/*.log
|
||||||
|
/*.log.*
|
||||||
/*.log.config
|
/*.log.config
|
||||||
/*.pid
|
/*.pid
|
||||||
/.python-version
|
/.python-version
|
||||||
/*.signing.key
|
/*.signing.key
|
||||||
/env/
|
/env/
|
||||||
|
/.venv*/
|
||||||
/homeserver*.yaml
|
/homeserver*.yaml
|
||||||
/logs
|
/logs
|
||||||
/media_store/
|
/media_store/
|
||||||
|
|||||||
957
CHANGES.md
957
CHANGES.md
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,7 @@ locally. You'll need python 3.6 or later, and to install a number of tools:
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Install the dependencies
|
# Install the dependencies
|
||||||
pip install -e ".[lint]"
|
pip install -e ".[lint,mypy]"
|
||||||
|
|
||||||
# Run the linter script
|
# Run the linter script
|
||||||
./scripts-dev/lint.sh
|
./scripts-dev/lint.sh
|
||||||
@@ -63,6 +63,10 @@ run-time:
|
|||||||
./scripts-dev/lint.sh path/to/file1.py path/to/file2.py path/to/folder
|
./scripts-dev/lint.sh path/to/file1.py path/to/file2.py path/to/folder
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also provide the `-d` option, which will lint the files that have been
|
||||||
|
changed since the last git commit. This will often be significantly faster than
|
||||||
|
linting the whole codebase.
|
||||||
|
|
||||||
Before pushing new changes, ensure they don't produce linting errors. Commit any
|
Before pushing new changes, ensure they don't produce linting errors. Commit any
|
||||||
files that were corrected.
|
files that were corrected.
|
||||||
|
|
||||||
@@ -152,6 +156,24 @@ directory, you will need both a regular newsfragment *and* an entry in the
|
|||||||
debian changelog. (Though typically such changes should be submitted as two
|
debian changelog. (Though typically such changes should be submitted as two
|
||||||
separate pull requests.)
|
separate pull requests.)
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
|
||||||
|
There is a growing amount of documentation located in the [docs](docs)
|
||||||
|
directory. This documentation is intended primarily for sysadmins running their
|
||||||
|
own Synapse instance, as well as developers interacting externally with
|
||||||
|
Synapse. [docs/dev](docs/dev) exists primarily to house documentation for
|
||||||
|
Synapse developers. [docs/admin_api](docs/admin_api) houses documentation
|
||||||
|
regarding Synapse's Admin API, which is used mostly by sysadmins and external
|
||||||
|
service developers.
|
||||||
|
|
||||||
|
New files added to both folders should be written in [Github-Flavoured
|
||||||
|
Markdown](https://guides.github.com/features/mastering-markdown/), and attempts
|
||||||
|
should be made to migrate existing documents to markdown where possible.
|
||||||
|
|
||||||
|
Some documentation also exists in [Synapse's Github
|
||||||
|
Wiki](https://github.com/matrix-org/synapse/wiki), although this is primarily
|
||||||
|
contributed to by community authors.
|
||||||
|
|
||||||
## Sign off
|
## Sign off
|
||||||
|
|
||||||
In order to have a concrete record that your contribution is intentional
|
In order to have a concrete record that your contribution is intentional
|
||||||
|
|||||||
275
INSTALL.md
275
INSTALL.md
@@ -1,19 +1,44 @@
|
|||||||
- [Choosing your server name](#choosing-your-server-name)
|
# Installation Instructions
|
||||||
- [Picking a database engine](#picking-a-database-engine)
|
|
||||||
- [Installing Synapse](#installing-synapse)
|
|
||||||
- [Installing from source](#installing-from-source)
|
|
||||||
- [Platform-Specific Instructions](#platform-specific-instructions)
|
|
||||||
- [Prebuilt packages](#prebuilt-packages)
|
|
||||||
- [Setting up Synapse](#setting-up-synapse)
|
|
||||||
- [TLS certificates](#tls-certificates)
|
|
||||||
- [Client Well-Known URI](#client-well-known-uri)
|
|
||||||
- [Email](#email)
|
|
||||||
- [Registering a user](#registering-a-user)
|
|
||||||
- [Setting up a TURN server](#setting-up-a-turn-server)
|
|
||||||
- [URL previews](#url-previews)
|
|
||||||
- [Troubleshooting Installation](#troubleshooting-installation)
|
|
||||||
|
|
||||||
# Choosing your server name
|
There are 3 steps to follow under **Installation Instructions**.
|
||||||
|
|
||||||
|
- [Installation Instructions](#installation-instructions)
|
||||||
|
- [Choosing your server name](#choosing-your-server-name)
|
||||||
|
- [Installing Synapse](#installing-synapse)
|
||||||
|
- [Installing from source](#installing-from-source)
|
||||||
|
- [Platform-Specific Instructions](#platform-specific-instructions)
|
||||||
|
- [Debian/Ubuntu/Raspbian](#debianubunturaspbian)
|
||||||
|
- [ArchLinux](#archlinux)
|
||||||
|
- [CentOS/Fedora](#centosfedora)
|
||||||
|
- [macOS](#macos)
|
||||||
|
- [OpenSUSE](#opensuse)
|
||||||
|
- [OpenBSD](#openbsd)
|
||||||
|
- [Windows](#windows)
|
||||||
|
- [Prebuilt packages](#prebuilt-packages)
|
||||||
|
- [Docker images and Ansible playbooks](#docker-images-and-ansible-playbooks)
|
||||||
|
- [Debian/Ubuntu](#debianubuntu)
|
||||||
|
- [Matrix.org packages](#matrixorg-packages)
|
||||||
|
- [Downstream Debian packages](#downstream-debian-packages)
|
||||||
|
- [Downstream Ubuntu packages](#downstream-ubuntu-packages)
|
||||||
|
- [Fedora](#fedora)
|
||||||
|
- [OpenSUSE](#opensuse-1)
|
||||||
|
- [SUSE Linux Enterprise Server](#suse-linux-enterprise-server)
|
||||||
|
- [ArchLinux](#archlinux-1)
|
||||||
|
- [Void Linux](#void-linux)
|
||||||
|
- [FreeBSD](#freebsd)
|
||||||
|
- [OpenBSD](#openbsd-1)
|
||||||
|
- [NixOS](#nixos)
|
||||||
|
- [Setting up Synapse](#setting-up-synapse)
|
||||||
|
- [Using PostgreSQL](#using-postgresql)
|
||||||
|
- [TLS certificates](#tls-certificates)
|
||||||
|
- [Client Well-Known URI](#client-well-known-uri)
|
||||||
|
- [Email](#email)
|
||||||
|
- [Registering a user](#registering-a-user)
|
||||||
|
- [Setting up a TURN server](#setting-up-a-turn-server)
|
||||||
|
- [URL previews](#url-previews)
|
||||||
|
- [Troubleshooting Installation](#troubleshooting-installation)
|
||||||
|
|
||||||
|
## Choosing your server name
|
||||||
|
|
||||||
It is important to choose the name for your server before you install Synapse,
|
It is important to choose the name for your server before you install Synapse,
|
||||||
because it cannot be changed later.
|
because it cannot be changed later.
|
||||||
@@ -29,35 +54,16 @@ that your email address is probably `user@example.com` rather than
|
|||||||
`user@email.example.com`) - but doing so may require more advanced setup: see
|
`user@email.example.com`) - but doing so may require more advanced setup: see
|
||||||
[Setting up Federation](docs/federate.md).
|
[Setting up Federation](docs/federate.md).
|
||||||
|
|
||||||
# Picking a database engine
|
## Installing Synapse
|
||||||
|
|
||||||
Synapse offers two database engines:
|
### Installing from source
|
||||||
* [PostgreSQL](https://www.postgresql.org)
|
|
||||||
* [SQLite](https://sqlite.org/)
|
|
||||||
|
|
||||||
Almost all installations should opt to use PostgreSQL. Advantages include:
|
|
||||||
|
|
||||||
* significant performance improvements due to the superior threading and
|
|
||||||
caching model, smarter query optimiser
|
|
||||||
* allowing the DB to be run on separate hardware
|
|
||||||
|
|
||||||
For information on how to install and use PostgreSQL, please see
|
|
||||||
[docs/postgres.md](docs/postgres.md)
|
|
||||||
|
|
||||||
By default Synapse uses SQLite and in doing so trades performance for convenience.
|
|
||||||
SQLite is only recommended in Synapse for testing purposes or for servers with
|
|
||||||
light workloads.
|
|
||||||
|
|
||||||
# Installing Synapse
|
|
||||||
|
|
||||||
## Installing from source
|
|
||||||
|
|
||||||
(Prebuilt packages are available for some platforms - see [Prebuilt packages](#prebuilt-packages).)
|
(Prebuilt packages are available for some platforms - see [Prebuilt packages](#prebuilt-packages).)
|
||||||
|
|
||||||
System requirements:
|
System requirements:
|
||||||
|
|
||||||
- POSIX-compliant system (tested on Linux & OS X)
|
- POSIX-compliant system (tested on Linux & OS X)
|
||||||
- Python 3.5.2 or later, up to Python 3.8.
|
- Python 3.5.2 or later, up to Python 3.9.
|
||||||
- At least 1GB of free RAM if you want to join large public rooms like #matrix:matrix.org
|
- At least 1GB of free RAM if you want to join large public rooms like #matrix:matrix.org
|
||||||
|
|
||||||
Synapse is written in Python but some of the libraries it uses are written in
|
Synapse is written in Python but some of the libraries it uses are written in
|
||||||
@@ -68,7 +74,7 @@ these on various platforms.
|
|||||||
|
|
||||||
To install the Synapse homeserver run:
|
To install the Synapse homeserver run:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
mkdir -p ~/synapse
|
mkdir -p ~/synapse
|
||||||
virtualenv -p python3 ~/synapse/env
|
virtualenv -p python3 ~/synapse/env
|
||||||
source ~/synapse/env/bin/activate
|
source ~/synapse/env/bin/activate
|
||||||
@@ -85,7 +91,7 @@ prefer.
|
|||||||
This Synapse installation can then be later upgraded by using pip again with the
|
This Synapse installation can then be later upgraded by using pip again with the
|
||||||
update flag:
|
update flag:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
source ~/synapse/env/bin/activate
|
source ~/synapse/env/bin/activate
|
||||||
pip install -U matrix-synapse
|
pip install -U matrix-synapse
|
||||||
```
|
```
|
||||||
@@ -93,7 +99,7 @@ pip install -U matrix-synapse
|
|||||||
Before you can start Synapse, you will need to generate a configuration
|
Before you can start Synapse, you will need to generate a configuration
|
||||||
file. To do this, run (in your virtualenv, as before):
|
file. To do this, run (in your virtualenv, as before):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
cd ~/synapse
|
cd ~/synapse
|
||||||
python -m synapse.app.homeserver \
|
python -m synapse.app.homeserver \
|
||||||
--server-name my.domain.name \
|
--server-name my.domain.name \
|
||||||
@@ -111,45 +117,43 @@ wise to back them up somewhere safe. (If, for whatever reason, you do need to
|
|||||||
change your homeserver's keys, you may find that other homeserver have the
|
change your homeserver's keys, you may find that other homeserver have the
|
||||||
old key cached. If you update the signing key, you should change the name of the
|
old key cached. If you update the signing key, you should change the name of the
|
||||||
key in the `<server name>.signing.key` file (the second word) to something
|
key in the `<server name>.signing.key` file (the second word) to something
|
||||||
different. See the
|
different. See the [spec](https://matrix.org/docs/spec/server_server/latest.html#retrieving-server-keys) for more information on key management).
|
||||||
[spec](https://matrix.org/docs/spec/server_server/latest.html#retrieving-server-keys)
|
|
||||||
for more information on key management).
|
|
||||||
|
|
||||||
To actually run your new homeserver, pick a working directory for Synapse to
|
To actually run your new homeserver, pick a working directory for Synapse to
|
||||||
run (e.g. `~/synapse`), and:
|
run (e.g. `~/synapse`), and:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
cd ~/synapse
|
cd ~/synapse
|
||||||
source env/bin/activate
|
source env/bin/activate
|
||||||
synctl start
|
synctl start
|
||||||
```
|
```
|
||||||
|
|
||||||
### Platform-Specific Instructions
|
#### Platform-Specific Instructions
|
||||||
|
|
||||||
#### Debian/Ubuntu/Raspbian
|
##### Debian/Ubuntu/Raspbian
|
||||||
|
|
||||||
Installing prerequisites on Ubuntu or Debian:
|
Installing prerequisites on Ubuntu or Debian:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo apt-get install build-essential python3-dev libffi-dev \
|
sudo apt install build-essential python3-dev libffi-dev \
|
||||||
python3-pip python3-setuptools sqlite3 \
|
python3-pip python3-setuptools sqlite3 \
|
||||||
libssl-dev virtualenv libjpeg-dev libxslt1-dev
|
libssl-dev virtualenv libjpeg-dev libxslt1-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
#### ArchLinux
|
##### ArchLinux
|
||||||
|
|
||||||
Installing prerequisites on ArchLinux:
|
Installing prerequisites on ArchLinux:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo pacman -S base-devel python python-pip \
|
sudo pacman -S base-devel python python-pip \
|
||||||
python-setuptools python-virtualenv sqlite3
|
python-setuptools python-virtualenv sqlite3
|
||||||
```
|
```
|
||||||
|
|
||||||
#### CentOS/Fedora
|
##### CentOS/Fedora
|
||||||
|
|
||||||
Installing prerequisites on CentOS 8 or Fedora>26:
|
Installing prerequisites on CentOS 8 or Fedora>26:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo dnf install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
|
sudo dnf install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
|
||||||
libwebp-devel tk-devel redhat-rpm-config \
|
libwebp-devel tk-devel redhat-rpm-config \
|
||||||
python3-virtualenv libffi-devel openssl-devel
|
python3-virtualenv libffi-devel openssl-devel
|
||||||
@@ -158,7 +162,7 @@ sudo dnf groupinstall "Development Tools"
|
|||||||
|
|
||||||
Installing prerequisites on CentOS 7 or Fedora<=25:
|
Installing prerequisites on CentOS 7 or Fedora<=25:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo yum install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
|
sudo yum install libtiff-devel libjpeg-devel libzip-devel freetype-devel \
|
||||||
lcms2-devel libwebp-devel tcl-devel tk-devel redhat-rpm-config \
|
lcms2-devel libwebp-devel tcl-devel tk-devel redhat-rpm-config \
|
||||||
python3-virtualenv libffi-devel openssl-devel
|
python3-virtualenv libffi-devel openssl-devel
|
||||||
@@ -170,11 +174,11 @@ uses SQLite 3.7. You may be able to work around this by installing a more
|
|||||||
recent SQLite version, but it is recommended that you instead use a Postgres
|
recent SQLite version, but it is recommended that you instead use a Postgres
|
||||||
database: see [docs/postgres.md](docs/postgres.md).
|
database: see [docs/postgres.md](docs/postgres.md).
|
||||||
|
|
||||||
#### macOS
|
##### macOS
|
||||||
|
|
||||||
Installing prerequisites on macOS:
|
Installing prerequisites on macOS:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
xcode-select --install
|
xcode-select --install
|
||||||
sudo easy_install pip
|
sudo easy_install pip
|
||||||
sudo pip install virtualenv
|
sudo pip install virtualenv
|
||||||
@@ -184,22 +188,23 @@ brew install pkg-config libffi
|
|||||||
On macOS Catalina (10.15) you may need to explicitly install OpenSSL
|
On macOS Catalina (10.15) you may need to explicitly install OpenSSL
|
||||||
via brew and inform `pip` about it so that `psycopg2` builds:
|
via brew and inform `pip` about it so that `psycopg2` builds:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
brew install openssl@1.1
|
brew install openssl@1.1
|
||||||
export LDFLAGS=-L/usr/local/Cellar/openssl\@1.1/1.1.1d/lib/
|
export LDFLAGS="-L/usr/local/opt/openssl/lib"
|
||||||
|
export CPPFLAGS="-I/usr/local/opt/openssl/include"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### OpenSUSE
|
##### OpenSUSE
|
||||||
|
|
||||||
Installing prerequisites on openSUSE:
|
Installing prerequisites on openSUSE:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo zypper in -t pattern devel_basis
|
sudo zypper in -t pattern devel_basis
|
||||||
sudo zypper in python-pip python-setuptools sqlite3 python-virtualenv \
|
sudo zypper in python-pip python-setuptools sqlite3 python-virtualenv \
|
||||||
python-devel libffi-devel libopenssl-devel libjpeg62-devel
|
python-devel libffi-devel libopenssl-devel libjpeg62-devel
|
||||||
```
|
```
|
||||||
|
|
||||||
#### OpenBSD
|
##### OpenBSD
|
||||||
|
|
||||||
A port of Synapse is available under `net/synapse`. The filesystem
|
A port of Synapse is available under `net/synapse`. The filesystem
|
||||||
underlying the homeserver directory (defaults to `/var/synapse`) has to be
|
underlying the homeserver directory (defaults to `/var/synapse`) has to be
|
||||||
@@ -213,73 +218,72 @@ mounted with `wxallowed` (cf. `mount(8)`).
|
|||||||
Creating a `WRKOBJDIR` for building python under `/usr/local` (which on a
|
Creating a `WRKOBJDIR` for building python under `/usr/local` (which on a
|
||||||
default OpenBSD installation is mounted with `wxallowed`):
|
default OpenBSD installation is mounted with `wxallowed`):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
doas mkdir /usr/local/pobj_wxallowed
|
doas mkdir /usr/local/pobj_wxallowed
|
||||||
```
|
```
|
||||||
|
|
||||||
Assuming `PORTS_PRIVSEP=Yes` (cf. `bsd.port.mk(5)`) and `SUDO=doas` are
|
Assuming `PORTS_PRIVSEP=Yes` (cf. `bsd.port.mk(5)`) and `SUDO=doas` are
|
||||||
configured in `/etc/mk.conf`:
|
configured in `/etc/mk.conf`:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
doas chown _pbuild:_pbuild /usr/local/pobj_wxallowed
|
doas chown _pbuild:_pbuild /usr/local/pobj_wxallowed
|
||||||
```
|
```
|
||||||
|
|
||||||
Setting the `WRKOBJDIR` for building python:
|
Setting the `WRKOBJDIR` for building python:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
echo WRKOBJDIR_lang/python/3.7=/usr/local/pobj_wxallowed \\nWRKOBJDIR_lang/python/2.7=/usr/local/pobj_wxallowed >> /etc/mk.conf
|
echo WRKOBJDIR_lang/python/3.7=/usr/local/pobj_wxallowed \\nWRKOBJDIR_lang/python/2.7=/usr/local/pobj_wxallowed >> /etc/mk.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
Building Synapse:
|
Building Synapse:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
cd /usr/ports/net/synapse
|
cd /usr/ports/net/synapse
|
||||||
make install
|
make install
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Windows
|
##### Windows
|
||||||
|
|
||||||
If you wish to run or develop Synapse on Windows, the Windows Subsystem For
|
If you wish to run or develop Synapse on Windows, the Windows Subsystem For
|
||||||
Linux provides a Linux environment on Windows 10 which is capable of using the
|
Linux provides a Linux environment on Windows 10 which is capable of using the
|
||||||
Debian, Fedora, or source installation methods. More information about WSL can
|
Debian, Fedora, or source installation methods. More information about WSL can
|
||||||
be found at https://docs.microsoft.com/en-us/windows/wsl/install-win10 for
|
be found at <https://docs.microsoft.com/en-us/windows/wsl/install-win10> for
|
||||||
Windows 10 and https://docs.microsoft.com/en-us/windows/wsl/install-on-server
|
Windows 10 and <https://docs.microsoft.com/en-us/windows/wsl/install-on-server>
|
||||||
for Windows Server.
|
for Windows Server.
|
||||||
|
|
||||||
## Prebuilt packages
|
### Prebuilt packages
|
||||||
|
|
||||||
As an alternative to installing from source, prebuilt packages are available
|
As an alternative to installing from source, prebuilt packages are available
|
||||||
for a number of platforms.
|
for a number of platforms.
|
||||||
|
|
||||||
### Docker images and Ansible playbooks
|
#### Docker images and Ansible playbooks
|
||||||
|
|
||||||
There is an offical synapse image available at
|
There is an official synapse image available at
|
||||||
https://hub.docker.com/r/matrixdotorg/synapse which can be used with
|
<https://hub.docker.com/r/matrixdotorg/synapse> which can be used with
|
||||||
the docker-compose file available at [contrib/docker](contrib/docker). Further
|
the docker-compose file available at [contrib/docker](contrib/docker). Further
|
||||||
information on this including configuration options is available in the README
|
information on this including configuration options is available in the README
|
||||||
on hub.docker.com.
|
on hub.docker.com.
|
||||||
|
|
||||||
Alternatively, Andreas Peters (previously Silvio Fricke) has contributed a
|
Alternatively, Andreas Peters (previously Silvio Fricke) has contributed a
|
||||||
Dockerfile to automate a synapse server in a single Docker image, at
|
Dockerfile to automate a synapse server in a single Docker image, at
|
||||||
https://hub.docker.com/r/avhost/docker-matrix/tags/
|
<https://hub.docker.com/r/avhost/docker-matrix/tags/>
|
||||||
|
|
||||||
Slavi Pantaleev has created an Ansible playbook,
|
Slavi Pantaleev has created an Ansible playbook,
|
||||||
which installs the offical Docker image of Matrix Synapse
|
which installs the offical Docker image of Matrix Synapse
|
||||||
along with many other Matrix-related services (Postgres database, Element, coturn,
|
along with many other Matrix-related services (Postgres database, Element, coturn,
|
||||||
ma1sd, SSL support, etc.).
|
ma1sd, SSL support, etc.).
|
||||||
For more details, see
|
For more details, see
|
||||||
https://github.com/spantaleev/matrix-docker-ansible-deploy
|
<https://github.com/spantaleev/matrix-docker-ansible-deploy>
|
||||||
|
|
||||||
|
#### Debian/Ubuntu
|
||||||
|
|
||||||
### Debian/Ubuntu
|
##### Matrix.org packages
|
||||||
|
|
||||||
#### Matrix.org packages
|
|
||||||
|
|
||||||
Matrix.org provides Debian/Ubuntu packages of the latest stable version of
|
Matrix.org provides Debian/Ubuntu packages of the latest stable version of
|
||||||
Synapse via https://packages.matrix.org/debian/. They are available for Debian
|
Synapse via <https://packages.matrix.org/debian/>. They are available for Debian
|
||||||
9 (Stretch), Ubuntu 16.04 (Xenial), and later. To use them:
|
9 (Stretch), Ubuntu 16.04 (Xenial), and later. To use them:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo apt install -y lsb-release wget apt-transport-https
|
sudo apt install -y lsb-release wget apt-transport-https
|
||||||
sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
|
sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg
|
||||||
echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" |
|
echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" |
|
||||||
@@ -299,7 +303,7 @@ The fingerprint of the repository signing key (as shown by `gpg
|
|||||||
/usr/share/keyrings/matrix-org-archive-keyring.gpg`) is
|
/usr/share/keyrings/matrix-org-archive-keyring.gpg`) is
|
||||||
`AAF9AE843A7584B5A3E4CD2BCF45A512DE2DA058`.
|
`AAF9AE843A7584B5A3E4CD2BCF45A512DE2DA058`.
|
||||||
|
|
||||||
#### Downstream Debian packages
|
##### Downstream Debian packages
|
||||||
|
|
||||||
We do not recommend using the packages from the default Debian `buster`
|
We do not recommend using the packages from the default Debian `buster`
|
||||||
repository at this time, as they are old and suffer from known security
|
repository at this time, as they are old and suffer from known security
|
||||||
@@ -311,49 +315,49 @@ for information on how to use backports.
|
|||||||
If you are using Debian `sid` or testing, Synapse is available in the default
|
If you are using Debian `sid` or testing, Synapse is available in the default
|
||||||
repositories and it should be possible to install it simply with:
|
repositories and it should be possible to install it simply with:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo apt install matrix-synapse
|
sudo apt install matrix-synapse
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Downstream Ubuntu packages
|
##### Downstream Ubuntu packages
|
||||||
|
|
||||||
We do not recommend using the packages in the default Ubuntu repository
|
We do not recommend using the packages in the default Ubuntu repository
|
||||||
at this time, as they are old and suffer from known security vulnerabilities.
|
at this time, as they are old and suffer from known security vulnerabilities.
|
||||||
The latest version of Synapse can be installed from [our repository](#matrixorg-packages).
|
The latest version of Synapse can be installed from [our repository](#matrixorg-packages).
|
||||||
|
|
||||||
### Fedora
|
#### Fedora
|
||||||
|
|
||||||
Synapse is in the Fedora repositories as `matrix-synapse`:
|
Synapse is in the Fedora repositories as `matrix-synapse`:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo dnf install matrix-synapse
|
sudo dnf install matrix-synapse
|
||||||
```
|
```
|
||||||
|
|
||||||
Oleg Girko provides Fedora RPMs at
|
Oleg Girko provides Fedora RPMs at
|
||||||
https://obs.infoserver.lv/project/monitor/matrix-synapse
|
<https://obs.infoserver.lv/project/monitor/matrix-synapse>
|
||||||
|
|
||||||
### OpenSUSE
|
#### OpenSUSE
|
||||||
|
|
||||||
Synapse is in the OpenSUSE repositories as `matrix-synapse`:
|
Synapse is in the OpenSUSE repositories as `matrix-synapse`:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo zypper install matrix-synapse
|
sudo zypper install matrix-synapse
|
||||||
```
|
```
|
||||||
|
|
||||||
### SUSE Linux Enterprise Server
|
#### SUSE Linux Enterprise Server
|
||||||
|
|
||||||
Unofficial package are built for SLES 15 in the openSUSE:Backports:SLE-15 repository at
|
Unofficial package are built for SLES 15 in the openSUSE:Backports:SLE-15 repository at
|
||||||
https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15/standard/
|
<https://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-15/standard/>
|
||||||
|
|
||||||
### ArchLinux
|
#### ArchLinux
|
||||||
|
|
||||||
The quickest way to get up and running with ArchLinux is probably with the community package
|
The quickest way to get up and running with ArchLinux is probably with the community package
|
||||||
https://www.archlinux.org/packages/community/any/matrix-synapse/, which should pull in most of
|
<https://www.archlinux.org/packages/community/any/matrix-synapse/>, which should pull in most of
|
||||||
the necessary dependencies.
|
the necessary dependencies.
|
||||||
|
|
||||||
pip may be outdated (6.0.7-1 and needs to be upgraded to 6.0.8-1 ):
|
pip may be outdated (6.0.7-1 and needs to be upgraded to 6.0.8-1 ):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo pip install --upgrade pip
|
sudo pip install --upgrade pip
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -362,28 +366,28 @@ ELFCLASS32 (x64 Systems), you may need to reinstall py-bcrypt to correctly
|
|||||||
compile it under the right architecture. (This should not be needed if
|
compile it under the right architecture. (This should not be needed if
|
||||||
installing under virtualenv):
|
installing under virtualenv):
|
||||||
|
|
||||||
```
|
```sh
|
||||||
sudo pip uninstall py-bcrypt
|
sudo pip uninstall py-bcrypt
|
||||||
sudo pip install py-bcrypt
|
sudo pip install py-bcrypt
|
||||||
```
|
```
|
||||||
|
|
||||||
### Void Linux
|
#### Void Linux
|
||||||
|
|
||||||
Synapse can be found in the void repositories as 'synapse':
|
Synapse can be found in the void repositories as 'synapse':
|
||||||
|
|
||||||
```
|
```sh
|
||||||
xbps-install -Su
|
xbps-install -Su
|
||||||
xbps-install -S synapse
|
xbps-install -S synapse
|
||||||
```
|
```
|
||||||
|
|
||||||
### FreeBSD
|
#### FreeBSD
|
||||||
|
|
||||||
Synapse can be installed via FreeBSD Ports or Packages contributed by Brendan Molloy from:
|
Synapse can be installed via FreeBSD Ports or Packages contributed by Brendan Molloy from:
|
||||||
|
|
||||||
- Ports: `cd /usr/ports/net-im/py-matrix-synapse && make install clean`
|
- Ports: `cd /usr/ports/net-im/py-matrix-synapse && make install clean`
|
||||||
- Packages: `pkg install py37-matrix-synapse`
|
- Packages: `pkg install py37-matrix-synapse`
|
||||||
|
|
||||||
### OpenBSD
|
#### OpenBSD
|
||||||
|
|
||||||
As of OpenBSD 6.7 Synapse is available as a pre-compiled binary. The filesystem
|
As of OpenBSD 6.7 Synapse is available as a pre-compiled binary. The filesystem
|
||||||
underlying the homeserver directory (defaults to `/var/synapse`) has to be
|
underlying the homeserver directory (defaults to `/var/synapse`) has to be
|
||||||
@@ -392,20 +396,35 @@ and mounting it to `/var/synapse` should be taken into consideration.
|
|||||||
|
|
||||||
Installing Synapse:
|
Installing Synapse:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
doas pkg_add synapse
|
doas pkg_add synapse
|
||||||
```
|
```
|
||||||
|
|
||||||
### NixOS
|
#### NixOS
|
||||||
|
|
||||||
Robin Lambertz has packaged Synapse for NixOS at:
|
Robin Lambertz has packaged Synapse for NixOS at:
|
||||||
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/matrix-synapse.nix
|
<https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/matrix-synapse.nix>
|
||||||
|
|
||||||
# Setting up Synapse
|
## Setting up Synapse
|
||||||
|
|
||||||
Once you have installed synapse as above, you will need to configure it.
|
Once you have installed synapse as above, you will need to configure it.
|
||||||
|
|
||||||
## TLS certificates
|
### Using PostgreSQL
|
||||||
|
|
||||||
|
By default Synapse uses [SQLite](https://sqlite.org/) and in doing so trades performance for convenience.
|
||||||
|
SQLite is only recommended in Synapse for testing purposes or for servers with
|
||||||
|
very light workloads.
|
||||||
|
|
||||||
|
Almost all installations should opt to use [PostgreSQL](https://www.postgresql.org). Advantages include:
|
||||||
|
|
||||||
|
- significant performance improvements due to the superior threading and
|
||||||
|
caching model, smarter query optimiser
|
||||||
|
- allowing the DB to be run on separate hardware
|
||||||
|
|
||||||
|
For information on how to install and use PostgreSQL in Synapse, please see
|
||||||
|
[docs/postgres.md](docs/postgres.md)
|
||||||
|
|
||||||
|
### TLS certificates
|
||||||
|
|
||||||
The default configuration exposes a single HTTP port on the local
|
The default configuration exposes a single HTTP port on the local
|
||||||
interface: `http://localhost:8008`. It is suitable for local testing,
|
interface: `http://localhost:8008`. It is suitable for local testing,
|
||||||
@@ -419,19 +438,19 @@ The recommended way to do so is to set up a reverse proxy on port
|
|||||||
Alternatively, you can configure Synapse to expose an HTTPS port. To do
|
Alternatively, you can configure Synapse to expose an HTTPS port. To do
|
||||||
so, you will need to edit `homeserver.yaml`, as follows:
|
so, you will need to edit `homeserver.yaml`, as follows:
|
||||||
|
|
||||||
* First, under the `listeners` section, uncomment the configuration for the
|
- First, under the `listeners` section, uncomment the configuration for the
|
||||||
TLS-enabled listener. (Remove the hash sign (`#`) at the start of
|
TLS-enabled listener. (Remove the hash sign (`#`) at the start of
|
||||||
each line). The relevant lines are like this:
|
each line). The relevant lines are like this:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
- port: 8448
|
- port: 8448
|
||||||
type: http
|
type: http
|
||||||
tls: true
|
tls: true
|
||||||
resources:
|
resources:
|
||||||
- names: [client, federation]
|
- names: [client, federation]
|
||||||
```
|
```
|
||||||
|
|
||||||
* You will also need to uncomment the `tls_certificate_path` and
|
- You will also need to uncomment the `tls_certificate_path` and
|
||||||
`tls_private_key_path` lines under the `TLS` section. You will need to manage
|
`tls_private_key_path` lines under the `TLS` section. You will need to manage
|
||||||
provisioning of these certificates yourself — Synapse had built-in ACME
|
provisioning of these certificates yourself — Synapse had built-in ACME
|
||||||
support, but the ACMEv1 protocol Synapse implements is deprecated, not
|
support, but the ACMEv1 protocol Synapse implements is deprecated, not
|
||||||
@@ -446,7 +465,7 @@ so, you will need to edit `homeserver.yaml`, as follows:
|
|||||||
For a more detailed guide to configuring your server for federation, see
|
For a more detailed guide to configuring your server for federation, see
|
||||||
[federate.md](docs/federate.md).
|
[federate.md](docs/federate.md).
|
||||||
|
|
||||||
## Client Well-Known URI
|
### Client Well-Known URI
|
||||||
|
|
||||||
Setting up the client Well-Known URI is optional but if you set it up, it will
|
Setting up the client Well-Known URI is optional but if you set it up, it will
|
||||||
allow users to enter their full username (e.g. `@user:<server_name>`) into clients
|
allow users to enter their full username (e.g. `@user:<server_name>`) into clients
|
||||||
@@ -457,7 +476,7 @@ about the actual homeserver URL you are using.
|
|||||||
The URL `https://<server_name>/.well-known/matrix/client` should return JSON in
|
The URL `https://<server_name>/.well-known/matrix/client` should return JSON in
|
||||||
the following format.
|
the following format.
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
"base_url": "https://<matrix.example.com>"
|
"base_url": "https://<matrix.example.com>"
|
||||||
@@ -467,7 +486,7 @@ the following format.
|
|||||||
|
|
||||||
It can optionally contain identity server information as well.
|
It can optionally contain identity server information as well.
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"m.homeserver": {
|
"m.homeserver": {
|
||||||
"base_url": "https://<matrix.example.com>"
|
"base_url": "https://<matrix.example.com>"
|
||||||
@@ -484,10 +503,11 @@ Cross-Origin Resource Sharing (CORS) headers. A recommended value would be
|
|||||||
view it.
|
view it.
|
||||||
|
|
||||||
In nginx this would be something like:
|
In nginx this would be something like:
|
||||||
```
|
|
||||||
|
```nginx
|
||||||
location /.well-known/matrix/client {
|
location /.well-known/matrix/client {
|
||||||
return 200 '{"m.homeserver": {"base_url": "https://<matrix.example.com>"}}';
|
return 200 '{"m.homeserver": {"base_url": "https://<matrix.example.com>"}}';
|
||||||
add_header Content-Type application/json;
|
default_type application/json;
|
||||||
add_header Access-Control-Allow-Origin *;
|
add_header Access-Control-Allow-Origin *;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -497,11 +517,11 @@ correctly. `public_baseurl` should be set to the URL that clients will use to
|
|||||||
connect to your server. This is the same URL you put for the `m.homeserver`
|
connect to your server. This is the same URL you put for the `m.homeserver`
|
||||||
`base_url` above.
|
`base_url` above.
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
public_baseurl: "https://<matrix.example.com>"
|
public_baseurl: "https://<matrix.example.com>"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Email
|
### Email
|
||||||
|
|
||||||
It is desirable for Synapse to have the capability to send email. This allows
|
It is desirable for Synapse to have the capability to send email. This allows
|
||||||
Synapse to send password reset emails, send verifications when an email address
|
Synapse to send password reset emails, send verifications when an email address
|
||||||
@@ -516,7 +536,7 @@ and `notif_from` fields filled out. You may also need to set `smtp_user`,
|
|||||||
If email is not configured, password reset, registration and notifications via
|
If email is not configured, password reset, registration and notifications via
|
||||||
email will be disabled.
|
email will be disabled.
|
||||||
|
|
||||||
## Registering a user
|
### Registering a user
|
||||||
|
|
||||||
The easiest way to create a new user is to do so from a client like [Element](https://element.io/).
|
The easiest way to create a new user is to do so from a client like [Element](https://element.io/).
|
||||||
|
|
||||||
@@ -524,7 +544,7 @@ Alternatively you can do so from the command line if you have installed via pip.
|
|||||||
|
|
||||||
This can be done as follows:
|
This can be done as follows:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ source ~/synapse/env/bin/activate
|
$ source ~/synapse/env/bin/activate
|
||||||
$ synctl start # if not already running
|
$ synctl start # if not already running
|
||||||
$ register_new_matrix_user -c homeserver.yaml http://localhost:8008
|
$ register_new_matrix_user -c homeserver.yaml http://localhost:8008
|
||||||
@@ -542,12 +562,12 @@ value is generated by `--generate-config`), but it should be kept secret, as
|
|||||||
anyone with knowledge of it can register users, including admin accounts,
|
anyone with knowledge of it can register users, including admin accounts,
|
||||||
on your server even if `enable_registration` is `false`.
|
on your server even if `enable_registration` is `false`.
|
||||||
|
|
||||||
## Setting up a TURN server
|
### Setting up a TURN server
|
||||||
|
|
||||||
For reliable VoIP calls to be routed via this homeserver, you MUST configure
|
For reliable VoIP calls to be routed via this homeserver, you MUST configure
|
||||||
a TURN server. See [docs/turn-howto.md](docs/turn-howto.md) for details.
|
a TURN server. See [docs/turn-howto.md](docs/turn-howto.md) for details.
|
||||||
|
|
||||||
## URL previews
|
### URL previews
|
||||||
|
|
||||||
Synapse includes support for previewing URLs, which is disabled by default. To
|
Synapse includes support for previewing URLs, which is disabled by default. To
|
||||||
turn it on you must enable the `url_preview_enabled: True` config parameter
|
turn it on you must enable the `url_preview_enabled: True` config parameter
|
||||||
@@ -557,19 +577,18 @@ This is critical from a security perspective to stop arbitrary Matrix users
|
|||||||
spidering 'internal' URLs on your network. At the very least we recommend that
|
spidering 'internal' URLs on your network. At the very least we recommend that
|
||||||
your loopback and RFC1918 IP addresses are blacklisted.
|
your loopback and RFC1918 IP addresses are blacklisted.
|
||||||
|
|
||||||
This also requires the optional `lxml` and `netaddr` python dependencies to be
|
This also requires the optional `lxml` python dependency to be installed. This
|
||||||
installed. This in turn requires the `libxml2` library to be available - on
|
in turn requires the `libxml2` library to be available - on Debian/Ubuntu this
|
||||||
Debian/Ubuntu this means `apt-get install libxml2-dev`, or equivalent for
|
means `apt-get install libxml2-dev`, or equivalent for your OS.
|
||||||
your OS.
|
|
||||||
|
|
||||||
# Troubleshooting Installation
|
### Troubleshooting Installation
|
||||||
|
|
||||||
`pip` seems to leak *lots* of memory during installation. For instance, a Linux
|
`pip` seems to leak *lots* of memory during installation. For instance, a Linux
|
||||||
host with 512MB of RAM may run out of memory whilst installing Twisted. If this
|
host with 512MB of RAM may run out of memory whilst installing Twisted. If this
|
||||||
happens, you will have to individually install the dependencies which are
|
happens, you will have to individually install the dependencies which are
|
||||||
failing, e.g.:
|
failing, e.g.:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
pip install twisted
|
pip install twisted
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
88
README.rst
88
README.rst
@@ -1,10 +1,6 @@
|
|||||||
================
|
=========================================================
|
||||||
Synapse |shield|
|
Synapse |support| |development| |license| |pypi| |python|
|
||||||
================
|
=========================================================
|
||||||
|
|
||||||
.. |shield| image:: https://img.shields.io/matrix/synapse:matrix.org?label=support&logo=matrix
|
|
||||||
:alt: (get support on #synapse:matrix.org)
|
|
||||||
:target: https://matrix.to/#/#synapse:matrix.org
|
|
||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
|
|
||||||
@@ -247,6 +243,8 @@ Then update the ``users`` table in the database::
|
|||||||
Synapse Development
|
Synapse Development
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
Join our developer community on Matrix: `#synapse-dev:matrix.org <https://matrix.to/#/#synapse-dev:matrix.org>`_
|
||||||
|
|
||||||
Before setting up a development environment for synapse, make sure you have the
|
Before setting up a development environment for synapse, make sure you have the
|
||||||
system dependencies (such as the python header files) installed - see
|
system dependencies (such as the python header files) installed - see
|
||||||
`Installing from source <INSTALL.md#installing-from-source>`_.
|
`Installing from source <INSTALL.md#installing-from-source>`_.
|
||||||
@@ -260,23 +258,48 @@ directory of your choice::
|
|||||||
Synapse has a number of external dependencies, that are easiest
|
Synapse has a number of external dependencies, that are easiest
|
||||||
to install using pip and a virtualenv::
|
to install using pip and a virtualenv::
|
||||||
|
|
||||||
virtualenv -p python3 env
|
python3 -m venv ./env
|
||||||
source env/bin/activate
|
source ./env/bin/activate
|
||||||
python -m pip install --no-use-pep517 -e ".[all]"
|
pip install -e ".[all,test]"
|
||||||
|
|
||||||
This will run a process of downloading and installing all the needed
|
This will run a process of downloading and installing all the needed
|
||||||
dependencies into a virtual env.
|
dependencies into a virtual env. If any dependencies fail to install,
|
||||||
|
try installing the failing modules individually::
|
||||||
|
|
||||||
Once this is done, you may wish to run Synapse's unit tests, to
|
pip install -e "module-name"
|
||||||
check that everything is installed as it should be::
|
|
||||||
|
Once this is done, you may wish to run Synapse's unit tests to
|
||||||
|
check that everything is installed correctly::
|
||||||
|
|
||||||
python -m twisted.trial tests
|
python -m twisted.trial tests
|
||||||
|
|
||||||
This should end with a 'PASSED' result::
|
This should end with a 'PASSED' result (note that exact numbers will
|
||||||
|
differ)::
|
||||||
|
|
||||||
|
Ran 1337 tests in 716.064s
|
||||||
|
|
||||||
|
PASSED (skips=15, successes=1322)
|
||||||
|
|
||||||
|
We recommend using the demo which starts 3 federated instances running on ports `8080` - `8082`
|
||||||
|
|
||||||
|
./demo/start.sh
|
||||||
|
|
||||||
|
(to stop, you can use `./demo/stop.sh`)
|
||||||
|
|
||||||
|
If you just want to start a single instance of the app and run it directly::
|
||||||
|
|
||||||
|
# Create the homeserver.yaml config once
|
||||||
|
python -m synapse.app.homeserver \
|
||||||
|
--server-name my.domain.name \
|
||||||
|
--config-path homeserver.yaml \
|
||||||
|
--generate-config \
|
||||||
|
--report-stats=[yes|no]
|
||||||
|
|
||||||
|
# Start the app
|
||||||
|
python -m synapse.app.homeserver --config-path homeserver.yaml
|
||||||
|
|
||||||
|
|
||||||
Ran 143 tests in 0.601s
|
|
||||||
|
|
||||||
PASSED (successes=143)
|
|
||||||
|
|
||||||
Running the Integration Tests
|
Running the Integration Tests
|
||||||
=============================
|
=============================
|
||||||
@@ -290,19 +313,6 @@ Testing with SyTest is recommended for verifying that changes related to the
|
|||||||
Client-Server API are functioning correctly. See the `installation instructions
|
Client-Server API are functioning correctly. See the `installation instructions
|
||||||
<https://github.com/matrix-org/sytest#installing>`_ for details.
|
<https://github.com/matrix-org/sytest#installing>`_ for details.
|
||||||
|
|
||||||
Building Internal API Documentation
|
|
||||||
===================================
|
|
||||||
|
|
||||||
Before building internal API documentation install sphinx and
|
|
||||||
sphinxcontrib-napoleon::
|
|
||||||
|
|
||||||
pip install sphinx
|
|
||||||
pip install sphinxcontrib-napoleon
|
|
||||||
|
|
||||||
Building internal API documentation::
|
|
||||||
|
|
||||||
python setup.py build_sphinx
|
|
||||||
|
|
||||||
Troubleshooting
|
Troubleshooting
|
||||||
===============
|
===============
|
||||||
|
|
||||||
@@ -387,3 +397,23 @@ something like the following in their logs::
|
|||||||
|
|
||||||
This is normally caused by a misconfiguration in your reverse-proxy. See
|
This is normally caused by a misconfiguration in your reverse-proxy. See
|
||||||
`<docs/reverse_proxy.md>`_ and double-check that your settings are correct.
|
`<docs/reverse_proxy.md>`_ and double-check that your settings are correct.
|
||||||
|
|
||||||
|
.. |support| image:: https://img.shields.io/matrix/synapse:matrix.org?label=support&logo=matrix
|
||||||
|
:alt: (get support on #synapse:matrix.org)
|
||||||
|
:target: https://matrix.to/#/#synapse:matrix.org
|
||||||
|
|
||||||
|
.. |development| image:: https://img.shields.io/matrix/synapse-dev:matrix.org?label=development&logo=matrix
|
||||||
|
:alt: (discuss development on #synapse-dev:matrix.org)
|
||||||
|
:target: https://matrix.to/#/#synapse-dev:matrix.org
|
||||||
|
|
||||||
|
.. |license| image:: https://img.shields.io/github/license/matrix-org/synapse
|
||||||
|
:alt: (check license in LICENSE file)
|
||||||
|
:target: LICENSE
|
||||||
|
|
||||||
|
.. |pypi| image:: https://img.shields.io/pypi/v/matrix-synapse
|
||||||
|
:alt: (latest version released on PyPi)
|
||||||
|
:target: https://pypi.org/project/matrix-synapse
|
||||||
|
|
||||||
|
.. |python| image:: https://img.shields.io/pypi/pyversions/matrix-synapse
|
||||||
|
:alt: (supported python versions)
|
||||||
|
:target: https://pypi.org/project/matrix-synapse
|
||||||
|
|||||||
178
UPGRADE.rst
178
UPGRADE.rst
@@ -5,6 +5,16 @@ Before upgrading check if any special steps are required to upgrade from the
|
|||||||
version you currently have installed to the current version of Synapse. The extra
|
version you currently have installed to the current version of Synapse. The extra
|
||||||
instructions that may be required are listed later in this document.
|
instructions that may be required are listed later in this document.
|
||||||
|
|
||||||
|
* Check that your versions of Python and PostgreSQL are still supported.
|
||||||
|
|
||||||
|
Synapse follows upstream lifecycles for `Python`_ and `PostgreSQL`_, and
|
||||||
|
removes support for versions which are no longer maintained.
|
||||||
|
|
||||||
|
The website https://endoflife.date also offers convenient summaries.
|
||||||
|
|
||||||
|
.. _Python: https://devguide.python.org/devcycle/#end-of-life-branches
|
||||||
|
.. _PostgreSQL: https://www.postgresql.org/support/versioning/
|
||||||
|
|
||||||
* If Synapse was installed using `prebuilt packages
|
* If Synapse was installed using `prebuilt packages
|
||||||
<INSTALL.md#prebuilt-packages>`_, you will need to follow the normal process
|
<INSTALL.md#prebuilt-packages>`_, you will need to follow the normal process
|
||||||
for upgrading those packages.
|
for upgrading those packages.
|
||||||
@@ -75,6 +85,174 @@ for example:
|
|||||||
wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
|
wget https://packages.matrix.org/debian/pool/main/m/matrix-synapse-py3/matrix-synapse-py3_1.3.0+stretch1_amd64.deb
|
||||||
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
|
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
|
||||||
|
|
||||||
|
Upgrading to v1.26.0
|
||||||
|
====================
|
||||||
|
|
||||||
|
Rolling back to v1.25.0 after a failed upgrade
|
||||||
|
----------------------------------------------
|
||||||
|
|
||||||
|
v1.26.0 includes a lot of large changes. If something problematic occurs, you
|
||||||
|
may want to roll-back to a previous version of Synapse. Because v1.26.0 also
|
||||||
|
includes a new database schema version, reverting that version is also required
|
||||||
|
alongside the generic rollback instructions mentioned above. In short, to roll
|
||||||
|
back to v1.25.0 you need to:
|
||||||
|
|
||||||
|
1. Stop the server
|
||||||
|
2. Decrease the schema version in the database:
|
||||||
|
|
||||||
|
.. code:: sql
|
||||||
|
|
||||||
|
UPDATE schema_version SET version = 58;
|
||||||
|
|
||||||
|
3. Delete the ignored users & chain cover data:
|
||||||
|
|
||||||
|
.. code:: sql
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS ignored_users;
|
||||||
|
UPDATE rooms SET has_auth_chain_index = false;
|
||||||
|
|
||||||
|
For PostgreSQL run:
|
||||||
|
|
||||||
|
.. code:: sql
|
||||||
|
|
||||||
|
TRUNCATE event_auth_chain_links;
|
||||||
|
TRUNCATE event_auth_chains;
|
||||||
|
|
||||||
|
For SQLite run:
|
||||||
|
|
||||||
|
.. code:: sql
|
||||||
|
|
||||||
|
DELETE FROM event_auth_chain_links;
|
||||||
|
DELETE FROM event_auth_chains;
|
||||||
|
|
||||||
|
4. Mark the deltas as not run (so they will re-run on upgrade).
|
||||||
|
|
||||||
|
.. code:: sql
|
||||||
|
|
||||||
|
DELETE FROM applied_schema_deltas WHERE version = 59 AND file = "59/01ignored_user.py";
|
||||||
|
DELETE FROM applied_schema_deltas WHERE version = 59 AND file = "59/06chain_cover_index.sql";
|
||||||
|
|
||||||
|
5. Downgrade Synapse by following the instructions for your installation method
|
||||||
|
in the "Rolling back to older versions" section above.
|
||||||
|
|
||||||
|
Upgrading to v1.25.0
|
||||||
|
====================
|
||||||
|
|
||||||
|
Last release supporting Python 3.5
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
This is the last release of Synapse which guarantees support with Python 3.5,
|
||||||
|
which passed its upstream End of Life date several months ago.
|
||||||
|
|
||||||
|
We will attempt to maintain support through March 2021, but without guarantees.
|
||||||
|
|
||||||
|
In the future, Synapse will follow upstream schedules for ending support of
|
||||||
|
older versions of Python and PostgreSQL. Please upgrade to at least Python 3.6
|
||||||
|
and PostgreSQL 9.6 as soon as possible.
|
||||||
|
|
||||||
|
Blacklisting IP ranges
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
Synapse v1.25.0 includes new settings, ``ip_range_blacklist`` and
|
||||||
|
``ip_range_whitelist``, for controlling outgoing requests from Synapse for federation,
|
||||||
|
identity servers, push, and for checking key validity for third-party invite events.
|
||||||
|
The previous setting, ``federation_ip_range_blacklist``, is deprecated. The new
|
||||||
|
``ip_range_blacklist`` defaults to private IP ranges if it is not defined.
|
||||||
|
|
||||||
|
If you have never customised ``federation_ip_range_blacklist`` it is recommended
|
||||||
|
that you remove that setting.
|
||||||
|
|
||||||
|
If you have customised ``federation_ip_range_blacklist`` you should update the
|
||||||
|
setting name to ``ip_range_blacklist``.
|
||||||
|
|
||||||
|
If you have a custom push server that is reached via private IP space you may
|
||||||
|
need to customise ``ip_range_blacklist`` or ``ip_range_whitelist``.
|
||||||
|
|
||||||
|
Upgrading to v1.24.0
|
||||||
|
====================
|
||||||
|
|
||||||
|
Custom OpenID Connect mapping provider breaking change
|
||||||
|
------------------------------------------------------
|
||||||
|
|
||||||
|
This release allows the OpenID Connect mapping provider to perform normalisation
|
||||||
|
of the localpart of the Matrix ID. This allows for the mapping provider to
|
||||||
|
specify different algorithms, instead of the [default way](https://matrix.org/docs/spec/appendices#mapping-from-other-character-sets).
|
||||||
|
|
||||||
|
If your Synapse configuration uses a custom mapping provider
|
||||||
|
(`oidc_config.user_mapping_provider.module` is specified and not equal to
|
||||||
|
`synapse.handlers.oidc_handler.JinjaOidcMappingProvider`) then you *must* ensure
|
||||||
|
that `map_user_attributes` of the mapping provider performs some normalisation
|
||||||
|
of the `localpart` returned. To match previous behaviour you can use the
|
||||||
|
`map_username_to_mxid_localpart` function provided by Synapse. An example is
|
||||||
|
shown below:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from synapse.types import map_username_to_mxid_localpart
|
||||||
|
|
||||||
|
class MyMappingProvider:
|
||||||
|
def map_user_attributes(self, userinfo, token):
|
||||||
|
# ... your custom logic ...
|
||||||
|
sso_user_id = ...
|
||||||
|
localpart = map_username_to_mxid_localpart(sso_user_id)
|
||||||
|
|
||||||
|
return {"localpart": localpart}
|
||||||
|
|
||||||
|
Removal historical Synapse Admin API
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
Historically, the Synapse Admin API has been accessible under:
|
||||||
|
|
||||||
|
* ``/_matrix/client/api/v1/admin``
|
||||||
|
* ``/_matrix/client/unstable/admin``
|
||||||
|
* ``/_matrix/client/r0/admin``
|
||||||
|
* ``/_synapse/admin/v1``
|
||||||
|
|
||||||
|
The endpoints with ``/_matrix/client/*`` prefixes have been removed as of v1.24.0.
|
||||||
|
The Admin API is now only accessible under:
|
||||||
|
|
||||||
|
* ``/_synapse/admin/v1``
|
||||||
|
|
||||||
|
The only exception is the `/admin/whois` endpoint, which is
|
||||||
|
`also available via the client-server API <https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid>`_.
|
||||||
|
|
||||||
|
The deprecation of the old endpoints was announced with Synapse 1.20.0 (released
|
||||||
|
on 2020-09-22) and makes it easier for homeserver admins to lock down external
|
||||||
|
access to the Admin API endpoints.
|
||||||
|
|
||||||
|
Upgrading to v1.23.0
|
||||||
|
====================
|
||||||
|
|
||||||
|
Structured logging configuration breaking changes
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
This release deprecates use of the ``structured: true`` logging configuration for
|
||||||
|
structured logging. If your logging configuration contains ``structured: true``
|
||||||
|
then it should be modified based on the `structured logging documentation
|
||||||
|
<https://github.com/matrix-org/synapse/blob/master/docs/structured_logging.md>`_.
|
||||||
|
|
||||||
|
The ``structured`` and ``drains`` logging options are now deprecated and should
|
||||||
|
be replaced by standard logging configuration of ``handlers`` and ``formatters``.
|
||||||
|
|
||||||
|
A future will release of Synapse will make using ``structured: true`` an error.
|
||||||
|
|
||||||
|
Upgrading to v1.22.0
|
||||||
|
====================
|
||||||
|
|
||||||
|
ThirdPartyEventRules breaking changes
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
This release introduces a backwards-incompatible change to modules making use of
|
||||||
|
``ThirdPartyEventRules`` in Synapse. If you make use of a module defined under the
|
||||||
|
``third_party_event_rules`` config option, please make sure it is updated to handle
|
||||||
|
the below change:
|
||||||
|
|
||||||
|
The ``http_client`` argument is no longer passed to modules as they are initialised. Instead,
|
||||||
|
modules are expected to make use of the ``http_client`` property on the ``ModuleApi`` class.
|
||||||
|
Modules are now passed a ``module_api`` argument during initialisation, which is an instance of
|
||||||
|
``ModuleApi``. ``ModuleApi`` instances have a ``http_client`` property which acts the same as
|
||||||
|
the ``http_client`` argument previously passed to ``ThirdPartyEventRules`` modules.
|
||||||
|
|
||||||
Upgrading to v1.21.0
|
Upgrading to v1.21.0
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
|||||||
1
changelog.d/9045.misc
Normal file
1
changelog.d/9045.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Add tests to `test_user.UsersListTestCase` for List Users Admin API.
|
||||||
1
changelog.d/9129.misc
Normal file
1
changelog.d/9129.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Various improvements to the federation client.
|
||||||
1
changelog.d/9135.doc
Normal file
1
changelog.d/9135.doc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Add link to Matrix VoIP tester for turn-howto.
|
||||||
1
changelog.d/9163.bugfix
Normal file
1
changelog.d/9163.bugfix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fix a long-standing bug where Synapse would return a 500 error when a thumbnail did not exist (and auto-generation of thumbnails was not enabled).
|
||||||
1
changelog.d/9176.misc
Normal file
1
changelog.d/9176.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Speed up chain cover calculation when persisting a batch of state events at once.
|
||||||
1
changelog.d/9180.misc
Normal file
1
changelog.d/9180.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Add a `long_description_type` to the package metadata.
|
||||||
1
changelog.d/9181.misc
Normal file
1
changelog.d/9181.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Speed up batch insertion when using PostgreSQL.
|
||||||
1
changelog.d/9184.misc
Normal file
1
changelog.d/9184.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Emit an error at startup if different Identity Providers are configured with the same `idp_id`.
|
||||||
1
changelog.d/9188.misc
Normal file
1
changelog.d/9188.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Speed up batch insertion when using PostgreSQL.
|
||||||
1
changelog.d/9189.misc
Normal file
1
changelog.d/9189.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Add an `oidc-` prefix to any `idp_id`s which are given in the `oidc_providers` configuration.
|
||||||
1
changelog.d/9190.misc
Normal file
1
changelog.d/9190.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Improve performance of concurrent use of `StreamIDGenerators`.
|
||||||
1
changelog.d/9191.misc
Normal file
1
changelog.d/9191.misc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Add some missing source directories to the automatic linting script.
|
||||||
1
changelog.d/9193.bugfix
Normal file
1
changelog.d/9193.bugfix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fix receipts or account data not being sent down sync. Introduced in v1.26.0rc1.
|
||||||
1
changelog.d/9195.bugfix
Normal file
1
changelog.d/9195.bugfix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Fix receipts or account data not being sent down sync. Introduced in v1.26.0rc1.
|
||||||
@@ -3,4 +3,4 @@
|
|||||||
0. Set up Prometheus and Grafana. Out of scope for this readme. Useful documentation about using Grafana with Prometheus: http://docs.grafana.org/features/datasources/prometheus/
|
0. Set up Prometheus and Grafana. Out of scope for this readme. Useful documentation about using Grafana with Prometheus: http://docs.grafana.org/features/datasources/prometheus/
|
||||||
1. Have your Prometheus scrape your Synapse. https://github.com/matrix-org/synapse/blob/master/docs/metrics-howto.md
|
1. Have your Prometheus scrape your Synapse. https://github.com/matrix-org/synapse/blob/master/docs/metrics-howto.md
|
||||||
2. Import dashboard into Grafana. Download `synapse.json`. Import it to Grafana and select the correct Prometheus datasource. http://docs.grafana.org/reference/export_import/
|
2. Import dashboard into Grafana. Download `synapse.json`. Import it to Grafana and select the correct Prometheus datasource. http://docs.grafana.org/reference/export_import/
|
||||||
3. Set up additional recording rules
|
3. Set up required recording rules. https://github.com/matrix-org/synapse/tree/master/contrib/prometheus
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Add a new job to the main prometheus.conf file:
|
|||||||
```
|
```
|
||||||
|
|
||||||
### for Prometheus v2
|
### for Prometheus v2
|
||||||
|
|
||||||
Add a new job to the main prometheus.yml file:
|
Add a new job to the main prometheus.yml file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -29,14 +30,17 @@ Add a new job to the main prometheus.yml file:
|
|||||||
scheme: "https"
|
scheme: "https"
|
||||||
|
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['SERVER.LOCATION:PORT']
|
- targets: ["my.server.here:port"]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
An example of a Prometheus configuration with workers can be found in
|
||||||
|
[metrics-howto.md](https://github.com/matrix-org/synapse/blob/master/docs/metrics-howto.md).
|
||||||
|
|
||||||
To use `synapse.rules` add
|
To use `synapse.rules` add
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
rule_files:
|
rule_files:
|
||||||
- "/PATH/TO/synapse-v2.rules"
|
- "/PATH/TO/synapse-v2.rules"
|
||||||
```
|
```
|
||||||
|
|
||||||
Metrics are disabled by default when running synapse; they must be enabled
|
Metrics are disabled by default when running synapse; they must be enabled
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#process_resource_utime"),
|
node: document.querySelector("#process_resource_utime"),
|
||||||
expr: "rate(process_cpu_seconds_total[2m]) * 100",
|
expr: "rate(process_cpu_seconds_total[2m]) * 100",
|
||||||
name: "[[job]]",
|
name: "[[job]]-[[index]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 100,
|
max: 100,
|
||||||
renderer: "line",
|
renderer: "line",
|
||||||
@@ -22,12 +22,12 @@ new PromConsole.Graph({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h3>Memory</h3>
|
<h3>Memory</h3>
|
||||||
<div id="process_resource_maxrss"></div>
|
<div id="process_resident_memory_bytes"></div>
|
||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#process_resource_maxrss"),
|
node: document.querySelector("#process_resident_memory_bytes"),
|
||||||
expr: "process_psutil_rss:max",
|
expr: "process_resident_memory_bytes",
|
||||||
name: "Maxrss",
|
name: "[[job]]-[[index]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
renderer: "line",
|
renderer: "line",
|
||||||
height: 150,
|
height: 150,
|
||||||
@@ -43,8 +43,8 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#process_fds"),
|
node: document.querySelector("#process_fds"),
|
||||||
expr: "process_open_fds{job='synapse'}",
|
expr: "process_open_fds",
|
||||||
name: "FDs",
|
name: "[[job]]-[[index]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
renderer: "line",
|
renderer: "line",
|
||||||
height: 150,
|
height: 150,
|
||||||
@@ -62,8 +62,8 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#reactor_total_time"),
|
node: document.querySelector("#reactor_total_time"),
|
||||||
expr: "rate(python_twisted_reactor_tick_time:total[2m]) / 1000",
|
expr: "rate(python_twisted_reactor_tick_time_sum[2m])",
|
||||||
name: "time",
|
name: "[[job]]-[[index]]",
|
||||||
max: 1,
|
max: 1,
|
||||||
min: 0,
|
min: 0,
|
||||||
renderer: "area",
|
renderer: "area",
|
||||||
@@ -80,8 +80,8 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#reactor_average_time"),
|
node: document.querySelector("#reactor_average_time"),
|
||||||
expr: "rate(python_twisted_reactor_tick_time:total[2m]) / rate(python_twisted_reactor_tick_time:count[2m]) / 1000",
|
expr: "rate(python_twisted_reactor_tick_time_sum[2m]) / rate(python_twisted_reactor_tick_time_count[2m])",
|
||||||
name: "time",
|
name: "[[job]]-[[index]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
renderer: "line",
|
renderer: "line",
|
||||||
height: 150,
|
height: 150,
|
||||||
@@ -97,14 +97,14 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#reactor_pending_calls"),
|
node: document.querySelector("#reactor_pending_calls"),
|
||||||
expr: "rate(python_twisted_reactor_pending_calls:total[30s])/rate(python_twisted_reactor_pending_calls:count[30s])",
|
expr: "rate(python_twisted_reactor_pending_calls_sum[30s]) / rate(python_twisted_reactor_pending_calls_count[30s])",
|
||||||
name: "calls",
|
name: "[[job]]-[[index]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
renderer: "line",
|
renderer: "line",
|
||||||
height: 150,
|
height: 150,
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yTitle: "Pending Cals"
|
yTitle: "Pending Calls"
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_storage_query_time"),
|
node: document.querySelector("#synapse_storage_query_time"),
|
||||||
expr: "rate(synapse_storage_query_time:count[2m])",
|
expr: "sum(rate(synapse_storage_query_time_count[2m])) by (verb)",
|
||||||
name: "[[verb]]",
|
name: "[[verb]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
@@ -129,8 +129,8 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_storage_transaction_time"),
|
node: document.querySelector("#synapse_storage_transaction_time"),
|
||||||
expr: "rate(synapse_storage_transaction_time:count[2m])",
|
expr: "topk(10, rate(synapse_storage_transaction_time_count[2m]))",
|
||||||
name: "[[desc]]",
|
name: "[[job]]-[[index]] [[desc]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
@@ -140,12 +140,12 @@ new PromConsole.Graph({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h3>Transaction execution time</h3>
|
<h3>Transaction execution time</h3>
|
||||||
<div id="synapse_storage_transactions_time_msec"></div>
|
<div id="synapse_storage_transactions_time_sec"></div>
|
||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_storage_transactions_time_msec"),
|
node: document.querySelector("#synapse_storage_transactions_time_sec"),
|
||||||
expr: "rate(synapse_storage_transaction_time:total[2m]) / 1000",
|
expr: "rate(synapse_storage_transaction_time_sum[2m])",
|
||||||
name: "[[desc]]",
|
name: "[[job]]-[[index]] [[desc]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
@@ -154,34 +154,33 @@ new PromConsole.Graph({
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h3>Database scheduling latency</h3>
|
<h3>Average time waiting for database connection</h3>
|
||||||
<div id="synapse_storage_schedule_time"></div>
|
<div id="synapse_storage_avg_waiting_time"></div>
|
||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_storage_schedule_time"),
|
node: document.querySelector("#synapse_storage_avg_waiting_time"),
|
||||||
expr: "rate(synapse_storage_schedule_time:total[2m]) / 1000",
|
expr: "rate(synapse_storage_schedule_time_sum[2m]) / rate(synapse_storage_schedule_time_count[2m])",
|
||||||
name: "Total latency",
|
name: "[[job]]-[[index]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "s/s",
|
yUnits: "s",
|
||||||
yTitle: "Usage"
|
yTitle: "Time"
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h3>Cache hit ratio</h3>
|
<h3>Cache request rate</h3>
|
||||||
<div id="synapse_cache_ratio"></div>
|
<div id="synapse_cache_request_rate"></div>
|
||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_cache_ratio"),
|
node: document.querySelector("#synapse_cache_request_rate"),
|
||||||
expr: "rate(synapse_util_caches_cache:total[2m]) * 100",
|
expr: "rate(synapse_util_caches_cache:total[2m])",
|
||||||
name: "[[name]]",
|
name: "[[job]]-[[index]] [[name]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 100,
|
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
yUnits: "%",
|
yUnits: "rps",
|
||||||
yTitle: "Percentage"
|
yTitle: "Cache request rate"
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -191,7 +190,7 @@ new PromConsole.Graph({
|
|||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_cache_size"),
|
node: document.querySelector("#synapse_cache_size"),
|
||||||
expr: "synapse_util_caches_cache:size",
|
expr: "synapse_util_caches_cache:size",
|
||||||
name: "[[name]]",
|
name: "[[job]]-[[index]] [[name]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
yUnits: "",
|
yUnits: "",
|
||||||
@@ -206,8 +205,8 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_http_server_request_count_servlet"),
|
node: document.querySelector("#synapse_http_server_request_count_servlet"),
|
||||||
expr: "rate(synapse_http_server_request_count:servlet[2m])",
|
expr: "rate(synapse_http_server_in_flight_requests_count[2m])",
|
||||||
name: "[[servlet]]",
|
name: "[[job]]-[[index]] [[method]] [[servlet]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "req/s",
|
yUnits: "req/s",
|
||||||
@@ -219,8 +218,8 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_http_server_request_count_servlet_minus_events"),
|
node: document.querySelector("#synapse_http_server_request_count_servlet_minus_events"),
|
||||||
expr: "rate(synapse_http_server_request_count:servlet{servlet!=\"EventStreamRestServlet\", servlet!=\"SyncRestServlet\"}[2m])",
|
expr: "rate(synapse_http_server_in_flight_requests_count{servlet!=\"EventStreamRestServlet\", servlet!=\"SyncRestServlet\"}[2m])",
|
||||||
name: "[[servlet]]",
|
name: "[[job]]-[[index]] [[method]] [[servlet]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "req/s",
|
yUnits: "req/s",
|
||||||
@@ -233,8 +232,8 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_http_server_response_time_avg"),
|
node: document.querySelector("#synapse_http_server_response_time_avg"),
|
||||||
expr: "rate(synapse_http_server_response_time_seconds[2m]) / rate(synapse_http_server_response_count[2m]) / 1000",
|
expr: "rate(synapse_http_server_response_time_seconds_sum[2m]) / rate(synapse_http_server_response_count[2m])",
|
||||||
name: "[[servlet]]",
|
name: "[[job]]-[[index]] [[servlet]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "s/req",
|
yUnits: "s/req",
|
||||||
@@ -277,7 +276,7 @@ new PromConsole.Graph({
|
|||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_http_server_response_ru_utime"),
|
node: document.querySelector("#synapse_http_server_response_ru_utime"),
|
||||||
expr: "rate(synapse_http_server_response_ru_utime_seconds[2m])",
|
expr: "rate(synapse_http_server_response_ru_utime_seconds[2m])",
|
||||||
name: "[[servlet]]",
|
name: "[[job]]-[[index]] [[servlet]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "s/s",
|
yUnits: "s/s",
|
||||||
@@ -292,7 +291,7 @@ new PromConsole.Graph({
|
|||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_http_server_response_db_txn_duration"),
|
node: document.querySelector("#synapse_http_server_response_db_txn_duration"),
|
||||||
expr: "rate(synapse_http_server_response_db_txn_duration_seconds[2m])",
|
expr: "rate(synapse_http_server_response_db_txn_duration_seconds[2m])",
|
||||||
name: "[[servlet]]",
|
name: "[[job]]-[[index]] [[servlet]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "s/s",
|
yUnits: "s/s",
|
||||||
@@ -306,8 +305,8 @@ new PromConsole.Graph({
|
|||||||
<script>
|
<script>
|
||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_http_server_send_time_avg"),
|
node: document.querySelector("#synapse_http_server_send_time_avg"),
|
||||||
expr: "rate(synapse_http_server_response_time_second{servlet='RoomSendEventRestServlet'}[2m]) / rate(synapse_http_server_response_count{servlet='RoomSendEventRestServlet'}[2m]) / 1000",
|
expr: "rate(synapse_http_server_response_time_seconds_sum{servlet='RoomSendEventRestServlet'}[2m]) / rate(synapse_http_server_response_count{servlet='RoomSendEventRestServlet'}[2m])",
|
||||||
name: "[[servlet]]",
|
name: "[[job]]-[[index]] [[servlet]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "s/req",
|
yUnits: "s/req",
|
||||||
@@ -323,7 +322,7 @@ new PromConsole.Graph({
|
|||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_federation_client_sent"),
|
node: document.querySelector("#synapse_federation_client_sent"),
|
||||||
expr: "rate(synapse_federation_client_sent[2m])",
|
expr: "rate(synapse_federation_client_sent[2m])",
|
||||||
name: "[[type]]",
|
name: "[[job]]-[[index]] [[type]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "req/s",
|
yUnits: "req/s",
|
||||||
@@ -337,7 +336,7 @@ new PromConsole.Graph({
|
|||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_federation_server_received"),
|
node: document.querySelector("#synapse_federation_server_received"),
|
||||||
expr: "rate(synapse_federation_server_received[2m])",
|
expr: "rate(synapse_federation_server_received[2m])",
|
||||||
name: "[[type]]",
|
name: "[[job]]-[[index]] [[type]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "req/s",
|
yUnits: "req/s",
|
||||||
@@ -367,7 +366,7 @@ new PromConsole.Graph({
|
|||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_notifier_listeners"),
|
node: document.querySelector("#synapse_notifier_listeners"),
|
||||||
expr: "synapse_notifier_listeners",
|
expr: "synapse_notifier_listeners",
|
||||||
name: "listeners",
|
name: "[[job]]-[[index]]",
|
||||||
min: 0,
|
min: 0,
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yAxisFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
yHoverFormatter: PromConsole.NumberFormatter.humanizeNoSmallPrefix,
|
||||||
@@ -382,7 +381,7 @@ new PromConsole.Graph({
|
|||||||
new PromConsole.Graph({
|
new PromConsole.Graph({
|
||||||
node: document.querySelector("#synapse_notifier_notified_events"),
|
node: document.querySelector("#synapse_notifier_notified_events"),
|
||||||
expr: "rate(synapse_notifier_notified_events[2m])",
|
expr: "rate(synapse_notifier_notified_events[2m])",
|
||||||
name: "events",
|
name: "[[job]]-[[index]]",
|
||||||
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
yAxisFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
yHoverFormatter: PromConsole.NumberFormatter.humanize,
|
||||||
yUnits: "events/s",
|
yUnits: "events/s",
|
||||||
|
|||||||
@@ -58,3 +58,21 @@ groups:
|
|||||||
labels:
|
labels:
|
||||||
type: "PDU"
|
type: "PDU"
|
||||||
expr: 'synapse_federation_transaction_queue_pending_pdus + 0'
|
expr: 'synapse_federation_transaction_queue_pending_pdus + 0'
|
||||||
|
|
||||||
|
- record: synapse_storage_events_persisted_by_source_type
|
||||||
|
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep{origin_type="remote"})
|
||||||
|
labels:
|
||||||
|
type: remote
|
||||||
|
- record: synapse_storage_events_persisted_by_source_type
|
||||||
|
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep{origin_entity="*client*",origin_type="local"})
|
||||||
|
labels:
|
||||||
|
type: local
|
||||||
|
- record: synapse_storage_events_persisted_by_source_type
|
||||||
|
expr: sum without(type, origin_type, origin_entity) (synapse_storage_events_persisted_events_sep{origin_entity!="*client*",origin_type="local"})
|
||||||
|
labels:
|
||||||
|
type: bridges
|
||||||
|
- record: synapse_storage_events_persisted_by_event_type
|
||||||
|
expr: sum without(origin_entity, origin_type) (synapse_storage_events_persisted_events_sep)
|
||||||
|
- record: synapse_storage_events_persisted_by_origin
|
||||||
|
expr: sum without(type) (synapse_storage_events_persisted_events_sep)
|
||||||
|
|
||||||
|
|||||||
2
debian/build_virtualenv
vendored
2
debian/build_virtualenv
vendored
@@ -42,7 +42,7 @@ dh_virtualenv \
|
|||||||
--preinstall="mock" \
|
--preinstall="mock" \
|
||||||
--extra-pip-arg="--no-cache-dir" \
|
--extra-pip-arg="--no-cache-dir" \
|
||||||
--extra-pip-arg="--compile" \
|
--extra-pip-arg="--compile" \
|
||||||
--extras="all,systemd"
|
--extras="all,systemd,test"
|
||||||
|
|
||||||
PACKAGE_BUILD_DIR="debian/matrix-synapse-py3"
|
PACKAGE_BUILD_DIR="debian/matrix-synapse-py3"
|
||||||
VIRTUALENV_DIR="${PACKAGE_BUILD_DIR}${DH_VIRTUALENV_INSTALL_ROOT}/matrix-synapse"
|
VIRTUALENV_DIR="${PACKAGE_BUILD_DIR}${DH_VIRTUALENV_INSTALL_ROOT}/matrix-synapse"
|
||||||
|
|||||||
64
debian/changelog
vendored
64
debian/changelog
vendored
@@ -1,3 +1,67 @@
|
|||||||
|
matrix-synapse-py3 (1.25.0ubuntu1) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* Remove dependency on `python3-distutils`.
|
||||||
|
|
||||||
|
-- Richard van der Hoff <richard@matrix.org> Fri, 15 Jan 2021 12:44:19 +0000
|
||||||
|
|
||||||
|
matrix-synapse-py3 (1.25.0) stable; urgency=medium
|
||||||
|
|
||||||
|
[ Dan Callahan ]
|
||||||
|
* Update dependencies to account for the removal of the transitional
|
||||||
|
dh-systemd package from Debian Bullseye.
|
||||||
|
|
||||||
|
[ Synapse Packaging team ]
|
||||||
|
* New synapse release 1.25.0.
|
||||||
|
|
||||||
|
-- Synapse Packaging team <packages@matrix.org> Wed, 13 Jan 2021 10:14:55 +0000
|
||||||
|
|
||||||
|
matrix-synapse-py3 (1.24.0) stable; urgency=medium
|
||||||
|
|
||||||
|
* New synapse release 1.24.0.
|
||||||
|
|
||||||
|
-- Synapse Packaging team <packages@matrix.org> Wed, 09 Dec 2020 10:14:30 +0000
|
||||||
|
|
||||||
|
matrix-synapse-py3 (1.23.1) stable; urgency=medium
|
||||||
|
|
||||||
|
* New synapse release 1.23.1.
|
||||||
|
|
||||||
|
-- Synapse Packaging team <packages@matrix.org> Wed, 09 Dec 2020 10:40:39 +0000
|
||||||
|
|
||||||
|
matrix-synapse-py3 (1.23.0) stable; urgency=medium
|
||||||
|
|
||||||
|
* New synapse release 1.23.0.
|
||||||
|
|
||||||
|
-- Synapse Packaging team <packages@matrix.org> Wed, 18 Nov 2020 11:41:28 +0000
|
||||||
|
|
||||||
|
matrix-synapse-py3 (1.22.1) stable; urgency=medium
|
||||||
|
|
||||||
|
* New synapse release 1.22.1.
|
||||||
|
|
||||||
|
-- Synapse Packaging team <packages@matrix.org> Fri, 30 Oct 2020 15:25:37 +0000
|
||||||
|
|
||||||
|
matrix-synapse-py3 (1.22.0) stable; urgency=medium
|
||||||
|
|
||||||
|
* New synapse release 1.22.0.
|
||||||
|
|
||||||
|
-- Synapse Packaging team <packages@matrix.org> Tue, 27 Oct 2020 12:07:12 +0000
|
||||||
|
|
||||||
|
matrix-synapse-py3 (1.21.2) stable; urgency=medium
|
||||||
|
|
||||||
|
[ Synapse Packaging team ]
|
||||||
|
* New synapse release 1.21.2.
|
||||||
|
|
||||||
|
-- Synapse Packaging team <packages@matrix.org> Thu, 15 Oct 2020 09:23:27 -0400
|
||||||
|
|
||||||
|
matrix-synapse-py3 (1.21.1) stable; urgency=medium
|
||||||
|
|
||||||
|
[ Synapse Packaging team ]
|
||||||
|
* New synapse release 1.21.1.
|
||||||
|
|
||||||
|
[ Andrew Morgan ]
|
||||||
|
* Explicitly install "test" python dependencies.
|
||||||
|
|
||||||
|
-- Synapse Packaging team <packages@matrix.org> Tue, 13 Oct 2020 10:24:13 +0100
|
||||||
|
|
||||||
matrix-synapse-py3 (1.21.0) stable; urgency=medium
|
matrix-synapse-py3 (1.21.0) stable; urgency=medium
|
||||||
|
|
||||||
* New synapse release 1.21.0.
|
* New synapse release 1.21.0.
|
||||||
|
|||||||
7
debian/control
vendored
7
debian/control
vendored
@@ -3,9 +3,11 @@ Section: contrib/python
|
|||||||
Priority: extra
|
Priority: extra
|
||||||
Maintainer: Synapse Packaging team <packages@matrix.org>
|
Maintainer: Synapse Packaging team <packages@matrix.org>
|
||||||
# keep this list in sync with the build dependencies in docker/Dockerfile-dhvirtualenv.
|
# keep this list in sync with the build dependencies in docker/Dockerfile-dhvirtualenv.
|
||||||
|
# TODO: Remove the dependency on dh-systemd after dropping support for Ubuntu xenial
|
||||||
|
# On all other supported releases, it's merely a transitional package which
|
||||||
|
# does nothing but depends on debhelper (> 9.20160709)
|
||||||
Build-Depends:
|
Build-Depends:
|
||||||
debhelper (>= 9),
|
debhelper (>= 9.20160709) | dh-systemd,
|
||||||
dh-systemd,
|
|
||||||
dh-virtualenv (>= 1.1),
|
dh-virtualenv (>= 1.1),
|
||||||
libsystemd-dev,
|
libsystemd-dev,
|
||||||
libpq-dev,
|
libpq-dev,
|
||||||
@@ -29,7 +31,6 @@ Pre-Depends: dpkg (>= 1.16.1)
|
|||||||
Depends:
|
Depends:
|
||||||
adduser,
|
adduser,
|
||||||
debconf,
|
debconf,
|
||||||
python3-distutils|libpython3-stdlib (<< 3.6),
|
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${shlibs:Depends},
|
${shlibs:Depends},
|
||||||
${synapse:pydepends},
|
${synapse:pydepends},
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ for port in 8080 8081 8082; do
|
|||||||
if ! grep -F "Customisation made by demo/start.sh" -q $DIR/etc/$port.config; then
|
if ! grep -F "Customisation made by demo/start.sh" -q $DIR/etc/$port.config; then
|
||||||
printf '\n\n# Customisation made by demo/start.sh\n' >> $DIR/etc/$port.config
|
printf '\n\n# Customisation made by demo/start.sh\n' >> $DIR/etc/$port.config
|
||||||
|
|
||||||
|
echo "public_baseurl: http://localhost:$port/" >> $DIR/etc/$port.config
|
||||||
|
|
||||||
echo 'enable_registration: true' >> $DIR/etc/$port.config
|
echo 'enable_registration: true' >> $DIR/etc/$port.config
|
||||||
|
|
||||||
# Warning, this heredoc depends on the interaction of tabs and spaces. Please don't
|
# Warning, this heredoc depends on the interaction of tabs and spaces. Please don't
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
import argparse
|
|
||||||
import BaseHTTPServer
|
|
||||||
import os
|
|
||||||
import SimpleHTTPServer
|
|
||||||
import cgi, logging
|
|
||||||
|
|
||||||
from daemonize import Daemonize
|
|
||||||
|
|
||||||
|
|
||||||
class SimpleHTTPRequestHandlerWithPOST(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
|
||||||
UPLOAD_PATH = "upload"
|
|
||||||
|
|
||||||
"""
|
|
||||||
Accept all post request as file upload
|
|
||||||
"""
|
|
||||||
|
|
||||||
def do_POST(self):
|
|
||||||
|
|
||||||
path = os.path.join(self.UPLOAD_PATH, os.path.basename(self.path))
|
|
||||||
length = self.headers["content-length"]
|
|
||||||
data = self.rfile.read(int(length))
|
|
||||||
|
|
||||||
with open(path, "wb") as fh:
|
|
||||||
fh.write(data)
|
|
||||||
|
|
||||||
self.send_response(200)
|
|
||||||
self.send_header("Content-Type", "application/json")
|
|
||||||
self.end_headers()
|
|
||||||
|
|
||||||
# Return the absolute path of the uploaded file
|
|
||||||
self.wfile.write('{"url":"/%s"}' % path)
|
|
||||||
|
|
||||||
|
|
||||||
def setup():
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument("directory")
|
|
||||||
parser.add_argument("-p", "--port", dest="port", type=int, default=8080)
|
|
||||||
parser.add_argument("-P", "--pid-file", dest="pid", default="web.pid")
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
# Get absolute path to directory to serve, as daemonize changes to '/'
|
|
||||||
os.chdir(args.directory)
|
|
||||||
dr = os.getcwd()
|
|
||||||
|
|
||||||
httpd = BaseHTTPServer.HTTPServer(("", args.port), SimpleHTTPRequestHandlerWithPOST)
|
|
||||||
|
|
||||||
def run():
|
|
||||||
os.chdir(dr)
|
|
||||||
httpd.serve_forever()
|
|
||||||
|
|
||||||
daemon = Daemonize(
|
|
||||||
app="synapse-webclient", pid=args.pid, action=run, auto_close_fds=False
|
|
||||||
)
|
|
||||||
|
|
||||||
daemon.start()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
setup()
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
# docker build -f docker/Dockerfile --build-arg PYTHON_VERSION=3.6 .
|
# docker build -f docker/Dockerfile --build-arg PYTHON_VERSION=3.6 .
|
||||||
#
|
#
|
||||||
|
|
||||||
ARG PYTHON_VERSION=3.7
|
ARG PYTHON_VERSION=3.8
|
||||||
|
|
||||||
###
|
###
|
||||||
### Stage 0: builder
|
### Stage 0: builder
|
||||||
@@ -36,7 +36,8 @@ RUN pip install --prefix="/install" --no-warn-script-location \
|
|||||||
frozendict \
|
frozendict \
|
||||||
jaeger-client \
|
jaeger-client \
|
||||||
opentracing \
|
opentracing \
|
||||||
prometheus-client \
|
# Match the version constraints of Synapse
|
||||||
|
"prometheus_client>=0.4.0" \
|
||||||
psycopg2 \
|
psycopg2 \
|
||||||
pycparser \
|
pycparser \
|
||||||
pyrsistent \
|
pyrsistent \
|
||||||
|
|||||||
@@ -50,17 +50,22 @@ FROM ${distro}
|
|||||||
ARG distro=""
|
ARG distro=""
|
||||||
ENV distro ${distro}
|
ENV distro ${distro}
|
||||||
|
|
||||||
|
# Python < 3.7 assumes LANG="C" means ASCII-only and throws on printing unicode
|
||||||
|
# http://bugs.python.org/issue19846
|
||||||
|
ENV LANG C.UTF-8
|
||||||
|
|
||||||
# Install the build dependencies
|
# Install the build dependencies
|
||||||
#
|
#
|
||||||
# NB: keep this list in sync with the list of build-deps in debian/control
|
# NB: keep this list in sync with the list of build-deps in debian/control
|
||||||
# TODO: it would be nice to do that automatically.
|
# TODO: it would be nice to do that automatically.
|
||||||
|
# TODO: Remove the dh-systemd stanza after dropping support for Ubuntu xenial
|
||||||
|
# it's a transitional package on all other, more recent releases
|
||||||
RUN apt-get update -qq -o Acquire::Languages=none \
|
RUN apt-get update -qq -o Acquire::Languages=none \
|
||||||
&& env DEBIAN_FRONTEND=noninteractive apt-get install \
|
&& env DEBIAN_FRONTEND=noninteractive apt-get install \
|
||||||
-yqq --no-install-recommends -o Dpkg::Options::=--force-unsafe-io \
|
-yqq --no-install-recommends -o Dpkg::Options::=--force-unsafe-io \
|
||||||
build-essential \
|
build-essential \
|
||||||
debhelper \
|
debhelper \
|
||||||
devscripts \
|
devscripts \
|
||||||
dh-systemd \
|
|
||||||
libsystemd-dev \
|
libsystemd-dev \
|
||||||
lsb-release \
|
lsb-release \
|
||||||
pkg-config \
|
pkg-config \
|
||||||
@@ -69,7 +74,11 @@ RUN apt-get update -qq -o Acquire::Languages=none \
|
|||||||
python3-setuptools \
|
python3-setuptools \
|
||||||
python3-venv \
|
python3-venv \
|
||||||
sqlite3 \
|
sqlite3 \
|
||||||
libpq-dev
|
libpq-dev \
|
||||||
|
xmlsec1 \
|
||||||
|
&& ( env DEBIAN_FRONTEND=noninteractive apt-get install \
|
||||||
|
-yqq --no-install-recommends -o Dpkg::Options::=--force-unsafe-io \
|
||||||
|
dh-systemd || true )
|
||||||
|
|
||||||
COPY --from=builder /dh-virtualenv_1.2~dev-1_all.deb /
|
COPY --from=builder /dh-virtualenv_1.2~dev-1_all.deb /
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ docker logs synapse
|
|||||||
If all is well, you should now be able to connect to http://localhost:8008 and
|
If all is well, you should now be able to connect to http://localhost:8008 and
|
||||||
see a confirmation message.
|
see a confirmation message.
|
||||||
|
|
||||||
The following environment variables are supported in run mode:
|
The following environment variables are supported in `run` mode:
|
||||||
|
|
||||||
* `SYNAPSE_CONFIG_DIR`: where additional config files are stored. Defaults to
|
* `SYNAPSE_CONFIG_DIR`: where additional config files are stored. Defaults to
|
||||||
`/data`.
|
`/data`.
|
||||||
@@ -94,6 +94,20 @@ The following environment variables are supported in run mode:
|
|||||||
* `UID`, `GID`: the user and group id to run Synapse as. Defaults to `991`, `991`.
|
* `UID`, `GID`: the user and group id to run Synapse as. Defaults to `991`, `991`.
|
||||||
* `TZ`: the [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) the container will run with. Defaults to `UTC`.
|
* `TZ`: the [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) the container will run with. Defaults to `UTC`.
|
||||||
|
|
||||||
|
For more complex setups (e.g. for workers) you can also pass your args directly to synapse using `run` mode. For example like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -d --name synapse \
|
||||||
|
--mount type=volume,src=synapse-data,dst=/data \
|
||||||
|
-p 8008:8008 \
|
||||||
|
matrixdotorg/synapse:latest run \
|
||||||
|
-m synapse.app.generic_worker \
|
||||||
|
--config-path=/data/homeserver.yaml \
|
||||||
|
--config-path=/data/generic_worker.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
If you do not provide `-m`, the value of the `SYNAPSE_WORKER` environment variable is used. If you do not provide at least one `--config-path` or `-c`, the value of the `SYNAPSE_CONFIG_PATH` environment variable is used instead.
|
||||||
|
|
||||||
## Generating an (admin) user
|
## Generating an (admin) user
|
||||||
|
|
||||||
After synapse is running, you may wish to create a user via `register_new_matrix_user`.
|
After synapse is running, you may wish to create a user via `register_new_matrix_user`.
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ federation_rc_concurrent: 3
|
|||||||
|
|
||||||
media_store_path: "/data/media"
|
media_store_path: "/data/media"
|
||||||
uploads_path: "/data/uploads"
|
uploads_path: "/data/uploads"
|
||||||
max_upload_size: "{{ SYNAPSE_MAX_UPLOAD_SIZE or "10M" }}"
|
max_upload_size: "{{ SYNAPSE_MAX_UPLOAD_SIZE or "50M" }}"
|
||||||
max_image_pixels: "32M"
|
max_image_pixels: "32M"
|
||||||
dynamic_thumbnails: false
|
dynamic_thumbnails: false
|
||||||
|
|
||||||
@@ -198,12 +198,10 @@ old_signing_keys: {}
|
|||||||
key_refresh_interval: "1d" # 1 Day.
|
key_refresh_interval: "1d" # 1 Day.
|
||||||
|
|
||||||
# The trusted servers to download signing keys from.
|
# The trusted servers to download signing keys from.
|
||||||
perspectives:
|
trusted_key_servers:
|
||||||
servers:
|
- server_name: matrix.org
|
||||||
"matrix.org":
|
verify_keys:
|
||||||
verify_keys:
|
"ed25519:auto": "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw"
|
||||||
"ed25519:auto":
|
|
||||||
key: "Noi6WqcDj0QmPxCNQqgezwTlBKrfqehY1u2FyWP9uYw"
|
|
||||||
|
|
||||||
password_config:
|
password_config:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ def run_generate_config(environ, ownership):
|
|||||||
|
|
||||||
|
|
||||||
def main(args, environ):
|
def main(args, environ):
|
||||||
mode = args[1] if len(args) > 1 else None
|
mode = args[1] if len(args) > 1 else "run"
|
||||||
desired_uid = int(environ.get("UID", "991"))
|
desired_uid = int(environ.get("UID", "991"))
|
||||||
desired_gid = int(environ.get("GID", "991"))
|
desired_gid = int(environ.get("GID", "991"))
|
||||||
synapse_worker = environ.get("SYNAPSE_WORKER", "synapse.app.homeserver")
|
synapse_worker = environ.get("SYNAPSE_WORKER", "synapse.app.homeserver")
|
||||||
@@ -205,36 +205,47 @@ def main(args, environ):
|
|||||||
config_dir, config_path, environ, ownership
|
config_dir, config_path, environ, ownership
|
||||||
)
|
)
|
||||||
|
|
||||||
if mode is not None:
|
if mode != "run":
|
||||||
error("Unknown execution mode '%s'" % (mode,))
|
error("Unknown execution mode '%s'" % (mode,))
|
||||||
|
|
||||||
config_dir = environ.get("SYNAPSE_CONFIG_DIR", "/data")
|
args = args[2:]
|
||||||
config_path = environ.get("SYNAPSE_CONFIG_PATH", config_dir + "/homeserver.yaml")
|
|
||||||
|
|
||||||
if not os.path.exists(config_path):
|
if "-m" not in args:
|
||||||
if "SYNAPSE_SERVER_NAME" in environ:
|
args = ["-m", synapse_worker] + args
|
||||||
error(
|
|
||||||
"""\
|
# if there are no config files passed to synapse, try adding the default file
|
||||||
|
if not any(p.startswith("--config-path") or p.startswith("-c") for p in args):
|
||||||
|
config_dir = environ.get("SYNAPSE_CONFIG_DIR", "/data")
|
||||||
|
config_path = environ.get(
|
||||||
|
"SYNAPSE_CONFIG_PATH", config_dir + "/homeserver.yaml"
|
||||||
|
)
|
||||||
|
|
||||||
|
if not os.path.exists(config_path):
|
||||||
|
if "SYNAPSE_SERVER_NAME" in environ:
|
||||||
|
error(
|
||||||
|
"""\
|
||||||
Config file '%s' does not exist.
|
Config file '%s' does not exist.
|
||||||
|
|
||||||
The synapse docker image no longer supports generating a config file on-the-fly
|
The synapse docker image no longer supports generating a config file on-the-fly
|
||||||
based on environment variables. You can migrate to a static config file by
|
based on environment variables. You can migrate to a static config file by
|
||||||
running with 'migrate_config'. See the README for more details.
|
running with 'migrate_config'. See the README for more details.
|
||||||
"""
|
"""
|
||||||
|
% (config_path,)
|
||||||
|
)
|
||||||
|
|
||||||
|
error(
|
||||||
|
"Config file '%s' does not exist. You should either create a new "
|
||||||
|
"config file by running with the `generate` argument (and then edit "
|
||||||
|
"the resulting file before restarting) or specify the path to an "
|
||||||
|
"existing config file with the SYNAPSE_CONFIG_PATH variable."
|
||||||
% (config_path,)
|
% (config_path,)
|
||||||
)
|
)
|
||||||
|
|
||||||
error(
|
args += ["--config-path", config_path]
|
||||||
"Config file '%s' does not exist. You should either create a new "
|
|
||||||
"config file by running with the `generate` argument (and then edit "
|
|
||||||
"the resulting file before restarting) or specify the path to an "
|
|
||||||
"existing config file with the SYNAPSE_CONFIG_PATH variable."
|
|
||||||
% (config_path,)
|
|
||||||
)
|
|
||||||
|
|
||||||
log("Starting synapse with config file " + config_path)
|
log("Starting synapse with args " + " ".join(args))
|
||||||
|
|
||||||
args = ["python", "-m", synapse_worker, "--config-path", config_path]
|
args = ["python"] + args
|
||||||
if ownership is not None:
|
if ownership is not None:
|
||||||
args = ["gosu", ownership] + args
|
args = ["gosu", ownership] + args
|
||||||
os.execv("/usr/sbin/gosu", args)
|
os.execv("/usr/sbin/gosu", args)
|
||||||
|
|||||||
172
docs/admin_api/event_reports.md
Normal file
172
docs/admin_api/event_reports.md
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
# Show reported events
|
||||||
|
|
||||||
|
This API returns information about reported events.
|
||||||
|
|
||||||
|
The api is:
|
||||||
|
```
|
||||||
|
GET /_synapse/admin/v1/event_reports?from=0&limit=10
|
||||||
|
```
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: see [README.rst](README.rst).
|
||||||
|
|
||||||
|
It returns a JSON body like the following:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"event_reports": [
|
||||||
|
{
|
||||||
|
"event_id": "$bNUFCwGzWca1meCGkjp-zwslF-GfVcXukvRLI1_FaVY",
|
||||||
|
"id": 2,
|
||||||
|
"reason": "foo",
|
||||||
|
"score": -100,
|
||||||
|
"received_ts": 1570897107409,
|
||||||
|
"canonical_alias": "#alias1:matrix.org",
|
||||||
|
"room_id": "!ERAgBpSOcCCuTJqQPk:matrix.org",
|
||||||
|
"name": "Matrix HQ",
|
||||||
|
"sender": "@foobar:matrix.org",
|
||||||
|
"user_id": "@foo:matrix.org"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"event_id": "$3IcdZsDaN_En-S1DF4EMCy3v4gNRKeOJs8W5qTOKj4I",
|
||||||
|
"id": 3,
|
||||||
|
"reason": "bar",
|
||||||
|
"score": -100,
|
||||||
|
"received_ts": 1598889612059,
|
||||||
|
"canonical_alias": "#alias2:matrix.org",
|
||||||
|
"room_id": "!eGvUQuTCkHGVwNMOjv:matrix.org",
|
||||||
|
"name": "Your room name here",
|
||||||
|
"sender": "@foobar:matrix.org",
|
||||||
|
"user_id": "@bar:matrix.org"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"next_token": 2,
|
||||||
|
"total": 4
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
To paginate, check for `next_token` and if present, call the endpoint again with `from`
|
||||||
|
set to the value of `next_token`. This will return a new page.
|
||||||
|
|
||||||
|
If the endpoint does not return a `next_token` then there are no more reports to
|
||||||
|
paginate through.
|
||||||
|
|
||||||
|
**URL parameters:**
|
||||||
|
|
||||||
|
* `limit`: integer - Is optional but is used for pagination, denoting the maximum number
|
||||||
|
of items to return in this call. Defaults to `100`.
|
||||||
|
* `from`: integer - Is optional but used for pagination, denoting the offset in the
|
||||||
|
returned results. This should be treated as an opaque value and not explicitly set to
|
||||||
|
anything other than the return value of `next_token` from a previous call. Defaults to `0`.
|
||||||
|
* `dir`: string - Direction of event report order. Whether to fetch the most recent
|
||||||
|
first (`b`) or the oldest first (`f`). Defaults to `b`.
|
||||||
|
* `user_id`: string - Is optional and filters to only return users with user IDs that
|
||||||
|
contain this value. This is the user who reported the event and wrote the reason.
|
||||||
|
* `room_id`: string - Is optional and filters to only return rooms with room IDs that
|
||||||
|
contain this value.
|
||||||
|
|
||||||
|
**Response**
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
* `id`: integer - ID of event report.
|
||||||
|
* `received_ts`: integer - The timestamp (in milliseconds since the unix epoch) when this
|
||||||
|
report was sent.
|
||||||
|
* `room_id`: string - The ID of the room in which the event being reported is located.
|
||||||
|
* `name`: string - The name of the room.
|
||||||
|
* `event_id`: string - The ID of the reported event.
|
||||||
|
* `user_id`: string - This is the user who reported the event and wrote the reason.
|
||||||
|
* `reason`: string - Comment made by the `user_id` in this report. May be blank.
|
||||||
|
* `score`: integer - Content is reported based upon a negative score, where -100 is
|
||||||
|
"most offensive" and 0 is "inoffensive".
|
||||||
|
* `sender`: string - This is the ID of the user who sent the original message/event that
|
||||||
|
was reported.
|
||||||
|
* `canonical_alias`: string - The canonical alias of the room. `null` if the room does not
|
||||||
|
have a canonical alias set.
|
||||||
|
* `next_token`: integer - Indication for pagination. See above.
|
||||||
|
* `total`: integer - Total number of event reports related to the query
|
||||||
|
(`user_id` and `room_id`).
|
||||||
|
|
||||||
|
# Show details of a specific event report
|
||||||
|
|
||||||
|
This API returns information about a specific event report.
|
||||||
|
|
||||||
|
The api is:
|
||||||
|
```
|
||||||
|
GET /_synapse/admin/v1/event_reports/<report_id>
|
||||||
|
```
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: see [README.rst](README.rst).
|
||||||
|
|
||||||
|
It returns a JSON body like the following:
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"event_id": "$bNUFCwGzWca1meCGkjp-zwslF-GfVcXukvRLI1_FaVY",
|
||||||
|
"event_json": {
|
||||||
|
"auth_events": [
|
||||||
|
"$YK4arsKKcc0LRoe700pS8DSjOvUT4NDv0HfInlMFw2M",
|
||||||
|
"$oggsNXxzPFRE3y53SUNd7nsj69-QzKv03a1RucHu-ws"
|
||||||
|
],
|
||||||
|
"content": {
|
||||||
|
"body": "matrix.org: This Week in Matrix",
|
||||||
|
"format": "org.matrix.custom.html",
|
||||||
|
"formatted_body": "<strong>matrix.org</strong>:<br><a href=\"https://matrix.org/blog/\"><strong>This Week in Matrix</strong></a>",
|
||||||
|
"msgtype": "m.notice"
|
||||||
|
},
|
||||||
|
"depth": 546,
|
||||||
|
"hashes": {
|
||||||
|
"sha256": "xK1//xnmvHJIOvbgXlkI8eEqdvoMmihVDJ9J4SNlsAw"
|
||||||
|
},
|
||||||
|
"origin": "matrix.org",
|
||||||
|
"origin_server_ts": 1592291711430,
|
||||||
|
"prev_events": [
|
||||||
|
"$YK4arsKKcc0LRoe700pS8DSjOvUT4NDv0HfInlMFw2M"
|
||||||
|
],
|
||||||
|
"prev_state": [],
|
||||||
|
"room_id": "!ERAgBpSOcCCuTJqQPk:matrix.org",
|
||||||
|
"sender": "@foobar:matrix.org",
|
||||||
|
"signatures": {
|
||||||
|
"matrix.org": {
|
||||||
|
"ed25519:a_JaEG": "cs+OUKW/iHx5pEidbWxh0UiNNHwe46Ai9LwNz+Ah16aWDNszVIe2gaAcVZfvNsBhakQTew51tlKmL2kspXk/Dg"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "m.room.message",
|
||||||
|
"unsigned": {
|
||||||
|
"age_ts": 1592291711430,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": <report_id>,
|
||||||
|
"reason": "foo",
|
||||||
|
"score": -100,
|
||||||
|
"received_ts": 1570897107409,
|
||||||
|
"canonical_alias": "#alias1:matrix.org",
|
||||||
|
"room_id": "!ERAgBpSOcCCuTJqQPk:matrix.org",
|
||||||
|
"name": "Matrix HQ",
|
||||||
|
"sender": "@foobar:matrix.org",
|
||||||
|
"user_id": "@foo:matrix.org"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**URL parameters:**
|
||||||
|
|
||||||
|
* `report_id`: string - The ID of the event report.
|
||||||
|
|
||||||
|
**Response**
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
* `id`: integer - ID of event report.
|
||||||
|
* `received_ts`: integer - The timestamp (in milliseconds since the unix epoch) when this
|
||||||
|
report was sent.
|
||||||
|
* `room_id`: string - The ID of the room in which the event being reported is located.
|
||||||
|
* `name`: string - The name of the room.
|
||||||
|
* `event_id`: string - The ID of the reported event.
|
||||||
|
* `user_id`: string - This is the user who reported the event and wrote the reason.
|
||||||
|
* `reason`: string - Comment made by the `user_id` in this report. May be blank.
|
||||||
|
* `score`: integer - Content is reported based upon a negative score, where -100 is
|
||||||
|
"most offensive" and 0 is "inoffensive".
|
||||||
|
* `sender`: string - This is the ID of the user who sent the original message/event that
|
||||||
|
was reported.
|
||||||
|
* `canonical_alias`: string - The canonical alias of the room. `null` if the room does not
|
||||||
|
have a canonical alias set.
|
||||||
|
* `event_json`: object - Details of the original event that was reported.
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
Show reported events
|
|
||||||
====================
|
|
||||||
|
|
||||||
This API returns information about reported events.
|
|
||||||
|
|
||||||
The api is::
|
|
||||||
|
|
||||||
GET /_synapse/admin/v1/event_reports?from=0&limit=10
|
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an ``access_token`` for a
|
|
||||||
server admin: see `README.rst <README.rst>`_.
|
|
||||||
|
|
||||||
It returns a JSON body like the following:
|
|
||||||
|
|
||||||
.. code:: jsonc
|
|
||||||
|
|
||||||
{
|
|
||||||
"event_reports": [
|
|
||||||
{
|
|
||||||
"content": {
|
|
||||||
"reason": "foo",
|
|
||||||
"score": -100
|
|
||||||
},
|
|
||||||
"event_id": "$bNUFCwGzWca1meCGkjp-zwslF-GfVcXukvRLI1_FaVY",
|
|
||||||
"event_json": {
|
|
||||||
"auth_events": [
|
|
||||||
"$YK4arsKKcc0LRoe700pS8DSjOvUT4NDv0HfInlMFw2M",
|
|
||||||
"$oggsNXxzPFRE3y53SUNd7nsj69-QzKv03a1RucHu-ws"
|
|
||||||
],
|
|
||||||
"content": {
|
|
||||||
"body": "matrix.org: This Week in Matrix",
|
|
||||||
"format": "org.matrix.custom.html",
|
|
||||||
"formatted_body": "<strong>matrix.org</strong>:<br><a href=\"https://matrix.org/blog/\"><strong>This Week in Matrix</strong></a>",
|
|
||||||
"msgtype": "m.notice"
|
|
||||||
},
|
|
||||||
"depth": 546,
|
|
||||||
"hashes": {
|
|
||||||
"sha256": "xK1//xnmvHJIOvbgXlkI8eEqdvoMmihVDJ9J4SNlsAw"
|
|
||||||
},
|
|
||||||
"origin": "matrix.org",
|
|
||||||
"origin_server_ts": 1592291711430,
|
|
||||||
"prev_events": [
|
|
||||||
"$YK4arsKKcc0LRoe700pS8DSjOvUT4NDv0HfInlMFw2M"
|
|
||||||
],
|
|
||||||
"prev_state": [],
|
|
||||||
"room_id": "!ERAgBpSOcCCuTJqQPk:matrix.org",
|
|
||||||
"sender": "@foobar:matrix.org",
|
|
||||||
"signatures": {
|
|
||||||
"matrix.org": {
|
|
||||||
"ed25519:a_JaEG": "cs+OUKW/iHx5pEidbWxh0UiNNHwe46Ai9LwNz+Ah16aWDNszVIe2gaAcVZfvNsBhakQTew51tlKmL2kspXk/Dg"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"type": "m.room.message",
|
|
||||||
"unsigned": {
|
|
||||||
"age_ts": 1592291711430,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"id": 2,
|
|
||||||
"reason": "foo",
|
|
||||||
"received_ts": 1570897107409,
|
|
||||||
"room_alias": "#alias1:matrix.org",
|
|
||||||
"room_id": "!ERAgBpSOcCCuTJqQPk:matrix.org",
|
|
||||||
"sender": "@foobar:matrix.org",
|
|
||||||
"user_id": "@foo:matrix.org"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"content": {
|
|
||||||
"reason": "bar",
|
|
||||||
"score": -100
|
|
||||||
},
|
|
||||||
"event_id": "$3IcdZsDaN_En-S1DF4EMCy3v4gNRKeOJs8W5qTOKj4I",
|
|
||||||
"event_json": {
|
|
||||||
// hidden items
|
|
||||||
// see above
|
|
||||||
},
|
|
||||||
"id": 3,
|
|
||||||
"reason": "bar",
|
|
||||||
"received_ts": 1598889612059,
|
|
||||||
"room_alias": "#alias2:matrix.org",
|
|
||||||
"room_id": "!eGvUQuTCkHGVwNMOjv:matrix.org",
|
|
||||||
"sender": "@foobar:matrix.org",
|
|
||||||
"user_id": "@bar:matrix.org"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"next_token": 2,
|
|
||||||
"total": 4
|
|
||||||
}
|
|
||||||
|
|
||||||
To paginate, check for ``next_token`` and if present, call the endpoint again
|
|
||||||
with ``from`` set to the value of ``next_token``. This will return a new page.
|
|
||||||
|
|
||||||
If the endpoint does not return a ``next_token`` then there are no more
|
|
||||||
reports to paginate through.
|
|
||||||
|
|
||||||
**URL parameters:**
|
|
||||||
|
|
||||||
- ``limit``: integer - Is optional but is used for pagination,
|
|
||||||
denoting the maximum number of items to return in this call. Defaults to ``100``.
|
|
||||||
- ``from``: integer - Is optional but used for pagination,
|
|
||||||
denoting the offset in the returned results. This should be treated as an opaque value and
|
|
||||||
not explicitly set to anything other than the return value of ``next_token`` from a previous call.
|
|
||||||
Defaults to ``0``.
|
|
||||||
- ``dir``: string - Direction of event report order. Whether to fetch the most recent first (``b``) or the
|
|
||||||
oldest first (``f``). Defaults to ``b``.
|
|
||||||
- ``user_id``: string - Is optional and filters to only return users with user IDs that contain this value.
|
|
||||||
This is the user who reported the event and wrote the reason.
|
|
||||||
- ``room_id``: string - Is optional and filters to only return rooms with room IDs that contain this value.
|
|
||||||
|
|
||||||
**Response**
|
|
||||||
|
|
||||||
The following fields are returned in the JSON response body:
|
|
||||||
|
|
||||||
- ``id``: integer - ID of event report.
|
|
||||||
- ``received_ts``: integer - The timestamp (in milliseconds since the unix epoch) when this report was sent.
|
|
||||||
- ``room_id``: string - The ID of the room in which the event being reported is located.
|
|
||||||
- ``event_id``: string - The ID of the reported event.
|
|
||||||
- ``user_id``: string - This is the user who reported the event and wrote the reason.
|
|
||||||
- ``reason``: string - Comment made by the ``user_id`` in this report. May be blank.
|
|
||||||
- ``content``: object - Content of reported event.
|
|
||||||
|
|
||||||
- ``reason``: string - Comment made by the ``user_id`` in this report. May be blank.
|
|
||||||
- ``score``: integer - Content is reported based upon a negative score, where -100 is "most offensive" and 0 is "inoffensive".
|
|
||||||
|
|
||||||
- ``sender``: string - This is the ID of the user who sent the original message/event that was reported.
|
|
||||||
- ``room_alias``: string - The alias of the room. ``null`` if the room does not have a canonical alias set.
|
|
||||||
- ``event_json``: object - Details of the original event that was reported.
|
|
||||||
- ``next_token``: integer - Indication for pagination. See above.
|
|
||||||
- ``total``: integer - Total number of event reports related to the query (``user_id`` and ``room_id``).
|
|
||||||
|
|
||||||
@@ -1,6 +1,19 @@
|
|||||||
|
# Contents
|
||||||
|
- [List all media in a room](#list-all-media-in-a-room)
|
||||||
|
- [Quarantine media](#quarantine-media)
|
||||||
|
* [Quarantining media by ID](#quarantining-media-by-id)
|
||||||
|
* [Quarantining media in a room](#quarantining-media-in-a-room)
|
||||||
|
* [Quarantining all media of a user](#quarantining-all-media-of-a-user)
|
||||||
|
* [Protecting media from being quarantined](#protecting-media-from-being-quarantined)
|
||||||
|
- [Delete local media](#delete-local-media)
|
||||||
|
* [Delete a specific local media](#delete-a-specific-local-media)
|
||||||
|
* [Delete local media by date or size](#delete-local-media-by-date-or-size)
|
||||||
|
- [Purge Remote Media API](#purge-remote-media-api)
|
||||||
|
|
||||||
# List all media in a room
|
# List all media in a room
|
||||||
|
|
||||||
This API gets a list of known media in a room.
|
This API gets a list of known media in a room.
|
||||||
|
However, it only shows media from unencrypted events or rooms.
|
||||||
|
|
||||||
The API is:
|
The API is:
|
||||||
```
|
```
|
||||||
@@ -10,16 +23,16 @@ To use it, you will need to authenticate by providing an `access_token` for a
|
|||||||
server admin: see [README.rst](README.rst).
|
server admin: see [README.rst](README.rst).
|
||||||
|
|
||||||
The API returns a JSON body like the following:
|
The API returns a JSON body like the following:
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"local": [
|
"local": [
|
||||||
"mxc://localhost/xwvutsrqponmlkjihgfedcba",
|
"mxc://localhost/xwvutsrqponmlkjihgfedcba",
|
||||||
"mxc://localhost/abcdefghijklmnopqrstuvwx"
|
"mxc://localhost/abcdefghijklmnopqrstuvwx"
|
||||||
],
|
],
|
||||||
"remote": [
|
"remote": [
|
||||||
"mxc://matrix.org/xwvutsrqponmlkjihgfedcba",
|
"mxc://matrix.org/xwvutsrqponmlkjihgfedcba",
|
||||||
"mxc://matrix.org/abcdefghijklmnopqrstuvwx"
|
"mxc://matrix.org/abcdefghijklmnopqrstuvwx"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -47,7 +60,7 @@ form of `abcdefg12345...`.
|
|||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{}
|
{}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -67,14 +80,18 @@ Where `room_id` is in the form of `!roomid12345:example.org`.
|
|||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"num_quarantined": 10 # The number of media items successfully quarantined
|
"num_quarantined": 10
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
* `num_quarantined`: integer - The number of media items successfully quarantined
|
||||||
|
|
||||||
Note that there is a legacy endpoint, `POST
|
Note that there is a legacy endpoint, `POST
|
||||||
/_synapse/admin/v1/quarantine_media/<room_id >`, that operates the same.
|
/_synapse/admin/v1/quarantine_media/<room_id>`, that operates the same.
|
||||||
However, it is deprecated and may be removed in a future release.
|
However, it is deprecated and may be removed in a future release.
|
||||||
|
|
||||||
## Quarantining all media of a user
|
## Quarantining all media of a user
|
||||||
@@ -91,12 +108,155 @@ POST /_synapse/admin/v1/user/<user_id>/media/quarantine
|
|||||||
{}
|
{}
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `user_id` is in the form of `@bob:example.org`.
|
URL Parameters
|
||||||
|
|
||||||
|
* `user_id`: string - User ID in the form of `@bob:example.org`
|
||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"num_quarantined": 10 # The number of media items successfully quarantined
|
"num_quarantined": 10
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
* `num_quarantined`: integer - The number of media items successfully quarantined
|
||||||
|
|
||||||
|
## Protecting media from being quarantined
|
||||||
|
|
||||||
|
This API protects a single piece of local media from being quarantined using the
|
||||||
|
above APIs. This is useful for sticker packs and other shared media which you do
|
||||||
|
not want to get quarantined, especially when
|
||||||
|
[quarantining media in a room](#quarantining-media-in-a-room).
|
||||||
|
|
||||||
|
Request:
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /_synapse/admin/v1/media/protect/<media_id>
|
||||||
|
|
||||||
|
{}
|
||||||
|
```
|
||||||
|
|
||||||
|
Where `media_id` is in the form of `abcdefg12345...`.
|
||||||
|
|
||||||
|
Response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{}
|
||||||
|
```
|
||||||
|
|
||||||
|
# Delete local media
|
||||||
|
This API deletes the *local* media from the disk of your own server.
|
||||||
|
This includes any local thumbnails and copies of media downloaded from
|
||||||
|
remote homeservers.
|
||||||
|
This API will not affect media that has been uploaded to external
|
||||||
|
media repositories (e.g https://github.com/turt2live/matrix-media-repo/).
|
||||||
|
See also [Purge Remote Media API](#purge-remote-media-api).
|
||||||
|
|
||||||
|
## Delete a specific local media
|
||||||
|
Delete a specific `media_id`.
|
||||||
|
|
||||||
|
Request:
|
||||||
|
|
||||||
|
```
|
||||||
|
DELETE /_synapse/admin/v1/media/<server_name>/<media_id>
|
||||||
|
|
||||||
|
{}
|
||||||
|
```
|
||||||
|
|
||||||
|
URL Parameters
|
||||||
|
|
||||||
|
* `server_name`: string - The name of your local server (e.g `matrix.org`)
|
||||||
|
* `media_id`: string - The ID of the media (e.g `abcdefghijklmnopqrstuvwx`)
|
||||||
|
|
||||||
|
Response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"deleted_media": [
|
||||||
|
"abcdefghijklmnopqrstuvwx"
|
||||||
|
],
|
||||||
|
"total": 1
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
* `deleted_media`: an array of strings - List of deleted `media_id`
|
||||||
|
* `total`: integer - Total number of deleted `media_id`
|
||||||
|
|
||||||
|
## Delete local media by date or size
|
||||||
|
|
||||||
|
Request:
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /_synapse/admin/v1/media/<server_name>/delete?before_ts=<before_ts>
|
||||||
|
|
||||||
|
{}
|
||||||
|
```
|
||||||
|
|
||||||
|
URL Parameters
|
||||||
|
|
||||||
|
* `server_name`: string - The name of your local server (e.g `matrix.org`).
|
||||||
|
* `before_ts`: string representing a positive integer - Unix timestamp in ms.
|
||||||
|
Files that were last used before this timestamp will be deleted. It is the timestamp of
|
||||||
|
last access and not the timestamp creation.
|
||||||
|
* `size_gt`: Optional - string representing a positive integer - Size of the media in bytes.
|
||||||
|
Files that are larger will be deleted. Defaults to `0`.
|
||||||
|
* `keep_profiles`: Optional - string representing a boolean - Switch to also delete files
|
||||||
|
that are still used in image data (e.g user profile, room avatar).
|
||||||
|
If `false` these files will be deleted. Defaults to `true`.
|
||||||
|
|
||||||
|
Response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"deleted_media": [
|
||||||
|
"abcdefghijklmnopqrstuvwx",
|
||||||
|
"abcdefghijklmnopqrstuvwz"
|
||||||
|
],
|
||||||
|
"total": 2
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
* `deleted_media`: an array of strings - List of deleted `media_id`
|
||||||
|
* `total`: integer - Total number of deleted `media_id`
|
||||||
|
|
||||||
|
# Purge Remote Media API
|
||||||
|
|
||||||
|
The purge remote media API allows server admins to purge old cached remote media.
|
||||||
|
|
||||||
|
The API is:
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /_synapse/admin/v1/purge_media_cache?before_ts=<unix_timestamp_in_ms>
|
||||||
|
|
||||||
|
{}
|
||||||
|
```
|
||||||
|
|
||||||
|
URL Parameters
|
||||||
|
|
||||||
|
* `unix_timestamp_in_ms`: string representing a positive integer - Unix timestamp in ms.
|
||||||
|
All cached media that was last accessed before this timestamp will be removed.
|
||||||
|
|
||||||
|
Response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"deleted": 10
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
* `deleted`: integer - The number of media items successfully deleted
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token` for a
|
||||||
|
server admin: see [README.rst](README.rst).
|
||||||
|
|
||||||
|
If the user re-requests purged remote media, synapse will re-request the media
|
||||||
|
from the originating server.
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
Purge Remote Media API
|
|
||||||
======================
|
|
||||||
|
|
||||||
The purge remote media API allows server admins to purge old cached remote
|
|
||||||
media.
|
|
||||||
|
|
||||||
The API is::
|
|
||||||
|
|
||||||
POST /_synapse/admin/v1/purge_media_cache?before_ts=<unix_timestamp_in_ms>
|
|
||||||
|
|
||||||
{}
|
|
||||||
|
|
||||||
\... which will remove all cached media that was last accessed before
|
|
||||||
``<unix_timestamp_in_ms>``.
|
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an ``access_token`` for a
|
|
||||||
server admin: see `README.rst <README.rst>`_.
|
|
||||||
|
|
||||||
If the user re-requests purged remote media, synapse will re-request the media
|
|
||||||
from the originating server.
|
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
Purge room API
|
Deprecated: Purge room API
|
||||||
==============
|
==========================
|
||||||
|
|
||||||
|
**The old Purge room API is deprecated and will be removed in a future release.
|
||||||
|
See the new [Delete Room API](rooms.md#delete-room-api) for more details.**
|
||||||
|
|
||||||
This API will remove all trace of a room from your database.
|
This API will remove all trace of a room from your database.
|
||||||
|
|
||||||
All local users must have left the room before it can be removed.
|
All local users must have left the room before it can be removed.
|
||||||
|
|
||||||
See also: [Delete Room API](rooms.md#delete-room-api)
|
|
||||||
|
|
||||||
The API is:
|
The API is:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ To fetch the nonce, you need to request one from the API::
|
|||||||
|
|
||||||
Once you have the nonce, you can make a ``POST`` to the same URL with a JSON
|
Once you have the nonce, you can make a ``POST`` to the same URL with a JSON
|
||||||
body containing the nonce, username, password, whether they are an admin
|
body containing the nonce, username, password, whether they are an admin
|
||||||
(optional, False by default), and a HMAC digest of the content.
|
(optional, False by default), and a HMAC digest of the content. Also you can
|
||||||
|
set the displayname (optional, ``username`` by default).
|
||||||
|
|
||||||
As an example::
|
As an example::
|
||||||
|
|
||||||
@@ -26,6 +27,7 @@ As an example::
|
|||||||
> {
|
> {
|
||||||
"nonce": "thisisanonce",
|
"nonce": "thisisanonce",
|
||||||
"username": "pepper_roni",
|
"username": "pepper_roni",
|
||||||
|
"displayname": "Pepper Roni",
|
||||||
"password": "pizza",
|
"password": "pizza",
|
||||||
"admin": true,
|
"admin": true,
|
||||||
"mac": "mac_digest_here"
|
"mac": "mac_digest_here"
|
||||||
|
|||||||
@@ -1,3 +1,15 @@
|
|||||||
|
# Contents
|
||||||
|
- [List Room API](#list-room-api)
|
||||||
|
* [Parameters](#parameters)
|
||||||
|
* [Usage](#usage)
|
||||||
|
- [Room Details API](#room-details-api)
|
||||||
|
- [Room Members API](#room-members-api)
|
||||||
|
- [Delete Room API](#delete-room-api)
|
||||||
|
* [Parameters](#parameters-1)
|
||||||
|
* [Response](#response)
|
||||||
|
* [Undoing room shutdowns](#undoing-room-shutdowns)
|
||||||
|
- [Make Room Admin API](#make-room-admin-api)
|
||||||
|
|
||||||
# List Room API
|
# List Room API
|
||||||
|
|
||||||
The List Room admin API allows server admins to get a list of rooms on their
|
The List Room admin API allows server admins to get a list of rooms on their
|
||||||
@@ -76,7 +88,7 @@ GET /_synapse/admin/v1/rooms
|
|||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```
|
```jsonc
|
||||||
{
|
{
|
||||||
"rooms": [
|
"rooms": [
|
||||||
{
|
{
|
||||||
@@ -128,7 +140,7 @@ GET /_synapse/admin/v1/rooms?search_term=TWIM
|
|||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"rooms": [
|
"rooms": [
|
||||||
{
|
{
|
||||||
@@ -163,7 +175,7 @@ GET /_synapse/admin/v1/rooms?order_by=size
|
|||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```
|
```jsonc
|
||||||
{
|
{
|
||||||
"rooms": [
|
"rooms": [
|
||||||
{
|
{
|
||||||
@@ -219,14 +231,14 @@ GET /_synapse/admin/v1/rooms?order_by=size&from=100
|
|||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```
|
```jsonc
|
||||||
{
|
{
|
||||||
"rooms": [
|
"rooms": [
|
||||||
{
|
{
|
||||||
"room_id": "!mscvqgqpHYjBGDxNym:matrix.org",
|
"room_id": "!mscvqgqpHYjBGDxNym:matrix.org",
|
||||||
"name": "Music Theory",
|
"name": "Music Theory",
|
||||||
"canonical_alias": "#musictheory:matrix.org",
|
"canonical_alias": "#musictheory:matrix.org",
|
||||||
"joined_members": 127
|
"joined_members": 127,
|
||||||
"joined_local_members": 2,
|
"joined_local_members": 2,
|
||||||
"version": "1",
|
"version": "1",
|
||||||
"creator": "@foo:matrix.org",
|
"creator": "@foo:matrix.org",
|
||||||
@@ -243,7 +255,7 @@ Response:
|
|||||||
"room_id": "!twcBhHVdZlQWuuxBhN:termina.org.uk",
|
"room_id": "!twcBhHVdZlQWuuxBhN:termina.org.uk",
|
||||||
"name": "weechat-matrix",
|
"name": "weechat-matrix",
|
||||||
"canonical_alias": "#weechat-matrix:termina.org.uk",
|
"canonical_alias": "#weechat-matrix:termina.org.uk",
|
||||||
"joined_members": 137
|
"joined_members": 137,
|
||||||
"joined_local_members": 20,
|
"joined_local_members": 20,
|
||||||
"version": "4",
|
"version": "4",
|
||||||
"creator": "@foo:termina.org.uk",
|
"creator": "@foo:termina.org.uk",
|
||||||
@@ -265,12 +277,10 @@ Response:
|
|||||||
Once the `next_token` parameter is no longer present, we know we've reached the
|
Once the `next_token` parameter is no longer present, we know we've reached the
|
||||||
end of the list.
|
end of the list.
|
||||||
|
|
||||||
# DRAFT: Room Details API
|
# Room Details API
|
||||||
|
|
||||||
The Room Details admin API allows server admins to get all details of a room.
|
The Room Details admin API allows server admins to get all details of a room.
|
||||||
|
|
||||||
This API is still a draft and details might change!
|
|
||||||
|
|
||||||
The following fields are possible in the JSON response body:
|
The following fields are possible in the JSON response body:
|
||||||
|
|
||||||
* `room_id` - The ID of the room.
|
* `room_id` - The ID of the room.
|
||||||
@@ -280,6 +290,7 @@ The following fields are possible in the JSON response body:
|
|||||||
* `canonical_alias` - The canonical (main) alias address of the room.
|
* `canonical_alias` - The canonical (main) alias address of the room.
|
||||||
* `joined_members` - How many users are currently in the room.
|
* `joined_members` - How many users are currently in the room.
|
||||||
* `joined_local_members` - How many local users are currently in the room.
|
* `joined_local_members` - How many local users are currently in the room.
|
||||||
|
* `joined_local_devices` - How many local devices are currently in the room.
|
||||||
* `version` - The version of the room as a string.
|
* `version` - The version of the room as a string.
|
||||||
* `creator` - The `user_id` of the room creator.
|
* `creator` - The `user_id` of the room creator.
|
||||||
* `encryption` - Algorithm of end-to-end encryption of messages. Is `null` if encryption is not active.
|
* `encryption` - Algorithm of end-to-end encryption of messages. Is `null` if encryption is not active.
|
||||||
@@ -302,15 +313,16 @@ GET /_synapse/admin/v1/rooms/<room_id>
|
|||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"room_id": "!mscvqgqpHYjBGDxNym:matrix.org",
|
"room_id": "!mscvqgqpHYjBGDxNym:matrix.org",
|
||||||
"name": "Music Theory",
|
"name": "Music Theory",
|
||||||
"avatar": "mxc://matrix.org/AQDaVFlbkQoErdOgqWRgiGSV",
|
"avatar": "mxc://matrix.org/AQDaVFlbkQoErdOgqWRgiGSV",
|
||||||
"topic": "Theory, Composition, Notation, Analysis",
|
"topic": "Theory, Composition, Notation, Analysis",
|
||||||
"canonical_alias": "#musictheory:matrix.org",
|
"canonical_alias": "#musictheory:matrix.org",
|
||||||
"joined_members": 127
|
"joined_members": 127,
|
||||||
"joined_local_members": 2,
|
"joined_local_members": 2,
|
||||||
|
"joined_local_devices": 2,
|
||||||
"version": "1",
|
"version": "1",
|
||||||
"creator": "@foo:matrix.org",
|
"creator": "@foo:matrix.org",
|
||||||
"encryption": null,
|
"encryption": null,
|
||||||
@@ -344,13 +356,13 @@ GET /_synapse/admin/v1/rooms/<room_id>/members
|
|||||||
|
|
||||||
Response:
|
Response:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"members": [
|
"members": [
|
||||||
"@foo:matrix.org",
|
"@foo:matrix.org",
|
||||||
"@bar:matrix.org",
|
"@bar:matrix.org",
|
||||||
"@foobar:matrix.org
|
"@foobar:matrix.org"
|
||||||
],
|
],
|
||||||
"total": 3
|
"total": 3
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -359,8 +371,6 @@ Response:
|
|||||||
|
|
||||||
The Delete Room admin API allows server admins to remove rooms from server
|
The Delete Room admin API allows server admins to remove rooms from server
|
||||||
and block these rooms.
|
and block these rooms.
|
||||||
It is a combination and improvement of "[Shutdown room](shutdown_room.md)"
|
|
||||||
and "[Purge room](purge_room.md)" API.
|
|
||||||
|
|
||||||
Shuts down a room. Moves all local users and room aliases automatically to a
|
Shuts down a room. Moves all local users and room aliases automatically to a
|
||||||
new room if `new_room_user_id` is set. Otherwise local users only
|
new room if `new_room_user_id` is set. Otherwise local users only
|
||||||
@@ -384,7 +394,7 @@ the new room. Users on other servers will be unaffected.
|
|||||||
|
|
||||||
The API is:
|
The API is:
|
||||||
|
|
||||||
```json
|
```
|
||||||
POST /_synapse/admin/v1/rooms/<room_id>/delete
|
POST /_synapse/admin/v1/rooms/<room_id>/delete
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -441,6 +451,10 @@ The following JSON body parameters are available:
|
|||||||
future attempts to join the room. Defaults to `false`.
|
future attempts to join the room. Defaults to `false`.
|
||||||
* `purge` - Optional. If set to `true`, it will remove all traces of the room from your database.
|
* `purge` - Optional. If set to `true`, it will remove all traces of the room from your database.
|
||||||
Defaults to `true`.
|
Defaults to `true`.
|
||||||
|
* `force_purge` - Optional, and ignored unless `purge` is `true`. If set to `true`, it
|
||||||
|
will force a purge to go ahead even if there are local users still in the room. Do not
|
||||||
|
use this unless a regular `purge` operation fails, as it could leave those users'
|
||||||
|
clients in a confused state.
|
||||||
|
|
||||||
The JSON body must not be empty. The body must be at least `{}`.
|
The JSON body must not be empty. The body must be at least `{}`.
|
||||||
|
|
||||||
@@ -453,3 +467,47 @@ The following fields are returned in the JSON response body:
|
|||||||
* `local_aliases` - An array of strings representing the local aliases that were migrated from
|
* `local_aliases` - An array of strings representing the local aliases that were migrated from
|
||||||
the old room to the new.
|
the old room to the new.
|
||||||
* `new_room_id` - A string representing the room ID of the new room.
|
* `new_room_id` - A string representing the room ID of the new room.
|
||||||
|
|
||||||
|
|
||||||
|
## Undoing room shutdowns
|
||||||
|
|
||||||
|
*Note*: This guide may be outdated by the time you read it. By nature of room shutdowns being performed at the database level,
|
||||||
|
the structure can and does change without notice.
|
||||||
|
|
||||||
|
First, it's important to understand that a room shutdown is very destructive. Undoing a shutdown is not as simple as pretending it
|
||||||
|
never happened - work has to be done to move forward instead of resetting the past. In fact, in some cases it might not be possible
|
||||||
|
to recover at all:
|
||||||
|
|
||||||
|
* If the room was invite-only, your users will need to be re-invited.
|
||||||
|
* If the room no longer has any members at all, it'll be impossible to rejoin.
|
||||||
|
* The first user to rejoin will have to do so via an alias on a different server.
|
||||||
|
|
||||||
|
With all that being said, if you still want to try and recover the room:
|
||||||
|
|
||||||
|
1. For safety reasons, shut down Synapse.
|
||||||
|
2. In the database, run `DELETE FROM blocked_rooms WHERE room_id = '!example:example.org';`
|
||||||
|
* For caution: it's recommended to run this in a transaction: `BEGIN; DELETE ...;`, verify you got 1 result, then `COMMIT;`.
|
||||||
|
* The room ID is the same one supplied to the shutdown room API, not the Content Violation room.
|
||||||
|
3. Restart Synapse.
|
||||||
|
|
||||||
|
You will have to manually handle, if you so choose, the following:
|
||||||
|
|
||||||
|
* Aliases that would have been redirected to the Content Violation room.
|
||||||
|
* Users that would have been booted from the room (and will have been force-joined to the Content Violation room).
|
||||||
|
* Removal of the Content Violation room if desired.
|
||||||
|
|
||||||
|
|
||||||
|
# Make Room Admin API
|
||||||
|
|
||||||
|
Grants another user the highest power available to a local user who is in the room.
|
||||||
|
If the user is not in the room, and it is not publicly joinable, then invite the user.
|
||||||
|
|
||||||
|
By default the server admin (the caller) is granted power, but another user can
|
||||||
|
optionally be specified, e.g.:
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /_synapse/admin/v1/rooms/<room_id_or_alias>/make_room_admin
|
||||||
|
{
|
||||||
|
"user_id": "@foo:example.com"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
# Shutdown room API
|
# Deprecated: Shutdown room API
|
||||||
|
|
||||||
|
**The old Shutdown room API is deprecated and will be removed in a future release.
|
||||||
|
See the new [Delete Room API](rooms.md#delete-room-api) for more details.**
|
||||||
|
|
||||||
Shuts down a room, preventing new joins and moves local users and room aliases automatically
|
Shuts down a room, preventing new joins and moves local users and room aliases automatically
|
||||||
to a new room. The new room will be created with the user specified by the
|
to a new room. The new room will be created with the user specified by the
|
||||||
@@ -10,8 +13,6 @@ disallow any further invites or joins.
|
|||||||
The local server will only have the power to move local user and room aliases to
|
The local server will only have the power to move local user and room aliases to
|
||||||
the new room. Users on other servers will be unaffected.
|
the new room. Users on other servers will be unaffected.
|
||||||
|
|
||||||
See also: [Delete Room API](rooms.md#delete-room-api)
|
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
You will need to authenticate with an access token for an admin user.
|
You will need to authenticate with an access token for an admin user.
|
||||||
|
|||||||
83
docs/admin_api/statistics.md
Normal file
83
docs/admin_api/statistics.md
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
# Users' media usage statistics
|
||||||
|
|
||||||
|
Returns information about all local media usage of users. Gives the
|
||||||
|
possibility to filter them by time and user.
|
||||||
|
|
||||||
|
The API is:
|
||||||
|
|
||||||
|
```
|
||||||
|
GET /_synapse/admin/v1/statistics/users/media
|
||||||
|
```
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an `access_token`
|
||||||
|
for a server admin: see [README.rst](README.rst).
|
||||||
|
|
||||||
|
A response body like the following is returned:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"users": [
|
||||||
|
{
|
||||||
|
"displayname": "foo_user_0",
|
||||||
|
"media_count": 2,
|
||||||
|
"media_length": 134,
|
||||||
|
"user_id": "@foo_user_0:test"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"displayname": "foo_user_1",
|
||||||
|
"media_count": 2,
|
||||||
|
"media_length": 134,
|
||||||
|
"user_id": "@foo_user_1:test"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"next_token": 3,
|
||||||
|
"total": 10
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
To paginate, check for `next_token` and if present, call the endpoint
|
||||||
|
again with `from` set to the value of `next_token`. This will return a new page.
|
||||||
|
|
||||||
|
If the endpoint does not return a `next_token` then there are no more
|
||||||
|
reports to paginate through.
|
||||||
|
|
||||||
|
**Parameters**
|
||||||
|
|
||||||
|
The following parameters should be set in the URL:
|
||||||
|
|
||||||
|
* `limit`: string representing a positive integer - Is optional but is
|
||||||
|
used for pagination, denoting the maximum number of items to return
|
||||||
|
in this call. Defaults to `100`.
|
||||||
|
* `from`: string representing a positive integer - Is optional but used for pagination,
|
||||||
|
denoting the offset in the returned results. This should be treated as an opaque value
|
||||||
|
and not explicitly set to anything other than the return value of `next_token` from a
|
||||||
|
previous call. Defaults to `0`.
|
||||||
|
* `order_by` - string - The method in which to sort the returned list of users. Valid values are:
|
||||||
|
- `user_id` - Users are ordered alphabetically by `user_id`. This is the default.
|
||||||
|
- `displayname` - Users are ordered alphabetically by `displayname`.
|
||||||
|
- `media_length` - Users are ordered by the total size of uploaded media in bytes.
|
||||||
|
Smallest to largest.
|
||||||
|
- `media_count` - Users are ordered by number of uploaded media. Smallest to largest.
|
||||||
|
* `from_ts` - string representing a positive integer - Considers only
|
||||||
|
files created at this timestamp or later. Unix timestamp in ms.
|
||||||
|
* `until_ts` - string representing a positive integer - Considers only
|
||||||
|
files created at this timestamp or earlier. Unix timestamp in ms.
|
||||||
|
* `search_term` - string - Filter users by their user ID localpart **or** displayname.
|
||||||
|
The search term can be found in any part of the string.
|
||||||
|
Defaults to no filtering.
|
||||||
|
* `dir` - string - Direction of order. Either `f` for forwards or `b` for backwards.
|
||||||
|
Setting this value to `b` will reverse the above sort order. Defaults to `f`.
|
||||||
|
|
||||||
|
|
||||||
|
**Response**
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
* `users` - An array of objects, each containing information
|
||||||
|
about the user and their local media. Objects contain the following fields:
|
||||||
|
- `displayname` - string - Displayname of this user.
|
||||||
|
- `media_count` - integer - Number of uploaded media by this user.
|
||||||
|
- `media_length` - integer - Size of uploaded media in bytes by this user.
|
||||||
|
- `user_id` - string - Fully-qualified user ID (ex. `@user:server.com`).
|
||||||
|
* `next_token` - integer - Opaque value used for pagination. See above.
|
||||||
|
* `total` - integer - Total number of users after filtering.
|
||||||
@@ -30,7 +30,12 @@ It returns a JSON body like the following:
|
|||||||
],
|
],
|
||||||
"avatar_url": "<avatar_url>",
|
"avatar_url": "<avatar_url>",
|
||||||
"admin": false,
|
"admin": false,
|
||||||
"deactivated": false
|
"deactivated": false,
|
||||||
|
"password_hash": "$2b$12$p9B4GkqYdRTPGD",
|
||||||
|
"creation_ts": 1560432506,
|
||||||
|
"appservice_id": null,
|
||||||
|
"consent_server_notice_sent": null,
|
||||||
|
"consent_version": null
|
||||||
}
|
}
|
||||||
|
|
||||||
URL parameters:
|
URL parameters:
|
||||||
@@ -93,6 +98,8 @@ Body parameters:
|
|||||||
|
|
||||||
- ``deactivated``, optional. If unspecified, deactivation state will be left
|
- ``deactivated``, optional. If unspecified, deactivation state will be left
|
||||||
unchanged on existing accounts and set to ``false`` for new accounts.
|
unchanged on existing accounts and set to ``false`` for new accounts.
|
||||||
|
A user cannot be erased by deactivating with this API. For details on deactivating users see
|
||||||
|
`Deactivate Account <#deactivate-account>`_.
|
||||||
|
|
||||||
If the user already exists then optional parameters default to the current value.
|
If the user already exists then optional parameters default to the current value.
|
||||||
|
|
||||||
@@ -139,7 +146,6 @@ A JSON body is returned with the following shape:
|
|||||||
"users": [
|
"users": [
|
||||||
{
|
{
|
||||||
"name": "<user_id1>",
|
"name": "<user_id1>",
|
||||||
"password_hash": "<password_hash1>",
|
|
||||||
"is_guest": 0,
|
"is_guest": 0,
|
||||||
"admin": 0,
|
"admin": 0,
|
||||||
"user_type": null,
|
"user_type": null,
|
||||||
@@ -148,7 +154,6 @@ A JSON body is returned with the following shape:
|
|||||||
"avatar_url": null
|
"avatar_url": null
|
||||||
}, {
|
}, {
|
||||||
"name": "<user_id2>",
|
"name": "<user_id2>",
|
||||||
"password_hash": "<password_hash2>",
|
|
||||||
"is_guest": 0,
|
"is_guest": 0,
|
||||||
"admin": 1,
|
"admin": 1,
|
||||||
"user_type": null,
|
"user_type": null,
|
||||||
@@ -176,6 +181,13 @@ The api is::
|
|||||||
|
|
||||||
GET /_synapse/admin/v1/whois/<user_id>
|
GET /_synapse/admin/v1/whois/<user_id>
|
||||||
|
|
||||||
|
and::
|
||||||
|
|
||||||
|
GET /_matrix/client/r0/admin/whois/<userId>
|
||||||
|
|
||||||
|
See also: `Client Server API Whois
|
||||||
|
<https://matrix.org/docs/spec/client_server/r0.6.1#get-matrix-client-r0-admin-whois-userid>`_
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an ``access_token`` for a
|
To use it, you will need to authenticate by providing an ``access_token`` for a
|
||||||
server admin: see `README.rst <README.rst>`_.
|
server admin: see `README.rst <README.rst>`_.
|
||||||
|
|
||||||
@@ -238,6 +250,25 @@ server admin: see `README.rst <README.rst>`_.
|
|||||||
The erase parameter is optional and defaults to ``false``.
|
The erase parameter is optional and defaults to ``false``.
|
||||||
An empty body may be passed for backwards compatibility.
|
An empty body may be passed for backwards compatibility.
|
||||||
|
|
||||||
|
The following actions are performed when deactivating an user:
|
||||||
|
|
||||||
|
- Try to unpind 3PIDs from the identity server
|
||||||
|
- Remove all 3PIDs from the homeserver
|
||||||
|
- Delete all devices and E2EE keys
|
||||||
|
- Delete all access tokens
|
||||||
|
- Delete the password hash
|
||||||
|
- Removal from all rooms the user is a member of
|
||||||
|
- Remove the user from the user directory
|
||||||
|
- Reject all pending invites
|
||||||
|
- Remove all account validity information related to the user
|
||||||
|
|
||||||
|
The following additional actions are performed during deactivation if``erase``
|
||||||
|
is set to ``true``:
|
||||||
|
|
||||||
|
- Remove the user's display name
|
||||||
|
- Remove the user's avatar URL
|
||||||
|
- Mark the user as erased
|
||||||
|
|
||||||
|
|
||||||
Reset password
|
Reset password
|
||||||
==============
|
==============
|
||||||
@@ -254,7 +285,7 @@ with a body of:
|
|||||||
|
|
||||||
{
|
{
|
||||||
"new_password": "<secret>",
|
"new_password": "<secret>",
|
||||||
"logout_devices": true,
|
"logout_devices": true
|
||||||
}
|
}
|
||||||
|
|
||||||
To use it, you will need to authenticate by providing an ``access_token`` for a
|
To use it, you will need to authenticate by providing an ``access_token`` for a
|
||||||
@@ -327,6 +358,10 @@ A response body like the following is returned:
|
|||||||
"total": 2
|
"total": 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
The server returns the list of rooms of which the user and the server
|
||||||
|
are member. If the user is local, all the rooms of which the user is
|
||||||
|
member are returned.
|
||||||
|
|
||||||
**Parameters**
|
**Parameters**
|
||||||
|
|
||||||
The following parameters should be set in the URL:
|
The following parameters should be set in the URL:
|
||||||
@@ -341,6 +376,124 @@ The following fields are returned in the JSON response body:
|
|||||||
- ``total`` - Number of rooms.
|
- ``total`` - Number of rooms.
|
||||||
|
|
||||||
|
|
||||||
|
List media of an user
|
||||||
|
================================
|
||||||
|
Gets a list of all local media that a specific ``user_id`` has created.
|
||||||
|
The response is ordered by creation date descending and media ID descending.
|
||||||
|
The newest media is on top.
|
||||||
|
|
||||||
|
The API is::
|
||||||
|
|
||||||
|
GET /_synapse/admin/v1/users/<user_id>/media
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an ``access_token`` for a
|
||||||
|
server admin: see `README.rst <README.rst>`_.
|
||||||
|
|
||||||
|
A response body like the following is returned:
|
||||||
|
|
||||||
|
.. code:: json
|
||||||
|
|
||||||
|
{
|
||||||
|
"media": [
|
||||||
|
{
|
||||||
|
"created_ts": 100400,
|
||||||
|
"last_access_ts": null,
|
||||||
|
"media_id": "qXhyRzulkwLsNHTbpHreuEgo",
|
||||||
|
"media_length": 67,
|
||||||
|
"media_type": "image/png",
|
||||||
|
"quarantined_by": null,
|
||||||
|
"safe_from_quarantine": false,
|
||||||
|
"upload_name": "test1.png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"created_ts": 200400,
|
||||||
|
"last_access_ts": null,
|
||||||
|
"media_id": "FHfiSnzoINDatrXHQIXBtahw",
|
||||||
|
"media_length": 67,
|
||||||
|
"media_type": "image/png",
|
||||||
|
"quarantined_by": null,
|
||||||
|
"safe_from_quarantine": false,
|
||||||
|
"upload_name": "test2.png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"next_token": 3,
|
||||||
|
"total": 2
|
||||||
|
}
|
||||||
|
|
||||||
|
To paginate, check for ``next_token`` and if present, call the endpoint again
|
||||||
|
with ``from`` set to the value of ``next_token``. This will return a new page.
|
||||||
|
|
||||||
|
If the endpoint does not return a ``next_token`` then there are no more
|
||||||
|
reports to paginate through.
|
||||||
|
|
||||||
|
**Parameters**
|
||||||
|
|
||||||
|
The following parameters should be set in the URL:
|
||||||
|
|
||||||
|
- ``user_id`` - string - fully qualified: for example, ``@user:server.com``.
|
||||||
|
- ``limit``: string representing a positive integer - Is optional but is used for pagination,
|
||||||
|
denoting the maximum number of items to return in this call. Defaults to ``100``.
|
||||||
|
- ``from``: string representing a positive integer - Is optional but used for pagination,
|
||||||
|
denoting the offset in the returned results. This should be treated as an opaque value and
|
||||||
|
not explicitly set to anything other than the return value of ``next_token`` from a previous call.
|
||||||
|
Defaults to ``0``.
|
||||||
|
|
||||||
|
**Response**
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
- ``media`` - An array of objects, each containing information about a media.
|
||||||
|
Media objects contain the following fields:
|
||||||
|
|
||||||
|
- ``created_ts`` - integer - Timestamp when the content was uploaded in ms.
|
||||||
|
- ``last_access_ts`` - integer - Timestamp when the content was last accessed in ms.
|
||||||
|
- ``media_id`` - string - The id used to refer to the media.
|
||||||
|
- ``media_length`` - integer - Length of the media in bytes.
|
||||||
|
- ``media_type`` - string - The MIME-type of the media.
|
||||||
|
- ``quarantined_by`` - string - The user ID that initiated the quarantine request
|
||||||
|
for this media.
|
||||||
|
|
||||||
|
- ``safe_from_quarantine`` - bool - Status if this media is safe from quarantining.
|
||||||
|
- ``upload_name`` - string - The name the media was uploaded with.
|
||||||
|
|
||||||
|
- ``next_token``: integer - Indication for pagination. See above.
|
||||||
|
- ``total`` - integer - Total number of media.
|
||||||
|
|
||||||
|
Login as a user
|
||||||
|
===============
|
||||||
|
|
||||||
|
Get an access token that can be used to authenticate as that user. Useful for
|
||||||
|
when admins wish to do actions on behalf of a user.
|
||||||
|
|
||||||
|
The API is::
|
||||||
|
|
||||||
|
POST /_synapse/admin/v1/users/<user_id>/login
|
||||||
|
{}
|
||||||
|
|
||||||
|
An optional ``valid_until_ms`` field can be specified in the request body as an
|
||||||
|
integer timestamp that specifies when the token should expire. By default tokens
|
||||||
|
do not expire.
|
||||||
|
|
||||||
|
A response body like the following is returned:
|
||||||
|
|
||||||
|
.. code:: json
|
||||||
|
|
||||||
|
{
|
||||||
|
"access_token": "<opaque_access_token_string>"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
This API does *not* generate a new device for the user, and so will not appear
|
||||||
|
their ``/devices`` list, and in general the target user should not be able to
|
||||||
|
tell they have been logged in as.
|
||||||
|
|
||||||
|
To expire the token call the standard ``/logout`` API with the token.
|
||||||
|
|
||||||
|
Note: The token will expire if the *admin* user calls ``/logout/all`` from any
|
||||||
|
of their devices, but the token will *not* expire if the target user does the
|
||||||
|
same.
|
||||||
|
|
||||||
|
|
||||||
User devices
|
User devices
|
||||||
============
|
============
|
||||||
|
|
||||||
@@ -375,7 +528,8 @@ A response body like the following is returned:
|
|||||||
"last_seen_ts": 1474491775025,
|
"last_seen_ts": 1474491775025,
|
||||||
"user_id": "<user_id>"
|
"user_id": "<user_id>"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"total": 2
|
||||||
}
|
}
|
||||||
|
|
||||||
**Parameters**
|
**Parameters**
|
||||||
@@ -400,6 +554,8 @@ The following fields are returned in the JSON response body:
|
|||||||
devices was last seen. (May be a few minutes out of date, for efficiency reasons).
|
devices was last seen. (May be a few minutes out of date, for efficiency reasons).
|
||||||
- ``user_id`` - Owner of device.
|
- ``user_id`` - Owner of device.
|
||||||
|
|
||||||
|
- ``total`` - Total number of user's devices.
|
||||||
|
|
||||||
Delete multiple devices
|
Delete multiple devices
|
||||||
------------------
|
------------------
|
||||||
Deletes the given devices for a specific ``user_id``, and invalidates
|
Deletes the given devices for a specific ``user_id``, and invalidates
|
||||||
@@ -525,3 +681,82 @@ The following parameters should be set in the URL:
|
|||||||
|
|
||||||
- ``user_id`` - fully qualified: for example, ``@user:server.com``.
|
- ``user_id`` - fully qualified: for example, ``@user:server.com``.
|
||||||
- ``device_id`` - The device to delete.
|
- ``device_id`` - The device to delete.
|
||||||
|
|
||||||
|
List all pushers
|
||||||
|
================
|
||||||
|
Gets information about all pushers for a specific ``user_id``.
|
||||||
|
|
||||||
|
The API is::
|
||||||
|
|
||||||
|
GET /_synapse/admin/v1/users/<user_id>/pushers
|
||||||
|
|
||||||
|
To use it, you will need to authenticate by providing an ``access_token`` for a
|
||||||
|
server admin: see `README.rst <README.rst>`_.
|
||||||
|
|
||||||
|
A response body like the following is returned:
|
||||||
|
|
||||||
|
.. code:: json
|
||||||
|
|
||||||
|
{
|
||||||
|
"pushers": [
|
||||||
|
{
|
||||||
|
"app_display_name":"HTTP Push Notifications",
|
||||||
|
"app_id":"m.http",
|
||||||
|
"data": {
|
||||||
|
"url":"example.com"
|
||||||
|
},
|
||||||
|
"device_display_name":"pushy push",
|
||||||
|
"kind":"http",
|
||||||
|
"lang":"None",
|
||||||
|
"profile_tag":"",
|
||||||
|
"pushkey":"a@example.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total": 1
|
||||||
|
}
|
||||||
|
|
||||||
|
**Parameters**
|
||||||
|
|
||||||
|
The following parameters should be set in the URL:
|
||||||
|
|
||||||
|
- ``user_id`` - fully qualified: for example, ``@user:server.com``.
|
||||||
|
|
||||||
|
**Response**
|
||||||
|
|
||||||
|
The following fields are returned in the JSON response body:
|
||||||
|
|
||||||
|
- ``pushers`` - An array containing the current pushers for the user
|
||||||
|
|
||||||
|
- ``app_display_name`` - string - A string that will allow the user to identify
|
||||||
|
what application owns this pusher.
|
||||||
|
|
||||||
|
- ``app_id`` - string - This is a reverse-DNS style identifier for the application.
|
||||||
|
Max length, 64 chars.
|
||||||
|
|
||||||
|
- ``data`` - A dictionary of information for the pusher implementation itself.
|
||||||
|
|
||||||
|
- ``url`` - string - Required if ``kind`` is ``http``. The URL to use to send
|
||||||
|
notifications to.
|
||||||
|
|
||||||
|
- ``format`` - string - The format to use when sending notifications to the
|
||||||
|
Push Gateway.
|
||||||
|
|
||||||
|
- ``device_display_name`` - string - A string that will allow the user to identify
|
||||||
|
what device owns this pusher.
|
||||||
|
|
||||||
|
- ``profile_tag`` - string - This string determines which set of device specific rules
|
||||||
|
this pusher executes.
|
||||||
|
|
||||||
|
- ``kind`` - string - The kind of pusher. "http" is a pusher that sends HTTP pokes.
|
||||||
|
- ``lang`` - string - The preferred language for receiving notifications
|
||||||
|
(e.g. 'en' or 'en-US')
|
||||||
|
|
||||||
|
- ``profile_tag`` - string - This string determines which set of device specific rules
|
||||||
|
this pusher executes.
|
||||||
|
|
||||||
|
- ``pushkey`` - string - This is a unique identifier for this pusher.
|
||||||
|
Max length, 512 bytes.
|
||||||
|
|
||||||
|
- ``total`` - integer - Number of pushers.
|
||||||
|
|
||||||
|
See also `Client-Server API Spec <https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-pushers>`_
|
||||||
|
|||||||
32
docs/auth_chain_diff.dot
Normal file
32
docs/auth_chain_diff.dot
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
digraph auth {
|
||||||
|
nodesep=0.5;
|
||||||
|
rankdir="RL";
|
||||||
|
|
||||||
|
C [label="Create (1,1)"];
|
||||||
|
|
||||||
|
BJ [label="Bob's Join (2,1)", color=red];
|
||||||
|
BJ2 [label="Bob's Join (2,2)", color=red];
|
||||||
|
BJ2 -> BJ [color=red, dir=none];
|
||||||
|
|
||||||
|
subgraph cluster_foo {
|
||||||
|
A1 [label="Alice's invite (4,1)", color=blue];
|
||||||
|
A2 [label="Alice's Join (4,2)", color=blue];
|
||||||
|
A3 [label="Alice's Join (4,3)", color=blue];
|
||||||
|
A3 -> A2 -> A1 [color=blue, dir=none];
|
||||||
|
color=none;
|
||||||
|
}
|
||||||
|
|
||||||
|
PL1 [label="Power Level (3,1)", color=darkgreen];
|
||||||
|
PL2 [label="Power Level (3,2)", color=darkgreen];
|
||||||
|
PL2 -> PL1 [color=darkgreen, dir=none];
|
||||||
|
|
||||||
|
{rank = same; C; BJ; PL1; A1;}
|
||||||
|
|
||||||
|
A1 -> C [color=grey];
|
||||||
|
A1 -> BJ [color=grey];
|
||||||
|
PL1 -> C [color=grey];
|
||||||
|
BJ2 -> PL1 [penwidth=2];
|
||||||
|
|
||||||
|
A3 -> PL2 [penwidth=2];
|
||||||
|
A1 -> PL1 -> BJ -> C [penwidth=2];
|
||||||
|
}
|
||||||
BIN
docs/auth_chain_diff.dot.png
Normal file
BIN
docs/auth_chain_diff.dot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
108
docs/auth_chain_difference_algorithm.md
Normal file
108
docs/auth_chain_difference_algorithm.md
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
# Auth Chain Difference Algorithm
|
||||||
|
|
||||||
|
The auth chain difference algorithm is used by V2 state resolution, where a
|
||||||
|
naive implementation can be a significant source of CPU and DB usage.
|
||||||
|
|
||||||
|
### Definitions
|
||||||
|
|
||||||
|
A *state set* is a set of state events; e.g. the input of a state resolution
|
||||||
|
algorithm is a collection of state sets.
|
||||||
|
|
||||||
|
The *auth chain* of a set of events are all the events' auth events and *their*
|
||||||
|
auth events, recursively (i.e. the events reachable by walking the graph induced
|
||||||
|
by an event's auth events links).
|
||||||
|
|
||||||
|
The *auth chain difference* of a collection of state sets is the union minus the
|
||||||
|
intersection of the sets of auth chains corresponding to the state sets, i.e an
|
||||||
|
event is in the auth chain difference if it is reachable by walking the auth
|
||||||
|
event graph from at least one of the state sets but not from *all* of the state
|
||||||
|
sets.
|
||||||
|
|
||||||
|
## Breadth First Walk Algorithm
|
||||||
|
|
||||||
|
A way of calculating the auth chain difference without calculating the full auth
|
||||||
|
chains for each state set is to do a parallel breadth first walk (ordered by
|
||||||
|
depth) of each state set's auth chain. By tracking which events are reachable
|
||||||
|
from each state set we can finish early if every pending event is reachable from
|
||||||
|
every state set.
|
||||||
|
|
||||||
|
This can work well for state sets that have a small auth chain difference, but
|
||||||
|
can be very inefficient for larger differences. However, this algorithm is still
|
||||||
|
used if we don't have a chain cover index for the room (e.g. because we're in
|
||||||
|
the process of indexing it).
|
||||||
|
|
||||||
|
## Chain Cover Index
|
||||||
|
|
||||||
|
Synapse computes auth chain differences by pre-computing a "chain cover" index
|
||||||
|
for the auth chain in a room, allowing efficient reachability queries like "is
|
||||||
|
event A in the auth chain of event B". This is done by assigning every event a
|
||||||
|
*chain ID* and *sequence number* (e.g. `(5,3)`), and having a map of *links*
|
||||||
|
between chains (e.g. `(5,3) -> (2,4)`) such that A is reachable by B (i.e. `A`
|
||||||
|
is in the auth chain of `B`) if and only if either:
|
||||||
|
|
||||||
|
1. A and B have the same chain ID and `A`'s sequence number is less than `B`'s
|
||||||
|
sequence number; or
|
||||||
|
2. there is a link `L` between `B`'s chain ID and `A`'s chain ID such that
|
||||||
|
`L.start_seq_no` <= `B.seq_no` and `A.seq_no` <= `L.end_seq_no`.
|
||||||
|
|
||||||
|
There are actually two potential implementations, one where we store links from
|
||||||
|
each chain to every other reachable chain (the transitive closure of the links
|
||||||
|
graph), and one where we remove redundant links (the transitive reduction of the
|
||||||
|
links graph) e.g. if we have chains `C3 -> C2 -> C1` then the link `C3 -> C1`
|
||||||
|
would not be stored. Synapse uses the former implementations so that it doesn't
|
||||||
|
need to recurse to test reachability between chains.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
An example auth graph would look like the following, where chains have been
|
||||||
|
formed based on type/state_key and are denoted by colour and are labelled with
|
||||||
|
`(chain ID, sequence number)`. Links are denoted by the arrows (links in grey
|
||||||
|
are those that would be remove in the second implementation described above).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Note that we don't include all links between events and their auth events, as
|
||||||
|
most of those links would be redundant. For example, all events point to the
|
||||||
|
create event, but each chain only needs the one link from it's base to the
|
||||||
|
create event.
|
||||||
|
|
||||||
|
## Using the Index
|
||||||
|
|
||||||
|
This index can be used to calculate the auth chain difference of the state sets
|
||||||
|
by looking at the chain ID and sequence numbers reachable from each state set:
|
||||||
|
|
||||||
|
1. For every state set lookup the chain ID/sequence numbers of each state event
|
||||||
|
2. Use the index to find all chains and the maximum sequence number reachable
|
||||||
|
from each state set.
|
||||||
|
3. The auth chain difference is then all events in each chain that have sequence
|
||||||
|
numbers between the maximum sequence number reachable from *any* state set and
|
||||||
|
the minimum reachable by *all* state sets (if any).
|
||||||
|
|
||||||
|
Note that steps 2 is effectively calculating the auth chain for each state set
|
||||||
|
(in terms of chain IDs and sequence numbers), and step 3 is calculating the
|
||||||
|
difference between the union and intersection of the auth chains.
|
||||||
|
|
||||||
|
### Worked Example
|
||||||
|
|
||||||
|
For example, given the above graph, we can calculate the difference between
|
||||||
|
state sets consisting of:
|
||||||
|
|
||||||
|
1. `S1`: Alice's invite `(4,1)` and Bob's second join `(2,2)`; and
|
||||||
|
2. `S2`: Alice's second join `(4,3)` and Bob's first join `(2,1)`.
|
||||||
|
|
||||||
|
Using the index we see that the following auth chains are reachable from each
|
||||||
|
state set:
|
||||||
|
|
||||||
|
1. `S1`: `(1,1)`, `(2,2)`, `(3,1)` & `(4,1)`
|
||||||
|
2. `S2`: `(1,1)`, `(2,1)`, `(3,2)` & `(4,3)`
|
||||||
|
|
||||||
|
And so, for each the ranges that are in the auth chain difference:
|
||||||
|
1. Chain 1: None, (since everything can reach the create event).
|
||||||
|
2. Chain 2: The range `(1, 2]` (i.e. just `2`), as `1` is reachable by all state
|
||||||
|
sets and the maximum reachable is `2` (corresponding to Bob's second join).
|
||||||
|
3. Chain 3: Similarly the range `(1, 2]` (corresponding to the second power
|
||||||
|
level).
|
||||||
|
4. Chain 4: The range `(1, 3]` (corresponding to both of Alice's joins).
|
||||||
|
|
||||||
|
So the final result is: Bob's second join `(2,2)`, the second power level
|
||||||
|
`(3,2)` and both of Alice's joins `(4,2)` & `(4,3)`.
|
||||||
@@ -64,8 +64,6 @@ save as it takes a while and is very resource intensive.
|
|||||||
- Use underscores for functions and variables.
|
- Use underscores for functions and variables.
|
||||||
- **Docstrings**: should follow the [google code
|
- **Docstrings**: should follow the [google code
|
||||||
style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings).
|
style](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings).
|
||||||
This is so that we can generate documentation with
|
|
||||||
[sphinx](http://sphinxcontrib-napoleon.readthedocs.org/en/latest/).
|
|
||||||
See the
|
See the
|
||||||
[examples](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
|
[examples](http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html)
|
||||||
in the sphinx documentation.
|
in the sphinx documentation.
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ easy to run CAS implementation built on top of Django.
|
|||||||
You should now have a Django project configured to serve CAS authentication with
|
You should now have a Django project configured to serve CAS authentication with
|
||||||
a single user created.
|
a single user created.
|
||||||
|
|
||||||
## Configure Synapse (and Riot) to use CAS
|
## Configure Synapse (and Element) to use CAS
|
||||||
|
|
||||||
1. Modify your `homeserver.yaml` to enable CAS and point it to your locally
|
1. Modify your `homeserver.yaml` to enable CAS and point it to your locally
|
||||||
running Django test server:
|
running Django test server:
|
||||||
@@ -51,9 +51,9 @@ and that the CAS server is on port 8000, both on localhost.
|
|||||||
|
|
||||||
## Testing the configuration
|
## Testing the configuration
|
||||||
|
|
||||||
Then in Riot:
|
Then in Element:
|
||||||
|
|
||||||
1. Visit the login page with a Riot pointing at your homeserver.
|
1. Visit the login page with a Element pointing at your homeserver.
|
||||||
2. Click the Single Sign-On button.
|
2. Click the Single Sign-On button.
|
||||||
3. Login using the credentials created with `createsuperuser`.
|
3. Login using the credentials created with `createsuperuser`.
|
||||||
4. You should be logged in.
|
4. You should be logged in.
|
||||||
|
|||||||
@@ -5,8 +5,45 @@ The "manhole" allows server administrators to access a Python shell on a running
|
|||||||
Synapse installation. This is a very powerful mechanism for administration and
|
Synapse installation. This is a very powerful mechanism for administration and
|
||||||
debugging.
|
debugging.
|
||||||
|
|
||||||
|
**_Security Warning_**
|
||||||
|
|
||||||
|
Note that this will give administrative access to synapse to **all users** with
|
||||||
|
shell access to the server. It should therefore **not** be enabled in
|
||||||
|
environments where untrusted users have shell access.
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
To enable it, first uncomment the `manhole` listener configuration in
|
To enable it, first uncomment the `manhole` listener configuration in
|
||||||
`homeserver.yaml`:
|
`homeserver.yaml`. The configuration is slightly different if you're using docker.
|
||||||
|
|
||||||
|
#### Docker config
|
||||||
|
|
||||||
|
If you are using Docker, set `bind_addresses` to `['0.0.0.0']` as shown:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
listeners:
|
||||||
|
- port: 9000
|
||||||
|
bind_addresses: ['0.0.0.0']
|
||||||
|
type: manhole
|
||||||
|
```
|
||||||
|
|
||||||
|
When using `docker run` to start the server, you will then need to change the command to the following to include the
|
||||||
|
`manhole` port forwarding. The `-p 127.0.0.1:9000:9000` below is important: it
|
||||||
|
ensures that access to the `manhole` is only possible for local users.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -d --name synapse \
|
||||||
|
--mount type=volume,src=synapse-data,dst=/data \
|
||||||
|
-p 8008:8008 \
|
||||||
|
-p 127.0.0.1:9000:9000 \
|
||||||
|
matrixdotorg/synapse:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Native config
|
||||||
|
|
||||||
|
If you are not using docker, set `bind_addresses` to `['::1', '127.0.0.1']` as shown.
|
||||||
|
The `bind_addresses` in the example below is important: it ensures that access to the
|
||||||
|
`manhole` is only possible for local users).
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
listeners:
|
listeners:
|
||||||
@@ -15,12 +52,7 @@ listeners:
|
|||||||
type: manhole
|
type: manhole
|
||||||
```
|
```
|
||||||
|
|
||||||
(`bind_addresses` in the above is important: it ensures that access to the
|
#### Accessing synapse manhole
|
||||||
manhole is only possible for local users).
|
|
||||||
|
|
||||||
Note that this will give administrative access to synapse to **all users** with
|
|
||||||
shell access to the server. It should therefore **not** be enabled in
|
|
||||||
environments where untrusted users have shell access.
|
|
||||||
|
|
||||||
Then restart synapse, and point an ssh client at port 9000 on localhost, using
|
Then restart synapse, and point an ssh client at port 9000 on localhost, using
|
||||||
the username `matrix`:
|
the username `matrix`:
|
||||||
@@ -35,9 +67,12 @@ This gives a Python REPL in which `hs` gives access to the
|
|||||||
`synapse.server.HomeServer` object - which in turn gives access to many other
|
`synapse.server.HomeServer` object - which in turn gives access to many other
|
||||||
parts of the process.
|
parts of the process.
|
||||||
|
|
||||||
|
Note that any call which returns a coroutine will need to be wrapped in `ensureDeferred`.
|
||||||
|
|
||||||
As a simple example, retrieving an event from the database:
|
As a simple example, retrieving an event from the database:
|
||||||
|
|
||||||
```
|
```pycon
|
||||||
>>> hs.get_datastore().get_event('$1416420717069yeQaw:matrix.org')
|
>>> from twisted.internet import defer
|
||||||
|
>>> defer.ensureDeferred(hs.get_datastore().get_event('$1416420717069yeQaw:matrix.org'))
|
||||||
<Deferred at 0x7ff253fc6998 current result: <FrozenEvent event_id='$1416420717069yeQaw:matrix.org', type='m.room.create', state_key=''>>
|
<Deferred at 0x7ff253fc6998 current result: <FrozenEvent event_id='$1416420717069yeQaw:matrix.org', type='m.room.create', state_key=''>>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -136,24 +136,34 @@ the server's database.
|
|||||||
|
|
||||||
### Lifetime limits
|
### Lifetime limits
|
||||||
|
|
||||||
**Note: this feature is mainly useful within a closed federation or on
|
Server admins can set limits on the values of `max_lifetime` to use when
|
||||||
servers that don't federate, because there currently is no way to
|
purging old events in a room. These limits can be defined as such in the
|
||||||
enforce these limits in an open federation.**
|
`retention` section of the configuration file:
|
||||||
|
|
||||||
Server admins can restrict the values their local users are allowed to
|
|
||||||
use for both `min_lifetime` and `max_lifetime`. These limits can be
|
|
||||||
defined as such in the `retention` section of the configuration file:
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
allowed_lifetime_min: 1d
|
allowed_lifetime_min: 1d
|
||||||
allowed_lifetime_max: 1y
|
allowed_lifetime_max: 1y
|
||||||
```
|
```
|
||||||
|
|
||||||
Here, `allowed_lifetime_min` is the lowest value a local user can set
|
The limits are considered when running purge jobs. If necessary, the
|
||||||
for both `min_lifetime` and `max_lifetime`, and `allowed_lifetime_max`
|
effective value of `max_lifetime` will be brought between
|
||||||
is the highest value. Both parameters are optional (e.g. setting
|
`allowed_lifetime_min` and `allowed_lifetime_max` (inclusive).
|
||||||
`allowed_lifetime_min` but not `allowed_lifetime_max` only enforces a
|
This means that, if the value of `max_lifetime` defined in the room's state
|
||||||
minimum and no maximum).
|
is lower than `allowed_lifetime_min`, the value of `allowed_lifetime_min`
|
||||||
|
will be used instead. Likewise, if the value of `max_lifetime` is higher
|
||||||
|
than `allowed_lifetime_max`, the value of `allowed_lifetime_max` will be
|
||||||
|
used instead.
|
||||||
|
|
||||||
|
In the example above, we ensure Synapse never deletes events that are less
|
||||||
|
than one day old, and that it always deletes events that are over a year
|
||||||
|
old.
|
||||||
|
|
||||||
|
If a default policy is set, and its `max_lifetime` value is lower than
|
||||||
|
`allowed_lifetime_min` or higher than `allowed_lifetime_max`, the same
|
||||||
|
process applies.
|
||||||
|
|
||||||
|
Both parameters are optional; if one is omitted Synapse won't use it to
|
||||||
|
adjust the effective value of `max_lifetime`.
|
||||||
|
|
||||||
Like other settings in this section, these parameters can be expressed
|
Like other settings in this section, these parameters can be expressed
|
||||||
either as a duration or as a number of milliseconds.
|
either as a duration or as a number of milliseconds.
|
||||||
|
|||||||
@@ -13,10 +13,12 @@
|
|||||||
can be enabled by adding the \"metrics\" resource to the existing
|
can be enabled by adding the \"metrics\" resource to the existing
|
||||||
listener as such:
|
listener as such:
|
||||||
|
|
||||||
resources:
|
```yaml
|
||||||
- names:
|
resources:
|
||||||
- client
|
- names:
|
||||||
- metrics
|
- client
|
||||||
|
- metrics
|
||||||
|
```
|
||||||
|
|
||||||
This provides a simple way of adding metrics to your Synapse
|
This provides a simple way of adding metrics to your Synapse
|
||||||
installation, and serves under `/_synapse/metrics`. If you do not
|
installation, and serves under `/_synapse/metrics`. If you do not
|
||||||
@@ -31,11 +33,13 @@
|
|||||||
|
|
||||||
Add a new listener to homeserver.yaml:
|
Add a new listener to homeserver.yaml:
|
||||||
|
|
||||||
listeners:
|
```yaml
|
||||||
- type: metrics
|
listeners:
|
||||||
port: 9000
|
- type: metrics
|
||||||
bind_addresses:
|
port: 9000
|
||||||
- '0.0.0.0'
|
bind_addresses:
|
||||||
|
- '0.0.0.0'
|
||||||
|
```
|
||||||
|
|
||||||
For both options, you will need to ensure that `enable_metrics` is
|
For both options, you will need to ensure that `enable_metrics` is
|
||||||
set to `True`.
|
set to `True`.
|
||||||
@@ -47,10 +51,13 @@
|
|||||||
It needs to set the `metrics_path` to a non-default value (under
|
It needs to set the `metrics_path` to a non-default value (under
|
||||||
`scrape_configs`):
|
`scrape_configs`):
|
||||||
|
|
||||||
- job_name: "synapse"
|
```yaml
|
||||||
metrics_path: "/_synapse/metrics"
|
- job_name: "synapse"
|
||||||
static_configs:
|
scrape_interval: 15s
|
||||||
- targets: ["my.server.here:port"]
|
metrics_path: "/_synapse/metrics"
|
||||||
|
static_configs:
|
||||||
|
- targets: ["my.server.here:port"]
|
||||||
|
```
|
||||||
|
|
||||||
where `my.server.here` is the IP address of Synapse, and `port` is
|
where `my.server.here` is the IP address of Synapse, and `port` is
|
||||||
the listener port configured with the `metrics` resource.
|
the listener port configured with the `metrics` resource.
|
||||||
@@ -60,6 +67,9 @@
|
|||||||
|
|
||||||
1. Restart Prometheus.
|
1. Restart Prometheus.
|
||||||
|
|
||||||
|
1. Consider using the [grafana dashboard](https://github.com/matrix-org/synapse/tree/master/contrib/grafana/)
|
||||||
|
and required [recording rules](https://github.com/matrix-org/synapse/tree/master/contrib/prometheus/)
|
||||||
|
|
||||||
## Monitoring workers
|
## Monitoring workers
|
||||||
|
|
||||||
To monitor a Synapse installation using
|
To monitor a Synapse installation using
|
||||||
@@ -74,9 +84,9 @@ To allow collecting metrics from a worker, you need to add a
|
|||||||
under `worker_listeners`:
|
under `worker_listeners`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- type: metrics
|
- type: metrics
|
||||||
bind_address: ''
|
bind_address: ''
|
||||||
port: 9101
|
port: 9101
|
||||||
```
|
```
|
||||||
|
|
||||||
The `bind_address` and `port` parameters should be set so that
|
The `bind_address` and `port` parameters should be set so that
|
||||||
@@ -85,6 +95,38 @@ don't clash with an existing worker.
|
|||||||
With this example, the worker's metrics would then be available
|
With this example, the worker's metrics would then be available
|
||||||
on `http://127.0.0.1:9101`.
|
on `http://127.0.0.1:9101`.
|
||||||
|
|
||||||
|
Example Prometheus target for Synapse with workers:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- job_name: "synapse"
|
||||||
|
scrape_interval: 15s
|
||||||
|
metrics_path: "/_synapse/metrics"
|
||||||
|
static_configs:
|
||||||
|
- targets: ["my.server.here:port"]
|
||||||
|
labels:
|
||||||
|
instance: "my.server"
|
||||||
|
job: "master"
|
||||||
|
index: 1
|
||||||
|
- targets: ["my.workerserver.here:port"]
|
||||||
|
labels:
|
||||||
|
instance: "my.server"
|
||||||
|
job: "generic_worker"
|
||||||
|
index: 1
|
||||||
|
- targets: ["my.workerserver.here:port"]
|
||||||
|
labels:
|
||||||
|
instance: "my.server"
|
||||||
|
job: "generic_worker"
|
||||||
|
index: 2
|
||||||
|
- targets: ["my.workerserver.here:port"]
|
||||||
|
labels:
|
||||||
|
instance: "my.server"
|
||||||
|
job: "media_repository"
|
||||||
|
index: 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Labels (`instance`, `job`, `index`) can be defined as anything.
|
||||||
|
The labels are used to group graphs in grafana.
|
||||||
|
|
||||||
## Renaming of metrics & deprecation of old names in 1.2
|
## Renaming of metrics & deprecation of old names in 1.2
|
||||||
|
|
||||||
Synapse 1.2 updates the Prometheus metrics to match the naming
|
Synapse 1.2 updates the Prometheus metrics to match the naming
|
||||||
|
|||||||
203
docs/openid.md
203
docs/openid.md
@@ -37,29 +37,54 @@ as follows:
|
|||||||
provided by `matrix.org` so no further action is needed.
|
provided by `matrix.org` so no further action is needed.
|
||||||
|
|
||||||
* If you installed Synapse into a virtualenv, run `/path/to/env/bin/pip
|
* If you installed Synapse into a virtualenv, run `/path/to/env/bin/pip
|
||||||
install synapse[oidc]` to install the necessary dependencies.
|
install matrix-synapse[oidc]` to install the necessary dependencies.
|
||||||
|
|
||||||
* For other installation mechanisms, see the documentation provided by the
|
* For other installation mechanisms, see the documentation provided by the
|
||||||
maintainer.
|
maintainer.
|
||||||
|
|
||||||
To enable the OpenID integration, you should then add an `oidc_config` section
|
To enable the OpenID integration, you should then add a section to the `oidc_providers`
|
||||||
to your configuration file (or uncomment the `enabled: true` line in the
|
setting in your configuration file (or uncomment one of the existing examples).
|
||||||
existing section). See [sample_config.yaml](./sample_config.yaml) for some
|
See [sample_config.yaml](./sample_config.yaml) for some sample settings, as well as
|
||||||
sample settings, as well as the text below for example configurations for
|
the text below for example configurations for specific providers.
|
||||||
specific providers.
|
|
||||||
|
|
||||||
## Sample configs
|
## Sample configs
|
||||||
|
|
||||||
Here are a few configs for providers that should work with Synapse.
|
Here are a few configs for providers that should work with Synapse.
|
||||||
|
|
||||||
|
### Microsoft Azure Active Directory
|
||||||
|
Azure AD can act as an OpenID Connect Provider. Register a new application under
|
||||||
|
*App registrations* in the Azure AD management console. The RedirectURI for your
|
||||||
|
application should point to your matrix server: `[synapse public baseurl]/_synapse/oidc/callback`
|
||||||
|
|
||||||
|
Go to *Certificates & secrets* and register a new client secret. Make note of your
|
||||||
|
Directory (tenant) ID as it will be used in the Azure links.
|
||||||
|
Edit your Synapse config file and change the `oidc_config` section:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
oidc_providers:
|
||||||
|
- idp_id: microsoft
|
||||||
|
idp_name: Microsoft
|
||||||
|
issuer: "https://login.microsoftonline.com/<tenant id>/v2.0"
|
||||||
|
client_id: "<client id>"
|
||||||
|
client_secret: "<client secret>"
|
||||||
|
scopes: ["openid", "profile"]
|
||||||
|
authorization_endpoint: "https://login.microsoftonline.com/<tenant id>/oauth2/v2.0/authorize"
|
||||||
|
token_endpoint: "https://login.microsoftonline.com/<tenant id>/oauth2/v2.0/token"
|
||||||
|
userinfo_endpoint: "https://graph.microsoft.com/oidc/userinfo"
|
||||||
|
|
||||||
|
user_mapping_provider:
|
||||||
|
config:
|
||||||
|
localpart_template: "{{ user.preferred_username.split('@')[0] }}"
|
||||||
|
display_name_template: "{{ user.name }}"
|
||||||
|
```
|
||||||
|
|
||||||
### [Dex][dex-idp]
|
### [Dex][dex-idp]
|
||||||
|
|
||||||
[Dex][dex-idp] is a simple, open-source, certified OpenID Connect Provider.
|
[Dex][dex-idp] is a simple, open-source, certified OpenID Connect Provider.
|
||||||
Although it is designed to help building a full-blown provider with an
|
Although it is designed to help building a full-blown provider with an
|
||||||
external database, it can be configured with static passwords in a config file.
|
external database, it can be configured with static passwords in a config file.
|
||||||
|
|
||||||
Follow the [Getting Started
|
Follow the [Getting Started guide](https://dexidp.io/docs/getting-started/)
|
||||||
guide](https://github.com/dexidp/dex/blob/master/Documentation/getting-started.md)
|
|
||||||
to install Dex.
|
to install Dex.
|
||||||
|
|
||||||
Edit `examples/config-dev.yaml` config file from the Dex repo to add a client:
|
Edit `examples/config-dev.yaml` config file from the Dex repo to add a client:
|
||||||
@@ -73,22 +98,23 @@ staticClients:
|
|||||||
name: 'Synapse'
|
name: 'Synapse'
|
||||||
```
|
```
|
||||||
|
|
||||||
Run with `dex serve examples/config-dex.yaml`.
|
Run with `dex serve examples/config-dev.yaml`.
|
||||||
|
|
||||||
Synapse config:
|
Synapse config:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
oidc_config:
|
oidc_providers:
|
||||||
enabled: true
|
- idp_id: dex
|
||||||
skip_verification: true # This is needed as Dex is served on an insecure endpoint
|
idp_name: "My Dex server"
|
||||||
issuer: "http://127.0.0.1:5556/dex"
|
skip_verification: true # This is needed as Dex is served on an insecure endpoint
|
||||||
client_id: "synapse"
|
issuer: "http://127.0.0.1:5556/dex"
|
||||||
client_secret: "secret"
|
client_id: "synapse"
|
||||||
scopes: ["openid", "profile"]
|
client_secret: "secret"
|
||||||
user_mapping_provider:
|
scopes: ["openid", "profile"]
|
||||||
config:
|
user_mapping_provider:
|
||||||
localpart_template: "{{ user.name }}"
|
config:
|
||||||
display_name_template: "{{ user.name|capitalize }}"
|
localpart_template: "{{ user.name }}"
|
||||||
|
display_name_template: "{{ user.name|capitalize }}"
|
||||||
```
|
```
|
||||||
### [Keycloak][keycloak-idp]
|
### [Keycloak][keycloak-idp]
|
||||||
|
|
||||||
@@ -127,12 +153,17 @@ Follow the [Getting Started Guide](https://www.keycloak.org/getting-started) to
|
|||||||
8. Copy Secret
|
8. Copy Secret
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
oidc_config:
|
oidc_providers:
|
||||||
enabled: true
|
- idp_id: keycloak
|
||||||
issuer: "https://127.0.0.1:8443/auth/realms/{realm_name}"
|
idp_name: "My KeyCloak server"
|
||||||
client_id: "synapse"
|
issuer: "https://127.0.0.1:8443/auth/realms/{realm_name}"
|
||||||
client_secret: "copy secret generated from above"
|
client_id: "synapse"
|
||||||
scopes: ["openid", "profile"]
|
client_secret: "copy secret generated from above"
|
||||||
|
scopes: ["openid", "profile"]
|
||||||
|
user_mapping_provider:
|
||||||
|
config:
|
||||||
|
localpart_template: "{{ user.preferred_username }}"
|
||||||
|
display_name_template: "{{ user.name }}"
|
||||||
```
|
```
|
||||||
### [Auth0][auth0]
|
### [Auth0][auth0]
|
||||||
|
|
||||||
@@ -162,16 +193,17 @@ oidc_config:
|
|||||||
Synapse config:
|
Synapse config:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
oidc_config:
|
oidc_providers:
|
||||||
enabled: true
|
- idp_id: auth0
|
||||||
issuer: "https://your-tier.eu.auth0.com/" # TO BE FILLED
|
idp_name: Auth0
|
||||||
client_id: "your-client-id" # TO BE FILLED
|
issuer: "https://your-tier.eu.auth0.com/" # TO BE FILLED
|
||||||
client_secret: "your-client-secret" # TO BE FILLED
|
client_id: "your-client-id" # TO BE FILLED
|
||||||
scopes: ["openid", "profile"]
|
client_secret: "your-client-secret" # TO BE FILLED
|
||||||
user_mapping_provider:
|
scopes: ["openid", "profile"]
|
||||||
config:
|
user_mapping_provider:
|
||||||
localpart_template: "{{ user.preferred_username }}"
|
config:
|
||||||
display_name_template: "{{ user.name }}"
|
localpart_template: "{{ user.preferred_username }}"
|
||||||
|
display_name_template: "{{ user.name }}"
|
||||||
```
|
```
|
||||||
|
|
||||||
### GitHub
|
### GitHub
|
||||||
@@ -180,7 +212,7 @@ GitHub is a bit special as it is not an OpenID Connect compliant provider, but
|
|||||||
just a regular OAuth2 provider.
|
just a regular OAuth2 provider.
|
||||||
|
|
||||||
The [`/user` API endpoint](https://developer.github.com/v3/users/#get-the-authenticated-user)
|
The [`/user` API endpoint](https://developer.github.com/v3/users/#get-the-authenticated-user)
|
||||||
can be used to retrieve information on the authenticated user. As the Synaspse
|
can be used to retrieve information on the authenticated user. As the Synapse
|
||||||
login mechanism needs an attribute to uniquely identify users, and that endpoint
|
login mechanism needs an attribute to uniquely identify users, and that endpoint
|
||||||
does not return a `sub` property, an alternative `subject_claim` has to be set.
|
does not return a `sub` property, an alternative `subject_claim` has to be set.
|
||||||
|
|
||||||
@@ -190,21 +222,22 @@ does not return a `sub` property, an alternative `subject_claim` has to be set.
|
|||||||
Synapse config:
|
Synapse config:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
oidc_config:
|
oidc_providers:
|
||||||
enabled: true
|
- idp_id: github
|
||||||
discover: false
|
idp_name: Github
|
||||||
issuer: "https://github.com/"
|
discover: false
|
||||||
client_id: "your-client-id" # TO BE FILLED
|
issuer: "https://github.com/"
|
||||||
client_secret: "your-client-secret" # TO BE FILLED
|
client_id: "your-client-id" # TO BE FILLED
|
||||||
authorization_endpoint: "https://github.com/login/oauth/authorize"
|
client_secret: "your-client-secret" # TO BE FILLED
|
||||||
token_endpoint: "https://github.com/login/oauth/access_token"
|
authorization_endpoint: "https://github.com/login/oauth/authorize"
|
||||||
userinfo_endpoint: "https://api.github.com/user"
|
token_endpoint: "https://github.com/login/oauth/access_token"
|
||||||
scopes: ["read:user"]
|
userinfo_endpoint: "https://api.github.com/user"
|
||||||
user_mapping_provider:
|
scopes: ["read:user"]
|
||||||
config:
|
user_mapping_provider:
|
||||||
subject_claim: "id"
|
config:
|
||||||
localpart_template: "{{ user.login }}"
|
subject_claim: "id"
|
||||||
display_name_template: "{{ user.name }}"
|
localpart_template: "{{ user.login }}"
|
||||||
|
display_name_template: "{{ user.name }}"
|
||||||
```
|
```
|
||||||
|
|
||||||
### [Google][google-idp]
|
### [Google][google-idp]
|
||||||
@@ -214,16 +247,17 @@ oidc_config:
|
|||||||
2. add an "OAuth Client ID" for a Web Application under "Credentials".
|
2. add an "OAuth Client ID" for a Web Application under "Credentials".
|
||||||
3. Copy the Client ID and Client Secret, and add the following to your synapse config:
|
3. Copy the Client ID and Client Secret, and add the following to your synapse config:
|
||||||
```yaml
|
```yaml
|
||||||
oidc_config:
|
oidc_providers:
|
||||||
enabled: true
|
- idp_id: google
|
||||||
issuer: "https://accounts.google.com/"
|
idp_name: Google
|
||||||
client_id: "your-client-id" # TO BE FILLED
|
issuer: "https://accounts.google.com/"
|
||||||
client_secret: "your-client-secret" # TO BE FILLED
|
client_id: "your-client-id" # TO BE FILLED
|
||||||
scopes: ["openid", "profile"]
|
client_secret: "your-client-secret" # TO BE FILLED
|
||||||
user_mapping_provider:
|
scopes: ["openid", "profile"]
|
||||||
config:
|
user_mapping_provider:
|
||||||
localpart_template: "{{ user.given_name|lower }}"
|
config:
|
||||||
display_name_template: "{{ user.name }}"
|
localpart_template: "{{ user.given_name|lower }}"
|
||||||
|
display_name_template: "{{ user.name }}"
|
||||||
```
|
```
|
||||||
4. Back in the Google console, add this Authorized redirect URI: `[synapse
|
4. Back in the Google console, add this Authorized redirect URI: `[synapse
|
||||||
public baseurl]/_synapse/oidc/callback`.
|
public baseurl]/_synapse/oidc/callback`.
|
||||||
@@ -237,14 +271,39 @@ oidc_config:
|
|||||||
Synapse config:
|
Synapse config:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
oidc_config:
|
oidc_providers:
|
||||||
enabled: true
|
- idp_id: twitch
|
||||||
issuer: "https://id.twitch.tv/oauth2/"
|
idp_name: Twitch
|
||||||
client_id: "your-client-id" # TO BE FILLED
|
issuer: "https://id.twitch.tv/oauth2/"
|
||||||
client_secret: "your-client-secret" # TO BE FILLED
|
client_id: "your-client-id" # TO BE FILLED
|
||||||
client_auth_method: "client_secret_post"
|
client_secret: "your-client-secret" # TO BE FILLED
|
||||||
user_mapping_provider:
|
client_auth_method: "client_secret_post"
|
||||||
config:
|
user_mapping_provider:
|
||||||
localpart_template: '{{ user.preferred_username }}'
|
config:
|
||||||
display_name_template: '{{ user.name }}'
|
localpart_template: "{{ user.preferred_username }}"
|
||||||
|
display_name_template: "{{ user.name }}"
|
||||||
|
```
|
||||||
|
|
||||||
|
### GitLab
|
||||||
|
|
||||||
|
1. Create a [new application](https://gitlab.com/profile/applications).
|
||||||
|
2. Add the `read_user` and `openid` scopes.
|
||||||
|
3. Add this Callback URL: `[synapse public baseurl]/_synapse/oidc/callback`
|
||||||
|
|
||||||
|
Synapse config:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
oidc_providers:
|
||||||
|
- idp_id: gitlab
|
||||||
|
idp_name: Gitlab
|
||||||
|
issuer: "https://gitlab.com/"
|
||||||
|
client_id: "your-client-id" # TO BE FILLED
|
||||||
|
client_secret: "your-client-secret" # TO BE FILLED
|
||||||
|
client_auth_method: "client_secret_post"
|
||||||
|
scopes: ["openid", "read_user"]
|
||||||
|
user_profile_method: "userinfo_endpoint"
|
||||||
|
user_mapping_provider:
|
||||||
|
config:
|
||||||
|
localpart_template: '{{ user.nickname }}'
|
||||||
|
display_name_template: '{{ user.name }}'
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ Password auth provider classes must provide the following methods:
|
|||||||
|
|
||||||
It should perform any appropriate sanity checks on the provided
|
It should perform any appropriate sanity checks on the provided
|
||||||
configuration, and return an object which is then passed into
|
configuration, and return an object which is then passed into
|
||||||
|
`__init__`.
|
||||||
|
|
||||||
This method should have the `@staticmethod` decoration.
|
This method should have the `@staticmethod` decoration.
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ connect to a postgres database.
|
|||||||
virtualenv](../INSTALL.md#installing-from-source), you can install
|
virtualenv](../INSTALL.md#installing-from-source), you can install
|
||||||
the library with:
|
the library with:
|
||||||
|
|
||||||
~/synapse/env/bin/pip install matrix-synapse[postgres]
|
~/synapse/env/bin/pip install "matrix-synapse[postgres]"
|
||||||
|
|
||||||
(substituting the path to your virtualenv for `~/synapse/env`, if
|
(substituting the path to your virtualenv for `~/synapse/env`, if
|
||||||
you used a different path). You will require the postgres
|
you used a different path). You will require the postgres
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
# Nginx by default only allows file uploads up to 1M in size
|
# Nginx by default only allows file uploads up to 1M in size
|
||||||
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
|
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
|
||||||
client_max_body_size 10M;
|
client_max_body_size 50M;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -67,11 +67,16 @@ pid_file: DATADIR/homeserver.pid
|
|||||||
#
|
#
|
||||||
#web_client_location: https://riot.example.com/
|
#web_client_location: https://riot.example.com/
|
||||||
|
|
||||||
# The public-facing base URL that clients use to access this HS
|
# The public-facing base URL that clients use to access this Homeserver (not
|
||||||
# (not including _matrix/...). This is the same URL a user would
|
# including _matrix/...). This is the same URL a user might enter into the
|
||||||
# enter into the 'custom HS URL' field on their client. If you
|
# 'Custom Homeserver URL' field on their client. If you use Synapse with a
|
||||||
# use synapse with a reverse proxy, this should be the URL to reach
|
# reverse proxy, this should be the URL to reach Synapse via the proxy.
|
||||||
# synapse via the proxy.
|
# Otherwise, it should be the URL to reach Synapse's client HTTP listener (see
|
||||||
|
# 'listeners' below).
|
||||||
|
#
|
||||||
|
# If this is left unset, it defaults to 'https://<server_name>/'. (Note that
|
||||||
|
# that will not work unless you configure Synapse or a reverse-proxy to listen
|
||||||
|
# on port 443.)
|
||||||
#
|
#
|
||||||
#public_baseurl: https://example.com/
|
#public_baseurl: https://example.com/
|
||||||
|
|
||||||
@@ -119,7 +124,7 @@ pid_file: DATADIR/homeserver.pid
|
|||||||
# For example, for room version 1, default_room_version should be set
|
# For example, for room version 1, default_room_version should be set
|
||||||
# to "1".
|
# to "1".
|
||||||
#
|
#
|
||||||
#default_room_version: "5"
|
#default_room_version: "6"
|
||||||
|
|
||||||
# The GC threshold parameters to pass to `gc.set_threshold`, if defined
|
# The GC threshold parameters to pass to `gc.set_threshold`, if defined
|
||||||
#
|
#
|
||||||
@@ -144,6 +149,47 @@ pid_file: DATADIR/homeserver.pid
|
|||||||
#
|
#
|
||||||
#enable_search: false
|
#enable_search: false
|
||||||
|
|
||||||
|
# Prevent outgoing requests from being sent to the following blacklisted IP address
|
||||||
|
# CIDR ranges. If this option is not specified then it defaults to private IP
|
||||||
|
# address ranges (see the example below).
|
||||||
|
#
|
||||||
|
# The blacklist applies to the outbound requests for federation, identity servers,
|
||||||
|
# push servers, and for checking key validity for third-party invite events.
|
||||||
|
#
|
||||||
|
# (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
|
||||||
|
# listed here, since they correspond to unroutable addresses.)
|
||||||
|
#
|
||||||
|
# This option replaces federation_ip_range_blacklist in Synapse v1.25.0.
|
||||||
|
#
|
||||||
|
#ip_range_blacklist:
|
||||||
|
# - '127.0.0.0/8'
|
||||||
|
# - '10.0.0.0/8'
|
||||||
|
# - '172.16.0.0/12'
|
||||||
|
# - '192.168.0.0/16'
|
||||||
|
# - '100.64.0.0/10'
|
||||||
|
# - '192.0.0.0/24'
|
||||||
|
# - '169.254.0.0/16'
|
||||||
|
# - '198.18.0.0/15'
|
||||||
|
# - '192.0.2.0/24'
|
||||||
|
# - '198.51.100.0/24'
|
||||||
|
# - '203.0.113.0/24'
|
||||||
|
# - '224.0.0.0/4'
|
||||||
|
# - '::1/128'
|
||||||
|
# - 'fe80::/10'
|
||||||
|
# - 'fc00::/7'
|
||||||
|
|
||||||
|
# List of IP address CIDR ranges that should be allowed for federation,
|
||||||
|
# identity servers, push servers, and for checking key validity for
|
||||||
|
# third-party invite events. This is useful for specifying exceptions to
|
||||||
|
# wide-ranging blacklisted target IP ranges - e.g. for communication with
|
||||||
|
# a push server only visible in your network.
|
||||||
|
#
|
||||||
|
# This whitelist overrides ip_range_blacklist and defaults to an empty
|
||||||
|
# list.
|
||||||
|
#
|
||||||
|
#ip_range_whitelist:
|
||||||
|
# - '192.168.1.1'
|
||||||
|
|
||||||
# List of ports that Synapse should listen on, their purpose and their
|
# List of ports that Synapse should listen on, their purpose and their
|
||||||
# configuration.
|
# configuration.
|
||||||
#
|
#
|
||||||
@@ -642,27 +688,6 @@ acme:
|
|||||||
# - nyc.example.com
|
# - nyc.example.com
|
||||||
# - syd.example.com
|
# - syd.example.com
|
||||||
|
|
||||||
# Prevent federation requests from being sent to the following
|
|
||||||
# blacklist IP address CIDR ranges. If this option is not specified, or
|
|
||||||
# specified with an empty list, no ip range blacklist will be enforced.
|
|
||||||
#
|
|
||||||
# As of Synapse v1.4.0 this option also affects any outbound requests to identity
|
|
||||||
# servers provided by user input.
|
|
||||||
#
|
|
||||||
# (0.0.0.0 and :: are always blacklisted, whether or not they are explicitly
|
|
||||||
# listed here, since they correspond to unroutable addresses.)
|
|
||||||
#
|
|
||||||
federation_ip_range_blacklist:
|
|
||||||
- '127.0.0.0/8'
|
|
||||||
- '10.0.0.0/8'
|
|
||||||
- '172.16.0.0/12'
|
|
||||||
- '192.168.0.0/16'
|
|
||||||
- '100.64.0.0/10'
|
|
||||||
- '169.254.0.0/16'
|
|
||||||
- '::1/128'
|
|
||||||
- 'fe80::/64'
|
|
||||||
- 'fc00::/7'
|
|
||||||
|
|
||||||
# Report prometheus metrics on the age of PDUs being sent to and received from
|
# Report prometheus metrics on the age of PDUs being sent to and received from
|
||||||
# the following domains. This can be used to give an idea of "delay" on inbound
|
# the following domains. This can be used to give an idea of "delay" on inbound
|
||||||
# and outbound federation, though be aware that any delay can be due to problems
|
# and outbound federation, though be aware that any delay can be due to problems
|
||||||
@@ -893,7 +918,7 @@ media_store_path: "DATADIR/media_store"
|
|||||||
|
|
||||||
# The largest allowed upload size in bytes
|
# The largest allowed upload size in bytes
|
||||||
#
|
#
|
||||||
#max_upload_size: 10M
|
#max_upload_size: 50M
|
||||||
|
|
||||||
# Maximum number of pixels that will be thumbnailed
|
# Maximum number of pixels that will be thumbnailed
|
||||||
#
|
#
|
||||||
@@ -953,9 +978,15 @@ media_store_path: "DATADIR/media_store"
|
|||||||
# - '172.16.0.0/12'
|
# - '172.16.0.0/12'
|
||||||
# - '192.168.0.0/16'
|
# - '192.168.0.0/16'
|
||||||
# - '100.64.0.0/10'
|
# - '100.64.0.0/10'
|
||||||
|
# - '192.0.0.0/24'
|
||||||
# - '169.254.0.0/16'
|
# - '169.254.0.0/16'
|
||||||
|
# - '198.18.0.0/15'
|
||||||
|
# - '192.0.2.0/24'
|
||||||
|
# - '198.51.100.0/24'
|
||||||
|
# - '203.0.113.0/24'
|
||||||
|
# - '224.0.0.0/4'
|
||||||
# - '::1/128'
|
# - '::1/128'
|
||||||
# - 'fe80::/64'
|
# - 'fe80::/10'
|
||||||
# - 'fc00::/7'
|
# - 'fc00::/7'
|
||||||
|
|
||||||
# List of IP address CIDR ranges that the URL preview spider is allowed
|
# List of IP address CIDR ranges that the URL preview spider is allowed
|
||||||
@@ -1124,8 +1155,9 @@ account_validity:
|
|||||||
# send an email to the account's email address with a renewal link. By
|
# send an email to the account's email address with a renewal link. By
|
||||||
# default, no such emails are sent.
|
# default, no such emails are sent.
|
||||||
#
|
#
|
||||||
# If you enable this setting, you will also need to fill out the 'email' and
|
# If you enable this setting, you will also need to fill out the 'email'
|
||||||
# 'public_baseurl' configuration sections.
|
# configuration section. You should also check that 'public_baseurl' is set
|
||||||
|
# correctly.
|
||||||
#
|
#
|
||||||
#renew_at: 1w
|
#renew_at: 1w
|
||||||
|
|
||||||
@@ -1216,8 +1248,7 @@ account_validity:
|
|||||||
# The identity server which we suggest that clients should use when users log
|
# The identity server which we suggest that clients should use when users log
|
||||||
# in on this server.
|
# in on this server.
|
||||||
#
|
#
|
||||||
# (By default, no suggestion is made, so it is left up to the client.
|
# (By default, no suggestion is made, so it is left up to the client.)
|
||||||
# This setting is ignored unless public_baseurl is also set.)
|
|
||||||
#
|
#
|
||||||
#default_identity_server: https://matrix.org
|
#default_identity_server: https://matrix.org
|
||||||
|
|
||||||
@@ -1230,8 +1261,9 @@ account_validity:
|
|||||||
# email will be globally disabled.
|
# email will be globally disabled.
|
||||||
#
|
#
|
||||||
# Additionally, if `msisdn` is not set, registration and password resets via msisdn
|
# Additionally, if `msisdn` is not set, registration and password resets via msisdn
|
||||||
# will be disabled regardless. This is due to Synapse currently not supporting any
|
# will be disabled regardless, and users will not be able to associate an msisdn
|
||||||
# method of sending SMS messages on its own.
|
# identifier to their account. This is due to Synapse currently not supporting
|
||||||
|
# any method of sending SMS messages on its own.
|
||||||
#
|
#
|
||||||
# To enable using an identity server for operations regarding a particular third-party
|
# To enable using an identity server for operations regarding a particular third-party
|
||||||
# identifier type, set the value to the URL of that identity server as shown in the
|
# identifier type, set the value to the URL of that identity server as shown in the
|
||||||
@@ -1241,8 +1273,6 @@ account_validity:
|
|||||||
# by the Matrix Identity Service API specification:
|
# by the Matrix Identity Service API specification:
|
||||||
# https://matrix.org/docs/spec/identity_service/latest
|
# https://matrix.org/docs/spec/identity_service/latest
|
||||||
#
|
#
|
||||||
# If a delegate is specified, the config option public_baseurl must also be filled out.
|
|
||||||
#
|
|
||||||
account_threepid_delegates:
|
account_threepid_delegates:
|
||||||
#email: https://example.com # Delegate email sending to example.com
|
#email: https://example.com # Delegate email sending to example.com
|
||||||
#msisdn: http://localhost:8090 # Delegate SMS sending to this local process
|
#msisdn: http://localhost:8090 # Delegate SMS sending to this local process
|
||||||
@@ -1505,10 +1535,8 @@ trusted_key_servers:
|
|||||||
|
|
||||||
## Single sign-on integration ##
|
## Single sign-on integration ##
|
||||||
|
|
||||||
# Enable SAML2 for registration and login. Uses pysaml2.
|
# The following settings can be used to make Synapse use a single sign-on
|
||||||
#
|
# provider for authentication, instead of its internal password database.
|
||||||
# At least one of `sp_config` or `config_path` must be set in this section to
|
|
||||||
# enable SAML login.
|
|
||||||
#
|
#
|
||||||
# You will probably also want to set the following options to `false` to
|
# You will probably also want to set the following options to `false` to
|
||||||
# disable the regular login/registration flows:
|
# disable the regular login/registration flows:
|
||||||
@@ -1517,6 +1545,11 @@ trusted_key_servers:
|
|||||||
#
|
#
|
||||||
# You will also want to investigate the settings under the "sso" configuration
|
# You will also want to investigate the settings under the "sso" configuration
|
||||||
# section below.
|
# section below.
|
||||||
|
|
||||||
|
# Enable SAML2 for registration and login. Uses pysaml2.
|
||||||
|
#
|
||||||
|
# At least one of `sp_config` or `config_path` must be set in this section to
|
||||||
|
# enable SAML login.
|
||||||
#
|
#
|
||||||
# Once SAML support is enabled, a metadata file will be exposed at
|
# Once SAML support is enabled, a metadata file will be exposed at
|
||||||
# https://<server>:<port>/_matrix/saml2/metadata.xml, which you may be able to
|
# https://<server>:<port>/_matrix/saml2/metadata.xml, which you may be able to
|
||||||
@@ -1532,40 +1565,70 @@ saml2_config:
|
|||||||
# so it is not normally necessary to specify them unless you need to
|
# so it is not normally necessary to specify them unless you need to
|
||||||
# override them.
|
# override them.
|
||||||
#
|
#
|
||||||
#sp_config:
|
sp_config:
|
||||||
# # point this to the IdP's metadata. You can use either a local file or
|
# Point this to the IdP's metadata. You must provide either a local
|
||||||
# # (preferably) a URL.
|
# file via the `local` attribute or (preferably) a URL via the
|
||||||
# metadata:
|
# `remote` attribute.
|
||||||
# #local: ["saml2/idp.xml"]
|
#
|
||||||
# remote:
|
#metadata:
|
||||||
# - url: https://our_idp/metadata.xml
|
# local: ["saml2/idp.xml"]
|
||||||
#
|
# remote:
|
||||||
# # By default, the user has to go to our login page first. If you'd like
|
# - url: https://our_idp/metadata.xml
|
||||||
# # to allow IdP-initiated login, set 'allow_unsolicited: true' in a
|
|
||||||
# # 'service.sp' section:
|
# Allowed clock difference in seconds between the homeserver and IdP.
|
||||||
# #
|
#
|
||||||
# #service:
|
# Uncomment the below to increase the accepted time difference from 0 to 3 seconds.
|
||||||
# # sp:
|
#
|
||||||
# # allow_unsolicited: true
|
#accepted_time_diff: 3
|
||||||
#
|
|
||||||
# # The examples below are just used to generate our metadata xml, and you
|
# By default, the user has to go to our login page first. If you'd like
|
||||||
# # may well not need them, depending on your setup. Alternatively you
|
# to allow IdP-initiated login, set 'allow_unsolicited: true' in a
|
||||||
# # may need a whole lot more detail - see the pysaml2 docs!
|
# 'service.sp' section:
|
||||||
#
|
#
|
||||||
# description: ["My awesome SP", "en"]
|
#service:
|
||||||
# name: ["Test SP", "en"]
|
# sp:
|
||||||
#
|
# allow_unsolicited: true
|
||||||
# organization:
|
|
||||||
# name: Example com
|
# The examples below are just used to generate our metadata xml, and you
|
||||||
# display_name:
|
# may well not need them, depending on your setup. Alternatively you
|
||||||
# - ["Example co", "en"]
|
# may need a whole lot more detail - see the pysaml2 docs!
|
||||||
# url: "http://example.com"
|
|
||||||
#
|
#description: ["My awesome SP", "en"]
|
||||||
# contact_person:
|
#name: ["Test SP", "en"]
|
||||||
# - given_name: Bob
|
|
||||||
# sur_name: "the Sysadmin"
|
#ui_info:
|
||||||
# email_address": ["admin@example.com"]
|
# display_name:
|
||||||
# contact_type": technical
|
# - lang: en
|
||||||
|
# text: "Display Name is the descriptive name of your service."
|
||||||
|
# description:
|
||||||
|
# - lang: en
|
||||||
|
# text: "Description should be a short paragraph explaining the purpose of the service."
|
||||||
|
# information_url:
|
||||||
|
# - lang: en
|
||||||
|
# text: "https://example.com/terms-of-service"
|
||||||
|
# privacy_statement_url:
|
||||||
|
# - lang: en
|
||||||
|
# text: "https://example.com/privacy-policy"
|
||||||
|
# keywords:
|
||||||
|
# - lang: en
|
||||||
|
# text: ["Matrix", "Element"]
|
||||||
|
# logo:
|
||||||
|
# - lang: en
|
||||||
|
# text: "https://example.com/logo.svg"
|
||||||
|
# width: "200"
|
||||||
|
# height: "80"
|
||||||
|
|
||||||
|
#organization:
|
||||||
|
# name: Example com
|
||||||
|
# display_name:
|
||||||
|
# - ["Example co", "en"]
|
||||||
|
# url: "http://example.com"
|
||||||
|
|
||||||
|
#contact_person:
|
||||||
|
# - given_name: Bob
|
||||||
|
# sur_name: "the Sysadmin"
|
||||||
|
# email_address": ["admin@example.com"]
|
||||||
|
# contact_type": technical
|
||||||
|
|
||||||
# Instead of putting the config inline as above, you can specify a
|
# Instead of putting the config inline as above, you can specify a
|
||||||
# separate pysaml2 configuration file:
|
# separate pysaml2 configuration file:
|
||||||
@@ -1640,145 +1703,200 @@ saml2_config:
|
|||||||
# - attribute: department
|
# - attribute: department
|
||||||
# value: "sales"
|
# value: "sales"
|
||||||
|
|
||||||
|
# If the metadata XML contains multiple IdP entities then the `idp_entityid`
|
||||||
|
# option must be set to the entity to redirect users to.
|
||||||
|
#
|
||||||
|
# Most deployments only have a single IdP entity and so should omit this
|
||||||
|
# option.
|
||||||
|
#
|
||||||
|
#idp_entityid: 'https://our_idp/entityid'
|
||||||
|
|
||||||
# OpenID Connect integration. The following settings can be used to make Synapse
|
|
||||||
# use an OpenID Connect Provider for authentication, instead of its internal
|
# List of OpenID Connect (OIDC) / OAuth 2.0 identity providers, for registration
|
||||||
# password database.
|
# and login.
|
||||||
#
|
#
|
||||||
# See https://github.com/matrix-org/synapse/blob/master/docs/openid.md.
|
# Options for each entry include:
|
||||||
#
|
#
|
||||||
oidc_config:
|
# idp_id: a unique identifier for this identity provider. Used internally
|
||||||
# Uncomment the following to enable authorization against an OpenID Connect
|
# by Synapse; should be a single word such as 'github'.
|
||||||
# server. Defaults to false.
|
#
|
||||||
|
# Note that, if this is changed, users authenticating via that provider
|
||||||
|
# will no longer be recognised as the same user!
|
||||||
|
#
|
||||||
|
# idp_name: A user-facing name for this identity provider, which is used to
|
||||||
|
# offer the user a choice of login mechanisms.
|
||||||
|
#
|
||||||
|
# idp_icon: An optional icon for this identity provider, which is presented
|
||||||
|
# by identity picker pages. If given, must be an MXC URI of the format
|
||||||
|
# mxc://<server-name>/<media-id>. (An easy way to obtain such an MXC URI
|
||||||
|
# is to upload an image to an (unencrypted) room and then copy the "url"
|
||||||
|
# from the source of the event.)
|
||||||
|
#
|
||||||
|
# discover: set to 'false' to disable the use of the OIDC discovery mechanism
|
||||||
|
# to discover endpoints. Defaults to true.
|
||||||
|
#
|
||||||
|
# issuer: Required. The OIDC issuer. Used to validate tokens and (if discovery
|
||||||
|
# is enabled) to discover the provider's endpoints.
|
||||||
|
#
|
||||||
|
# client_id: Required. oauth2 client id to use.
|
||||||
|
#
|
||||||
|
# client_secret: Required. oauth2 client secret to use.
|
||||||
|
#
|
||||||
|
# client_auth_method: auth method to use when exchanging the token. Valid
|
||||||
|
# values are 'client_secret_basic' (default), 'client_secret_post' and
|
||||||
|
# 'none'.
|
||||||
|
#
|
||||||
|
# scopes: list of scopes to request. This should normally include the "openid"
|
||||||
|
# scope. Defaults to ["openid"].
|
||||||
|
#
|
||||||
|
# authorization_endpoint: the oauth2 authorization endpoint. Required if
|
||||||
|
# provider discovery is disabled.
|
||||||
|
#
|
||||||
|
# token_endpoint: the oauth2 token endpoint. Required if provider discovery is
|
||||||
|
# disabled.
|
||||||
|
#
|
||||||
|
# userinfo_endpoint: the OIDC userinfo endpoint. Required if discovery is
|
||||||
|
# disabled and the 'openid' scope is not requested.
|
||||||
|
#
|
||||||
|
# jwks_uri: URI where to fetch the JWKS. Required if discovery is disabled and
|
||||||
|
# the 'openid' scope is used.
|
||||||
|
#
|
||||||
|
# skip_verification: set to 'true' to skip metadata verification. Use this if
|
||||||
|
# you are connecting to a provider that is not OpenID Connect compliant.
|
||||||
|
# Defaults to false. Avoid this in production.
|
||||||
|
#
|
||||||
|
# user_profile_method: Whether to fetch the user profile from the userinfo
|
||||||
|
# endpoint. Valid values are: 'auto' or 'userinfo_endpoint'.
|
||||||
|
#
|
||||||
|
# Defaults to 'auto', which fetches the userinfo endpoint if 'openid' is
|
||||||
|
# included in 'scopes'. Set to 'userinfo_endpoint' to always fetch the
|
||||||
|
# userinfo endpoint.
|
||||||
|
#
|
||||||
|
# allow_existing_users: set to 'true' to allow a user logging in via OIDC to
|
||||||
|
# match a pre-existing account instead of failing. This could be used if
|
||||||
|
# switching from password logins to OIDC. Defaults to false.
|
||||||
|
#
|
||||||
|
# user_mapping_provider: Configuration for how attributes returned from a OIDC
|
||||||
|
# provider are mapped onto a matrix user. This setting has the following
|
||||||
|
# sub-properties:
|
||||||
|
#
|
||||||
|
# module: The class name of a custom mapping module. Default is
|
||||||
|
# 'synapse.handlers.oidc_handler.JinjaOidcMappingProvider'.
|
||||||
|
# See https://github.com/matrix-org/synapse/blob/master/docs/sso_mapping_providers.md#openid-mapping-providers
|
||||||
|
# for information on implementing a custom mapping provider.
|
||||||
|
#
|
||||||
|
# config: Configuration for the mapping provider module. This section will
|
||||||
|
# be passed as a Python dictionary to the user mapping provider
|
||||||
|
# module's `parse_config` method.
|
||||||
|
#
|
||||||
|
# For the default provider, the following settings are available:
|
||||||
|
#
|
||||||
|
# sub: name of the claim containing a unique identifier for the
|
||||||
|
# user. Defaults to 'sub', which OpenID Connect compliant
|
||||||
|
# providers should provide.
|
||||||
|
#
|
||||||
|
# localpart_template: Jinja2 template for the localpart of the MXID.
|
||||||
|
# If this is not set, the user will be prompted to choose their
|
||||||
|
# own username.
|
||||||
|
#
|
||||||
|
# display_name_template: Jinja2 template for the display name to set
|
||||||
|
# on first login. If unset, no displayname will be set.
|
||||||
|
#
|
||||||
|
# extra_attributes: a map of Jinja2 templates for extra attributes
|
||||||
|
# to send back to the client during login.
|
||||||
|
# Note that these are non-standard and clients will ignore them
|
||||||
|
# without modifications.
|
||||||
|
#
|
||||||
|
# When rendering, the Jinja2 templates are given a 'user' variable,
|
||||||
|
# which is set to the claims returned by the UserInfo Endpoint and/or
|
||||||
|
# in the ID Token.
|
||||||
|
#
|
||||||
|
# See https://github.com/matrix-org/synapse/blob/master/docs/openid.md
|
||||||
|
# for information on how to configure these options.
|
||||||
|
#
|
||||||
|
# For backwards compatibility, it is also possible to configure a single OIDC
|
||||||
|
# provider via an 'oidc_config' setting. This is now deprecated and admins are
|
||||||
|
# advised to migrate to the 'oidc_providers' format. (When doing that migration,
|
||||||
|
# use 'oidc' for the idp_id to ensure that existing users continue to be
|
||||||
|
# recognised.)
|
||||||
|
#
|
||||||
|
oidc_providers:
|
||||||
|
# Generic example
|
||||||
|
#
|
||||||
|
#- idp_id: my_idp
|
||||||
|
# idp_name: "My OpenID provider"
|
||||||
|
# idp_icon: "mxc://example.com/mediaid"
|
||||||
|
# discover: false
|
||||||
|
# issuer: "https://accounts.example.com/"
|
||||||
|
# client_id: "provided-by-your-issuer"
|
||||||
|
# client_secret: "provided-by-your-issuer"
|
||||||
|
# client_auth_method: client_secret_post
|
||||||
|
# scopes: ["openid", "profile"]
|
||||||
|
# authorization_endpoint: "https://accounts.example.com/oauth2/auth"
|
||||||
|
# token_endpoint: "https://accounts.example.com/oauth2/token"
|
||||||
|
# userinfo_endpoint: "https://accounts.example.com/userinfo"
|
||||||
|
# jwks_uri: "https://accounts.example.com/.well-known/jwks.json"
|
||||||
|
# skip_verification: true
|
||||||
|
|
||||||
|
# For use with Keycloak
|
||||||
|
#
|
||||||
|
#- idp_id: keycloak
|
||||||
|
# idp_name: Keycloak
|
||||||
|
# issuer: "https://127.0.0.1:8443/auth/realms/my_realm_name"
|
||||||
|
# client_id: "synapse"
|
||||||
|
# client_secret: "copy secret generated in Keycloak UI"
|
||||||
|
# scopes: ["openid", "profile"]
|
||||||
|
|
||||||
|
# For use with Github
|
||||||
|
#
|
||||||
|
#- idp_id: github
|
||||||
|
# idp_name: Github
|
||||||
|
# discover: false
|
||||||
|
# issuer: "https://github.com/"
|
||||||
|
# client_id: "your-client-id" # TO BE FILLED
|
||||||
|
# client_secret: "your-client-secret" # TO BE FILLED
|
||||||
|
# authorization_endpoint: "https://github.com/login/oauth/authorize"
|
||||||
|
# token_endpoint: "https://github.com/login/oauth/access_token"
|
||||||
|
# userinfo_endpoint: "https://api.github.com/user"
|
||||||
|
# scopes: ["read:user"]
|
||||||
|
# user_mapping_provider:
|
||||||
|
# config:
|
||||||
|
# subject_claim: "id"
|
||||||
|
# localpart_template: "{ user.login }"
|
||||||
|
# display_name_template: "{ user.name }"
|
||||||
|
|
||||||
|
|
||||||
|
# Enable Central Authentication Service (CAS) for registration and login.
|
||||||
|
#
|
||||||
|
cas_config:
|
||||||
|
# Uncomment the following to enable authorization against a CAS server.
|
||||||
|
# Defaults to false.
|
||||||
#
|
#
|
||||||
#enabled: true
|
#enabled: true
|
||||||
|
|
||||||
# Uncomment the following to disable use of the OIDC discovery mechanism to
|
# The URL of the CAS authorization endpoint.
|
||||||
# discover endpoints. Defaults to true.
|
|
||||||
#
|
#
|
||||||
#discover: false
|
#server_url: "https://cas-server.com"
|
||||||
|
|
||||||
# the OIDC issuer. Used to validate tokens and (if discovery is enabled) to
|
# The public URL of the homeserver.
|
||||||
# discover the provider's endpoints.
|
|
||||||
#
|
#
|
||||||
# Required if 'enabled' is true.
|
#service_url: "https://homeserver.domain.com:8448"
|
||||||
|
|
||||||
|
# The attribute of the CAS response to use as the display name.
|
||||||
#
|
#
|
||||||
#issuer: "https://accounts.example.com/"
|
# If unset, no displayname will be set.
|
||||||
|
|
||||||
# oauth2 client id to use.
|
|
||||||
#
|
#
|
||||||
# Required if 'enabled' is true.
|
#displayname_attribute: name
|
||||||
|
|
||||||
|
# It is possible to configure Synapse to only allow logins if CAS attributes
|
||||||
|
# match particular values. All of the keys in the mapping below must exist
|
||||||
|
# and the values must match the given value. Alternately if the given value
|
||||||
|
# is None then any value is allowed (the attribute just must exist).
|
||||||
|
# All of the listed attributes must match for the login to be permitted.
|
||||||
#
|
#
|
||||||
#client_id: "provided-by-your-issuer"
|
#required_attributes:
|
||||||
|
# userGroup: "staff"
|
||||||
# oauth2 client secret to use.
|
# department: None
|
||||||
#
|
|
||||||
# Required if 'enabled' is true.
|
|
||||||
#
|
|
||||||
#client_secret: "provided-by-your-issuer"
|
|
||||||
|
|
||||||
# auth method to use when exchanging the token.
|
|
||||||
# Valid values are 'client_secret_basic' (default), 'client_secret_post' and
|
|
||||||
# 'none'.
|
|
||||||
#
|
|
||||||
#client_auth_method: client_secret_post
|
|
||||||
|
|
||||||
# list of scopes to request. This should normally include the "openid" scope.
|
|
||||||
# Defaults to ["openid"].
|
|
||||||
#
|
|
||||||
#scopes: ["openid", "profile"]
|
|
||||||
|
|
||||||
# the oauth2 authorization endpoint. Required if provider discovery is disabled.
|
|
||||||
#
|
|
||||||
#authorization_endpoint: "https://accounts.example.com/oauth2/auth"
|
|
||||||
|
|
||||||
# the oauth2 token endpoint. Required if provider discovery is disabled.
|
|
||||||
#
|
|
||||||
#token_endpoint: "https://accounts.example.com/oauth2/token"
|
|
||||||
|
|
||||||
# the OIDC userinfo endpoint. Required if discovery is disabled and the
|
|
||||||
# "openid" scope is not requested.
|
|
||||||
#
|
|
||||||
#userinfo_endpoint: "https://accounts.example.com/userinfo"
|
|
||||||
|
|
||||||
# URI where to fetch the JWKS. Required if discovery is disabled and the
|
|
||||||
# "openid" scope is used.
|
|
||||||
#
|
|
||||||
#jwks_uri: "https://accounts.example.com/.well-known/jwks.json"
|
|
||||||
|
|
||||||
# Uncomment to skip metadata verification. Defaults to false.
|
|
||||||
#
|
|
||||||
# Use this if you are connecting to a provider that is not OpenID Connect
|
|
||||||
# compliant.
|
|
||||||
# Avoid this in production.
|
|
||||||
#
|
|
||||||
#skip_verification: true
|
|
||||||
|
|
||||||
# Uncomment to allow a user logging in via OIDC to match a pre-existing account instead
|
|
||||||
# of failing. This could be used if switching from password logins to OIDC. Defaults to false.
|
|
||||||
#
|
|
||||||
#allow_existing_users: true
|
|
||||||
|
|
||||||
# An external module can be provided here as a custom solution to mapping
|
|
||||||
# attributes returned from a OIDC provider onto a matrix user.
|
|
||||||
#
|
|
||||||
user_mapping_provider:
|
|
||||||
# The custom module's class. Uncomment to use a custom module.
|
|
||||||
# Default is 'synapse.handlers.oidc_handler.JinjaOidcMappingProvider'.
|
|
||||||
#
|
|
||||||
# See https://github.com/matrix-org/synapse/blob/master/docs/sso_mapping_providers.md#openid-mapping-providers
|
|
||||||
# for information on implementing a custom mapping provider.
|
|
||||||
#
|
|
||||||
#module: mapping_provider.OidcMappingProvider
|
|
||||||
|
|
||||||
# Custom configuration values for the module. This section will be passed as
|
|
||||||
# a Python dictionary to the user mapping provider module's `parse_config`
|
|
||||||
# method.
|
|
||||||
#
|
|
||||||
# The examples below are intended for the default provider: they should be
|
|
||||||
# changed if using a custom provider.
|
|
||||||
#
|
|
||||||
config:
|
|
||||||
# name of the claim containing a unique identifier for the user.
|
|
||||||
# Defaults to `sub`, which OpenID Connect compliant providers should provide.
|
|
||||||
#
|
|
||||||
#subject_claim: "sub"
|
|
||||||
|
|
||||||
# Jinja2 template for the localpart of the MXID.
|
|
||||||
#
|
|
||||||
# When rendering, this template is given the following variables:
|
|
||||||
# * user: The claims returned by the UserInfo Endpoint and/or in the ID
|
|
||||||
# Token
|
|
||||||
#
|
|
||||||
# This must be configured if using the default mapping provider.
|
|
||||||
#
|
|
||||||
localpart_template: "{{ user.preferred_username }}"
|
|
||||||
|
|
||||||
# Jinja2 template for the display name to set on first login.
|
|
||||||
#
|
|
||||||
# If unset, no displayname will be set.
|
|
||||||
#
|
|
||||||
#display_name_template: "{{ user.given_name }} {{ user.last_name }}"
|
|
||||||
|
|
||||||
# Jinja2 templates for extra attributes to send back to the client during
|
|
||||||
# login.
|
|
||||||
#
|
|
||||||
# Note that these are non-standard and clients will ignore them without modifications.
|
|
||||||
#
|
|
||||||
#extra_attributes:
|
|
||||||
#birthdate: "{{ user.birthdate }}"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Enable CAS for registration and login.
|
|
||||||
#
|
|
||||||
#cas_config:
|
|
||||||
# enabled: true
|
|
||||||
# server_url: "https://cas-server.com"
|
|
||||||
# service_url: "https://homeserver.domain.com:8448"
|
|
||||||
# #displayname_attribute: name
|
|
||||||
# #required_attributes:
|
|
||||||
# # name: value
|
|
||||||
|
|
||||||
|
|
||||||
# Additional settings to use with single-sign on systems such as OpenID Connect,
|
# Additional settings to use with single-sign on systems such as OpenID Connect,
|
||||||
@@ -1795,9 +1913,9 @@ sso:
|
|||||||
# phishing attacks from evil.site. To avoid this, include a slash after the
|
# phishing attacks from evil.site. To avoid this, include a slash after the
|
||||||
# hostname: "https://my.client/".
|
# hostname: "https://my.client/".
|
||||||
#
|
#
|
||||||
# If public_baseurl is set, then the login fallback page (used by clients
|
# The login fallback page (used by clients that don't natively support the
|
||||||
# that don't natively support the required login flows) is whitelisted in
|
# required login flows) is automatically whitelisted in addition to any URLs
|
||||||
# addition to any URLs in this list.
|
# in this list.
|
||||||
#
|
#
|
||||||
# By default, this list is empty.
|
# By default, this list is empty.
|
||||||
#
|
#
|
||||||
@@ -1806,14 +1924,36 @@ sso:
|
|||||||
# - https://my.custom.client/
|
# - https://my.custom.client/
|
||||||
|
|
||||||
# Directory in which Synapse will try to find the template files below.
|
# Directory in which Synapse will try to find the template files below.
|
||||||
# If not set, default templates from within the Synapse package will be used.
|
# If not set, or the files named below are not found within the template
|
||||||
#
|
# directory, default templates from within the Synapse package will be used.
|
||||||
# DO NOT UNCOMMENT THIS SETTING unless you want to customise the templates.
|
|
||||||
# If you *do* uncomment it, you will need to make sure that all the templates
|
|
||||||
# below are in the directory.
|
|
||||||
#
|
#
|
||||||
# Synapse will look for the following templates in this directory:
|
# Synapse will look for the following templates in this directory:
|
||||||
#
|
#
|
||||||
|
# * HTML page to prompt the user to choose an Identity Provider during
|
||||||
|
# login: 'sso_login_idp_picker.html'.
|
||||||
|
#
|
||||||
|
# This is only used if multiple SSO Identity Providers are configured.
|
||||||
|
#
|
||||||
|
# When rendering, this template is given the following variables:
|
||||||
|
# * redirect_url: the URL that the user will be redirected to after
|
||||||
|
# login. Needs manual escaping (see
|
||||||
|
# https://jinja.palletsprojects.com/en/2.11.x/templates/#html-escaping).
|
||||||
|
#
|
||||||
|
# * server_name: the homeserver's name.
|
||||||
|
#
|
||||||
|
# * providers: a list of available Identity Providers. Each element is
|
||||||
|
# an object with the following attributes:
|
||||||
|
# * idp_id: unique identifier for the IdP
|
||||||
|
# * idp_name: user-facing name for the IdP
|
||||||
|
#
|
||||||
|
# The rendered HTML page should contain a form which submits its results
|
||||||
|
# back as a GET request, with the following query parameters:
|
||||||
|
#
|
||||||
|
# * redirectUrl: the client redirect URI (ie, the `redirect_url` passed
|
||||||
|
# to the template)
|
||||||
|
#
|
||||||
|
# * idp: the 'idp_id' of the chosen IDP.
|
||||||
|
#
|
||||||
# * HTML page for a confirmation step before redirecting back to the client
|
# * HTML page for a confirmation step before redirecting back to the client
|
||||||
# with the login token: 'sso_redirect_confirm.html'.
|
# with the login token: 'sso_redirect_confirm.html'.
|
||||||
#
|
#
|
||||||
@@ -1849,6 +1989,14 @@ sso:
|
|||||||
#
|
#
|
||||||
# This template has no additional variables.
|
# This template has no additional variables.
|
||||||
#
|
#
|
||||||
|
# * HTML page shown after a user-interactive authentication session which
|
||||||
|
# does not map correctly onto the expected user: 'sso_auth_bad_user.html'.
|
||||||
|
#
|
||||||
|
# When rendering, this template is given the following variables:
|
||||||
|
# * server_name: the homeserver's name.
|
||||||
|
# * user_id_to_verify: the MXID of the user that we are trying to
|
||||||
|
# validate.
|
||||||
|
#
|
||||||
# * HTML page shown during single sign-on if a deactivated user (according to Synapse's database)
|
# * HTML page shown during single sign-on if a deactivated user (according to Synapse's database)
|
||||||
# attempts to login: 'sso_account_deactivated.html'.
|
# attempts to login: 'sso_account_deactivated.html'.
|
||||||
#
|
#
|
||||||
@@ -1878,7 +2026,7 @@ sso:
|
|||||||
# and issued at ("iat") claims are validated if present.
|
# and issued at ("iat") claims are validated if present.
|
||||||
#
|
#
|
||||||
# Note that this is a non-standard login type and client support is
|
# Note that this is a non-standard login type and client support is
|
||||||
# expected to be non-existant.
|
# expected to be non-existent.
|
||||||
#
|
#
|
||||||
# See https://github.com/matrix-org/synapse/blob/master/docs/jwt.md.
|
# See https://github.com/matrix-org/synapse/blob/master/docs/jwt.md.
|
||||||
#
|
#
|
||||||
@@ -1974,6 +2122,21 @@ password_config:
|
|||||||
#
|
#
|
||||||
#require_uppercase: true
|
#require_uppercase: true
|
||||||
|
|
||||||
|
ui_auth:
|
||||||
|
# The number of milliseconds to allow a user-interactive authentication
|
||||||
|
# session to be active.
|
||||||
|
#
|
||||||
|
# This defaults to 0, meaning the user is queried for their credentials
|
||||||
|
# before every action, but this can be overridden to alow a single
|
||||||
|
# validation to be re-used. This weakens the protections afforded by
|
||||||
|
# the user-interactive authentication process, by allowing for multiple
|
||||||
|
# (and potentially different) operations to use the same validation session.
|
||||||
|
#
|
||||||
|
# Uncomment below to allow for credential validation to last for 15
|
||||||
|
# seconds.
|
||||||
|
#
|
||||||
|
#session_timeout: 15000
|
||||||
|
|
||||||
|
|
||||||
# Configuration for sending emails from Synapse.
|
# Configuration for sending emails from Synapse.
|
||||||
#
|
#
|
||||||
@@ -2039,10 +2202,15 @@ email:
|
|||||||
#
|
#
|
||||||
#validation_token_lifetime: 15m
|
#validation_token_lifetime: 15m
|
||||||
|
|
||||||
# Directory in which Synapse will try to find the template files below.
|
# The web client location to direct users to during an invite. This is passed
|
||||||
# If not set, default templates from within the Synapse package will be used.
|
# to the identity server as the org.matrix.web_client_location key. Defaults
|
||||||
|
# to unset, giving no guidance to the identity server.
|
||||||
#
|
#
|
||||||
# Do not uncomment this setting unless you want to customise the templates.
|
#invite_client_location: https://app.element.io
|
||||||
|
|
||||||
|
# Directory in which Synapse will try to find the template files below.
|
||||||
|
# If not set, or the files named below are not found within the template
|
||||||
|
# directory, default templates from within the Synapse package will be used.
|
||||||
#
|
#
|
||||||
# Synapse will look for the following templates in this directory:
|
# Synapse will look for the following templates in this directory:
|
||||||
#
|
#
|
||||||
@@ -2180,20 +2348,35 @@ password_providers:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Clients requesting push notifications can either have the body of
|
## Push ##
|
||||||
# the message sent in the notification poke along with other details
|
|
||||||
# like the sender, or just the event ID and room ID (`event_id_only`).
|
push:
|
||||||
# If clients choose the former, this option controls whether the
|
# Clients requesting push notifications can either have the body of
|
||||||
# notification request includes the content of the event (other details
|
# the message sent in the notification poke along with other details
|
||||||
# like the sender are still included). For `event_id_only` push, it
|
# like the sender, or just the event ID and room ID (`event_id_only`).
|
||||||
# has no effect.
|
# If clients choose the former, this option controls whether the
|
||||||
#
|
# notification request includes the content of the event (other details
|
||||||
# For modern android devices the notification content will still appear
|
# like the sender are still included). For `event_id_only` push, it
|
||||||
# because it is loaded by the app. iPhone, however will send a
|
# has no effect.
|
||||||
# notification saying only that a message arrived and who it came from.
|
#
|
||||||
#
|
# For modern android devices the notification content will still appear
|
||||||
#push:
|
# because it is loaded by the app. iPhone, however will send a
|
||||||
# include_content: true
|
# notification saying only that a message arrived and who it came from.
|
||||||
|
#
|
||||||
|
# The default value is "true" to include message details. Uncomment to only
|
||||||
|
# include the event ID and room ID in push notification payloads.
|
||||||
|
#
|
||||||
|
#include_content: false
|
||||||
|
|
||||||
|
# When a push notification is received, an unread count is also sent.
|
||||||
|
# This number can either be calculated as the number of unread messages
|
||||||
|
# for the user, or the number of *rooms* the user has unread messages in.
|
||||||
|
#
|
||||||
|
# The default value is "true", meaning push clients will see the number of
|
||||||
|
# rooms with unread messages in them. Uncomment to instead send the number
|
||||||
|
# of unread messages.
|
||||||
|
#
|
||||||
|
#group_unread_count_by_room: false
|
||||||
|
|
||||||
|
|
||||||
# Spam checkers are third-party modules that can block specific actions
|
# Spam checkers are third-party modules that can block specific actions
|
||||||
@@ -2236,7 +2419,7 @@ spam_checker:
|
|||||||
# If enabled, non server admins can only create groups with local parts
|
# If enabled, non server admins can only create groups with local parts
|
||||||
# starting with this prefix
|
# starting with this prefix
|
||||||
#
|
#
|
||||||
#group_creation_prefix: "unofficial/"
|
#group_creation_prefix: "unofficial_"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2394,7 +2577,7 @@ spam_checker:
|
|||||||
#
|
#
|
||||||
# Options for the rules include:
|
# Options for the rules include:
|
||||||
#
|
#
|
||||||
# user_id: Matches agaisnt the creator of the alias
|
# user_id: Matches against the creator of the alias
|
||||||
# room_id: Matches against the room ID being published
|
# room_id: Matches against the room ID being published
|
||||||
# alias: Matches against any current local or canonical aliases
|
# alias: Matches against any current local or canonical aliases
|
||||||
# associated with the room
|
# associated with the room
|
||||||
@@ -2440,7 +2623,7 @@ opentracing:
|
|||||||
# This is a list of regexes which are matched against the server_name of the
|
# This is a list of regexes which are matched against the server_name of the
|
||||||
# homeserver.
|
# homeserver.
|
||||||
#
|
#
|
||||||
# By defult, it is empty, so no servers are matched.
|
# By default, it is empty, so no servers are matched.
|
||||||
#
|
#
|
||||||
#homeserver_whitelist:
|
#homeserver_whitelist:
|
||||||
# - ".*"
|
# - ".*"
|
||||||
@@ -2496,6 +2679,18 @@ opentracing:
|
|||||||
# events: worker1
|
# events: worker1
|
||||||
# typing: worker1
|
# typing: worker1
|
||||||
|
|
||||||
|
# The worker that is used to run background tasks (e.g. cleaning up expired
|
||||||
|
# data). If not provided this defaults to the main process.
|
||||||
|
#
|
||||||
|
#run_background_tasks_on: worker1
|
||||||
|
|
||||||
|
# A shared secret used by the replication APIs to authenticate HTTP requests
|
||||||
|
# from workers.
|
||||||
|
#
|
||||||
|
# By default this is unused and traffic is not authenticated.
|
||||||
|
#
|
||||||
|
#worker_replication_secret: ""
|
||||||
|
|
||||||
|
|
||||||
# Configuration for Redis when using workers. This *must* be enabled when
|
# Configuration for Redis when using workers. This *must* be enabled when
|
||||||
# using workers (unless using old style direct TCP configuration).
|
# using workers (unless using old style direct TCP configuration).
|
||||||
|
|||||||
@@ -3,7 +3,11 @@
|
|||||||
# This is a YAML file containing a standard Python logging configuration
|
# This is a YAML file containing a standard Python logging configuration
|
||||||
# dictionary. See [1] for details on the valid settings.
|
# dictionary. See [1] for details on the valid settings.
|
||||||
#
|
#
|
||||||
|
# Synapse also supports structured logging for machine readable logs which can
|
||||||
|
# be ingested by ELK stacks. See [2] for details.
|
||||||
|
#
|
||||||
# [1]: https://docs.python.org/3.7/library/logging.config.html#configuration-dictionary-schema
|
# [1]: https://docs.python.org/3.7/library/logging.config.html#configuration-dictionary-schema
|
||||||
|
# [2]: https://github.com/matrix-org/synapse/blob/master/docs/structured_logging.md
|
||||||
|
|
||||||
version: 1
|
version: 1
|
||||||
|
|
||||||
@@ -59,7 +63,7 @@ root:
|
|||||||
# then write them to a file.
|
# then write them to a file.
|
||||||
#
|
#
|
||||||
# Replace "buffer" with "console" to log to stderr instead. (Note that you'll
|
# Replace "buffer" with "console" to log to stderr instead. (Note that you'll
|
||||||
# also need to update the configuation for the `twisted` logger above, in
|
# also need to update the configuration for the `twisted` logger above, in
|
||||||
# this case.)
|
# this case.)
|
||||||
#
|
#
|
||||||
handlers: [buffer]
|
handlers: [buffer]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ able to be imported by the running Synapse.
|
|||||||
The Python class is instantiated with two objects:
|
The Python class is instantiated with two objects:
|
||||||
|
|
||||||
* Any configuration (see below).
|
* Any configuration (see below).
|
||||||
* An instance of `synapse.spam_checker_api.SpamCheckerApi`.
|
* An instance of `synapse.module_api.ModuleApi`.
|
||||||
|
|
||||||
It then implements methods which return a boolean to alter behavior in Synapse.
|
It then implements methods which return a boolean to alter behavior in Synapse.
|
||||||
|
|
||||||
@@ -22,41 +22,45 @@ well as some specific methods:
|
|||||||
* `user_may_create_room`
|
* `user_may_create_room`
|
||||||
* `user_may_create_room_alias`
|
* `user_may_create_room_alias`
|
||||||
* `user_may_publish_room`
|
* `user_may_publish_room`
|
||||||
|
* `check_username_for_spam`
|
||||||
|
* `check_registration_for_spam`
|
||||||
|
|
||||||
The details of the each of these methods (as well as their inputs and outputs)
|
The details of the each of these methods (as well as their inputs and outputs)
|
||||||
are documented in the `synapse.events.spamcheck.SpamChecker` class.
|
are documented in the `synapse.events.spamcheck.SpamChecker` class.
|
||||||
|
|
||||||
The `SpamCheckerApi` class provides a way for the custom spam checker class to
|
The `ModuleApi` class provides a way for the custom spam checker class to
|
||||||
call back into the homeserver internals. It currently implements the following
|
call back into the homeserver internals.
|
||||||
methods:
|
|
||||||
|
|
||||||
* `get_state_events_in_room`
|
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
from synapse.spam_checker_api import RegistrationBehaviour
|
||||||
|
|
||||||
class ExampleSpamChecker:
|
class ExampleSpamChecker:
|
||||||
def __init__(self, config, api):
|
def __init__(self, config, api):
|
||||||
self.config = config
|
self.config = config
|
||||||
self.api = api
|
self.api = api
|
||||||
|
|
||||||
def check_event_for_spam(self, foo):
|
async def check_event_for_spam(self, foo):
|
||||||
return False # allow all events
|
return False # allow all events
|
||||||
|
|
||||||
def user_may_invite(self, inviter_userid, invitee_userid, room_id):
|
async def user_may_invite(self, inviter_userid, invitee_userid, room_id):
|
||||||
return True # allow all invites
|
return True # allow all invites
|
||||||
|
|
||||||
def user_may_create_room(self, userid):
|
async def user_may_create_room(self, userid):
|
||||||
return True # allow all room creations
|
return True # allow all room creations
|
||||||
|
|
||||||
def user_may_create_room_alias(self, userid, room_alias):
|
async def user_may_create_room_alias(self, userid, room_alias):
|
||||||
return True # allow all room aliases
|
return True # allow all room aliases
|
||||||
|
|
||||||
def user_may_publish_room(self, userid, room_id):
|
async def user_may_publish_room(self, userid, room_id):
|
||||||
return True # allow publishing of all rooms
|
return True # allow publishing of all rooms
|
||||||
|
|
||||||
def check_username_for_spam(self, user_profile):
|
async def check_username_for_spam(self, user_profile):
|
||||||
return False # allow all usernames
|
return False # allow all usernames
|
||||||
|
|
||||||
|
async def check_registration_for_spam(self, email_threepid, username, request_info):
|
||||||
|
return RegistrationBehaviour.ALLOW # allow all registrations
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
TODO: how (if at all) is this actually maintained?
|
|
||||||
@@ -1,271 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
#
|
|
||||||
# Synapse documentation build configuration file, created by
|
|
||||||
# sphinx-quickstart on Tue Jun 10 17:31:02 2014.
|
|
||||||
#
|
|
||||||
# This file is execfile()d with the current directory set to its
|
|
||||||
# containing dir.
|
|
||||||
#
|
|
||||||
# Note that not all possible configuration values are present in this
|
|
||||||
# autogenerated file.
|
|
||||||
#
|
|
||||||
# All configuration values have a default; values that are commented out
|
|
||||||
# serve to show the default.
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
|
||||||
# add these directories to sys.path here. If the directory is relative to the
|
|
||||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
||||||
sys.path.insert(0, os.path.abspath(".."))
|
|
||||||
|
|
||||||
# -- General configuration ------------------------------------------------
|
|
||||||
|
|
||||||
# If your documentation needs a minimal Sphinx version, state it here.
|
|
||||||
# needs_sphinx = '1.0'
|
|
||||||
|
|
||||||
# Add any Sphinx extension module names here, as strings. They can be
|
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
||||||
# ones.
|
|
||||||
extensions = [
|
|
||||||
"sphinx.ext.autodoc",
|
|
||||||
"sphinx.ext.intersphinx",
|
|
||||||
"sphinx.ext.coverage",
|
|
||||||
"sphinx.ext.ifconfig",
|
|
||||||
"sphinxcontrib.napoleon",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
|
||||||
templates_path = ["_templates"]
|
|
||||||
|
|
||||||
# The suffix of source filenames.
|
|
||||||
source_suffix = ".rst"
|
|
||||||
|
|
||||||
# The encoding of source files.
|
|
||||||
# source_encoding = 'utf-8-sig'
|
|
||||||
|
|
||||||
# The master toctree document.
|
|
||||||
master_doc = "index"
|
|
||||||
|
|
||||||
# General information about the project.
|
|
||||||
project = "Synapse"
|
|
||||||
copyright = (
|
|
||||||
"Copyright 2014-2017 OpenMarket Ltd, 2017 Vector Creations Ltd, 2017 New Vector Ltd"
|
|
||||||
)
|
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
|
||||||
# |version| and |release|, also used in various other places throughout the
|
|
||||||
# built documents.
|
|
||||||
#
|
|
||||||
# The short X.Y version.
|
|
||||||
version = "1.0"
|
|
||||||
# The full version, including alpha/beta/rc tags.
|
|
||||||
release = "1.0"
|
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
||||||
# for a list of supported languages.
|
|
||||||
# language = None
|
|
||||||
|
|
||||||
# There are two options for replacing |today|: either, you set today to some
|
|
||||||
# non-false value, then it is used:
|
|
||||||
# today = ''
|
|
||||||
# Else, today_fmt is used as the format for a strftime call.
|
|
||||||
# today_fmt = '%B %d, %Y'
|
|
||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
|
||||||
# directories to ignore when looking for source files.
|
|
||||||
exclude_patterns = ["_build"]
|
|
||||||
|
|
||||||
# The reST default role (used for this markup: `text`) to use for all
|
|
||||||
# documents.
|
|
||||||
# default_role = None
|
|
||||||
|
|
||||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
|
||||||
# add_function_parentheses = True
|
|
||||||
|
|
||||||
# If true, the current module name will be prepended to all description
|
|
||||||
# unit titles (such as .. function::).
|
|
||||||
# add_module_names = True
|
|
||||||
|
|
||||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
|
||||||
# output. They are ignored by default.
|
|
||||||
# show_authors = False
|
|
||||||
|
|
||||||
# The name of the Pygments (syntax highlighting) style to use.
|
|
||||||
pygments_style = "sphinx"
|
|
||||||
|
|
||||||
# A list of ignored prefixes for module index sorting.
|
|
||||||
# modindex_common_prefix = []
|
|
||||||
|
|
||||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
|
||||||
# keep_warnings = False
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output ----------------------------------------------
|
|
||||||
|
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
||||||
# a list of builtin themes.
|
|
||||||
html_theme = "default"
|
|
||||||
|
|
||||||
# Theme options are theme-specific and customize the look and feel of a theme
|
|
||||||
# further. For a list of options available for each theme, see the
|
|
||||||
# documentation.
|
|
||||||
# html_theme_options = {}
|
|
||||||
|
|
||||||
# Add any paths that contain custom themes here, relative to this directory.
|
|
||||||
# html_theme_path = []
|
|
||||||
|
|
||||||
# The name for this set of Sphinx documents. If None, it defaults to
|
|
||||||
# "<project> v<release> documentation".
|
|
||||||
# html_title = None
|
|
||||||
|
|
||||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
|
||||||
# html_short_title = None
|
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top
|
|
||||||
# of the sidebar.
|
|
||||||
# html_logo = None
|
|
||||||
|
|
||||||
# The name of an image file (within the static path) to use as favicon of the
|
|
||||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
|
||||||
# pixels large.
|
|
||||||
# html_favicon = None
|
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
||||||
html_static_path = ["_static"]
|
|
||||||
|
|
||||||
# Add any extra paths that contain custom files (such as robots.txt or
|
|
||||||
# .htaccess) here, relative to this directory. These files are copied
|
|
||||||
# directly to the root of the documentation.
|
|
||||||
# html_extra_path = []
|
|
||||||
|
|
||||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
|
||||||
# using the given strftime format.
|
|
||||||
# html_last_updated_fmt = '%b %d, %Y'
|
|
||||||
|
|
||||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
|
||||||
# typographically correct entities.
|
|
||||||
# html_use_smartypants = True
|
|
||||||
|
|
||||||
# Custom sidebar templates, maps document names to template names.
|
|
||||||
# html_sidebars = {}
|
|
||||||
|
|
||||||
# Additional templates that should be rendered to pages, maps page names to
|
|
||||||
# template names.
|
|
||||||
# html_additional_pages = {}
|
|
||||||
|
|
||||||
# If false, no module index is generated.
|
|
||||||
# html_domain_indices = True
|
|
||||||
|
|
||||||
# If false, no index is generated.
|
|
||||||
# html_use_index = True
|
|
||||||
|
|
||||||
# If true, the index is split into individual pages for each letter.
|
|
||||||
# html_split_index = False
|
|
||||||
|
|
||||||
# If true, links to the reST sources are added to the pages.
|
|
||||||
# html_show_sourcelink = True
|
|
||||||
|
|
||||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
|
||||||
# html_show_sphinx = True
|
|
||||||
|
|
||||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
|
||||||
# html_show_copyright = True
|
|
||||||
|
|
||||||
# If true, an OpenSearch description file will be output, and all pages will
|
|
||||||
# contain a <link> tag referring to it. The value of this option must be the
|
|
||||||
# base URL from which the finished HTML is served.
|
|
||||||
# html_use_opensearch = ''
|
|
||||||
|
|
||||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
|
||||||
# html_file_suffix = None
|
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
|
||||||
htmlhelp_basename = "Synapsedoc"
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for LaTeX output ---------------------------------------------
|
|
||||||
|
|
||||||
latex_elements = {
|
|
||||||
# The paper size ('letterpaper' or 'a4paper').
|
|
||||||
#'papersize': 'letterpaper',
|
|
||||||
# The font size ('10pt', '11pt' or '12pt').
|
|
||||||
#'pointsize': '10pt',
|
|
||||||
# Additional stuff for the LaTeX preamble.
|
|
||||||
#'preamble': '',
|
|
||||||
}
|
|
||||||
|
|
||||||
# Grouping the document tree into LaTeX files. List of tuples
|
|
||||||
# (source start file, target name, title,
|
|
||||||
# author, documentclass [howto, manual, or own class]).
|
|
||||||
latex_documents = [("index", "Synapse.tex", "Synapse Documentation", "TNG", "manual")]
|
|
||||||
|
|
||||||
# The name of an image file (relative to this directory) to place at the top of
|
|
||||||
# the title page.
|
|
||||||
# latex_logo = None
|
|
||||||
|
|
||||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
|
||||||
# not chapters.
|
|
||||||
# latex_use_parts = False
|
|
||||||
|
|
||||||
# If true, show page references after internal links.
|
|
||||||
# latex_show_pagerefs = False
|
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
|
||||||
# latex_show_urls = False
|
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
|
||||||
# latex_appendices = []
|
|
||||||
|
|
||||||
# If false, no module index is generated.
|
|
||||||
# latex_domain_indices = True
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for manual page output ---------------------------------------
|
|
||||||
|
|
||||||
# One entry per manual page. List of tuples
|
|
||||||
# (source start file, name, description, authors, manual section).
|
|
||||||
man_pages = [("index", "synapse", "Synapse Documentation", ["TNG"], 1)]
|
|
||||||
|
|
||||||
# If true, show URL addresses after external links.
|
|
||||||
# man_show_urls = False
|
|
||||||
|
|
||||||
|
|
||||||
# -- Options for Texinfo output -------------------------------------------
|
|
||||||
|
|
||||||
# Grouping the document tree into Texinfo files. List of tuples
|
|
||||||
# (source start file, target name, title, author,
|
|
||||||
# dir menu entry, description, category)
|
|
||||||
texinfo_documents = [
|
|
||||||
(
|
|
||||||
"index",
|
|
||||||
"Synapse",
|
|
||||||
"Synapse Documentation",
|
|
||||||
"TNG",
|
|
||||||
"Synapse",
|
|
||||||
"One line description of project.",
|
|
||||||
"Miscellaneous",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
# Documents to append as an appendix to all manuals.
|
|
||||||
# texinfo_appendices = []
|
|
||||||
|
|
||||||
# If false, no module index is generated.
|
|
||||||
# texinfo_domain_indices = True
|
|
||||||
|
|
||||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
|
||||||
# texinfo_show_urls = 'footnote'
|
|
||||||
|
|
||||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
|
||||||
# texinfo_no_detailmenu = False
|
|
||||||
|
|
||||||
|
|
||||||
# Example configuration for intersphinx: refer to the Python standard library.
|
|
||||||
intersphinx_mapping = {"http://docs.python.org/": None}
|
|
||||||
|
|
||||||
napoleon_include_special_with_doc = True
|
|
||||||
napoleon_use_ivar = True
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
.. Synapse documentation master file, created by
|
|
||||||
sphinx-quickstart on Tue Jun 10 17:31:02 2014.
|
|
||||||
You can adapt this file completely to your liking, but it should at least
|
|
||||||
contain the root `toctree` directive.
|
|
||||||
|
|
||||||
Welcome to Synapse's documentation!
|
|
||||||
===================================
|
|
||||||
|
|
||||||
Contents:
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
synapse
|
|
||||||
|
|
||||||
Indices and tables
|
|
||||||
==================
|
|
||||||
|
|
||||||
* :ref:`genindex`
|
|
||||||
* :ref:`modindex`
|
|
||||||
* :ref:`search`
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse
|
|
||||||
=======
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 4
|
|
||||||
|
|
||||||
synapse
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.auth module
|
|
||||||
=======================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.auth
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.constants module
|
|
||||||
============================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.constants
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.dbobjects module
|
|
||||||
============================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.dbobjects
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.errors module
|
|
||||||
=========================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.errors
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.event_stream module
|
|
||||||
===============================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.event_stream
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.events.factory module
|
|
||||||
=================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.events.factory
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.events.room module
|
|
||||||
==============================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.events.room
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
synapse.api.events package
|
|
||||||
==========================
|
|
||||||
|
|
||||||
Submodules
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
synapse.api.events.factory
|
|
||||||
synapse.api.events.room
|
|
||||||
|
|
||||||
Module contents
|
|
||||||
---------------
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.events
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.handlers.events module
|
|
||||||
==================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.handlers.events
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.handlers.factory module
|
|
||||||
===================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.handlers.factory
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.handlers.federation module
|
|
||||||
======================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.handlers.federation
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.handlers.register module
|
|
||||||
====================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.handlers.register
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.handlers.room module
|
|
||||||
================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.handlers.room
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
synapse.api.handlers package
|
|
||||||
============================
|
|
||||||
|
|
||||||
Submodules
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
synapse.api.handlers.events
|
|
||||||
synapse.api.handlers.factory
|
|
||||||
synapse.api.handlers.federation
|
|
||||||
synapse.api.handlers.register
|
|
||||||
synapse.api.handlers.room
|
|
||||||
|
|
||||||
Module contents
|
|
||||||
---------------
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.handlers
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.notifier module
|
|
||||||
===========================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.notifier
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.register_events module
|
|
||||||
==================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.register_events
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.room_events module
|
|
||||||
==============================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.room_events
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
synapse.api package
|
|
||||||
===================
|
|
||||||
|
|
||||||
Subpackages
|
|
||||||
-----------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
synapse.api.events
|
|
||||||
synapse.api.handlers
|
|
||||||
synapse.api.streams
|
|
||||||
|
|
||||||
Submodules
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
synapse.api.auth
|
|
||||||
synapse.api.constants
|
|
||||||
synapse.api.errors
|
|
||||||
synapse.api.notifier
|
|
||||||
synapse.api.storage
|
|
||||||
|
|
||||||
Module contents
|
|
||||||
---------------
|
|
||||||
|
|
||||||
.. automodule:: synapse.api
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.server module
|
|
||||||
=========================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.server
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.storage module
|
|
||||||
==========================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.storage
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.stream module
|
|
||||||
=========================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.stream
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.api.streams.event module
|
|
||||||
================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.streams.event
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
synapse.api.streams package
|
|
||||||
===========================
|
|
||||||
|
|
||||||
Submodules
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
synapse.api.streams.event
|
|
||||||
|
|
||||||
Module contents
|
|
||||||
---------------
|
|
||||||
|
|
||||||
.. automodule:: synapse.api.streams
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.app.homeserver module
|
|
||||||
=============================
|
|
||||||
|
|
||||||
.. automodule:: synapse.app.homeserver
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
synapse.app package
|
|
||||||
===================
|
|
||||||
|
|
||||||
Submodules
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
synapse.app.homeserver
|
|
||||||
|
|
||||||
Module contents
|
|
||||||
---------------
|
|
||||||
|
|
||||||
.. automodule:: synapse.app
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
synapse.db package
|
|
||||||
==================
|
|
||||||
|
|
||||||
Module contents
|
|
||||||
---------------
|
|
||||||
|
|
||||||
.. automodule:: synapse.db
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.federation.handler module
|
|
||||||
=================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.federation.handler
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.federation.messaging module
|
|
||||||
===================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.federation.messaging
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.federation.pdu_codec module
|
|
||||||
===================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.federation.pdu_codec
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.federation.persistence module
|
|
||||||
=====================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.federation.persistence
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
synapse.federation.replication module
|
|
||||||
=====================================
|
|
||||||
|
|
||||||
.. automodule:: synapse.federation.replication
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
synapse.federation package
|
|
||||||
==========================
|
|
||||||
|
|
||||||
Submodules
|
|
||||||
----------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
|
|
||||||
synapse.federation.handler
|
|
||||||
synapse.federation.pdu_codec
|
|
||||||
synapse.federation.persistence
|
|
||||||
synapse.federation.replication
|
|
||||||
synapse.federation.transport
|
|
||||||
synapse.federation.units
|
|
||||||
|
|
||||||
Module contents
|
|
||||||
---------------
|
|
||||||
|
|
||||||
.. automodule:: synapse.federation
|
|
||||||
:members:
|
|
||||||
:undoc-members:
|
|
||||||
:show-inheritance:
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user