Compare commits
253 Commits
a37a1f5c97
...
f183e3e1cb
Author | SHA1 | Date |
---|---|---|
josiah | f183e3e1cb | 3 years ago |
josiah | 205d7c15ab | 3 years ago |
Slavi Pantaleev | 39ea3496a4 | 3 years ago |
Slavi Pantaleev | c9d96d8135 | 3 years ago |
Slavi Pantaleev | 56c54d5cc7 | 3 years ago |
Slavi Pantaleev | c1008fde44 | 3 years ago |
Slavi Pantaleev | cf06f84608 | 3 years ago |
Slavi Pantaleev | ef64c88dc7 | 3 years ago |
Slavi Pantaleev | d95cbe38d7 | 3 years ago |
Slavi Pantaleev | 28d86e3aaa | 3 years ago |
Slavi Pantaleev | 6f51c1ed96 | 3 years ago |
Slavi Pantaleev | 8549926395 | 3 years ago |
Slavi Pantaleev | 1692a28fe4 | 3 years ago |
Slavi Pantaleev | 26f0bbfdef | 3 years ago |
Slavi Pantaleev | 9e936e45ad | 3 years ago |
Slavi Pantaleev | e1690722f7 | 3 years ago |
Slavi Pantaleev | 05ca9357a8 | 3 years ago |
Slavi Pantaleev | 653d1d7924 | 3 years ago |
Slavi Pantaleev | 6f5aaad48d | 3 years ago |
Slavi Pantaleev | 57ea43d8b0 | 3 years ago |
Slavi Pantaleev | 7a90eb6d4f | 3 years ago |
Slavi Pantaleev | 67dc5237c5 | 3 years ago |
Slavi Pantaleev | 862a6276a0 | 3 years ago |
Slavi Pantaleev | b15da29ebb | 3 years ago |
Panagiotis Georgiadis | a66a604e53 | 3 years ago |
Slavi Pantaleev | 48b6487d41 | 3 years ago |
Slavi Pantaleev | 2a25b63bb6 | 3 years ago |
Slavi Pantaleev | 88acc98c23 | 3 years ago |
Slavi Pantaleev | 789f9b4606 | 3 years ago |
Slavi Pantaleev | a5a44a9d3f | 3 years ago |
Slavi Pantaleev | 52fa7e576b | 3 years ago |
Slavi Pantaleev | 5fa30cdfcb | 3 years ago |
Slavi Pantaleev | 105354a052 | 3 years ago |
Panagiotis Georgiadis | fd540d8592 | 3 years ago |
Slavi Pantaleev | 568cb3d86f | 3 years ago |
Slavi Pantaleev | 24100342e1 | 3 years ago |
Slavi Pantaleev | d5945c6e78 | 3 years ago |
Slavi Pantaleev | 21d3802ed7 | 3 years ago |
Slavi Pantaleev | 018f213c60 | 3 years ago |
Panagiotis Georgiadis | 999fd2596f | 3 years ago |
Slavi Pantaleev | 0b260a133f | 3 years ago |
Slavi Pantaleev | 0f9be8321c | 3 years ago |
Slavi Pantaleev | c6382f3c46 | 3 years ago |
Will | 5b0761bf40 | 3 years ago |
Will | 1468010194 | 3 years ago |
Slavi Pantaleev | 3943a747b8 | 3 years ago |
Slavi Pantaleev | 95ebff1ef1 | 3 years ago |
Slavi Pantaleev | f7ae050eaf | 3 years ago |
Slavi Pantaleev | 5822ba0c01 | 3 years ago |
Slavi Pantaleev | de6ecd8818 | 3 years ago |
Slavi Pantaleev | 4bc8193f69 | 3 years ago |
Agustin Ferrario | 5156c63a76 | 3 years ago |
Slavi Pantaleev | d7dba0a2ff | 3 years ago |
Agustin Ferrario | 25d423e6b6 | 3 years ago |
Agustin Ferrario | 7de51b7df3 | 3 years ago |
Slavi Pantaleev | 1dec01095a | 3 years ago |
teutat3s | a2f6adbeaf | 3 years ago |
Slavi Pantaleev | 0a977ce113 | 3 years ago |
Slavi Pantaleev | 24d73a554d | 3 years ago |
Agustin Ferrario | 3cb71e7e84 | 3 years ago |
Slavi Pantaleev | 6b1e25d843 | 3 years ago |
Slavi Pantaleev | bcb408497d | 3 years ago |
Slavi Pantaleev | 23f246b0ad | 3 years ago |
Slavi Pantaleev | 6cce5383bc | 3 years ago |
Slavi Pantaleev | 2c09111a3a | 3 years ago |
Slavi Pantaleev | 8710883064 | 3 years ago |
Slavi Pantaleev | 6e652e10ad | 3 years ago |
Slavi Pantaleev | cd2d2f594a | 3 years ago |
Slavi Pantaleev | 3b524ee815 | 3 years ago |
Slavi Pantaleev | 274f23f668 | 3 years ago |
Slavi Pantaleev | da2a6682b3 | 3 years ago |
Slavi Pantaleev | aac400664a | 3 years ago |
Slavi Pantaleev | df8d9cfd34 | 3 years ago |
Slavi Pantaleev | 4805637181 | 3 years ago |
Slavi Pantaleev | f84c69c164 | 3 years ago |
Slavi Pantaleev | b5812b539b | 3 years ago |
Slavi Pantaleev | fb83eccf99 | 3 years ago |
Sabine Laszakovits | 84cac25c11 | 3 years ago |
Sabine Laszakovits | 56af2b1a8c | 3 years ago |
Sabine Laszakovits | 89f7f3c3b8 | 3 years ago |
Sabine Laszakovits | ffb837d4bc | 3 years ago |
Sabine Laszakovits | a06c58c753 | 3 years ago |
Slavi Pantaleev | e39b9ab3fd | 3 years ago |
0hlov3 | f86d781244 | 3 years ago |
0hlov3 | 63c92fc2de | 3 years ago |
0hlov3 | a1ecaf54ef | 3 years ago |
Slavi Pantaleev | 1ed991e25c | 3 years ago |
Slavi Pantaleev | 86da489b9b | 3 years ago |
Aaron Raimist | 8827a49e21 | 3 years ago |
Aaron Raimist | 3dd0517f04 | 3 years ago |
Slavi Pantaleev | c0a62d6c17 | 3 years ago |
Slavi Pantaleev | d023355d2e | 3 years ago |
Slavi Pantaleev | 6403904f59 | 3 years ago |
laszabine | 19d030be16 | 3 years ago |
Slavi Pantaleev | 067f12b628 | 3 years ago |
David Gnedt | befffa926b | 3 years ago |
Slavi Pantaleev | a2a4218e95 | 3 years ago |
Slavi Pantaleev | 80c72615c7 | 3 years ago |
Slavi Pantaleev | 21662af3be | 3 years ago |
Slavi Pantaleev | a284b6f452 | 3 years ago |
Stuart Mumford | 019a4d7dcd | 3 years ago |
Slavi Pantaleev | be0c599565 | 3 years ago |
Slavi Pantaleev | ea804f2f9f | 3 years ago |
Slavi Pantaleev | 8b6174786b | 3 years ago |
Slavi Pantaleev | f3fc832e85 | 3 years ago |
Slavi Pantaleev | 9f00970c90 | 3 years ago |
Jan | 4675c8a715 | 3 years ago |
Slavi Pantaleev | c5f8b1f61b | 3 years ago |
Slavi Pantaleev | 4fe1248d95 | 3 years ago |
Slavi Pantaleev | 3475b98b76 | 3 years ago |
Slavi Pantaleev | f19b29846d | 3 years ago |
Slavi Pantaleev | ad1425eee4 | 3 years ago |
Slavi Pantaleev | 8675dedbdb | 3 years ago |
Slavi Pantaleev | 9b95e1937c | 3 years ago |
Slavi Pantaleev | 715bdf2c64 | 3 years ago |
Slavi Pantaleev | 815a80c290 | 3 years ago |
Slavi Pantaleev | 15f4cc924d | 3 years ago |
Slavi Pantaleev | ab6563ce4e | 3 years ago |
Slavi Pantaleev | 69cc2145d2 | 3 years ago |
Slavi Pantaleev | 262a25f997 | 3 years ago |
Slavi Pantaleev | a80b5b2ca5 | 3 years ago |
Slavi Pantaleev | e49eb078a2 | 3 years ago |
Dan Arnfield | c3b63c6c97 | 3 years ago |
Slavi Pantaleev | c180fa4e83 | 3 years ago |
Dan Arnfield | 10e0fa17ad | 3 years ago |
Slavi Pantaleev | d135cd9cd3 | 3 years ago |
Slavi Pantaleev | 44c9f4daca | 3 years ago |
Slavi Pantaleev | e64758c119 | 3 years ago |
Slavi Pantaleev | 149872e00c | 3 years ago |
Slavi Pantaleev | 9b4bf73587 | 3 years ago |
Slavi Pantaleev | 6488e11d69 | 3 years ago |
Slavi Pantaleev | ca066217d1 | 3 years ago |
louis | dcd4716636 | 3 years ago |
Slavi Pantaleev | d0ee86e0a5 | 3 years ago |
Agustin Ferrario | a06feba281 | 3 years ago |
josiah | 78b933ceb4 | 3 years ago |
Slavi Pantaleev | 8748f3d443 | 3 years ago |
Slavi Pantaleev | 349fbb6434 | 3 years ago |
Slavi Pantaleev | a09ed58892 | 3 years ago |
Slavi Pantaleev | f545de53f7 | 3 years ago |
Slavi Pantaleev | 55f252a6ed | 3 years ago |
Slavi Pantaleev | ed159cc742 | 3 years ago |
Slavi Pantaleev | e2e6cfaa8b | 3 years ago |
Slavi Pantaleev | db69a51653 | 3 years ago |
Agustin Ferrario | 49b3cc024b | 3 years ago |
Agustin Ferrario | ff6db5fd3b | 3 years ago |
Agustin Ferrario | 2082242499 | 3 years ago |
Slavi Pantaleev | 0f4649a45c | 3 years ago |
Slavi Pantaleev | a4b8baee49 | 3 years ago |
Slavi Pantaleev | a197968b7f | 3 years ago |
Slavi Pantaleev | 1bd5c240e5 | 3 years ago |
Slavi Pantaleev | 3289298ac7 | 3 years ago |
Slavi Pantaleev | 69f71f48a6 | 3 years ago |
Slavi Pantaleev | 6ebebcaa81 | 3 years ago |
Tomas Strand | 6a3f6fbcb5 | 3 years ago |
Slavi Pantaleev | e2ba46bf01 | 3 years ago |
Slavi Pantaleev | dd797ba6a7 | 3 years ago |
Slavi Pantaleev | 2a502db239 | 3 years ago |
Slavi Pantaleev | 0790a7b2a8 | 3 years ago |
Slavi Pantaleev | 374f43735a | 3 years ago |
Slavi Pantaleev | 8d74593878 | 3 years ago |
Slavi Pantaleev | 516ccb2b2b | 3 years ago |
transcaffeine | 13d8a9b39c | 3 years ago |
Slavi Pantaleev | 3ab7dd1abe | 3 years ago |
Slavi Pantaleev | af3ea67bba | 3 years ago |
Slavi Pantaleev | 0ca48f3532 | 3 years ago |
Slavi Pantaleev | 7248eb3c11 | 3 years ago |
Slavi Pantaleev | cba973d6b5 | 3 years ago |
Slavi Pantaleev | 13f84e2ad5 | 3 years ago |
Slavi Pantaleev | 86a8091768 | 3 years ago |
Slavi Pantaleev | 3ba8520266 | 3 years ago |
Slavi Pantaleev | bbc08722c5 | 3 years ago |
Slavi Pantaleev | c1431b28f0 | 3 years ago |
Slavi Pantaleev | ac37091d01 | 3 years ago |
Slavi Pantaleev | dc7850e83c | 3 years ago |
Slavi Pantaleev | bc376c2fb2 | 3 years ago |
transcaffeine | 54da61f81b | 3 years ago |
Slavi Pantaleev | e3a0c9adda | 3 years ago |
Slavi Pantaleev | dde1c9f899 | 3 years ago |
Slavi Pantaleev | aa828ff9f6 | 3 years ago |
Slavi Pantaleev | b9a04a7f95 | 3 years ago |
transcaffeine | 5d70bc1376 | 3 years ago |
Slavi Pantaleev | 087dbe4ddc | 3 years ago |
Slavi Pantaleev | ce21ea3640 | 3 years ago |
Slavi Pantaleev | 43d6ff2af8 | 3 years ago |
Slavi Pantaleev | 6c77eae969 | 3 years ago |
Slavi Pantaleev | 2848322461 | 3 years ago |
Slavi Pantaleev | 6a2dd8088c | 3 years ago |
Slavi Pantaleev | 05dd091133 | 3 years ago |
Slavi Pantaleev | 9bf8ce878e | 3 years ago |
Slavi Pantaleev | a3406a182b | 3 years ago |
Slavi Pantaleev | 2d99ade72f | 3 years ago |
Slavi Pantaleev | 5dba0c038b | 3 years ago |
Slavi Pantaleev | 2a99e84b5b | 3 years ago |
Slavi Pantaleev | c0edacbefd | 3 years ago |
Slavi Pantaleev | d91aa5a060 | 3 years ago |
Slavi Pantaleev | f1e85f7112 | 3 years ago |
transcaffeine | b217a2ed69 | 3 years ago |
Slavi Pantaleev | 4617984b9f | 3 years ago |
Slavi Pantaleev | cb969c6ca2 | 3 years ago |
Slavi Pantaleev | c66c084027 | 3 years ago |
Slavi Pantaleev | 6e1dfb62f0 | 3 years ago |
Slavi Pantaleev | b87b754372 | 3 years ago |
Slavi Pantaleev | dd994995bc | 3 years ago |
Slavi Pantaleev | 183d2a10db | 3 years ago |
Slavi Pantaleev | a374d309c8 | 3 years ago |
Slavi Pantaleev | 46a4034d3e | 3 years ago |
Slavi Pantaleev | 3a037a5993 | 3 years ago |
Slavi Pantaleev | da4cb2f639 | 3 years ago |
Slavi Pantaleev | bbc09d013b | 3 years ago |
Slavi Pantaleev | c765ceb270 | 3 years ago |
Slavi Pantaleev | e2952f16f7 | 3 years ago |
Slavi Pantaleev | f47e8a97e6 | 3 years ago |
Slavi Pantaleev | d251764c16 | 3 years ago |
Slavi Pantaleev | 0641106370 | 3 years ago |
Slavi Pantaleev | 527d5f57d5 | 3 years ago |
Slavi Pantaleev | dac0d3a682 | 3 years ago |
Slavi Pantaleev | 77a5c7cf3c | 3 years ago |
Slavi Pantaleev | 9dc023c558 | 3 years ago |
Slavi Pantaleev | bae4113422 | 3 years ago |
chagai95 | d96d7f2a43 | 3 years ago |
Slavi Pantaleev | 47613e5a27 | 3 years ago |
Slavi Pantaleev | 86988ae180 | 3 years ago |
Slavi Pantaleev | 0a9109771d | 3 years ago |
Slavi Pantaleev | 7f1f3fd97b | 3 years ago |
Aaron Raimist | 3c2a644e5c | 3 years ago |
Slavi Pantaleev | eae4f67470 | 3 years ago |
Slavi Pantaleev | 7593d969e3 | 3 years ago |
transcaffeine | d9f4914e0d | 3 years ago |
Slavi Pantaleev | d08b27784f | 3 years ago |
Slavi Pantaleev | 327ca847b6 | 3 years ago |
John Goerzen | 673e19f830 | 3 years ago |
Slavi Pantaleev | 245b749946 | 3 years ago |
Slavi Pantaleev | aa86e0dac6 | 3 years ago |
Slavi Pantaleev | f453d28f0e | 3 years ago |
benkuly | ad92c61fdd | 3 years ago |
Slavi Pantaleev | c07c927d9f | 3 years ago |
Béla Becker | 6f9b4bd9ac | 3 years ago |
Béla Becker | 6921ec4b8a | 3 years ago |
laszabine | 77b04b282d | 3 years ago |
Sabine | cea2faa1b3 | 4 years ago |
Sabine | aabefe21f4 | 4 years ago |
Sabine | 468cc39465 | 4 years ago |
Sabine Laszakovits | dd50ee19ab | 4 years ago |
Sabine Laszakovits | 2211e678f3 | 4 years ago |
Sabine Laszakovits | e59aa07b86 | 4 years ago |
Sabine Laszakovits | c36e1355cf | 4 years ago |
Sabine Laszakovits | 8ebc39dea0 | 4 years ago |
Sabine Laszakovits | 9b890e9ced | 4 years ago |
Sabine Laszakovits | ff1d7921a0 | 4 years ago |
Sabine Laszakovits | d6940d9f10 | 4 years ago |
Sabine | 7a54e11090 | 4 years ago |
Sabine | 69efcb5c21 | 4 years ago |
@ -0,0 +1,46 @@
|
||||
# Setting up Mautrix Signal (optional)
|
||||
|
||||
The playbook can install and configure [mautrix-signal](https://github.com/tulir/mautrix-signal) for you.
|
||||
|
||||
See the project's [documentation](https://github.com/tulir/mautrix-signal/wiki) to learn what it does and why it might be useful to you.
|
||||
|
||||
**Note/Prerequisite**: If you're running with the Postgres database server integrated by the playbook (which is the default), you don't need to do anything special and can easily proceed with installing. However, if you're [using an external Postgres server](configuring-playbook-external-postgres.md), you'd need to manually prepare a Postgres database for this bridge and adjust the variables related to that (`matrix_mautrix_signal_database_*`).
|
||||
|
||||
Use the following playbook configuration:
|
||||
|
||||
```yaml
|
||||
matrix_mautrix_signal_enabled: true
|
||||
```
|
||||
|
||||
## Set up Double Puppeting
|
||||
|
||||
If you'd like to use [Double Puppeting](https://github.com/tulir/mautrix-whatsapp/wiki/Authentication#replacing-whatsapp-accounts-matrix-puppet-with-matrix-account) (hint: you most likely do), you have 2 ways of going about it.
|
||||
|
||||
### Method 1: automatically, by enabling Shared Secret Auth
|
||||
|
||||
The bridge will automatically perform Double Puppeting if you enable [Shared Secret Auth](configuring-playbook-shared-secret-auth.md) for this playbook.
|
||||
|
||||
This is the recommended way of setting up Double Puppeting, as it's easier to accomplish, works for all your users automatically, and has less of a chance of breaking in the future.
|
||||
|
||||
### Method 2: manually, by asking each user to provide a working access token
|
||||
|
||||
**Note**: This method for enabling Double Puppeting can be configured only after you've already set up bridging (see [Usage](#usage)).
|
||||
|
||||
When using this method, **each user** that wishes to enable Double Puppeting needs to follow the following steps:
|
||||
|
||||
- retrieve a Matrix access token for yourself. You can use the following command:
|
||||
|
||||
```
|
||||
curl \
|
||||
--data '{"identifier": {"type": "m.id.user", "user": "YOUR_MATRIX_USERNAME" }, "password": "YOUR_MATRIX_PASSWORD", "type": "m.login.password", "device_id": "Mautrix-Signal", "initial_device_display_name": "Mautrix-Signal"}' \
|
||||
https://matrix.DOMAIN/_matrix/client/r0/login
|
||||
```
|
||||
|
||||
- send the access token to the bot. Example: `login-matrix MATRIX_ACCESS_TOKEN_HERE`
|
||||
|
||||
- make sure you don't log out the `Mautrix-Signal` device some time in the future, as that would break the Double Puppeting feature
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
You then need to start a chat with `@signalbot:YOUR_DOMAIN` (where `YOUR_DOMAIN` is your base domain, not the `matrix.` domain).
|
@ -0,0 +1,12 @@
|
||||
# Caddyfile
|
||||
|
||||
This directory contains sample files that show you how to do reverse-proxying using Caddy2.
|
||||
|
||||
## Config
|
||||
|
||||
| Variable | Function |
|
||||
| ------------------ | -------- |
|
||||
| tls your@email.com | Specify an email address for your [ACME account](https://caddyserver.com/docs/caddyfile/directives/tls) (but if only one email is used for all sites, we recommend the email [global option](https://caddyserver.com/docs/caddyfile/options) instead) |
|
||||
| tls | To enable [tls](https://caddyserver.com/docs/caddyfile/directives/tls) support uncomment the lines for tls |
|
||||
| Dimnension | To enable Dimension support uncomment the lines for Dimension and set your data |
|
||||
| Jitsi | To enable Jitsi support uncomment the lines for Jitsi and set your data |
|
@ -1,103 +1,118 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
62656561663637313534316434323264346335326230616438616332383234386463616561313835
|
||||
3032373531333836343631326334376466623837343838340a656437363366356463633764643962
|
||||
66333233373632623364623634376532363732623664393131346464343166333539386139383061
|
||||
6162383765613931630a343661356264383031353136363539316234353738393261366331313739
|
||||
64333865333432323466363930373638386234646335316465333763626332333832643831353737
|
||||
64313061363236613734386633383661323266633338363836666236336463643630656334383839
|
||||
34663062303863376438353837396233663761626264353063666534343766303862353838653435
|
||||
33663266646433303161393337613133623233346366343462343965666539343762613035353138
|
||||
32316335646630646366616236346563623037313365663165643637623731396538303931366539
|
||||
66656365363362346533376366393861646664323137336634376534643964656330323761333438
|
||||
34393532396237356363613562653437666561373639333630613061623063643533333339383831
|
||||
35396163343039353734373566306133373264656438383235353232346636656139363761633230
|
||||
64626665373965366233363730393539633763363665373431616561383132643530623333343937
|
||||
31653535616665383335653433623939323734353038366566323162306632613166373631636433
|
||||
61373537636534336438613534313163383332366263346532626536333536316330373261656331
|
||||
35616562643738613666373534343739396335643532303531323731386166306661386366623838
|
||||
64313362656565346130626434336533313035363935386435366430666335336230316562613135
|
||||
65636132393131663032356237636463376436663937383235653030326466643236613137656563
|
||||
61346139653863633063383561656634353334343863353039393432626365353665346536616564
|
||||
32303466333136323962306238613939333734623234346635616365386465366563626535306533
|
||||
63363337383263666463353737393331353037376334306466323262333234386564633164643834
|
||||
37353837356437363161396431643339643630373465396438643734393065643633366538393435
|
||||
39313366326463373233313435323763353861636464386362316165336564303166353662643931
|
||||
64663038376633316536643062393439353637306565663734383530346366303430303838343133
|
||||
65393365383031656238326632613863373662323133366665646161666537333938386433376333
|
||||
39333762303236343037666137336361613964303135363033343662363431333332346631356233
|
||||
64333963633836663530626366373335366434613733343266646230313261623036633731383963
|
||||
64663566346230323936663731396131343239363466623261323163613334353731343730653466
|
||||
30353836343962653265656533373237316366653561346661343430666561356631306337366363
|
||||
37663064626539356439623639306632633666613561373730656238333733613832643231396133
|
||||
38343866323064646534656331303530613131343832663261393466333038623962333361326464
|
||||
36383636303763313666353931653635366265303364653931323132383036336437633263323137
|
||||
62393464663330656339663435616430326463643633373231623930623933366438613362393335
|
||||
39383963353661663964623664386437343537343034393634636335383066613763343837303063
|
||||
32363065623162643863316665333235636133376637313634313665613964373263316261373436
|
||||
34316530353631663937653339663939303431383839626363316634343336343163356164356537
|
||||
65363432313064643566386130343130633264323430323935323361383035333538626362353664
|
||||
32346565383566356234366461313265393465666131333734666664333632626539613234633039
|
||||
62346562303233633631326430343862366163363635383262663132623735666666323636666331
|
||||
62346639396539336435343033363535396435613533373030343063353762303862633832366465
|
||||
36353466323033333063663430313765666334613038626137643536623136396632626336613937
|
||||
36366634343730373433653932323462666330386135306531663566316230663936393836633965
|
||||
63646630653835316266656235646162613237376135663531323761643962613637383338663937
|
||||
63346336383733666561643134376231643930363039616432623239343632396264666365646536
|
||||
64373335613336306636326366346131663533363365623061633131333962343139303034373733
|
||||
61626665356266356333303562303534636639623061653033326166333732313062366230653035
|
||||
62326437383564396630633063343731353936633363353564626636363964353133646139353266
|
||||
38323432616136333131663166333265626533643937666136343665376263376137613564323234
|
||||
33633330373732363466653563333864306537613765303831623831633662303234643462393132
|
||||
38353464386131656638376461633066356163396365666165373335396263643564306635366630
|
||||
66666431376166393934646664643230386662363161626363376564353831373131363164633331
|
||||
38613133663139636461633230346532373063363234623637663966613339666333303139373531
|
||||
64366162336135313030653738383962613463373364326166303136316537646566303236646335
|
||||
61613761343863323662633863316161393734343836313266613666376630646461303639396434
|
||||
63333562323561643762636661326237386366383838353637626434356132333439306335363730
|
||||
64663966663834363365383731646432633638623736616463393065336331666236633162626466
|
||||
65346330393630333863396663623261363738663037353738656333393561356362633539356532
|
||||
65663266656465323862313135366666333033346463346333383036386438336630306666313834
|
||||
39393739346235636561303435373666616132633636653037373638643135356632613732343637
|
||||
37323039383464386434303634393232303738313333633365666662626337323563346432663732
|
||||
39333038323633633037353737616263643232393336623431613039303832376534333861663131
|
||||
34376564623265386132306237616235363031616637323761373138626262393539663731376232
|
||||
36353335303939323562643735356131363265633233613261386331383931646532656633633561
|
||||
33333934653366653434646135636433316364376335326239623034333036616633653830333533
|
||||
31383663306366653162663632643363313435396465343139383637333663356430353136323262
|
||||
63353666383839643333643735373535323962326365323930356637363432626666373765316236
|
||||
61623363323163356138313337643334336631336163646630643734376632663137323230346266
|
||||
62623731326362636430353838613338316261623034656134663966383961326665653633363834
|
||||
33336461636333313433376461653962613265633132353832333263303464623732626438646539
|
||||
61396636316233343730363031363330623836356336386235386363633734366262393334643864
|
||||
36613038643061613735646435363465353563306661663466356631613032303038666634343237
|
||||
65643465326364613634666138333736336437623830306464373636343831623637343235303163
|
||||
32643035333435316333656365316532313233613736653134653531313037663631386566633134
|
||||
64616536663263373139373664653364663538616566336461656362333964313765396439656238
|
||||
38353362633663336131386638643439636333643162346164646536306662336430343065306335
|
||||
35316131323034333064383934393538623837396663326639656163303666313136336233363065
|
||||
32623433393734306534646632306362393933626266353564303866323134366431333833616635
|
||||
65646133316266633439646534313234653537353536353465643338613762313130653630316563
|
||||
37376437313036376438626563356631623162363262336265653933333930336337323933336639
|
||||
30636132313563306664313163323330363564343462363662353134383965386139383331343362
|
||||
66386430363633376437666637303834353433313039613139373136393764623565386530356132
|
||||
36313833383836363363383433376133313266393431366330346331663237376366613934333239
|
||||
35316135316361373861323334333230323063396435616630613939356131633436373839346433
|
||||
37626634616438303262356539646138663866346162316164636631343138636264353139313431
|
||||
37346334623764663137343764333133316639336266396264306434303261623835323838633561
|
||||
61353062623864623932663032306132346533383535316531666336623166633665366436393837
|
||||
39626231363430616634386436393133326634343033373230303361613130363431336131313735
|
||||
34326235333430353265636264343539616662633966363261393431653365626432613365336436
|
||||
38386239353966646532326438386366383064333434313561373664333465653363646635333165
|
||||
38613337666430633337613932626466373236316632636665343738363163646639386661306263
|
||||
32643065353362643035366662306336386462303331383131653065396662393237323564643362
|
||||
37656332653633303836643233373535313332653963343132363064613430323731633865376633
|
||||
63353063613536663437333435386337353561303430396236373566616533326466376536366333
|
||||
37363531333830333332636636363230353561663563333037613761356561663834303332613833
|
||||
32363130303065336434393033613534643161363361373066383238333165633635383535663431
|
||||
32303232643161663964316365346132626634656239656365316136336265616534303936313964
|
||||
36656630376164316563306334303638616231343739623132656136343464306363373732313631
|
||||
33663666373438656430373432643436663133636337363961346134376666626638626137343339
|
||||
32343735633663306165373633373437356465343762643135326430356330313663623130633737
|
||||
61356563333630633966653831323561323264343962326466313566666666386432326362333338
|
||||
66333435623834383666326634616234623761636238346534623034366265653430303134656439
|
||||
3162666337353934633539666666336264336564623337363336
|
||||
66633865333931323532653061623366633536306531613738666236333563383462393236393565
|
||||
3030643933643865303563613966663935616632306163380a353739306336386239346262373736
|
||||
66353963373834393465363763643335623563303236366239643062366132623433623639643431
|
||||
3432313830613565610a383938386133623966386631306530313865323234386534613665616262
|
||||
35383266663431353736393337313631663739363634396364393135646562633432623330303434
|
||||
32623238366437333237376437636333386130326636346462663165366465303232353937646161
|
||||
36396466626630333963323131303336663337333061613531346563316666626461646138353931
|
||||
65346135396266623434333362376162616166373163303734303033303634353031303762393338
|
||||
32353833646439303233343230323131323765623863366663666337316332613339393337353634
|
||||
62383131653363613938363834376235316330343064623234393062626134396365393761383339
|
||||
35343035646133343733373339353763646562343765363135346233393466666239306333346264
|
||||
37353962626132653032343332633936326166323138643134326563306263613234643636393938
|
||||
30343566663135343037663138633566653762323037373936336663376132663266663731613731
|
||||
64623237326563366439353065326531326136666564396537383462633132373530393131396666
|
||||
37356132333764383239306261643163616164383466616463643135326365663763393437623837
|
||||
61353134623336666233636563373538623562623132636264663930643661336561346535326262
|
||||
34643832303365653839626161633162666565636536656338346332623461373935313030663964
|
||||
64323366613130333264313136343135396562643561383235376130666334363536333265616361
|
||||
31656165653838313964313864396439323266303439383838323931363161343132326163643264
|
||||
31333933386164663438343739616138313064353338616366353237393131353234663634643964
|
||||
31336437343261356636396162386434313332356461646561306435363734306634336264653839
|
||||
39366138373162393163656437626634373533656137353266313633316239616337633066343863
|
||||
32396138393731386131653131633566616161326363613638623635646136633234623664656631
|
||||
65633063663330386330343461336133663165323337303534303435646330333066306230636464
|
||||
36373061393663646262303832376235366635353535613730633835663236656138653534353134
|
||||
31313334623530326534376332616562643139303265623761666438616362613134663533383230
|
||||
64653961306565333337353731323135393965656232626630666431633435333531626431633832
|
||||
33393138653431613830353635323165383265636661316430336461353034353536623164653764
|
||||
39303332323066343266643966336633353561386234643139663539653435653036646665666163
|
||||
38636261393361366437336535666563393632316332623366363536373564356238353436326639
|
||||
61393533343936613531333439386162386162313138386536663037663936646135643765396664
|
||||
34393533363137613039306335313462643437623861396566356338653734356361656233323332
|
||||
63353163653162646131356439306662376266636438393435663961303239666339616266383864
|
||||
66393837363739353665353234336534333965333735353335316531383963336233623430393432
|
||||
66316531663661363362383965643461303339666436376637633233303733333636346365353239
|
||||
64363433366135303530636461656165396530353134623536323631646564656236666161303065
|
||||
65393438313864623633303365356430626133363165323433353837646139646566316431666233
|
||||
35393562316137346331353637626134376138373266373233346136643336356238393065303265
|
||||
38396432346539373066313763643137643165613563346536663164363635326635623835373736
|
||||
62623231376562343138383563633266303733323937633738303330353436653434353838303563
|
||||
34383963323331303932666566666137383366663364646334326632366136663763386138666461
|
||||
36653764363931386465313134343638373935323061303063323262626133346562326535663330
|
||||
64333662663837333931373038663165633730636332366235636364363335376233373565303330
|
||||
61663432363233626236643130303135386334613464343861363338626632613731373231653337
|
||||
61353933313935623965333461333662346364343639333362616165656634373031363532373764
|
||||
38373139633038623934663639653430633564303830633864366134323835643039386439323961
|
||||
37373733626534303764393362633561363933326366323265373335653135653432633664383838
|
||||
39613964646361303761663535363837326263396432656565326232313135643335386239653030
|
||||
38326562333533363738366161343936303732346439363266626365363833663036323065313563
|
||||
33306435353632613862356531636331356538613633393932643165386361376361373434616630
|
||||
33623431343031623336386136386661303166343838666330383036653462623339613962616266
|
||||
33303536666237376135326139376236616138346231383932326566343537656530396464633963
|
||||
37626239623230326137323061343961336561303434343963363530613263633466383232613364
|
||||
61366263383434633139613831623738653434303162643738663836373931636136613631356237
|
||||
64326133313833336364353164363032363539323630616337336663633238336636633130376138
|
||||
37623933646230643439323934666564663132393233363135353630646630633065653839316665
|
||||
30386439313965633061366232333764393538323862643130633937363239363338663034623333
|
||||
37326564373538623661616637373434633961393361383965383439383065316462373763346465
|
||||
64626662646538326532643839333435313066333462656634373832396439393236323865646239
|
||||
33313032376166633861336366393036333431313565663266643133366631303034666464333566
|
||||
37333631393639646438666665323937656262396665336561623866613766656363353762386265
|
||||
30396533653231666439613239316564626236303635646538353335383534666339666566633837
|
||||
35653961386135353735636434333830323564656466306365663763346633396530646536396135
|
||||
36346133666665343334623536383931373435333562653634303538326136363062613732653832
|
||||
31373239616337386332346434393339316563366365653933616161316130626639396134306636
|
||||
64613037623539343061313961646263316134613632626165623532306563653639373263633032
|
||||
39353864393734396537386134633561386262353837653931653362306139323538623639356539
|
||||
61623131626662656531366433333363633766636662376366313537383930373434353865306562
|
||||
37383462346264323936396461336365646663653732333765666364386331343339633366393835
|
||||
34626533613736323962636236306265323665366163306430336261306130663464323931656133
|
||||
34653538376439313036316632366231663264323739373032623332343038383364303335366562
|
||||
34656133373465333665643238663665643137626261303938646466343463353562363330323638
|
||||
61383232383038363961393636316161303366373237626665303532633336336436626662363733
|
||||
34356466333330626337643437656239396566666362353130303836353262336534376564363830
|
||||
30313737373730636130383363323737313531663961343438343061393138353765393830653566
|
||||
39303439383738613662336663353764323932306632633932643165633431623063346166613966
|
||||
62326438383037376435613861623530336161386535303566626461393737303263643932343862
|
||||
65386537306235363837653139353130643638626662363166636463633030656339613865313738
|
||||
36306365616334363933343165386265386163303432303233633333303134633566643561346661
|
||||
38386436633061376437313464336333386332376337383136396638643261613832656133313366
|
||||
63343134333030646331663466316331643432386363646134306462303664393165383563353264
|
||||
37336465323638656664343830383431376361383535663632393363383234663462393332633438
|
||||
36383134366236393834663237666138353661306564303631336330396634366338643034346331
|
||||
37393962636165616462653632626333346537313131393261346632613166343663393265356537
|
||||
39316633633633396236373532313338386536316337373037666661303030356564383632343065
|
||||
62373438396666356336383963356263316531333032653666646162363139303336646431303430
|
||||
65363662376130616436316435313464353038313338636239383665663432343930396238393764
|
||||
38363734386662313061643139626335336462653635373861663633636364363964316162646235
|
||||
62336238653337303863303761303262333666366237626464666666666230613863343631386464
|
||||
37313234333561633534313564393932363865363635303434653236393036363033666431376261
|
||||
63373234376361386166316238646462343765633331366166383864656130613466633435646338
|
||||
38656438616238323638663636626430633766623538343735313631303963306663386331396331
|
||||
36393333323938356433316132303637373165323532373363323837643866373034356133393832
|
||||
34653437623333323835643865633865626663633362303535336565386636316232376164336432
|
||||
65333839646264323939636662373035323231663733623034386135653436663261363634613439
|
||||
34646331666633376461323430623862393736633635323266343334646135636434373235643263
|
||||
63373733346537633662613832373566396163663864346630313766336166373733303565316534
|
||||
62373832323433653464653133363764633565326435663230613966383562313638306235336433
|
||||
65666636353331323865386437303035376264316633376637663562373739343636633235393232
|
||||
33396534623036323831323065393236366662313263633339333034633231313434323238393834
|
||||
37636433376465343334396632666636356665383163323236313633383530663632366232613763
|
||||
32326134353936343233306262636163393734366631623861626266393765396230653662393434
|
||||
66623335363232643933326333646364616532323434353464366138636335333138613636393435
|
||||
34643534653766356539396536656336663537346637313437623835306132653532323963393337
|
||||
65626462653939336335623262633262383636316565663661663538383330393233396634363531
|
||||
65303331663662633236393664633166666661633735376263346235343362363662626232363232
|
||||
66373661393031353064323932613361363734373638623531643863396361323232373265643361
|
||||
62323033383431323431633235333535663262353938353064303765336139356134656364343433
|
||||
39356232316436633165643361383135373962626536633662663230366662333262626530663633
|
||||
66376630633036313537326634616337346466616333396665663063316334636436636438633938
|
||||
66393934306562663431396665323238633761383333316665316535656161393862346535393436
|
||||
36316462323636623539346666636639626438343539646230653934373764316539366465383135
|
||||
36306664623039316336646135633530343235356630613161623638616339306262373466323830
|
||||
35666531626530653435326333383831363239383564633531383437376566666232366431343865
|
||||
37353430623138393664346237623839656666316638366532633933383534313734373166336464
|
||||
37613139313338323962633735636332373265356132643437663137383035646332366330366163
|
||||
32623538336565663061326237643763663637643735633431333232356330646533
|
||||
|
@ -0,0 +1,72 @@
|
||||
---
|
||||
|
||||
# matrix-aux is a role that manages auxiliary files and directories on your Matrix server.
|
||||
#
|
||||
# Certain components (like matrix-synapse, etc.) may sometimes require additional templates (email templates, privacy policies, etc.).
|
||||
# This role allows such files to be managed by the playbook.
|
||||
#
|
||||
# Note that files and directories created via this role are not automatically made available for containers to use.
|
||||
# If you use this role to put files in a directory that's already mounted into a container,
|
||||
# you can access the files without additional work.
|
||||
# Otherwise, you'd need to mount the file/directory to the container that needs it.
|
||||
# Roles usually provide a `matrix_*_additional_volumes` or `matrix_*_container_extra_arguments` variable
|
||||
# that you can use to mount an additional volume.
|
||||
|
||||
# The default permission mode when creating directories using `matrix_aux_directory_definitions`
|
||||
matrix_aux_directory_default_mode: '0750'
|
||||
|
||||
# Holds a list of directories to create on the server.
|
||||
#
|
||||
# By default, directories are:
|
||||
# - created with permissions as specified in `matrix_aux_directory_default_mode`
|
||||
# - owned by the `matrix_user_username` user and `matrix_user_groupname` group (usually `matrix:matrix`)
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# matrix_aux_directory_definitions:
|
||||
# - dest: /matrix/aux
|
||||
#
|
||||
# - dest: /matrix/another
|
||||
# mode: '0700'
|
||||
# owner: 'some-user'
|
||||
# group: 'some-group'
|
||||
matrix_aux_directory_definitions: []
|
||||
|
||||
# The default permission mode when creating directories using `matrix_aux_directory_definitions`
|
||||
matrix_aux_file_default_mode: '0640'
|
||||
|
||||
# Holds a list of files to create on the server.
|
||||
#
|
||||
# By default, files are:
|
||||
# - created with permissions as specified in `matrix_aux_file_default_mode`
|
||||
# - owned by the `matrix_user_username` user and `matrix_user_groupname` group (usually `matrix:matrix`)
|
||||
#
|
||||
# You can define the file content inline (in your `vars.yml` file) or as an external file (see the example below).
|
||||
# Defining the content inline in `vars.yml` has the benefit of not splitting your configuration into multiple files,
|
||||
# but rather keeping everything inside `vars.yml` (which also gets backed up on the server in `/matrix/vars.yml`).
|
||||
#
|
||||
# Note: parent paths for files must exist.
|
||||
# If you've defined a file with a destination of `/matrix/some/path/file.txt`,
|
||||
# then you likely need to add `/matrix/some/path` to `matrix_aux_directory_definitions` as well.
|
||||
# You don't need to do this for directories that the playbook already creates for you.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# matrix_aux_file_definitions:
|
||||
# - dest: "{{ matrix_synapse_config_dir_path }}/something.html"
|
||||
# content: |
|
||||
# <!doctype html>
|
||||
# <html><body>Something</body></html>
|
||||
#
|
||||
# - dest: /matrix/aux/some-other-file.txt
|
||||
# content: "Something"
|
||||
# mode: '0600'
|
||||
# owner: 'some-user'
|
||||
# group: 'some-group'
|
||||
#
|
||||
# - dest: /matrix/aux/yet-another-file.txt
|
||||
# content: "{{ lookup('template', '/path/to/file.txt.j2') }}"
|
||||
# mode: '0600'
|
||||
# owner: 'some-user'
|
||||
# group: 'some-group'
|
||||
matrix_aux_file_definitions: []
|
@ -0,0 +1,5 @@
|
||||
- import_tasks: "{{ role_path }}/tasks/setup.yml"
|
||||
when: run_stop|bool
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-aux-files
|
@ -0,0 +1,19 @@
|
||||
---
|
||||
|
||||
- name: Ensure AUX directories are created
|
||||
file:
|
||||
dest: "{{ item.dest }}"
|
||||
state: directory
|
||||
owner: "{{ item.owner|default(matrix_user_username) }}"
|
||||
group: "{{ item.group|default(matrix_user_groupname) }}"
|
||||
mode: "{{ item.mode|default(matrix_aux_directory_default_mode) }}"
|
||||
with_items: "{{ matrix_aux_directory_definitions }}"
|
||||
|
||||
- name: Ensure AUX files are created
|
||||
copy:
|
||||
dest: "{{ item.dest }}"
|
||||
content: "{{ item.content }}"
|
||||
owner: "{{ item.owner|default(matrix_user_username) }}"
|
||||
group: "{{ item.group|default(matrix_user_groupname) }}"
|
||||
mode: "{{ item.mode|default(matrix_aux_file_default_mode) }}"
|
||||
with_items: "{{ matrix_aux_file_definitions }}"
|
@ -1,3 +1,3 @@
|
||||
- set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-matrix-reminder-bot'] }}"
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-bot-matrix-reminder-bot.service'] }}"
|
||||
when: matrix_bot_matrix_reminder_bot_enabled|bool
|
||||
|
@ -1,88 +0,0 @@
|
||||
---
|
||||
|
||||
#
|
||||
# Tasks related to setting up matrix-reminder-bot
|
||||
#
|
||||
|
||||
- name: Ensure matrix-reminder-bot paths exist
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- { path: "{{ matrix_bot_matrix_reminder_bot_config_path }}", when: true }
|
||||
- { path: "{{ matrix_bot_matrix_reminder_bot_data_path }}", when: true }
|
||||
- { path: "{{ matrix_bot_matrix_reminder_bot_data_store_path }}", when: true }
|
||||
when: matrix_bot_matrix_reminder_bot_enabled|bool and item.when
|
||||
|
||||
- name: Ensure matrix-reminder-bot image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_bot_matrix_reminder_bot_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_bot_matrix_reminder_bot_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_matrix_reminder_bot_docker_image_force_pull }}"
|
||||
when: matrix_bot_matrix_reminder_bot_enabled|bool
|
||||
|
||||
- name: Ensure matrix-reminder-bot config installed
|
||||
copy:
|
||||
content: "{{ matrix_bot_matrix_reminder_bot_configuration|to_nice_yaml }}"
|
||||
dest: "{{ matrix_bot_matrix_reminder_bot_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
when: matrix_bot_matrix_reminder_bot_enabled|bool
|
||||
|
||||
- name: Ensure matrix-matrix-reminder-bot.service installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-bot-matrix-reminder-bot.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-bot-matrix-reminder-bot.service"
|
||||
mode: 0644
|
||||
register: matrix_bot_matrix_reminder_bot_systemd_service_result
|
||||
when: matrix_bot_matrix_reminder_bot_enabled|bool
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-matrix-reminder-bot.service installation
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_bot_matrix_reminder_bot_enabled|bool and matrix_bot_matrix_reminder_bot_systemd_service_result.changed"
|
||||
|
||||
#
|
||||
# Tasks related to getting rid of matrix-reminder-bot (if it was previously enabled)
|
||||
#
|
||||
|
||||
- name: Check existence of matrix-matrix-reminder-bot service
|
||||
stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-matrix-reminder-bot.service"
|
||||
register: matrix_bot_matrix_reminder_bot_service_stat
|
||||
|
||||
- name: Ensure matrix-matrix-reminder-bot is stopped
|
||||
service:
|
||||
name: matrix-matrix-reminder-bot
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
register: stopping_result
|
||||
when: "not matrix_bot_matrix_reminder_bot_enabled|bool and matrix_bot_matrix_reminder_bot_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-matrix-reminder-bot.service doesn't exist
|
||||
file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-matrix-reminder-bot.service"
|
||||
state: absent
|
||||
when: "not matrix_bot_matrix_reminder_bot_enabled|bool and matrix_bot_matrix_reminder_bot_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-matrix-reminder-bot.service removal
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "not matrix_bot_matrix_reminder_bot_enabled|bool and matrix_bot_matrix_reminder_bot_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure Matrix matrix-reminder-bot paths don't exist
|
||||
file:
|
||||
path: "{{ matrix_bot_matrix_reminder_bot_base_path }}"
|
||||
state: absent
|
||||
when: "not matrix_bot_matrix_reminder_bot_enabled|bool"
|
||||
|
||||
- name: Ensure matrix-reminder-bot Docker image doesn't exist
|
||||
docker_image:
|
||||
name: "{{ matrix_bot_matrix_reminder_bot_docker_image }}"
|
||||
state: absent
|
||||
when: "not matrix_bot_matrix_reminder_bot_enabled|bool"
|
@ -0,0 +1,73 @@
|
||||
---
|
||||
|
||||
- set_fact:
|
||||
matrix_bot_matrix_reminder_bot_requires_restart: false
|
||||
|
||||
- block:
|
||||
- name: Check if an SQLite database already exists
|
||||
stat:
|
||||
path: "{{ matrix_bot_matrix_reminder_bot_sqlite_database_path_local }}"
|
||||
register: matrix_bot_matrix_reminder_bot_sqlite_database_path_local_stat_result
|
||||
|
||||
- block:
|
||||
- set_fact:
|
||||
matrix_postgres_db_migration_request:
|
||||
src: "{{ matrix_bot_matrix_reminder_bot_sqlite_database_path_local }}"
|
||||
dst: "{{ matrix_bot_matrix_reminder_bot_database_connection_string }}"
|
||||
caller: "{{ role_path|basename }}"
|
||||
engine_variable_name: 'matrix_bot_matrix_reminder_bot_database_engine'
|
||||
engine_old: 'sqlite'
|
||||
systemd_services_to_stop: ['matrix-bot-matrix-reminder-bot.service']
|
||||
|
||||
- import_tasks: "{{ role_path }}/../matrix-postgres/tasks/util/migrate_db_to_postgres.yml"
|
||||
|
||||
- set_fact:
|
||||
matrix_bot_matrix_reminder_bot_requires_restart: true
|
||||
when: "matrix_bot_matrix_reminder_bot_sqlite_database_path_local_stat_result.stat.exists|bool"
|
||||
when: "matrix_bot_matrix_reminder_bot_database_engine == 'postgres'"
|
||||
|
||||
- name: Ensure matrix-reminder-bot paths exist
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- { path: "{{ matrix_bot_matrix_reminder_bot_config_path }}", when: true }
|
||||
- { path: "{{ matrix_bot_matrix_reminder_bot_data_path }}", when: true }
|
||||
- { path: "{{ matrix_bot_matrix_reminder_bot_data_store_path }}", when: true }
|
||||
when: "item.when|bool"
|
||||
|
||||
- name: Ensure matrix-reminder-bot image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_bot_matrix_reminder_bot_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_bot_matrix_reminder_bot_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_matrix_reminder_bot_docker_image_force_pull }}"
|
||||
|
||||
- name: Ensure matrix-reminder-bot config installed
|
||||
copy:
|
||||
content: "{{ matrix_bot_matrix_reminder_bot_configuration|to_nice_yaml }}"
|
||||
dest: "{{ matrix_bot_matrix_reminder_bot_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure matrix-bot-matrix-reminder-bot.service installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-bot-matrix-reminder-bot.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-bot-matrix-reminder-bot.service"
|
||||
mode: 0644
|
||||
register: matrix_bot_matrix_reminder_bot_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service installation
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_bot_matrix_reminder_bot_systemd_service_result.changed|bool"
|
||||
|
||||
- name: Ensure matrix-bot-matrix-reminder-bot.service restarted, if necessary
|
||||
service:
|
||||
name: "matrix-bot-matrix-reminder-bot.service"
|
||||
state: restarted
|
||||
when: "matrix_bot_matrix_reminder_bot_requires_restart|bool"
|
@ -0,0 +1,35 @@
|
||||
---
|
||||
|
||||
- name: Check existence of matrix-matrix-reminder-bot service
|
||||
stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-bot-matrix-reminder-bot.service"
|
||||
register: matrix_bot_matrix_reminder_bot_service_stat
|
||||
|
||||
- name: Ensure matrix-matrix-reminder-bot is stopped
|
||||
service:
|
||||
name: matrix-matrix-reminder-bot
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
register: stopping_result
|
||||
when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists|bool"
|
||||
|
||||
- name: Ensure matrix-bot-matrix-reminder-bot.service doesn't exist
|
||||
file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-bot-matrix-reminder-bot.service"
|
||||
state: absent
|
||||
when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists|bool"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-bot-matrix-reminder-bot.service removal
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_bot_matrix_reminder_bot_service_stat.stat.exists|bool"
|
||||
|
||||
- name: Ensure Matrix matrix-reminder-bot paths don't exist
|
||||
file:
|
||||
path: "{{ matrix_bot_matrix_reminder_bot_base_path }}"
|
||||
state: absent
|
||||
|
||||
- name: Ensure matrix-reminder-bot Docker image doesn't exist
|
||||
docker_image:
|
||||
name: "{{ matrix_bot_matrix_reminder_bot_docker_image }}"
|
||||
state: absent
|
@ -0,0 +1,64 @@
|
||||
- name: Fail if Postgres not enabled
|
||||
fail:
|
||||
msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate."
|
||||
when: "not matrix_postgres_enabled|bool"
|
||||
|
||||
# Defaults
|
||||
|
||||
- name: Set postgres_start_wait_time, if not provided
|
||||
set_fact:
|
||||
postgres_start_wait_time: 15
|
||||
when: "postgres_start_wait_time|default('') == ''"
|
||||
|
||||
# Actual import work
|
||||
|
||||
- name: Ensure matrix-postgres is started
|
||||
service:
|
||||
name: matrix-postgres
|
||||
state: started
|
||||
daemon_reload: yes
|
||||
register: matrix_postgres_service_start_result
|
||||
|
||||
- name: Wait a bit, so that Postgres can start
|
||||
wait_for:
|
||||
timeout: "{{ postgres_start_wait_time }}"
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
when: "matrix_postgres_service_start_result.changed|bool"
|
||||
|
||||
- name: Ensure matrix-appservice-irc is stopped
|
||||
service:
|
||||
name: matrix-appservice-irc
|
||||
state: stopped
|
||||
|
||||
- name: Import appservice-irc NeDB database into Postgres
|
||||
command:
|
||||
cmd: >-
|
||||
{{ matrix_host_command_docker }} run
|
||||
--rm
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }}
|
||||
--cap-drop=ALL
|
||||
--network={{ matrix_docker_network }}
|
||||
--mount type=bind,src={{ matrix_appservice_irc_data_path }},dst=/data
|
||||
--entrypoint=/bin/sh
|
||||
{{ matrix_appservice_irc_docker_image }}
|
||||
-c
|
||||
'/usr/local/bin/node /app/lib/scripts/migrate-db-to-pgres.js --dbdir /data --privateKey /data/passkey.pem --connectionString {{ matrix_appservice_irc_database_connection_string }}'
|
||||
|
||||
- name: Archive NeDB database files
|
||||
command:
|
||||
cmd: "mv {{ matrix_appservice_irc_data_path }}/{{ item }} {{ matrix_appservice_irc_data_path }}/{{ item }}.backup"
|
||||
with_items:
|
||||
- rooms.db
|
||||
- users.db
|
||||
|
||||
- name: Inject result
|
||||
set_fact:
|
||||
matrix_playbook_runtime_results: |
|
||||
{{
|
||||
matrix_playbook_runtime_results|default([])
|
||||
+
|
||||
[
|
||||
"NOTE: Your appservice-irc database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_irc_data_path }}/*.db` to `{{ matrix_appservice_irc_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files."
|
||||
]
|
||||
}}
|
@ -0,0 +1,66 @@
|
||||
- name: Fail if Postgres not enabled
|
||||
fail:
|
||||
msg: "Postgres via the matrix-postgres role is not enabled (`matrix_postgres_enabled`). Cannot migrate."
|
||||
when: "not matrix_postgres_enabled|bool"
|
||||
|
||||
# Defaults
|
||||
|
||||
- name: Set postgres_start_wait_time, if not provided
|
||||
set_fact:
|
||||
postgres_start_wait_time: 15
|
||||
when: "postgres_start_wait_time|default('') == ''"
|
||||
|
||||
# Actual import work
|
||||
|
||||
- name: Ensure matrix-postgres is started
|
||||
service:
|
||||
name: matrix-postgres
|
||||
state: started
|
||||
daemon_reload: yes
|
||||
register: matrix_postgres_service_start_result
|
||||
|
||||
- name: Wait a bit, so that Postgres can start
|
||||
wait_for:
|
||||
timeout: "{{ postgres_start_wait_time }}"
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
when: "matrix_postgres_service_start_result.changed|bool"
|
||||
|
||||
- name: Ensure matrix-appservice-slack is stopped
|
||||
service:
|
||||
name: matrix-appservice-slack
|
||||
state: stopped
|
||||
|
||||
- name: Import appservice-slack NeDB database into Postgres
|
||||
command:
|
||||
cmd: >-
|
||||
{{ matrix_host_command_docker }} run
|
||||
--rm
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }}
|
||||
--cap-drop=ALL
|
||||
--network={{ matrix_docker_network }}
|
||||
--mount type=bind,src={{ matrix_appservice_slack_data_path }},dst=/data
|
||||
--entrypoint=/bin/sh
|
||||
{{ matrix_appservice_slack_docker_image }}
|
||||
-c
|
||||
'/usr/local/bin/node /usr/src/app/lib/scripts/migrateToPostgres.js --dbdir /data --connectionString {{ matrix_appservice_slack_database_connection_string }}'
|
||||
|
||||
- name: Archive NeDB database files
|
||||
command:
|
||||
cmd: "mv {{ matrix_appservice_slack_data_path }}/{{ item }} {{ matrix_appservice_slack_data_path }}/{{ item }}.backup"
|
||||
with_items:
|
||||
- teams.db
|
||||
- room-store.db
|
||||
- user-store.db
|
||||
- event-store.db
|
||||
|
||||
- name: Inject result
|
||||
set_fact:
|
||||
matrix_playbook_runtime_results: |
|
||||
{{
|
||||
matrix_playbook_runtime_results|default([])
|
||||
+
|
||||
[
|
||||
"NOTE: Your appservice-slack database files have been imported into Postgres. The original database files have been moved from `{{ matrix_appservice_slack_data_path }}/*.db` to `{{ matrix_appservice_slack_data_path }}/*.db.backup`. When you've confirmed that the import went well and everything works, you should be able to safely delete these files."
|
||||
]
|
||||
}}
|
@ -0,0 +1,95 @@
|
||||
# mautrix-signal is a Matrix <-> Signal bridge
|
||||
# See: https://github.com/tulir/mautrix-signal
|
||||
|
||||
matrix_mautrix_signal_enabled: true
|
||||
|
||||
# See: https://mau.dev/tulir/mautrix-signal/container_registry
|
||||
matrix_mautrix_signal_docker_image: "dock.mau.dev/tulir/mautrix-signal:latest"
|
||||
matrix_mautrix_signal_docker_image_force_pull: "{{ matrix_mautrix_signal_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_mautrix_signal_daemon_docker_image: "dock.mau.dev/maunium/signald:latest"
|
||||
matrix_mautrix_signal_daemon_docker_image_force_pull: "{{ matrix_mautrix_signal_daemon_docker_image.endswith(':latest') }}"
|
||||
|
||||
matrix_mautrix_signal_base_path: "{{ matrix_base_data_path }}/mautrix-signal"
|
||||
matrix_mautrix_signal_config_path: "{{ matrix_mautrix_signal_base_path }}/bridge"
|
||||
matrix_mautrix_signal_daemon_path: "{{ matrix_mautrix_signal_base_path }}/signald"
|
||||
|
||||
matrix_mautrix_signal_homeserver_address: ''
|
||||
matrix_mautrix_signal_homeserver_domain: ''
|
||||
matrix_mautrix_signal_appservice_address: 'http://matrix-mautrix-signal:29328'
|
||||
|
||||
# Controls whether the matrix-mautrix-signal container exposes its port (tcp/29328 in the container).
|
||||
#
|
||||
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9006"), or empty string to not expose.
|
||||
matrix_mautrix_signal_container_http_host_bind_port: ''
|
||||
|
||||
# A list of extra arguments to pass to the container
|
||||
matrix_mautrix_signal_container_extra_arguments: []
|
||||
|
||||
# List of systemd services that matrix-mautrix-signal.service depends on.
|
||||
matrix_mautrix_signal_systemd_required_services_list:
|
||||
- 'docker.service'
|
||||
- 'matrix-mautrix-signal-daemon.service'
|
||||
|
||||
# List of systemd services that matrix-mautrix-signal.service wants
|
||||
matrix_mautrix_signal_systemd_wanted_services_list: []
|
||||
|
||||
# List of systemd services that matrix-mautrix-signal-daemon.service depends on.
|
||||
matrix_mautrix_signal_daemon_systemd_required_services_list: ['docker.service']
|
||||
|
||||
# List of systemd services that matrix-mautrix-signal-daemon.service wants
|
||||
matrix_mautrix_signal_daemon_systemd_wanted_services_list: []
|
||||
|
||||
matrix_mautrix_signal_appservice_token: ''
|
||||
matrix_mautrix_signal_homeserver_token: ''
|
||||
|
||||
# Database-related configuration fields
|
||||
#
|
||||
# This bridge only supports postgres.
|
||||
#
|
||||
matrix_mautrix_signal_database_engine: 'postgres'
|
||||
|
||||
matrix_mautrix_signal_database_username: 'matrix_mautrix_signal'
|
||||
matrix_mautrix_signal_database_password: 'some-password'
|
||||
matrix_mautrix_signal_database_hostname: 'matrix-postgres'
|
||||
matrix_mautrix_signal_database_port: 5432
|
||||
matrix_mautrix_signal_database_name: 'matrix_mautrix_signal'
|
||||
|
||||
matrix_mautrix_signal_database_connection_string: 'postgres://{{ matrix_mautrix_signal_database_username }}:{{ matrix_mautrix_signal_database_password }}@{{ matrix_mautrix_signal_database_hostname }}:{{ matrix_mautrix_signal_database_port }}/{{ matrix_mautrix_signal_database_name }}'
|
||||
|
||||
matrix_mautrix_signal_appservice_database: "{{
|
||||
{
|
||||
'postgres': matrix_mautrix_facebook_database_connection_string,
|
||||
}[matrix_mautrix_signal_database_engine]
|
||||
}}"
|
||||
|
||||
# Can be set to enable automatic double-puppeting via Shared Secret Auth (https://github.com/devture/matrix-synapse-shared-secret-auth).
|
||||
matrix_mautrix_signal_login_shared_secret: ''
|
||||
|
||||
# Default configuration template which covers the generic use case.
|
||||
# You can customize it by controlling the various variables inside it.
|
||||
#
|
||||
# For a more advanced customization, you can extend the default (see `matrix_mautrix_signal_configuration_extension_yaml`)
|
||||
# or completely replace this variable with your own template.
|
||||
matrix_mautrix_signal_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
|
||||
|
||||
matrix_mautrix_signal_configuration_extension_yaml: |
|
||||
# Your custom YAML configuration goes here.
|
||||
# This configuration extends the default starting configuration (`matrix_mautrix_signal_configuration_yaml`).
|
||||
#
|
||||
# You can override individual variables from the default configuration, or introduce new ones.
|
||||
#
|
||||
# If you need something more special, you can take full control by
|
||||
# completely redefining `matrix_mautrix_signal_configuration_yaml`.
|
||||
|
||||
matrix_mautrix_signal_configuration_extension: "{{ matrix_mautrix_signal_configuration_extension_yaml|from_yaml if matrix_mautrix_signal_configuration_extension_yaml|from_yaml is mapping else {} }}"
|
||||
|
||||
# Holds the final configuration (a combination of the default and its extension).
|
||||
# You most likely don't need to touch this variable. Instead, see `matrix_mautrix_signal_configuration_yaml`.
|
||||
matrix_mautrix_signal_configuration: "{{ matrix_mautrix_signal_configuration_yaml|from_yaml|combine(matrix_mautrix_signal_configuration_extension, recursive=True) }}"
|
||||
|
||||
matrix_mautrix_signal_registration_yaml: "{{ lookup('template', 'templates/registration.yaml.j2') }}"
|
||||
|
||||
matrix_mautrix_signal_registration: "{{ matrix_mautrix_signal_registration_yaml|from_yaml }}"
|
||||
|
||||
matrix_mautrix_signal_log_level: 'DEBUG'
|
@ -0,0 +1,16 @@
|
||||
- set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-mautrix-signal.service', 'matrix-mautrix-signal-daemon.service'] }}"
|
||||
when: matrix_mautrix_signal_enabled|bool
|
||||
|
||||
# If the matrix-synapse role is not used, these variables may not exist.
|
||||
- set_fact:
|
||||
matrix_synapse_container_extra_arguments: >
|
||||
{{ matrix_synapse_container_extra_arguments|default([]) }}
|
||||
+
|
||||
["--mount type=bind,src={{ matrix_mautrix_signal_config_path }}/registration.yaml,dst=/matrix-mautrix-signal-registration.yaml,ro"]
|
||||
|
||||
matrix_synapse_app_service_config_files: >
|
||||
{{ matrix_synapse_app_service_config_files|default([]) }}
|
||||
+
|
||||
{{ ["/matrix-mautrix-signal-registration.yaml"] }}
|
||||
when: matrix_mautrix_signal_enabled|bool
|
@ -0,0 +1,21 @@
|
||||
- import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup|bool and matrix_mautrix_signal_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-signal
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_install.yml"
|
||||
when: "run_setup|bool and matrix_mautrix_signal_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-signal
|
||||
|
||||
- import_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"
|
||||
when: "run_setup|bool and not matrix_mautrix_signal_enabled|bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-mautrix-signal
|
@ -0,0 +1,72 @@
|
||||
---
|
||||
|
||||
# If the matrix-synapse role is not used, `matrix_synapse_role_executed` won't exist.
|
||||
# We don't want to fail in such cases.
|
||||
- name: Fail if matrix-synapse role already executed
|
||||
fail:
|
||||
msg: >-
|
||||
The matrix-bridge-mautrix-signal role needs to execute before the matrix-synapse role.
|
||||
when: "matrix_synapse_role_executed|default(False)"
|
||||
|
||||
- name: Ensure Mautrix Signal image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_mautrix_signal_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_mautrix_signal_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_signal_docker_image_force_pull }}"
|
||||
when: matrix_mautrix_signal_enabled|bool
|
||||
|
||||
- name: Ensure Mautrix Signal Daemon image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_mautrix_signal_daemon_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_mautrix_signal_daemon_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_mautrix_signal_docker_image_force_pull }}"
|
||||
when: matrix_mautrix_signal_enabled|bool
|
||||
|
||||
- name: Ensure Mautrix Signal paths exist
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- "{{ matrix_mautrix_signal_base_path }}"
|
||||
- "{{ matrix_mautrix_signal_config_path }}"
|
||||
- "{{ matrix_mautrix_signal_daemon_path }}"
|
||||
|
||||
- name: Ensure mautrix-signal config.yaml installed
|
||||
copy:
|
||||
content: "{{ matrix_mautrix_signal_configuration|to_nice_yaml }}"
|
||||
dest: "{{ matrix_mautrix_signal_config_path }}/config.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure mautrix-signal registration.yaml installed
|
||||
copy:
|
||||
content: "{{ matrix_mautrix_signal_registration|to_nice_yaml }}"
|
||||
dest: "{{ matrix_mautrix_signal_config_path }}/registration.yaml"
|
||||
mode: 0644
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
|
||||
- name: Ensure matrix-mautrix-signal-daemon.service installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-mautrix-signal-daemon.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-mautrix-signal-daemon.service"
|
||||
mode: 0644
|
||||
register: matrix_mautrix_signal_daemon_systemd_service_result
|
||||
|
||||
- name: Ensure matrix-mautrix-signal.service installed
|
||||
template:
|
||||
src: "{{ role_path }}/templates/systemd/matrix-mautrix-signal.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-mautrix-signal.service"
|
||||
mode: 0644
|
||||
register: matrix_mautrix_signal_systemd_service_result
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-mautrix-signal.service installation
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_mautrix_signal_systemd_service_result.changed or matrix_mautrix_signal_daemon_systemd_service_result.changed"
|
@ -0,0 +1,45 @@
|
||||
---
|
||||
|
||||
# Signal daemon service
|
||||
- name: Check existence of matrix-mautrix-signal-daemon service
|
||||
stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-mautrix-signal-daemon.service"
|
||||
register: matrix_mautrix_signal_daemon_service_stat
|
||||
|
||||
- name: Ensure matrix-mautrix-signal-daemon is stopped
|
||||
service:
|
||||
name: matrix-mautrix-signal-daemon
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
when: "matrix_mautrix_signal_daemon_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-mautrix-signal-daemon.service doesn't exist
|
||||
file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-mautrix-signal-daemon.service"
|
||||
state: absent
|
||||
when: "matrix_mautrix_signal_daemon_service_stat.stat.exists"
|
||||
|
||||
# Bridge service
|
||||
- name: Check existence of matrix-mautrix-signal service
|
||||
stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-mautrix-signal.service"
|
||||
register: matrix_mautrix_signal_service_stat
|
||||
|
||||
- name: Ensure matrix-mautrix-signal is stopped
|
||||
service:
|
||||
name: matrix-mautrix-signal
|
||||
state: stopped
|
||||
daemon_reload: yes
|
||||
when: "matrix_mautrix_signal_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-mautrix-signal.service doesn't exist
|
||||
file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-mautrix-signal.service"
|
||||
state: absent
|
||||
when: "matrix_mautrix_signal_service_stat.stat.exists"
|
||||
|
||||
# All services
|
||||
- name: Ensure systemd reloaded after matrix-mautrix-signal_X.service removal
|
||||
service:
|
||||
daemon_reload: yes
|
||||
when: "matrix_mautrix_signal_service_stat.stat.exists or matrix_mautrix_signal_daemon_service_stat.stat.exists"
|
@ -0,0 +1,28 @@
|
||||
---
|
||||
|
||||
- name: Fail if required settings not defined
|
||||
fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`).
|
||||
when: "vars[item] == ''"
|
||||
with_items:
|
||||
- "matrix_mautrix_signal_homeserver_domain"
|
||||
- "matrix_mautrix_signal_homeserver_address"
|
||||
- "matrix_mautrix_signal_homeserver_token"
|
||||
- "matrix_mautrix_signal_appservice_token"
|
||||
|
||||
- name: (Deprecation) Catch and report renamed Signal variables
|
||||
fail:
|
||||
msg: >-
|
||||
Your configuration contains a variable, which now has a different name.
|
||||
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
|
||||
when: "item.old in vars"
|
||||
with_items:
|
||||
- {'old': 'matrix_mautrix_signal_container_exposed_port_number', 'new': '<superseded by matrix_mautrix_signal_container_http_host_bind_port>'}
|
||||
- {'old': 'matrix_mautrix_signal_db_user', 'new': 'matrix_mautrix_signal_database_username'}
|
||||
- {'old': 'matrix_mautrix_signal_db_password', 'new': 'matrix_mautrix_signal_database_password'}
|
||||
- {'old': 'matrix_mautrix_signal_db_database', 'new': 'matrix_mautrix_signal_database_name'}
|
||||
- {'old': 'matrix_mautrix_signal_db_host', 'new': 'matrix_mautrix_signal_database_hostname'}
|
||||
- {'old': 'matrix_mautrix_signal_db_port', 'new': 'matrix_mautrix_signal_database_port'}
|
||||
- {'old': 'matrix_mautrix_signal_db_url', 'new': 'matrix_mautrix_signal_database_connection_string'}
|
||||
- {'old': 'matrix_mautrix_signal_configuration_permissions', 'new': '<superseded by matrix_mautrix_signal_configuration_extension_yaml>'}
|
@ -0,0 +1,202 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
# Homeserver details
|
||||
homeserver:
|
||||
# The address that this appservice can use to connect to the homeserver.
|
||||
address: {{ matrix_mautrix_signal_homeserver_address }}
|
||||
# The domain of the homeserver (for MXIDs, etc).
|
||||
domain: {{ matrix_mautrix_signal_homeserver_domain }}
|
||||
# Whether or not to verify the SSL certificate of the homeserver.
|
||||
# Only applies if address starts with https://
|
||||
verify_ssl: true
|
||||
asmux: false
|
||||
|
||||
# Application service host/registration related details
|
||||
# Changing these values requires regeneration of the registration.
|
||||
appservice:
|
||||
# The address that the homeserver can use to connect to this appservice.
|
||||
address: {{ matrix_mautrix_signal_appservice_address }}
|
||||
# When using https:// the TLS certificate and key files for the address.
|
||||
tls_cert: false
|
||||
tls_key: false
|
||||
|
||||
# The hostname and port where this appservice should listen.
|
||||
hostname: 0.0.0.0
|
||||
port: 29328
|
||||
# The maximum body size of appservice API requests (from the homeserver) in mebibytes
|
||||
# Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
|
||||
max_body_size: 1
|
||||
|
||||
# The full URI to the database. Only Postgres is currently supported.
|
||||
database: {{ matrix_mautrix_signal_database_connection_string }}
|
||||
|
||||
# Provisioning API part of the web server for automated portal creation and fetching information.
|
||||
# Used by things like mautrix-manager (https://github.com/tulir/mautrix-manager).
|
||||
provisioning:
|
||||
# Whether or not the provisioning API should be enabled.
|
||||
enabled: true
|
||||
# The prefix to use in the provisioning API endpoints.
|
||||
prefix: /_matrix/provision/v1
|
||||
# The shared secret to authorize users of the API.
|
||||
# Set to "generate" to generate and save a new token.
|
||||
shared_secret: generate
|
||||
|
||||
# The unique ID of this appservice.
|
||||
id: signal
|
||||
# Username of the appservice bot.
|
||||
bot_username: signalbot
|
||||
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
|
||||
# to leave display name/avatar as-is.
|
||||
bot_displayname: Signal bridge bot
|
||||
bot_avatar: mxc://maunium.net/wPJgTQbZOtpBFmDNkiNEMDUp
|
||||
|
||||
# Community ID for bridged users (changes registration file) and rooms.
|
||||
# Must be created manually.
|
||||
#
|
||||
# Example: "+signal:example.com". Set to false to disable.
|
||||
community_id: false
|
||||
|
||||
# Authentication tokens for AS <-> HS communication.
|
||||
as_token: "{{ matrix_mautrix_signal_appservice_token }}"
|
||||
hs_token: "{{ matrix_mautrix_signal_homeserver_token }}"
|
||||
|
||||
# Prometheus telemetry config. Requires prometheus-client to be installed.
|
||||
metrics:
|
||||
enabled: false
|
||||
listen_port: 8000
|
||||
|
||||
signal:
|
||||
# Path to signald unix socket
|
||||
socket_path: /signald/signald.sock
|
||||
# Directory for temp files when sending files to Signal. This should be an
|
||||
# absolute path that signald can read. For attachments in the other direction,
|
||||
# make sure signald is configured to use an absolute path as the data directory.
|
||||
outgoing_attachment_dir: /signald/attachments
|
||||
# Directory where signald stores avatars for groups.
|
||||
avatar_dir: /signald/avatars
|
||||
# Directory where signald stores auth data. Used to delete data when logging out.
|
||||
data_dir: /signald/data
|
||||
# Whether or not message attachments should be removed from disk after they're bridged.
|
||||
remove_file_after_handling: true
|
||||
|
||||
# Bridge config
|
||||
bridge:
|
||||
# Localpart template of MXIDs for Signal users.
|
||||
# {userid} is replaced with an identifier for the Signal user.
|
||||
username_template: "signal_{userid}"
|
||||
# Displayname template for Signal users.
|
||||
# {displayname} is replaced with the displayname of the Signal user, which is the first
|
||||
# available variable in displayname_preference. The variables in displayname_preference
|
||||
# can also be used here directly.
|
||||
displayname_template: "{displayname} (Signal)"
|
||||
# Whether or not contact list displaynames should be used.
|
||||
# Using this isn't recommended on multi-user instances.
|
||||
allow_contact_list_name_updates: false
|
||||
# Available variables: full_name, first_name, last_name, phone, uuid
|
||||
displayname_preference:
|
||||
- full_name
|
||||
- phone
|
||||
|
||||
# Whether or not to create portals for all groups on login/connect.
|
||||
autocreate_group_portal: true
|
||||
# Whether or not to create portals for all contacts on login/connect.
|
||||
autocreate_contact_portal: false
|
||||
# Whether or not to use /sync to get read receipts and typing notifications
|
||||
# when double puppeting is enabled
|
||||
sync_with_custom_puppets: true
|
||||
# Whether or not to update the m.direct account data event when double puppeting is enabled.
|
||||
# Note that updating the m.direct event is not atomic (except with mautrix-asmux)
|
||||
# and is therefore prone to race conditions.
|
||||
sync_direct_chat_list: false
|
||||
# Allow using double puppeting from any server with a valid client .well-known file.
|
||||
double_puppet_allow_discovery: false
|
||||
# Servers to allow double puppeting from, even if double_puppet_allow_discovery is false.
|
||||
double_puppet_server_map: {}
|
||||
# Shared secret for https://github.com/devture/matrix-synapse-shared-secret-auth
|
||||
#
|
||||
# If set, custom puppets will be enabled automatically for local users
|
||||
# instead of users having to find an access token and run `login-matrix`
|
||||
# manually.
|
||||
# If using this for other servers than the bridge's server,
|
||||
# you must also set the URL in the double_puppet_server_map.
|
||||
login_shared_secret_map:
|
||||
{{ matrix_mautrix_signal_homeserver_domain }}: {{ matrix_mautrix_signal_login_shared_secret|to_json }}
|
||||
# Whether or not created rooms should have federation enabled.
|
||||
# If false, created portal rooms will never be federated.
|
||||
federate_rooms: true
|
||||
# End-to-bridge encryption support options. These require matrix-nio to be installed with pip
|
||||
# and login_shared_secret to be configured in order to get a device for the bridge bot.
|
||||
#
|
||||
# Additionally, https://github.com/matrix-org/synapse/pull/5758 is required if using a normal
|
||||
# application service.
|
||||
encryption:
|
||||
# Allow encryption, work in group chat rooms with e2ee enabled
|
||||
allow: false
|
||||
# Default to encryption, force-enable encryption in all portals the bridge creates
|
||||
# This will cause the bridge bot to be in private chats for the encryption to work properly.
|
||||
default: false
|
||||
# Options for automatic key sharing.
|
||||
key_sharing:
|
||||
# Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
|
||||
# You must use a client that supports requesting keys from other users to use this feature.
|
||||
allow: false
|
||||
# Require the requesting device to have a valid cross-signing signature?
|
||||
# This doesn't require that the bridge has verified the device, only that the user has verified it.
|
||||
# Not yet implemented.
|
||||
require_cross_signing: false
|
||||
# Require devices to be verified by the bridge?
|
||||
# Verification by the bridge is not yet implemented.
|
||||
require_verification: true
|
||||
# Whether or not to explicitly set the avatar and room name for private
|
||||
# chat portal rooms. This will be implicitly enabled if encryption.default is true.
|
||||
private_chat_portal_meta: false
|
||||
# Whether or not the bridge should send a read receipt from the bridge bot when a message has
|
||||
# been sent to Signal. This let's you check manually whether the bridge is receiving your
|
||||
# messages.
|
||||
# Note that this is not related to Signal delivery receipts.
|
||||
delivery_receipts: false
|
||||
# Whether or not delivery errors should be reported as messages in the Matrix room. (not yet implemented)
|
||||
delivery_error_reports: false
|
||||
# Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
|
||||
# This field will automatically be changed back to false after it,
|
||||
# except if the config file is not writable.
|
||||
resend_bridge_info: false
|
||||
|
||||
# The prefix for commands. Only required in non-management rooms.
|
||||
command_prefix: "!signal"
|
||||
|
||||
# Permissions for using the bridge.
|
||||
# Permitted values:
|
||||
# user - Use the bridge with puppeting.
|
||||
# admin - Use and administrate the bridge.
|
||||
# Permitted keys:
|
||||
# * - All Matrix users
|
||||
# domain - All users on that homeserver
|
||||
# mxid - Specific user
|
||||
permissions:
|
||||
'{{ matrix_mautrix_signal_homeserver_domain }}': user
|
||||
|
||||
|
||||
# Python logging configuration.
|
||||
#
|
||||
# See section 16.7.2 of the Python documentation for more info:
|
||||
# https://docs.python.org/3.6/library/logging.config.html#configuration-dictionary-schema
|
||||
logging:
|
||||
version: 1
|
||||
formatters:
|
||||
colored:
|
||||
(): mautrix_signal.util.ColorFormatter
|
||||
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
|
||||
normal:
|
||||
format: "[%(asctime)s] [%(levelname)s@%(name)s] %(message)s"
|
||||
handlers:
|
||||
console:
|
||||
class: logging.StreamHandler
|
||||
formatter: colored
|
||||
loggers:
|
||||
mau:
|
||||
level: {{ matrix_mautrix_signal_log_level }}
|
||||
aiohttp:
|
||||
level: INFO
|
||||
root:
|
||||
level: {{ matrix_mautrix_signal_log_level }}
|
||||
handlers: [console]
|
@ -0,0 +1,14 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
id: signal
|
||||
as_token: "{{ matrix_mautrix_signal_appservice_token }}"
|
||||
hs_token: "{{ matrix_mautrix_signal_homeserver_token }}"
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: '^@signal_.+:{{ matrix_mautrix_signal_homeserver_domain|regex_escape }}$'
|
||||
aliases:
|
||||
- exclusive: true
|
||||
regex: '^#signal_.+:{{ matrix_mautrix_signal_homeserver_domain|regex_escape }}$'
|
||||
url: {{ matrix_mautrix_signal_appservice_address }}
|
||||
sender_localpart: signalbot
|
||||
rate_limited: false
|
@ -0,0 +1,39 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
[Unit]
|
||||
Description=Matrix Mautrix Signal daemon
|
||||
|
||||
{% for service in matrix_mautrix_signal_daemon_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
|
||||
{% for service in matrix_mautrix_signal_daemon_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ matrix_systemd_unit_home_path }}"
|
||||
|
||||
ExecStartPre=-{{ matrix_host_command_docker }} kill matrix-mautrix-signal-daemon
|
||||
ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-mautrix-signal-daemon
|
||||
|
||||
# Intentional delay, so that the homeserver (we likely depend on) can manage to start.
|
||||
ExecStartPre={{ matrix_host_command_sleep }} 5
|
||||
|
||||
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-signal-daemon \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--network={{ matrix_docker_network }} \
|
||||
-v {{ matrix_mautrix_signal_daemon_path }}:/signald:z \
|
||||
{{ matrix_mautrix_signal_daemon_docker_image }}
|
||||
|
||||
ExecStop=-{{ matrix_host_command_docker }} kill matrix-mautrix-signal-daemon
|
||||
ExecStop=-{{ matrix_host_command_docker }} rm matrix-mautrix-signal-daemon
|
||||
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-mautrix-signal-daemon
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
@ -0,0 +1,45 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
[Unit]
|
||||
Description=Matrix Mautrix Signal server
|
||||
|
||||
{% for service in matrix_mautrix_signal_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
|
||||
{% for service in matrix_mautrix_signal_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ matrix_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ matrix_host_command_docker }} kill matrix-mautrix-signal
|
||||
ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-mautrix-signal
|
||||
|
||||
# Intentional delay, so that the homeserver (we likely depend on) can manage to start.
|
||||
ExecStartPre={{ matrix_host_command_sleep }} 5
|
||||
|
||||
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-signal \
|
||||
--log-driver=none \
|
||||
--network={{ matrix_docker_network }} \
|
||||
{% if matrix_mautrix_signal_container_http_host_bind_port %}
|
||||
-p {{ matrix_mautrix_signal_container_http_host_bind_port }}:29328 \
|
||||
{% endif %}
|
||||
-v {{ matrix_mautrix_signal_daemon_path }}:/signald:z \
|
||||
-v {{ matrix_mautrix_signal_config_path }}:/data:z \
|
||||
{% for arg in matrix_mautrix_signal_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_mautrix_signal_docker_image }} \
|
||||
python3 -m mautrix_signal -c /data/config.yaml
|
||||
|
||||
ExecStop=-{{ matrix_host_command_docker }} kill matrix-mautrix-signal
|
||||
ExecStop=-{{ matrix_host_command_docker }} rm matrix-mautrix-signal
|
||||
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-mautrix-signal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue