├── .githooks
└── pre-commit
├── .github
├── ISSUE_TEMPLATE.md
└── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── ALL_README.md
├── LICENSE
├── README.md
├── README_es.md
├── README_eu.md
├── README_fr.md
├── README_gl.md
├── README_id.md
├── README_it.md
├── README_zh_Hans.md
├── conf
├── config.yaml
└── systemd.service
├── config_panel.toml
├── doc
├── ADMIN.md
├── ADMIN_es.md
├── ADMIN_fr.md
├── DESCRIPTION.md
├── DESCRIPTION_es.md
├── DESCRIPTION_fr.md
├── DEVELOPMENT.md
├── DEVELOPMENT_es.md
├── DEVELOPMENT_fr.md
├── POST_INSTALL.md
├── POST_INSTALL_es.md
├── POST_INSTALL_fr.md
├── PRE_INSTALL.md
├── PRE_INSTALL_es.md
└── PRE_INSTALL_fr.md
├── manifest.toml
├── scripts
├── _common.sh
├── backup
├── config
├── install
├── remove
├── restore
└── upgrade
└── tests.toml
/.githooks/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # An example hook script to verify what is about to be committed.
4 | # Called by "git commit" with no arguments. The hook should
5 | # exit with non-zero status after issuing an appropriate message if
6 | # it wants to stop the commit.
7 | #
8 | # To enable this hook, rename this file to "pre-commit".
9 |
10 | if git rev-parse --verify HEAD >/dev/null 2>&1
11 | then
12 | against=HEAD
13 | else
14 | # Initial commit: diff against an empty tree object
15 | against=$(git hash-object -t tree /dev/null)
16 | fi
17 |
18 | # If you want to allow non-ASCII filenames set this variable to true.
19 | allownonascii=$(git config --type=bool hooks.allownonascii)
20 |
21 | # Redirect output to stderr.
22 | exec 1>&2
23 |
24 | # Cross platform projects tend to avoid non-ASCII filenames; prevent
25 | # them from being added to the repository. We exploit the fact that the
26 | # printable range starts at the space character and ends with tilde.
27 | if [ "$allownonascii" != "true" ] &&
28 | # Note that the use of brackets around a tr range is ok here, (it's
29 | # even required, for portability to Solaris 10's /usr/bin/tr), since
30 | # the square bracket bytes happen to fall in the designated range.
31 | test $(git diff --cached --name-only --diff-filter=A -z $against |
32 | LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
33 | then
34 | cat <<\EOF
35 | Error: Attempt to add a non-ASCII file name.
36 |
37 | This can cause problems if you want to work with people on other platforms.
38 |
39 | To be portable it is advisable to rename the file.
40 |
41 | If you know what you are doing you can disable this check using:
42 |
43 | git config hooks.allownonascii true
44 | EOF
45 | exit 1
46 | fi
47 |
48 | # Check if config.yaml has been modified and add a message
49 | git diff --cached --name-only | if grep -q "conf/config.yaml"
50 | then
51 | cat <<\EOF
52 | It seems that you have modified the config.yaml file, consider checking 'SPECIFIC UPDATE STEPS' section of .github/workflows/updater.sh and update there as well if needed"
53 | EOF
54 | fi
55 |
56 | # If there are whitespace errors, print the offending file names and fail.
57 | exec git diff-index --check --cached $against --
58 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently.
4 |
5 | ---
6 |
7 | **How to post a meaningful bug report**
8 | 1. *Read this whole template first.*
9 | 2. *Determine if you are on the right place:*
10 | - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!*
11 | - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.*
12 | - *When in doubt, post here and we will figure it out together.*
13 | 3. *Delete the italic comments as you write over them below, and remove this guide.*
14 | ---
15 |
16 | ### Describe the bug
17 |
18 | *A clear and concise description of what the bug is.*
19 |
20 | ### Context
21 |
22 | - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...*
23 | - YunoHost version: x.x.x
24 | - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...*
25 | - Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes*
26 | - If yes, please explain:
27 | - Using, or trying to install package version/branch:
28 | - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`*
29 |
30 | ### Steps to reproduce
31 |
32 | - *If you performed a command from the CLI, the command itself is enough. For example:*
33 | ```sh
34 | sudo yunohost app install the_app
35 | ```
36 | - *If you used the webadmin, please perform the equivalent command from the CLI first.*
37 | - *If the error occurs in your browser, explain what you did:*
38 | 1. *Go to '...'*
39 | 2. *Click on '...'*
40 | 3. *Scroll down to '...'*
41 | 4. *See error*
42 |
43 | ### Expected behavior
44 |
45 | *A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.*
46 |
47 | ### Logs
48 |
49 | *When an operation fails, YunoHost provides a simple way to share the logs.*
50 | - *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.*
51 | - *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.*
52 |
53 | *After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)*
54 |
55 | *If applicable and useful, add screenshots to help explain your problem.*
56 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Problem
2 |
3 | - *Description of why you made this PR*
4 |
5 | ## Solution
6 |
7 | - *And how do you fix that problem*
8 |
9 | ## PR Status
10 |
11 | - [ ] Code finished and ready to be reviewed/tested
12 | - [ ] The fix/enhancement were manually tested (if applicable)
13 |
14 | ## Automatic tests
15 |
16 | Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.sw[op]
3 |
--------------------------------------------------------------------------------
/ALL_README.md:
--------------------------------------------------------------------------------
1 | # All available README files by language
2 |
3 | - [Read the README in English](README.md)
4 | - [Lea el README en español](README_es.md)
5 | - [Irakurri README euskaraz](README_eu.md)
6 | - [Lire le README en français](README_fr.md)
7 | - [Le o README en galego](README_gl.md)
8 | - [Baca README dalam bahasa bahasa Indonesia](README_id.md)
9 | - [阅读中文(简体)的 README](README_zh_Hans.md)
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU AFFERO GENERAL PUBLIC LICENSE
2 | Version 3, 19 November 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU Affero General Public License is a free, copyleft license for
11 | software and other kinds of works, specifically designed to ensure
12 | cooperation with the community in the case of network server software.
13 |
14 | The licenses for most software and other practical works are designed
15 | to take away your freedom to share and change the works. By contrast,
16 | our General Public Licenses are intended to guarantee your freedom to
17 | share and change all versions of a program--to make sure it remains free
18 | software for all its users.
19 |
20 | When we speak of free software, we are referring to freedom, not
21 | price. Our General Public Licenses are designed to make sure that you
22 | have the freedom to distribute copies of free software (and charge for
23 | them if you wish), that you receive source code or can get it if you
24 | want it, that you can change the software or use pieces of it in new
25 | free programs, and that you know you can do these things.
26 |
27 | Developers that use our General Public Licenses protect your rights
28 | with two steps: (1) assert copyright on the software, and (2) offer
29 | you this License which gives you legal permission to copy, distribute
30 | and/or modify the software.
31 |
32 | A secondary benefit of defending all users' freedom is that
33 | improvements made in alternate versions of the program, if they
34 | receive widespread use, become available for other developers to
35 | incorporate. Many developers of free software are heartened and
36 | encouraged by the resulting cooperation. However, in the case of
37 | software used on network servers, this result may fail to come about.
38 | The GNU General Public License permits making a modified version and
39 | letting the public access it on a server without ever releasing its
40 | source code to the public.
41 |
42 | The GNU Affero General Public License is designed specifically to
43 | ensure that, in such cases, the modified source code becomes available
44 | to the community. It requires the operator of a network server to
45 | provide the source code of the modified version running there to the
46 | users of that server. Therefore, public use of a modified version, on
47 | a publicly accessible server, gives the public access to the source
48 | code of the modified version.
49 |
50 | An older license, called the Affero General Public License and
51 | published by Affero, was designed to accomplish similar goals. This is
52 | a different license, not a version of the Affero GPL, but Affero has
53 | released a new version of the Affero GPL which permits relicensing under
54 | this license.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | TERMS AND CONDITIONS
60 |
61 | 0. Definitions.
62 |
63 | "This License" refers to version 3 of the GNU Affero General Public License.
64 |
65 | "Copyright" also means copyright-like laws that apply to other kinds of
66 | works, such as semiconductor masks.
67 |
68 | "The Program" refers to any copyrightable work licensed under this
69 | License. Each licensee is addressed as "you". "Licensees" and
70 | "recipients" may be individuals or organizations.
71 |
72 | To "modify" a work means to copy from or adapt all or part of the work
73 | in a fashion requiring copyright permission, other than the making of an
74 | exact copy. The resulting work is called a "modified version" of the
75 | earlier work or a work "based on" the earlier work.
76 |
77 | A "covered work" means either the unmodified Program or a work based
78 | on the Program.
79 |
80 | To "propagate" a work means to do anything with it that, without
81 | permission, would make you directly or secondarily liable for
82 | infringement under applicable copyright law, except executing it on a
83 | computer or modifying a private copy. Propagation includes copying,
84 | distribution (with or without modification), making available to the
85 | public, and in some countries other activities as well.
86 |
87 | To "convey" a work means any kind of propagation that enables other
88 | parties to make or receive copies. Mere interaction with a user through
89 | a computer network, with no transfer of a copy, is not conveying.
90 |
91 | An interactive user interface displays "Appropriate Legal Notices"
92 | to the extent that it includes a convenient and prominently visible
93 | feature that (1) displays an appropriate copyright notice, and (2)
94 | tells the user that there is no warranty for the work (except to the
95 | extent that warranties are provided), that licensees may convey the
96 | work under this License, and how to view a copy of this License. If
97 | the interface presents a list of user commands or options, such as a
98 | menu, a prominent item in the list meets this criterion.
99 |
100 | 1. Source Code.
101 |
102 | The "source code" for a work means the preferred form of the work
103 | for making modifications to it. "Object code" means any non-source
104 | form of a work.
105 |
106 | A "Standard Interface" means an interface that either is an official
107 | standard defined by a recognized standards body, or, in the case of
108 | interfaces specified for a particular programming language, one that
109 | is widely used among developers working in that language.
110 |
111 | The "System Libraries" of an executable work include anything, other
112 | than the work as a whole, that (a) is included in the normal form of
113 | packaging a Major Component, but which is not part of that Major
114 | Component, and (b) serves only to enable use of the work with that
115 | Major Component, or to implement a Standard Interface for which an
116 | implementation is available to the public in source code form. A
117 | "Major Component", in this context, means a major essential component
118 | (kernel, window system, and so on) of the specific operating system
119 | (if any) on which the executable work runs, or a compiler used to
120 | produce the work, or an object code interpreter used to run it.
121 |
122 | The "Corresponding Source" for a work in object code form means all
123 | the source code needed to generate, install, and (for an executable
124 | work) run the object code and to modify the work, including scripts to
125 | control those activities. However, it does not include the work's
126 | System Libraries, or general-purpose tools or generally available free
127 | programs which are used unmodified in performing those activities but
128 | which are not part of the work. For example, Corresponding Source
129 | includes interface definition files associated with source files for
130 | the work, and the source code for shared libraries and dynamically
131 | linked subprograms that the work is specifically designed to require,
132 | such as by intimate data communication or control flow between those
133 | subprograms and other parts of the work.
134 |
135 | The Corresponding Source need not include anything that users
136 | can regenerate automatically from other parts of the Corresponding
137 | Source.
138 |
139 | The Corresponding Source for a work in source code form is that
140 | same work.
141 |
142 | 2. Basic Permissions.
143 |
144 | All rights granted under this License are granted for the term of
145 | copyright on the Program, and are irrevocable provided the stated
146 | conditions are met. This License explicitly affirms your unlimited
147 | permission to run the unmodified Program. The output from running a
148 | covered work is covered by this License only if the output, given its
149 | content, constitutes a covered work. This License acknowledges your
150 | rights of fair use or other equivalent, as provided by copyright law.
151 |
152 | You may make, run and propagate covered works that you do not
153 | convey, without conditions so long as your license otherwise remains
154 | in force. You may convey covered works to others for the sole purpose
155 | of having them make modifications exclusively for you, or provide you
156 | with facilities for running those works, provided that you comply with
157 | the terms of this License in conveying all material for which you do
158 | not control copyright. Those thus making or running the covered works
159 | for you must do so exclusively on your behalf, under your direction
160 | and control, on terms that prohibit them from making any copies of
161 | your copyrighted material outside their relationship with you.
162 |
163 | Conveying under any other circumstances is permitted solely under
164 | the conditions stated below. Sublicensing is not allowed; section 10
165 | makes it unnecessary.
166 |
167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
168 |
169 | No covered work shall be deemed part of an effective technological
170 | measure under any applicable law fulfilling obligations under article
171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
172 | similar laws prohibiting or restricting circumvention of such
173 | measures.
174 |
175 | When you convey a covered work, you waive any legal power to forbid
176 | circumvention of technological measures to the extent such circumvention
177 | is effected by exercising rights under this License with respect to
178 | the covered work, and you disclaim any intention to limit operation or
179 | modification of the work as a means of enforcing, against the work's
180 | users, your or third parties' legal rights to forbid circumvention of
181 | technological measures.
182 |
183 | 4. Conveying Verbatim Copies.
184 |
185 | You may convey verbatim copies of the Program's source code as you
186 | receive it, in any medium, provided that you conspicuously and
187 | appropriately publish on each copy an appropriate copyright notice;
188 | keep intact all notices stating that this License and any
189 | non-permissive terms added in accord with section 7 apply to the code;
190 | keep intact all notices of the absence of any warranty; and give all
191 | recipients a copy of this License along with the Program.
192 |
193 | You may charge any price or no price for each copy that you convey,
194 | and you may offer support or warranty protection for a fee.
195 |
196 | 5. Conveying Modified Source Versions.
197 |
198 | You may convey a work based on the Program, or the modifications to
199 | produce it from the Program, in the form of source code under the
200 | terms of section 4, provided that you also meet all of these conditions:
201 |
202 | a) The work must carry prominent notices stating that you modified
203 | it, and giving a relevant date.
204 |
205 | b) The work must carry prominent notices stating that it is
206 | released under this License and any conditions added under section
207 | 7. This requirement modifies the requirement in section 4 to
208 | "keep intact all notices".
209 |
210 | c) You must license the entire work, as a whole, under this
211 | License to anyone who comes into possession of a copy. This
212 | License will therefore apply, along with any applicable section 7
213 | additional terms, to the whole of the work, and all its parts,
214 | regardless of how they are packaged. This License gives no
215 | permission to license the work in any other way, but it does not
216 | invalidate such permission if you have separately received it.
217 |
218 | d) If the work has interactive user interfaces, each must display
219 | Appropriate Legal Notices; however, if the Program has interactive
220 | interfaces that do not display Appropriate Legal Notices, your
221 | work need not make them do so.
222 |
223 | A compilation of a covered work with other separate and independent
224 | works, which are not by their nature extensions of the covered work,
225 | and which are not combined with it such as to form a larger program,
226 | in or on a volume of a storage or distribution medium, is called an
227 | "aggregate" if the compilation and its resulting copyright are not
228 | used to limit the access or legal rights of the compilation's users
229 | beyond what the individual works permit. Inclusion of a covered work
230 | in an aggregate does not cause this License to apply to the other
231 | parts of the aggregate.
232 |
233 | 6. Conveying Non-Source Forms.
234 |
235 | You may convey a covered work in object code form under the terms
236 | of sections 4 and 5, provided that you also convey the
237 | machine-readable Corresponding Source under the terms of this License,
238 | in one of these ways:
239 |
240 | a) Convey the object code in, or embodied in, a physical product
241 | (including a physical distribution medium), accompanied by the
242 | Corresponding Source fixed on a durable physical medium
243 | customarily used for software interchange.
244 |
245 | b) Convey the object code in, or embodied in, a physical product
246 | (including a physical distribution medium), accompanied by a
247 | written offer, valid for at least three years and valid for as
248 | long as you offer spare parts or customer support for that product
249 | model, to give anyone who possesses the object code either (1) a
250 | copy of the Corresponding Source for all the software in the
251 | product that is covered by this License, on a durable physical
252 | medium customarily used for software interchange, for a price no
253 | more than your reasonable cost of physically performing this
254 | conveying of source, or (2) access to copy the
255 | Corresponding Source from a network server at no charge.
256 |
257 | c) Convey individual copies of the object code with a copy of the
258 | written offer to provide the Corresponding Source. This
259 | alternative is allowed only occasionally and noncommercially, and
260 | only if you received the object code with such an offer, in accord
261 | with subsection 6b.
262 |
263 | d) Convey the object code by offering access from a designated
264 | place (gratis or for a charge), and offer equivalent access to the
265 | Corresponding Source in the same way through the same place at no
266 | further charge. You need not require recipients to copy the
267 | Corresponding Source along with the object code. If the place to
268 | copy the object code is a network server, the Corresponding Source
269 | may be on a different server (operated by you or a third party)
270 | that supports equivalent copying facilities, provided you maintain
271 | clear directions next to the object code saying where to find the
272 | Corresponding Source. Regardless of what server hosts the
273 | Corresponding Source, you remain obligated to ensure that it is
274 | available for as long as needed to satisfy these requirements.
275 |
276 | e) Convey the object code using peer-to-peer transmission, provided
277 | you inform other peers where the object code and Corresponding
278 | Source of the work are being offered to the general public at no
279 | charge under subsection 6d.
280 |
281 | A separable portion of the object code, whose source code is excluded
282 | from the Corresponding Source as a System Library, need not be
283 | included in conveying the object code work.
284 |
285 | A "User Product" is either (1) a "consumer product", which means any
286 | tangible personal property which is normally used for personal, family,
287 | or household purposes, or (2) anything designed or sold for incorporation
288 | into a dwelling. In determining whether a product is a consumer product,
289 | doubtful cases shall be resolved in favor of coverage. For a particular
290 | product received by a particular user, "normally used" refers to a
291 | typical or common use of that class of product, regardless of the status
292 | of the particular user or of the way in which the particular user
293 | actually uses, or expects or is expected to use, the product. A product
294 | is a consumer product regardless of whether the product has substantial
295 | commercial, industrial or non-consumer uses, unless such uses represent
296 | the only significant mode of use of the product.
297 |
298 | "Installation Information" for a User Product means any methods,
299 | procedures, authorization keys, or other information required to install
300 | and execute modified versions of a covered work in that User Product from
301 | a modified version of its Corresponding Source. The information must
302 | suffice to ensure that the continued functioning of the modified object
303 | code is in no case prevented or interfered with solely because
304 | modification has been made.
305 |
306 | If you convey an object code work under this section in, or with, or
307 | specifically for use in, a User Product, and the conveying occurs as
308 | part of a transaction in which the right of possession and use of the
309 | User Product is transferred to the recipient in perpetuity or for a
310 | fixed term (regardless of how the transaction is characterized), the
311 | Corresponding Source conveyed under this section must be accompanied
312 | by the Installation Information. But this requirement does not apply
313 | if neither you nor any third party retains the ability to install
314 | modified object code on the User Product (for example, the work has
315 | been installed in ROM).
316 |
317 | The requirement to provide Installation Information does not include a
318 | requirement to continue to provide support service, warranty, or updates
319 | for a work that has been modified or installed by the recipient, or for
320 | the User Product in which it has been modified or installed. Access to a
321 | network may be denied when the modification itself materially and
322 | adversely affects the operation of the network or violates the rules and
323 | protocols for communication across the network.
324 |
325 | Corresponding Source conveyed, and Installation Information provided,
326 | in accord with this section must be in a format that is publicly
327 | documented (and with an implementation available to the public in
328 | source code form), and must require no special password or key for
329 | unpacking, reading or copying.
330 |
331 | 7. Additional Terms.
332 |
333 | "Additional permissions" are terms that supplement the terms of this
334 | License by making exceptions from one or more of its conditions.
335 | Additional permissions that are applicable to the entire Program shall
336 | be treated as though they were included in this License, to the extent
337 | that they are valid under applicable law. If additional permissions
338 | apply only to part of the Program, that part may be used separately
339 | under those permissions, but the entire Program remains governed by
340 | this License without regard to the additional permissions.
341 |
342 | When you convey a copy of a covered work, you may at your option
343 | remove any additional permissions from that copy, or from any part of
344 | it. (Additional permissions may be written to require their own
345 | removal in certain cases when you modify the work.) You may place
346 | additional permissions on material, added by you to a covered work,
347 | for which you have or can give appropriate copyright permission.
348 |
349 | Notwithstanding any other provision of this License, for material you
350 | add to a covered work, you may (if authorized by the copyright holders of
351 | that material) supplement the terms of this License with terms:
352 |
353 | a) Disclaiming warranty or limiting liability differently from the
354 | terms of sections 15 and 16 of this License; or
355 |
356 | b) Requiring preservation of specified reasonable legal notices or
357 | author attributions in that material or in the Appropriate Legal
358 | Notices displayed by works containing it; or
359 |
360 | c) Prohibiting misrepresentation of the origin of that material, or
361 | requiring that modified versions of such material be marked in
362 | reasonable ways as different from the original version; or
363 |
364 | d) Limiting the use for publicity purposes of names of licensors or
365 | authors of the material; or
366 |
367 | e) Declining to grant rights under trademark law for use of some
368 | trade names, trademarks, or service marks; or
369 |
370 | f) Requiring indemnification of licensors and authors of that
371 | material by anyone who conveys the material (or modified versions of
372 | it) with contractual assumptions of liability to the recipient, for
373 | any liability that these contractual assumptions directly impose on
374 | those licensors and authors.
375 |
376 | All other non-permissive additional terms are considered "further
377 | restrictions" within the meaning of section 10. If the Program as you
378 | received it, or any part of it, contains a notice stating that it is
379 | governed by this License along with a term that is a further
380 | restriction, you may remove that term. If a license document contains
381 | a further restriction but permits relicensing or conveying under this
382 | License, you may add to a covered work material governed by the terms
383 | of that license document, provided that the further restriction does
384 | not survive such relicensing or conveying.
385 |
386 | If you add terms to a covered work in accord with this section, you
387 | must place, in the relevant source files, a statement of the
388 | additional terms that apply to those files, or a notice indicating
389 | where to find the applicable terms.
390 |
391 | Additional terms, permissive or non-permissive, may be stated in the
392 | form of a separately written license, or stated as exceptions;
393 | the above requirements apply either way.
394 |
395 | 8. Termination.
396 |
397 | You may not propagate or modify a covered work except as expressly
398 | provided under this License. Any attempt otherwise to propagate or
399 | modify it is void, and will automatically terminate your rights under
400 | this License (including any patent licenses granted under the third
401 | paragraph of section 11).
402 |
403 | However, if you cease all violation of this License, then your
404 | license from a particular copyright holder is reinstated (a)
405 | provisionally, unless and until the copyright holder explicitly and
406 | finally terminates your license, and (b) permanently, if the copyright
407 | holder fails to notify you of the violation by some reasonable means
408 | prior to 60 days after the cessation.
409 |
410 | Moreover, your license from a particular copyright holder is
411 | reinstated permanently if the copyright holder notifies you of the
412 | violation by some reasonable means, this is the first time you have
413 | received notice of violation of this License (for any work) from that
414 | copyright holder, and you cure the violation prior to 30 days after
415 | your receipt of the notice.
416 |
417 | Termination of your rights under this section does not terminate the
418 | licenses of parties who have received copies or rights from you under
419 | this License. If your rights have been terminated and not permanently
420 | reinstated, you do not qualify to receive new licenses for the same
421 | material under section 10.
422 |
423 | 9. Acceptance Not Required for Having Copies.
424 |
425 | You are not required to accept this License in order to receive or
426 | run a copy of the Program. Ancillary propagation of a covered work
427 | occurring solely as a consequence of using peer-to-peer transmission
428 | to receive a copy likewise does not require acceptance. However,
429 | nothing other than this License grants you permission to propagate or
430 | modify any covered work. These actions infringe copyright if you do
431 | not accept this License. Therefore, by modifying or propagating a
432 | covered work, you indicate your acceptance of this License to do so.
433 |
434 | 10. Automatic Licensing of Downstream Recipients.
435 |
436 | Each time you convey a covered work, the recipient automatically
437 | receives a license from the original licensors, to run, modify and
438 | propagate that work, subject to this License. You are not responsible
439 | for enforcing compliance by third parties with this License.
440 |
441 | An "entity transaction" is a transaction transferring control of an
442 | organization, or substantially all assets of one, or subdividing an
443 | organization, or merging organizations. If propagation of a covered
444 | work results from an entity transaction, each party to that
445 | transaction who receives a copy of the work also receives whatever
446 | licenses to the work the party's predecessor in interest had or could
447 | give under the previous paragraph, plus a right to possession of the
448 | Corresponding Source of the work from the predecessor in interest, if
449 | the predecessor has it or can get it with reasonable efforts.
450 |
451 | You may not impose any further restrictions on the exercise of the
452 | rights granted or affirmed under this License. For example, you may
453 | not impose a license fee, royalty, or other charge for exercise of
454 | rights granted under this License, and you may not initiate litigation
455 | (including a cross-claim or counterclaim in a lawsuit) alleging that
456 | any patent claim is infringed by making, using, selling, offering for
457 | sale, or importing the Program or any portion of it.
458 |
459 | 11. Patents.
460 |
461 | A "contributor" is a copyright holder who authorizes use under this
462 | License of the Program or a work on which the Program is based. The
463 | work thus licensed is called the contributor's "contributor version".
464 |
465 | A contributor's "essential patent claims" are all patent claims
466 | owned or controlled by the contributor, whether already acquired or
467 | hereafter acquired, that would be infringed by some manner, permitted
468 | by this License, of making, using, or selling its contributor version,
469 | but do not include claims that would be infringed only as a
470 | consequence of further modification of the contributor version. For
471 | purposes of this definition, "control" includes the right to grant
472 | patent sublicenses in a manner consistent with the requirements of
473 | this License.
474 |
475 | Each contributor grants you a non-exclusive, worldwide, royalty-free
476 | patent license under the contributor's essential patent claims, to
477 | make, use, sell, offer for sale, import and otherwise run, modify and
478 | propagate the contents of its contributor version.
479 |
480 | In the following three paragraphs, a "patent license" is any express
481 | agreement or commitment, however denominated, not to enforce a patent
482 | (such as an express permission to practice a patent or covenant not to
483 | sue for patent infringement). To "grant" such a patent license to a
484 | party means to make such an agreement or commitment not to enforce a
485 | patent against the party.
486 |
487 | If you convey a covered work, knowingly relying on a patent license,
488 | and the Corresponding Source of the work is not available for anyone
489 | to copy, free of charge and under the terms of this License, through a
490 | publicly available network server or other readily accessible means,
491 | then you must either (1) cause the Corresponding Source to be so
492 | available, or (2) arrange to deprive yourself of the benefit of the
493 | patent license for this particular work, or (3) arrange, in a manner
494 | consistent with the requirements of this License, to extend the patent
495 | license to downstream recipients. "Knowingly relying" means you have
496 | actual knowledge that, but for the patent license, your conveying the
497 | covered work in a country, or your recipient's use of the covered work
498 | in a country, would infringe one or more identifiable patents in that
499 | country that you have reason to believe are valid.
500 |
501 | If, pursuant to or in connection with a single transaction or
502 | arrangement, you convey, or propagate by procuring conveyance of, a
503 | covered work, and grant a patent license to some of the parties
504 | receiving the covered work authorizing them to use, propagate, modify
505 | or convey a specific copy of the covered work, then the patent license
506 | you grant is automatically extended to all recipients of the covered
507 | work and works based on it.
508 |
509 | A patent license is "discriminatory" if it does not include within
510 | the scope of its coverage, prohibits the exercise of, or is
511 | conditioned on the non-exercise of one or more of the rights that are
512 | specifically granted under this License. You may not convey a covered
513 | work if you are a party to an arrangement with a third party that is
514 | in the business of distributing software, under which you make payment
515 | to the third party based on the extent of your activity of conveying
516 | the work, and under which the third party grants, to any of the
517 | parties who would receive the covered work from you, a discriminatory
518 | patent license (a) in connection with copies of the covered work
519 | conveyed by you (or copies made from those copies), or (b) primarily
520 | for and in connection with specific products or compilations that
521 | contain the covered work, unless you entered into that arrangement,
522 | or that patent license was granted, prior to 28 March 2007.
523 |
524 | Nothing in this License shall be construed as excluding or limiting
525 | any implied license or other defenses to infringement that may
526 | otherwise be available to you under applicable patent law.
527 |
528 | 12. No Surrender of Others' Freedom.
529 |
530 | If conditions are imposed on you (whether by court order, agreement or
531 | otherwise) that contradict the conditions of this License, they do not
532 | excuse you from the conditions of this License. If you cannot convey a
533 | covered work so as to satisfy simultaneously your obligations under this
534 | License and any other pertinent obligations, then as a consequence you may
535 | not convey it at all. For example, if you agree to terms that obligate you
536 | to collect a royalty for further conveying from those to whom you convey
537 | the Program, the only way you could satisfy both those terms and this
538 | License would be to refrain entirely from conveying the Program.
539 |
540 | 13. Remote Network Interaction; Use with the GNU General Public License.
541 |
542 | Notwithstanding any other provision of this License, if you modify the
543 | Program, your modified version must prominently offer all users
544 | interacting with it remotely through a computer network (if your version
545 | supports such interaction) an opportunity to receive the Corresponding
546 | Source of your version by providing access to the Corresponding Source
547 | from a network server at no charge, through some standard or customary
548 | means of facilitating copying of software. This Corresponding Source
549 | shall include the Corresponding Source for any work covered by version 3
550 | of the GNU General Public License that is incorporated pursuant to the
551 | following paragraph.
552 |
553 | Notwithstanding any other provision of this License, you have
554 | permission to link or combine any covered work with a work licensed
555 | under version 3 of the GNU General Public License into a single
556 | combined work, and to convey the resulting work. The terms of this
557 | License will continue to apply to the part which is the covered work,
558 | but the work with which it is combined will remain governed by version
559 | 3 of the GNU General Public License.
560 |
561 | 14. Revised Versions of this License.
562 |
563 | The Free Software Foundation may publish revised and/or new versions of
564 | the GNU Affero General Public License from time to time. Such new versions
565 | will be similar in spirit to the present version, but may differ in detail to
566 | address new problems or concerns.
567 |
568 | Each version is given a distinguishing version number. If the
569 | Program specifies that a certain numbered version of the GNU Affero General
570 | Public License "or any later version" applies to it, you have the
571 | option of following the terms and conditions either of that numbered
572 | version or of any later version published by the Free Software
573 | Foundation. If the Program does not specify a version number of the
574 | GNU Affero General Public License, you may choose any version ever published
575 | by the Free Software Foundation.
576 |
577 | If the Program specifies that a proxy can decide which future
578 | versions of the GNU Affero General Public License can be used, that proxy's
579 | public statement of acceptance of a version permanently authorizes you
580 | to choose that version for the Program.
581 |
582 | Later license versions may give you additional or different
583 | permissions. However, no additional obligations are imposed on any
584 | author or copyright holder as a result of your choosing to follow a
585 | later version.
586 |
587 | 15. Disclaimer of Warranty.
588 |
589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
597 |
598 | 16. Limitation of Liability.
599 |
600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
608 | SUCH DAMAGES.
609 |
610 | 17. Interpretation of Sections 15 and 16.
611 |
612 | If the disclaimer of warranty and limitation of liability provided
613 | above cannot be given local legal effect according to their terms,
614 | reviewing courts shall apply local law that most closely approximates
615 | an absolute waiver of all civil liability in connection with the
616 | Program, unless a warranty or assumption of liability accompanies a
617 | copy of the Program in return for a fee.
618 |
619 | END OF TERMS AND CONDITIONS
620 |
621 | How to Apply These Terms to Your New Programs
622 |
623 | If you develop a new program, and you want it to be of the greatest
624 | possible use to the public, the best way to achieve this is to make it
625 | free software which everyone can redistribute and change under these terms.
626 |
627 | To do so, attach the following notices to the program. It is safest
628 | to attach them to the start of each source file to most effectively
629 | state the exclusion of warranty; and each file should have at least
630 | the "copyright" line and a pointer to where the full notice is found.
631 |
632 |
633 | Copyright (C)
634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published by
637 | the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Matrix-WhatsApp bridge for YunoHost
7 |
8 | [](https://ci-apps.yunohost.org/ci/apps/mautrix_whatsapp/)  
9 |
10 | [](https://install-app.yunohost.org/?app=mautrix_whatsapp)
11 |
12 | *[Read this README in other languages.](./ALL_README.md)*
13 |
14 | > *This package allows you to install Matrix-WhatsApp bridge quickly and simply on a YunoHost server.*
15 | > *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*
16 |
17 | ## Overview
18 |
19 | A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service.
20 | Messages, media and notifications are bridged between a WhatsApp user and a matrix user.
21 | With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations.
22 | The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available).
23 | Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand.
24 |
25 | ** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
26 |
27 |
28 | **Shipped version:** 0.10.9~ynh1
29 | ## Documentation and resources
30 |
31 | - Official app website:
32 | - Official admin documentation:
33 | - Upstream app code repository:
34 | - YunoHost Store:
35 | - Report a bug:
36 |
37 | ## Developer info
38 |
39 | Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing).
40 |
41 | To try the `testing` branch, please proceed like that:
42 |
43 | ```bash
44 | sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
45 | or
46 | sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
47 | ```
48 |
49 | **More info regarding app packaging:**
50 |
--------------------------------------------------------------------------------
/README_es.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Matrix-WhatsApp bridge para Yunohost
7 |
8 | [](https://ci-apps.yunohost.org/ci/apps/mautrix_whatsapp/)  
9 |
10 | [](https://install-app.yunohost.org/?app=mautrix_whatsapp)
11 |
12 | *[Leer este README en otros idiomas.](./ALL_README.md)*
13 |
14 | > *Este paquete le permite instalarMatrix-WhatsApp bridge rapidamente y simplement en un servidor YunoHost.*
15 | > *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.*
16 |
17 | ## Descripción general
18 |
19 | Un puente de marionetas entre Matrix y WhatsApp empaquetado como un servicio YunoHost.
20 | Mensajes, medios de comunicación y las notificaciones son puenteados entre una cuenta de WhatsApp y una cuenta de Matrix.
21 | Con la opción de inicio de sesión RelayBot, una persona de Matrix puede invitar a otra persona de Matrix a una sala de WhatsApp puenteada, de modo que incluso personas sin cuenta de WhatsApp pueden participar en conversaciones de grupo de WhatsApp.
22 | El puente ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) consiste en un servicio de la aplicación Synapse y se basa en Postgresql (Mysql también disponible).
23 | Por lo tanto, debe instalarse previamente [Synapse para YunoHost](https://github.com/YunoHost-Apps/synapse_ynh).
24 |
25 | ** Atención: haz siempre copias de seguridad y restaura las aplicaciones Yunohost matrix_synapse y mautrix_whatsapp juntas.
26 |
27 | **Versión actual:** 0.10.9~ynh1
28 | ## Documentaciones y recursos
29 |
30 | - Sitio web oficial:
31 | - Documentación administrador oficial:
32 | - Repositorio del código fuente oficial de la aplicación :
33 | - Catálogo YunoHost:
34 | - Reportar un error:
35 |
36 | ## Información para desarrolladores
37 |
38 | Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing
39 |
40 | Para probar la rama `testing`, sigue asÍ:
41 |
42 | ```bash
43 | sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
44 | o
45 | sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
46 | ```
47 |
48 | **Mas informaciones sobre el empaquetado de aplicaciones:**
49 |
--------------------------------------------------------------------------------
/README_eu.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Matrix-WhatsApp bridge YunoHost-erako
7 |
8 | [](https://ci-apps.yunohost.org/ci/apps/mautrix_whatsapp/)  
9 |
10 | [](https://install-app.yunohost.org/?app=mautrix_whatsapp)
11 |
12 | *[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
13 |
14 | > *Pakete honek Matrix-WhatsApp bridge YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
15 | > *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
16 |
17 | ## Aurreikuspena
18 |
19 | A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service.
20 | Messages, media and notifications are bridged between a WhatsApp user and a matrix user.
21 | With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations.
22 | The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available).
23 | Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand.
24 |
25 | ** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
26 |
27 |
28 | **Paketatutako bertsioa:** 0.10.9~ynh1
29 | ## Dokumentazioa eta baliabideak
30 |
31 | - Aplikazioaren webgune ofiziala:
32 | - Administratzaileen dokumentazio ofiziala:
33 | - Jatorrizko aplikazioaren kode-gordailua:
34 | - YunoHost Denda:
35 | - Eman errore baten berri:
36 |
37 | ## Garatzaileentzako informazioa
38 |
39 | Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing).
40 |
41 | `testing` abarra probatzeko, ondorengoa egin:
42 |
43 | ```bash
44 | sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
45 | edo
46 | sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
47 | ```
48 |
49 | **Informazio gehiago aplikazioaren paketatzeari buruz:**
50 |
--------------------------------------------------------------------------------
/README_fr.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Matrix-WhatsApp bridge pour YunoHost
7 |
8 | [](https://ci-apps.yunohost.org/ci/apps/mautrix_whatsapp/)  
9 |
10 | [](https://install-app.yunohost.org/?app=mautrix_whatsapp)
11 |
12 | *[Lire le README dans d'autres langues.](./ALL_README.md)*
13 |
14 | > *Ce package vous permet d’installer Matrix-WhatsApp bridge rapidement et simplement sur un serveur YunoHost.*
15 | > *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.*
16 |
17 | ## Vue d’ensemble
18 |
19 | Une passerelle entre Matrix et WhatsApp empaquetée comme un service YunoHost.
20 | Les messages, médias et notifications sont relayées entre un compte WhatsApp et un compte Matrix.
21 | Avec l'option de connexion Relaybot, un compte Matrix peut inviter d'autres comptes Matrix dans un salon Matrix relayé avec un groupe WhatsApp, ainsi même des personnes sans compte WhatsApp peuvent communiquer avec des utilisateur.ice.s de WhatsApp.
22 | La passerelle ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) consiste en un Service d'Application Matrix-Synapse et repose sur une base-de-données postgresql (mysql également possible).
23 | C'est pourquoi [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) doit être préalablemnet installé.
24 |
25 | ** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix_synapse et mautrix_whatsapp en même temps!**
26 |
27 |
28 | **Version incluse :** 0.10.9~ynh1
29 | ## Documentations et ressources
30 |
31 | - Site officiel de l’app :
32 | - Documentation officielle de l’admin :
33 | - Dépôt de code officiel de l’app :
34 | - YunoHost Store :
35 | - Signaler un bug :
36 |
37 | ## Informations pour les développeurs
38 |
39 | Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing).
40 |
41 | Pour essayer la branche `testing`, procédez comme suit :
42 |
43 | ```bash
44 | sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
45 | ou
46 | sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
47 | ```
48 |
49 | **Plus d’infos sur le packaging d’applications :**
50 |
--------------------------------------------------------------------------------
/README_gl.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Matrix-WhatsApp bridge para YunoHost
7 |
8 | [](https://ci-apps.yunohost.org/ci/apps/mautrix_whatsapp/)  
9 |
10 | [](https://install-app.yunohost.org/?app=mautrix_whatsapp)
11 |
12 | *[Le este README en outros idiomas.](./ALL_README.md)*
13 |
14 | > *Este paquete permíteche instalar Matrix-WhatsApp bridge de xeito rápido e doado nun servidor YunoHost.*
15 | > *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.*
16 |
17 | ## Vista xeral
18 |
19 | A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service.
20 | Messages, media and notifications are bridged between a WhatsApp user and a matrix user.
21 | With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations.
22 | The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available).
23 | Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand.
24 |
25 | ** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
26 |
27 |
28 | **Versión proporcionada:** 0.10.9~ynh1
29 | ## Documentación e recursos
30 |
31 | - Web oficial da app:
32 | - Documentación oficial para admin:
33 | - Repositorio de orixe do código:
34 | - Tenda YunoHost:
35 | - Informar dun problema:
36 |
37 | ## Info de desenvolvemento
38 |
39 | Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing).
40 |
41 | Para probar a rama `testing`, procede deste xeito:
42 |
43 | ```bash
44 | sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
45 | ou
46 | sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
47 | ```
48 |
49 | **Máis info sobre o empaquetado da app:**
50 |
--------------------------------------------------------------------------------
/README_id.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Matrix-WhatsApp bridge untuk YunoHost
7 |
8 | [](https://ci-apps.yunohost.org/ci/apps/mautrix_whatsapp/)  
9 |
10 | [](https://install-app.yunohost.org/?app=mautrix_whatsapp)
11 |
12 | *[Baca README ini dengan bahasa yang lain.](./ALL_README.md)*
13 |
14 | > *Paket ini memperbolehkan Anda untuk memasang Matrix-WhatsApp bridge secara cepat dan mudah pada server YunoHost.*
15 | > *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.*
16 |
17 | ## Ringkasan
18 |
19 | A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service.
20 | Messages, media and notifications are bridged between a WhatsApp user and a matrix user.
21 | With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations.
22 | The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available).
23 | Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand.
24 |
25 | ** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
26 |
27 |
28 | **Versi terkirim:** 0.10.9~ynh1
29 | ## Dokumentasi dan sumber daya
30 |
31 | - Website aplikasi resmi:
32 | - Dokumentasi admin resmi:
33 | - Depot kode aplikasi hulu:
34 | - Gudang YunoHost:
35 | - Laporkan bug:
36 |
37 | ## Info developer
38 |
39 | Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing).
40 |
41 | Untuk mencoba branch `testing`, silakan dilanjutkan seperti:
42 |
43 | ```bash
44 | sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
45 | atau
46 | sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
47 | ```
48 |
49 | **Info lebih lanjut mengenai pemaketan aplikasi:**
50 |
--------------------------------------------------------------------------------
/README_it.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # Matrix-WhatsApp bridge per YunoHost
7 |
8 | [](https://dash.yunohost.org/appci/app/mautrix_whatsapp)  
9 |
10 | [](https://install-app.yunohost.org/?app=mautrix_whatsapp)
11 |
12 | *[Leggi questo README in altre lingue.](./ALL_README.md)*
13 |
14 | > *Questo pacchetto ti permette di installare Matrix-WhatsApp bridge su un server YunoHost in modo semplice e veloce.*
15 | > *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.*
16 |
17 | ## Panoramica
18 |
19 | A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service.
20 | Messages, media and notifications are bridged between a WhatsApp user and a matrix user.
21 | With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations.
22 | The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available).
23 | Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand.
24 |
25 | ** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
26 |
27 |
28 | **Versione pubblicata:** 0.10.6~ynh1
29 | ## Documentazione e risorse
30 |
31 | - Sito web ufficiale dell’app:
32 | - Documentazione ufficiale per gli amministratori:
33 | - Repository upstream del codice dell’app:
34 | - Store di YunoHost:
35 | - Segnala un problema:
36 |
37 | ## Informazioni per sviluppatori
38 |
39 | Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing).
40 |
41 | Per provare la branch di `testing`, si prega di procedere in questo modo:
42 |
43 | ```bash
44 | sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
45 | o
46 | sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
47 | ```
48 |
49 | **Maggiori informazioni riguardo il pacchetto di quest’app:**
50 |
--------------------------------------------------------------------------------
/README_zh_Hans.md:
--------------------------------------------------------------------------------
1 |
5 |
6 | # YunoHost 上的 Matrix-WhatsApp bridge
7 |
8 | [](https://ci-apps.yunohost.org/ci/apps/mautrix_whatsapp/)  
9 |
10 | [](https://install-app.yunohost.org/?app=mautrix_whatsapp)
11 |
12 | *[阅读此 README 的其它语言版本。](./ALL_README.md)*
13 |
14 | > *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Matrix-WhatsApp bridge。*
15 | > *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。*
16 |
17 | ## 概况
18 |
19 | A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service.
20 | Messages, media and notifications are bridged between a WhatsApp user and a matrix user.
21 | With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations.
22 | The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available).
23 | Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand.
24 |
25 | ** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
26 |
27 |
28 | **分发版本:** 0.10.9~ynh1
29 | ## 文档与资源
30 |
31 | - 官方应用网站:
32 | - 官方管理文档:
33 | - 上游应用代码库:
34 | - YunoHost 商店:
35 | - 报告 bug:
36 |
37 | ## 开发者信息
38 |
39 | 请向 [`testing` 分支](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing) 发送拉取请求。
40 |
41 | 如要尝试 `testing` 分支,请这样操作:
42 |
43 | ```bash
44 | sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
45 | 或
46 | sudo yunohost app upgrade mautrix_whatsapp -u https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/tree/testing --debug
47 | ```
48 |
49 | **有关应用打包的更多信息:**
50 |
--------------------------------------------------------------------------------
/conf/config.yaml:
--------------------------------------------------------------------------------
1 | # Homeserver details.
2 | homeserver:
3 | # The address that this appservice can use to connect to the homeserver.
4 | address: https://__DOMAIN__
5 | # The domain of the homeserver (also known as server_name, used for MXIDs, etc).
6 | domain: __SERVER_NAME__
7 | # What software is the homeserver running?
8 | # Standard Matrix homeservers like Synapse, Dendrite and Conduit should just use "standard" here.
9 | software: standard
10 | # The URL to push real-time bridge status to.
11 | # If set, the bridge will make POST requests to this URL whenever a user's whatsapp connection state changes.
12 | # The bridge will use the appservice as_token to authorize requests.
13 | status_endpoint: null
14 | # Endpoint for reporting per-message status.
15 | message_send_checkpoint_endpoint: null
16 | # Does the homeserver support https://github.com/matrix-org/matrix-spec-proposals/pull/2246?
17 | async_media: __ASYNC_MEDIA__
18 | # Should the bridge use a websocket for connecting to the homeserver?
19 | # The server side is currently not documented anywhere and is only implemented by mautrix-wsproxy,
20 | # mautrix-asmux (deprecated), and hungryserv (proprietary).
21 | websocket: false
22 | # How often should the websocket be pinged? Pinging will be disabled if this is zero.
23 | ping_interval_seconds: 0
24 | # Application service host/registration related details.
25 | # Changing these values requires regeneration of the registration.
26 | appservice:
27 | # The address that the homeserver can use to connect to this appservice.
28 | address: http://localhost:__PORT__
29 | # The hostname and port where this appservice should listen.
30 | hostname: 0.0.0.0
31 | port: __PORT__
32 | # Database config.
33 | database:
34 | # The database type. "sqlite3-fk-wal" and "postgres" are supported.
35 | type: postgres
36 | # The database URI.
37 | # SQLite: A raw file path is supported, but `file:?_txlock=immediate` is recommended.
38 | # https://github.com/mattn/go-sqlite3#connection-string
39 | # Postgres: Connection string. For example, postgres://user:password@host/database?sslmode=disable
40 | # To connect via Unix socket, use something like postgres:///dbname?host=/var/run/postgresql
41 | uri: postgres://__APP__:__DB_PWD__@localhost:5432/__DB_NAME__
42 | # Maximum number of connections. Mostly relevant for Postgres.
43 | max_open_conns: 20
44 | max_idle_conns: 2
45 | # Maximum connection idle time and lifetime before they're closed. Disabled if null.
46 | # Parsed with https://pkg.go.dev/time#ParseDuration
47 | max_conn_idle_time: null
48 | max_conn_lifetime: null
49 | # The unique ID of this appservice.
50 | id: __APPSERVICEID__
51 | # Appservice bot details.
52 | bot:
53 | # Username of the appservice bot.
54 | username: __BOTNAME__
55 | # Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
56 | # to leave display name/avatar as-is.
57 | displayname: __DISPLAYNAME__
58 | avatar: __AVATAR__
59 | # Whether or not to receive ephemeral events via appservice transactions.
60 | # Requires MSC2409 support (i.e. Synapse 1.22+).
61 | ephemeral_events: __EPHEMERAL_EVENTS__
62 | # Should incoming events be handled asynchronously?
63 | # This may be necessary for large public instances with lots of messages going through.
64 | # However, messages will not be guaranteed to be bridged in the same order they were sent in.
65 | async_transactions: false
66 | # Authentication tokens for AS <-> HS communication. Autogenerated; do not modify.
67 | as_token: "This value is generated when generating the registration"
68 | hs_token: "This value is generated when generating the registration"
69 | # Segment-compatible analytics endpoint for tracking some events, like provisioning API login and encryption errors.
70 | analytics:
71 | # Hostname of the tracking server. The path is hardcoded to /v1/track
72 | host: api.segment.io
73 | # API key to send with tracking requests. Tracking is disabled if this is null.
74 | token: null
75 | # Optional user ID for tracking events. If null, defaults to using Matrix user ID.
76 | user_id: null
77 | # Prometheus config.
78 | metrics:
79 | # Enable prometheus metrics?
80 | enabled: __ENABLE_METRICS__
81 | # IP and port where the metrics listener should be. The path is always /metrics
82 | listen: __LISTEN_PORT__
83 | # Config for things that are directly sent to WhatsApp.
84 | whatsapp:
85 | # Device name that's shown in the "WhatsApp Web" section in the mobile app.
86 | os_name: __OS_NAME__
87 | # Browser name that determines the logo shown in the mobile app.
88 | # Must be "unknown" for a generic icon or a valid browser name if you want a specific icon.
89 | # List of valid browser names: https://github.com/tulir/whatsmeow/blob/efc632c008604016ddde63bfcfca8de4e5304da9/binary/proto/def.proto#L43-L64
90 | browser_name: __BROWSER_NAME__
91 | # Bridge config
92 | bridge:
93 | # Localpart template of MXIDs for WhatsApp users.
94 | # {{.}} is replaced with the phone number of the WhatsApp user.
95 | username_template: __USERNAME_TEMPLATE__
96 | # Displayname template for WhatsApp users.
97 | # {{.PushName}} - nickname set by the WhatsApp user
98 | # {{.BusinessName}} - validated WhatsApp business name
99 | # {{.Phone}} - phone number (international format)
100 | # The following variables are also available, but will cause problems on multi-user instances:
101 | # {{.FullName}} - full name from contact list
102 | # {{.FirstName}} - first name from contact list
103 | displayname_template: "{{or .BusinessName .PushName .JID}} (WA)"
104 | # Should the bridge create a space for each logged-in user and add bridged rooms to it?
105 | # Users who logged in before turning this on should run `!wa sync space` to create and fill the space for the first time.
106 | personal_filtering_spaces: __PERSONAL_FILTERING_SPACES__
107 | # Should the bridge send a read receipt from the bridge bot when a message has been sent to WhatsApp?
108 | delivery_receipts: __DELIVERY_RECEIPTS__
109 | # Whether the bridge should send the message status as a custom com.beeper.message_send_status event.
110 | message_status_events: false
111 | # Whether the bridge should send error notices via m.notice events when a message fails to bridge.
112 | message_error_notices: true
113 | # Should incoming calls send a message to the Matrix room?
114 | call_start_notices: true
115 | # Should another user's cryptographic identity changing send a message to Matrix?
116 | identity_change_notices: false
117 | portal_message_buffer: 128
118 | # Settings for handling history sync payloads.
119 | history_sync:
120 | # Enable backfilling history sync payloads from WhatsApp?
121 | backfill: true
122 | # The maximum number of initial conversations that should be synced.
123 | # Other conversations will be backfilled on demand when receiving a message or when initiating a direct chat.
124 | max_initial_conversations: -1
125 | # Maximum number of messages to backfill in each conversation.
126 | # Set to -1 to disable limit.
127 | message_count: 50
128 | # Should the bridge request a full sync from the phone when logging in?
129 | # This bumps the size of history syncs from 3 months to 1 year.
130 | request_full_sync: false
131 | # Configuration parameters that are sent to the phone along with the request full sync flag.
132 | # By default (when the values are null or 0), the config isn't sent at all.
133 | full_sync_config:
134 | # Number of days of history to request.
135 | # The limit seems to be around 3 years, but using higher values doesn't break.
136 | days_limit: null
137 | # This is presumably the maximum size of the transferred history sync blob, which may affect what the phone includes in the blob.
138 | size_mb_limit: null
139 | # This is presumably the local storage quota, which may affect what the phone includes in the history sync blob.
140 | storage_quota_mb: null
141 | # If this value is greater than 0, then if the conversation's last message was more than
142 | # this number of hours ago, then the conversation will automatically be marked it as read.
143 | # Conversations that have a last message that is less than this number of hours ago will
144 | # have their unread status synced from WhatsApp.
145 | unread_hours_threshold: 0
146 | ###############################################################################
147 | # The settings below are only applicable for backfilling using batch sending, #
148 | # which is no longer supported in Synapse. #
149 | ###############################################################################
150 |
151 | # Settings for media requests. If the media expired, then it will not be on the WA servers.
152 | # Media can always be requested by reacting with the ♻️ (recycle) emoji.
153 | # These settings determine if the media requests should be done automatically during or after backfill.
154 | media_requests:
155 | # Should expired media be automatically requested from the server as part of the backfill process?
156 | auto_request_media: true
157 | # Whether to request the media immediately after the media message is backfilled ("immediate")
158 | # or at a specific time of the day ("local_time").
159 | request_method: immediate
160 | # If request_method is "local_time", what time should the requests be sent (in minutes after midnight)?
161 | request_local_time: 120
162 | # Maximum number of media request responses to handle in parallel per user.
163 | max_async_handle: 2
164 | # Settings for immediate backfills. These backfills should generally be small and their main purpose is
165 | # to populate each of the initial chats (as configured by max_initial_conversations) with a few messages
166 | # so that you can continue conversations without losing context.
167 | immediate:
168 | # The number of concurrent backfill workers to create for immediate backfills.
169 | # Note that using more than one worker could cause the room list to jump around
170 | # since there are no guarantees about the order in which the backfills will complete.
171 | worker_count: 1
172 | # The maximum number of events to backfill initially.
173 | max_events: 10
174 | # Settings for deferred backfills. The purpose of these backfills are to fill in the rest of
175 | # the chat history that was not covered by the immediate backfills.
176 | # These backfills generally should happen at a slower pace so as not to overload the homeserver.
177 | # Each deferred backfill config should define a "stage" of backfill (i.e. the last week of messages).
178 | # The fields are as follows:
179 | # - start_days_ago: the number of days ago to start backfilling from.
180 | # To indicate the start of time, use -1. For example, for a week ago, use 7.
181 | # - max_batch_events: the number of events to send per batch.
182 | # - batch_delay: the number of seconds to wait before backfilling each batch.
183 | deferred:
184 | # Last Week
185 | - start_days_ago: 7
186 | max_batch_events: 20
187 | batch_delay: 5
188 | # Last Month
189 | - start_days_ago: 30
190 | max_batch_events: 50
191 | batch_delay: 10
192 | # Last 3 months
193 | - start_days_ago: 90
194 | max_batch_events: 100
195 | batch_delay: 10
196 | # The start of time
197 | - start_days_ago: -1
198 | max_batch_events: 500
199 | batch_delay: 10
200 | # Should puppet avatars be fetched from the server even if an avatar is already set?
201 | user_avatar_sync: true
202 | # Should Matrix users leaving groups be bridged to WhatsApp?
203 | bridge_matrix_leave: true
204 | # Should the bridge update the m.direct account data event when double puppeting is enabled.
205 | # Note that updating the m.direct event is not atomic (except with mautrix-asmux)
206 | # and is therefore prone to race conditions.
207 | sync_direct_chat_list: false
208 | # Should the bridge use MSC2867 to bridge manual "mark as unread"s from
209 | # WhatsApp and set the unread status on initial backfill?
210 | # This will only work on clients that support the m.marked_unread or
211 | # com.famedly.marked_unread room account data.
212 | sync_manual_marked_unread: true
213 | # When double puppeting is enabled, users can use `!wa toggle` to change whether
214 | # presence is bridged. This setting sets the default value.
215 | # Existing users won't be affected when these are changed.
216 | default_bridge_presence: true
217 | # Send the presence as "available" to whatsapp when users start typing on a portal.
218 | # This works as a workaround for homeservers that do not support presence, and allows
219 | # users to see when the whatsapp user on the other side is typing during a conversation.
220 | send_presence_on_typing: __SEND_PRESENCE_ON_TYPING__
221 | # Should the bridge always send "active" delivery receipts (two gray ticks on WhatsApp)
222 | # even if the user isn't marked as online (e.g. when presence bridging isn't enabled)?
223 | #
224 | # By default, the bridge acts like WhatsApp web, which only sends active delivery
225 | # receipts when it's in the foreground.
226 | force_active_delivery_receipts: false
227 | # Servers to always allow double puppeting from
228 | double_puppet_server_map:
229 | example.com: https://example.com
230 | # Allow using double puppeting from any server with a valid client .well-known file.
231 | double_puppet_allow_discovery: false
232 | # Shared secrets for https://github.com/devture/matrix-synapse-shared-secret-auth
233 | #
234 | # If set, double puppeting will be enabled automatically for local users
235 | # instead of users having to find an access token and run `login-matrix`
236 | # manually.
237 | login_shared_secret_map:
238 | example.com: foobar
239 | # Whether to explicitly set the avatar and room name for private chat portal rooms.
240 | # If set to `default`, this will be enabled in encrypted rooms and disabled in unencrypted rooms.
241 | # If set to `always`, all DM rooms will have explicit names and avatars set.
242 | # If set to `never`, DM rooms will never have names and avatars set.
243 | private_chat_portal_meta: default
244 | # Should group members be synced in parallel? This makes member sync faster
245 | parallel_member_sync: false
246 | # Should Matrix m.notice-type messages be bridged?
247 | bridge_notices: true
248 | # Set this to true to tell the bridge to re-send m.bridge events to all rooms on the next run.
249 | # This field will automatically be changed back to false after it, except if the config file is not writable.
250 | resend_bridge_info: false
251 | # When using double puppeting, should muted chats be muted in Matrix?
252 | mute_bridging: false
253 | # When using double puppeting, should archived chats be moved to a specific tag in Matrix?
254 | # Note that WhatsApp unarchives chats when a message is received, which will also be mirrored to Matrix.
255 | # This can be set to a tag (e.g. m.lowpriority), or null to disable.
256 | archive_tag: null
257 | # Same as above, but for pinned chats. The favorite tag is called m.favourite
258 | pinned_tag: null
259 | # Should mute status and tags only be bridged when the portal room is created?
260 | tag_only_on_create: true
261 | # Should WhatsApp status messages be bridged into a Matrix room?
262 | # Disabling this won't affect already created status broadcast rooms.
263 | enable_status_broadcast: true
264 | # Should sending WhatsApp status messages be allowed?
265 | # This can cause issues if the user has lots of contacts, so it's disabled by default.
266 | disable_status_broadcast_send: true
267 | # Should the status broadcast room be muted and moved into low priority by default?
268 | # This is only applied when creating the room, the user can unmute it later.
269 | mute_status_broadcast: true
270 | # Tag to apply to the status broadcast room.
271 | status_broadcast_tag: m.lowpriority
272 | # Should the bridge use thumbnails from WhatsApp?
273 | # They're disabled by default due to very low resolution.
274 | whatsapp_thumbnail: false
275 | # Allow invite permission for user. User can invite any bots to room with whatsapp
276 | # users (private chat and groups)
277 | allow_user_invite: false
278 | # Whether or not created rooms should have federation enabled.
279 | # If false, created portal rooms will never be federated.
280 | federate_rooms: true
281 | # Should the bridge never send alerts to the bridge management room?
282 | # These are mostly things like the user being logged out.
283 | disable_bridge_alerts: false
284 | # Should the bridge stop if the WhatsApp server says another user connected with the same session?
285 | # This is only safe on single-user bridges.
286 | crash_on_stream_replaced: false
287 | # Should the bridge detect URLs in outgoing messages, ask the homeserver to generate a preview,
288 | # and send it to WhatsApp? URL previews can always be sent using the `com.beeper.linkpreviews`
289 | # key in the event content even if this is disabled.
290 | url_previews: __URL_PREVIEWS__
291 | # Send captions in the same message as images. This will send data compatible with both MSC2530 and MSC3552.
292 | # This is currently not supported in most clients.
293 | caption_in_message: false
294 | # Send galleries as a single event? This is not an MSC (yet).
295 | beeper_galleries: false
296 | # Should polls be sent using MSC3381 event types?
297 | extev_polls: false
298 | # Should cross-chat replies from WhatsApp be bridged? Most servers and clients don't support this.
299 | cross_room_replies: false
300 | # Disable generating reply fallbacks? Some extremely bad clients still rely on them,
301 | # but they're being phased out and will be completely removed in the future.
302 | disable_reply_fallbacks: false
303 | # Maximum time for handling Matrix events. Duration strings formatted for https://pkg.go.dev/time#ParseDuration
304 | # Null means there's no enforced timeout.
305 | message_handling_timeout:
306 | # Send an error message after this timeout, but keep waiting for the response until the deadline.
307 | # This is counted from the origin_server_ts, so the warning time is consistent regardless of the source of delay.
308 | # If the message is older than this when it reaches the bridge, the message won't be handled at all.
309 | error_after: null
310 | # Drop messages after this timeout. They may still go through if the message got sent to the servers.
311 | # This is counted from the time the bridge starts handling the message.
312 | deadline: 120s
313 | # The prefix for commands. Only required in non-management rooms.
314 | command_prefix: "!wa"
315 | # Messages sent upon joining a management room.
316 | # Markdown is supported. The defaults are listed below.
317 | management_room_text:
318 | # Sent when joining a room.
319 | welcome: "Hello, I'm a WhatsApp bridge bot."
320 | # Sent when joining a management room and the user is already logged in.
321 | welcome_connected: "Use `help` for help."
322 | # Sent when joining a management room and the user is not logged in.
323 | welcome_unconnected: "Use `help` for help or `login` to log in."
324 | # Optional extra text sent when joining a management room.
325 | additional_help: ""
326 | # End-to-bridge encryption support options.
327 | #
328 | # See https://docs.mau.fi/bridges/general/end-to-bridge-encryption.html for more info.
329 | encryption:
330 | # Allow encryption, work in group chat rooms with e2ee enabled
331 | allow: __ENCRYPTION__
332 | # Default to encryption, force-enable encryption in all portals the bridge creates
333 | # This will cause the bridge bot to be in private chats for the encryption to work properly.
334 | default: __ENCRYPTION_DEFAULT__
335 | # Whether to use MSC2409/MSC3202 instead of /sync long polling for receiving encryption-related data.
336 | appservice: false
337 | # Require encryption, drop any unencrypted messages.
338 | require: __ENCRYPTION_REQUIRE__
339 | # Enable key sharing? If enabled, key requests for rooms where users are in will be fulfilled.
340 | # You must use a client that supports requesting keys from other users to use this feature.
341 | allow_key_sharing: false
342 | # Should users mentions be in the event wire content to enable the server to send push notifications?
343 | plaintext_mentions: false
344 | # Options for deleting megolm sessions from the bridge.
345 | delete_keys:
346 | # Beeper-specific: delete outbound sessions when hungryserv confirms
347 | # that the user has uploaded the key to key backup.
348 | delete_outbound_on_ack: false
349 | # Don't store outbound sessions in the inbound table.
350 | dont_store_outbound: false
351 | # Ratchet megolm sessions forward after decrypting messages.
352 | ratchet_on_decrypt: false
353 | # Delete fully used keys (index >= max_messages) after decrypting messages.
354 | delete_fully_used_on_decrypt: false
355 | # Delete previous megolm sessions from same device when receiving a new one.
356 | delete_prev_on_new_session: false
357 | # Delete megolm sessions received from a device when the device is deleted.
358 | delete_on_device_delete: false
359 | # Periodically delete megolm sessions when 2x max_age has passed since receiving the session.
360 | periodically_delete_expired: false
361 | # Delete inbound megolm sessions that don't have the received_at field used for
362 | # automatic ratcheting and expired session deletion. This is meant as a migration
363 | # to delete old keys prior to the bridge update.
364 | delete_outdated_inbound: false
365 | # What level of device verification should be required from users?
366 | #
367 | # Valid levels:
368 | # unverified - Send keys to all device in the room.
369 | # cross-signed-untrusted - Require valid cross-signing, but trust all cross-signing keys.
370 | # cross-signed-tofu - Require valid cross-signing, trust cross-signing keys on first use (and reject changes).
371 | # cross-signed-verified - Require valid cross-signing, plus a valid user signature from the bridge bot.
372 | # Note that creating user signatures from the bridge bot is not currently possible.
373 | # verified - Require manual per-device verification
374 | # (currently only possible by modifying the `trust` column in the `crypto_device` database table).
375 | verification_levels:
376 | # Minimum level for which the bridge should send keys to when bridging messages from WhatsApp to Matrix.
377 | receive: unverified
378 | # Minimum level that the bridge should accept for incoming Matrix messages.
379 | send: unverified
380 | # Minimum level that the bridge should require for accepting key requests.
381 | share: cross-signed-tofu
382 | # Options for Megolm room key rotation. These options allow you to
383 | # configure the m.room.encryption event content. See:
384 | # https://spec.matrix.org/v1.3/client-server-api/#mroomencryption for
385 | # more information about that event.
386 | rotation:
387 | # Enable custom Megolm room key rotation settings. Note that these
388 | # settings will only apply to rooms created after this option is
389 | # set.
390 | enable_custom: false
391 | # The maximum number of milliseconds a session should be used
392 | # before changing it. The Matrix spec recommends 604800000 (a week)
393 | # as the default.
394 | milliseconds: 604800000
395 | # The maximum number of messages that should be sent with a given a
396 | # session before changing it. The Matrix spec recommends 100 as the
397 | # default.
398 | messages: 100
399 | # Disable rotating keys when a user's devices change?
400 | # You should not enable this option unless you understand all the implications.
401 | disable_device_change_key_rotation: false
402 | # Settings for provisioning API
403 | provisioning:
404 | # Prefix for the provisioning API paths.
405 | prefix: /_matrix/provision
406 | # Shared secret for authentication. If set to "generate", a random secret will be generated,
407 | # or if set to "disable", the provisioning API will be disabled.
408 | shared_secret: generate
409 | # Enable debug API at /debug with provisioning authentication.
410 | debug_endpoints: false
411 | # Permissions for using the bridge.
412 | # Permitted values:
413 | # relay - Talk through the relaybot (if enabled), no access otherwise
414 | # user - Access to use the bridge to chat with a WhatsApp account.
415 | # admin - User level and some additional administration tools
416 | # Permitted keys:
417 | # * - All Matrix users
418 | # domain - All users on that homeserver
419 | # mxid - Specific user
420 | permissions:
421 | "__LISTRELAY__": "relay"
422 | "__LISTUSER__": "user"
423 | "__LISTADMIN__": "admin"
424 | # Settings for relay mode
425 | relay:
426 | # Whether relay mode should be allowed. If allowed, `!wa set-relay` can be used to turn any
427 | # authenticated user into a relaybot for that chat.
428 | enabled: __ENABLE_RELAYBOT__
429 | # Should only admins be allowed to set themselves as relay users?
430 | admin_only: __ADMIN_ONLY__
431 | # The formats to use when sending messages to WhatsApp via the relaybot.
432 | message_formats:
433 | m.text: "{{ .Sender.Displayname }}: {{ .Message }}"
434 | m.notice: "{{ .Sender.Displayname }}: {{ .Message }}"
435 | m.emote: "* {{ .Sender.Displayname }} {{ .Message }}"
436 | m.file: "{{ .Sender.Displayname }} sent a file"
437 | m.image: "{{ .Sender.Displayname }} sent an image"
438 | m.audio: "{{ .Sender.Displayname }} sent an audio file"
439 | m.video: "{{ .Sender.Displayname }} sent a video"
440 | m.location: "{{ .Sender.Displayname }} sent a location"
441 | # Logging config. See https://github.com/tulir/zeroconfig for details.
442 | logging:
443 | min_level: __PRINT_LEVEL__
444 | writers:
445 | - type: stdout
446 | format: pretty-colored
447 | - type: file
448 | format: json
449 | filename: /var/log/__APP__/__APP__.log
450 | max_size: 100
451 | max_backups: 10
452 | compress: true
453 |
--------------------------------------------------------------------------------
/conf/systemd.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Matrix Whatsapp Bridge
3 | After=matrix-synapse.service
4 |
5 | [Service]
6 | Type=simple
7 | User=__APP__
8 | Group=__APP__
9 | WorkingDirectory=__INSTALL_DIR__/
10 | ExecStart=__INSTALL_DIR__/mautrix-whatsapp -c=__INSTALL_DIR__/config.yaml
11 | Restart=always
12 | RestartSec=3
13 |
14 | # Optional hardening to improve security
15 | ReadWritePaths=__INSTALL_DIR__/ /var/log/__APP__
16 | NoNewPrivileges=yes
17 | MemoryDenyWriteExecute=true
18 | PrivateDevices=yes
19 | PrivateTmp=yes
20 | ProtectHome=yes
21 | ProtectSystem=strict
22 | ProtectControlGroups=true
23 | RestrictSUIDSGID=true
24 | RestrictRealtime=true
25 | LockPersonality=true
26 | ProtectKernelLogs=true
27 | ProtectKernelTunables=true
28 | ProtectHostname=true
29 | ProtectKernelModules=true
30 | PrivateUsers=true
31 | ProtectClock=true
32 | SystemCallArchitectures=native
33 | SystemCallErrorNumber=EPERM
34 | SystemCallFilter=@system-service
35 |
36 | # Denying access to capabilities that should not be relevant for webapps
37 | # Doc: https://man7.org/linux/man-pages/man7/capabilities.7.html
38 | CapabilityBoundingSet=~CAP_RAWIO CAP_MKNOD
39 | CapabilityBoundingSet=~CAP_AUDIT_CONTROL CAP_AUDIT_READ CAP_AUDIT_WRITE
40 | CapabilityBoundingSet=~CAP_SYS_BOOT CAP_SYS_TIME CAP_SYS_MODULE CAP_SYS_PACCT
41 | CapabilityBoundingSet=~CAP_LEASE CAP_LINUX_IMMUTABLE CAP_IPC_LOCK
42 | CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM
43 | CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
44 | CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
45 | CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
46 | CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
47 |
48 | [Install]
49 | WantedBy=multi-user.target
50 |
--------------------------------------------------------------------------------
/config_panel.toml:
--------------------------------------------------------------------------------
1 | #:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/config_panel.v1.schema.json
2 |
3 | version = "1.0"
4 |
5 | [main]
6 | name = "Main Settings"
7 | services = ["__APP__"]
8 |
9 | [main.permissions]
10 | name = "Permissions for using the bridge"
11 |
12 | [main.permissions.helptext]
13 | ask = '''
14 | Roles with Increasing Power: Relay Portal Rooms & Encryption Settings`. If you enable `Allow Encryption between Matrix Client and Bridge Server?`, the bridge won't enable encryption on its own, but will work in encrypted rooms.
15 | Alternatively two more options will appear, `Force-enable Encryption in all Portal Rooms the Bridge creates?` which will automatically enable encryption in new portals and `Require encryption?` which will enforce encryption on any of the messages that you send (this will make the bridge drop any future unencrypted messages).
16 |
17 | There is also the possibity to configure it in the bridge configuration YAML file in the section `bridge: encryption`.
--------------------------------------------------------------------------------
/doc/ADMIN_es.md:
--------------------------------------------------------------------------------
1 | ## Configuración del puente
2 | El puente está [configurado a grandes rasgos en la instalación](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/blob/master/conf/config.yaml), por ejemplo, se permite admin y usuarix del bot.
3 | Se puede hacer una configuración más fina usando el panel de configuración existente en el panel de administración de Yunohost o modificando el
4 | siguiente archivo de configuración con SSH:
5 | ```/opt/yunohost/mautrix_whatsapp/config.yaml```
6 | y reiniciando el servicio mautrix_whatsapp.
7 |
8 | #### Cifrado de extremo a puente
9 | El puente puede cifrar opcionalmente los mensajes entre lxs usuarixs de Matrix y él mismo para ocultar los mensajes del servidor doméstico. Se recomienda encarecidamente el uso de Postgres cuando se utilice el cifrado de extremo a puente.
10 |
11 | Si se desea habilitar, se debe ir a la sección del panel de configuración `Privacidad -> Salas y configuración de cifrado`. Si se activa `¿Permitir la encriptación entre el cliente Matrix y el puente?`, el puente no activará la encriptación por sí mismo, pero funcionará en salas encriptadas.
12 | Alternativamente, aparecerán dos opciones más, `Forzar la encriptación en todas las salas que cree el puente`, que habilitará automáticamente la encriptación en las nuevas salas, y `Requerir encriptación`, que forzará la encriptación en cualquiera de los mensajes que envíe (esto hará que el puente elimine cualquier futuro mensaje no encriptado).
13 |
14 | También existe la posibilidad de configurarlo en el fichero YAML de configuración del puente en la sección `bridge: encryption`.
--------------------------------------------------------------------------------
/doc/ADMIN_fr.md:
--------------------------------------------------------------------------------
1 | ### Configuration de la passerelle
2 | La passerelle est [configurée avec les paramètres standards adaptés pour votre YunoHost et l'instance Matrix-Synapse sélectionnée](https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh/blob/master/conf/config.yaml).
3 | Une configuration plus fine peut être effectuée en utilisant le panneau de configuration existant dans le panneau d'administration de Yunohost ou en modifiant le fichier de configuration suivant avec SSH:
4 | ``` /opt/yunohost/mautrix_whatsapp/config.yaml```
5 | puis en redémarrant le service mautrix_whatsapp.
6 |
7 | #### User permissions
8 |
9 |
10 | #### End-to-bridge encryption
11 | Le robot peut éventuellement chiffrer les messages entre les utilisateurs de Matrix et la passarelle pour cacher les messages du serveur domestique. L'utilisation de Postgres est fortement recommandée lors de l'utilisation du chiffrement end-to-bridge.
12 |
13 | Si vous voulez l'activer, allez dans la section `Privacy -> Portal Rooms & Encryption Settings` du panneau de configuration. Si vous activez `Allow Encryption between Matrix Client and Bridge Server?`, la passarelle n'activera pas le cryptage d'elle-même, mais fonctionnera dans les salles cryptées.
14 | Sinon, deux autres options apparaissent, `Force-enable Encryption in all Portal Rooms the Bridge creates?` qui activera automatiquement le cryptage dans les nouveaux portails et `Require encryption?` qui imposera le cryptage sur tous les messages que vous envoyez (ce qui fera que le robot abandonnera tous les messages non cryptés à l'avenir).
15 |
16 | Il est également possible de le configurer dans le fichier YAML de configuration du robot dans la section `bridge: encryption`.
--------------------------------------------------------------------------------
/doc/DESCRIPTION.md:
--------------------------------------------------------------------------------
1 | A puppeting bridge between Matrix and WhatsApp packaged as a YunoHost service.
2 | Messages, media and notifications are bridged between a WhatsApp user and a matrix user.
3 | With the RelayBot login option, the matrix user can invite other matrix user in a bridged WhatsApp room, such that even people without a WhatsApp account can participate to WhatsApp group conversations.
4 | The ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) bridge consists in a synapse app service and relies on postgresql (mysql also available).
5 | Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand.
6 |
7 | ** Attention: always backup and restore the Yunohost matrix_synapse et mautrix_whatsapp apps together!**
8 |
--------------------------------------------------------------------------------
/doc/DESCRIPTION_es.md:
--------------------------------------------------------------------------------
1 | Un puente de marionetas entre Matrix y WhatsApp empaquetado como un servicio YunoHost.
2 | Mensajes, medios de comunicación y las notificaciones son puenteados entre una cuenta de WhatsApp y una cuenta de Matrix.
3 | Con la opción de inicio de sesión RelayBot, una persona de Matrix puede invitar a otra persona de Matrix a una sala de WhatsApp puenteada, de modo que incluso personas sin cuenta de WhatsApp pueden participar en conversaciones de grupo de WhatsApp.
4 | El puente ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) consiste en un servicio de la aplicación Synapse y se basa en Postgresql (Mysql también disponible).
5 | Por lo tanto, debe instalarse previamente [Synapse para YunoHost](https://github.com/YunoHost-Apps/synapse_ynh).
6 |
7 | ** Atención: haz siempre copias de seguridad y restaura las aplicaciones Yunohost matrix_synapse y mautrix_whatsapp juntas.
--------------------------------------------------------------------------------
/doc/DESCRIPTION_fr.md:
--------------------------------------------------------------------------------
1 | Une passerelle entre Matrix et WhatsApp empaquetée comme un service YunoHost.
2 | Les messages, médias et notifications sont relayées entre un compte WhatsApp et un compte Matrix.
3 | Avec l'option de connexion Relaybot, un compte Matrix peut inviter d'autres comptes Matrix dans un salon Matrix relayé avec un groupe WhatsApp, ainsi même des personnes sans compte WhatsApp peuvent communiquer avec des utilisateur.ice.s de WhatsApp.
4 | La passerelle ["Mautrix-WhatsApp"](https://docs.mau.fi/bridges/go/whatsapp/index.html) consiste en un Service d'Application Matrix-Synapse et repose sur une base-de-données postgresql (mysql également possible).
5 | C'est pourquoi [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) doit être préalablemnet installé.
6 |
7 | ** Attention : sauvegardez et restaurez toujours les deux applications Yunohost matrix_synapse et mautrix_whatsapp en même temps!**
8 |
--------------------------------------------------------------------------------
/doc/DEVELOPMENT.md:
--------------------------------------------------------------------------------
1 | ## Development code quality
2 | The `.github/workflows/updater.sh` script needs to be synced with changes in `conf/config.yaml` therefore a `pre-commit`
3 | hook is used to display a reminder to update `.github/workflows/updater.sh` (if needed) when `conf/config.yaml` has been modified.
4 |
5 | Please enable Git hooks using following command to ensure code quality and stability.
6 | ``` bash
7 | git config --local core.hooksPath .githooks
8 | ```
--------------------------------------------------------------------------------
/doc/DEVELOPMENT_es.md:
--------------------------------------------------------------------------------
1 | ## Buenas prácticas de desarrollo
2 | El script `.github/workflows/updater.sh` necesita estar acorde con los cambios en `conf/config.yaml` por lo que se utiliza un hook `pre-commit`
3 | que se utiliza para mostrar un recordatorio para actualizar `.github/workflows/updater.sh` (si es necesario) cuando `conf/config.yaml` ha sido modificado.
4 |
5 | Por favor, es importante activar los hooks Git usando el siguiente comando para asegurar la calidad y estabilidad del código.
6 | ``` bash
7 | git config --local core.hooksPath .githooks
8 | ```
--------------------------------------------------------------------------------
/doc/DEVELOPMENT_fr.md:
--------------------------------------------------------------------------------
1 | ## Development code quality
2 | Le script `.github/workflows/updater.sh` doit être synchronisé avec les changements dans `conf/config.yaml`,
3 | donc un hook `pre-commit` est utilisé pour afficher un rappel pour mettre à jour
4 | `.github/workflows/updater.sh` (si nécessaire) lorsque `conf/config.yaml` a été modifié.
5 |
6 | Veuillez activer les hooks Git en utilisant la commande suivante pour assurer la qualité et la stabilité du code.
7 | ``` bash
8 | git config --local core.hooksPath .githooks
9 | ```
--------------------------------------------------------------------------------
/doc/POST_INSTALL.md:
--------------------------------------------------------------------------------
1 | ## List of known public services
2 | * Ask on one of the following rooms: #mautrix_yunohost:matrix.fdn.fr or #whatsapp:maunium.net
3 |
4 | ## Bridging usage
5 | ** Note that several WhatsApp and Matrix users can be bridged, each WhatsApp account has its own bot administration room. If they are in a same WhatsApp group, only one matrix room will be created. **
6 |
7 | ### Bridge a WhatsApp user and a Matrix user
8 | * First your matrix user or server has to be authorized in the bridge configuration (see below)
9 | * Then, invite the bot (default @whatsappbot:yoursynapse.domain)
10 | * The room with the Mautrix-WhatsApp bot is called "administration room".
11 | * Type `login`
12 | * Capture the QR code with the camera in the WhatsApp of your VM or smartphone (WhatsApp Web)
13 | * Send `help` to the bot in the created room to know how to control the bot.
14 | See also [upstream wiki Authentication page](https://docs.mau.fi/bridges/go/whatsapp/authentication.html)
15 |
16 | ### Bridge an existing room
17 | By default, the bridge creates a room for each WhatsApp group that the WhatsApp user actively uses.
18 | Your can also create a portal for an existing Matrix room. **Note that this can be a room created by another bridge, e.g. a Signal room**
19 | 1. Invite the bridge bot to the room (with an authorized user)
20 | 2. Type `!wa create`
21 | 3. Your logged-in user creates a new corresponding group.
22 | 4. Get the invite link `!wa invite-link` and share it with friends. Or invite WhatsApp puppets to room.
23 | 5. Optional: Activate relaybot, see next section.
24 |
25 | ### Relaybot: Bridge a group for several Matrix and several WhatsApp users to chat together
26 | To be able to bridge not only your logged in Matrix account but also Matrix friends you invite to a room, you need to:
27 | 1. Enable relaybot setting in the config panel section `Main Settings -> Puppetting Bridge Settings` or in the bridge configuration YAML file `relay: enabled: true`. Also make sure that the users you want to invite have at least the `relay` level in the `permissions` section (this can be configured in the config panel section `Main Settings -> Permissions for using the bridge`).
28 | 2. Login to your WhatsApp account in the (main) administration room
29 | 3. Depending on what has been selected during installation this could be done only by admins, but can also be changed in the config panel section `Main Settings -> Puppetting Bridge Settings` or in the bridge configuration YAML file `relay: admin_only`.
30 | 4. Write `!wa set-relay` in each of the rooms you want to relay to (re-)activate the relaybot function.
31 |
32 | * In WhatsApp: all messages will be seen as received from the account who is logged in with a prefix for the source Matrix user.
33 | * On the Matrix side: the bridge will create matrix puppets corresponding to the WhatsApp users when they send a message.
34 | See also [upstream wiki Relaybot page](https://docs.mau.fi/bridges/general/relay-mode.html)
--------------------------------------------------------------------------------
/doc/POST_INSTALL_es.md:
--------------------------------------------------------------------------------
1 | ## Lista de servicios públicos conocidos
2 | * Pregunta en una de las siguientes salas #mautrix_yunohost:matrix.fdn.fr o #whatsapp:maunium.net
3 |
4 | ## Uso del puente
5 | ** Ten en cuenta que se pueden puentear varixs usuarixs de WhatsApp y Matrix, cada cuenta de WhatsApp tiene su propia sala de administración de bots. Si están en un mismo grupo de WhatsApp, sólo se creará una sala de Matrix. **
6 |
7 | ### Puentear una cuenta de WhatsApp y con otra de Matrix
8 | * En primer lugar, el/la usuarix o servidor de Matrix debe estar autorizado en la configuración del puente (véase más abajo).
9 | * A continuación, invite al bot (por defecto @whatsappbot:yoursynapse.domain)
10 | * La sala con el bot de Mautrix-WhatsApp se llama "Administration Room".
11 | * Escribe `login`
12 | * Captura el código QR con la cámara del WhatsApp de tu VM o smartphone (WhatsApp Web)
13 | * Envía `help` al bot en la sala creada para saber cómo controlarlo.
14 | Ver también [upstream wiki Authentication page](https://docs.mau.fi/bridges/go/whatsapp/authentication.html)
15 |
16 | ### Puentear una sala existente
17 | Por defecto, el puente crea una sala para cada grupo de WhatsApp que el/la usuarix de WhatsApp utiliza activamente.
18 | También puede crear una sala de Matrix existente. **Tenga en cuenta que puede tratarse de una sala creada por otro puente, por ejemplo, una sala de Signal**.
19 | 1. Invita al bot del puente a la sala (con una cuenta autorizada).
20 | 2. Escriba `!wa create`.
21 | 3. Tu usuarix conectadx crea un nuevo grupo correspondiente.
22 | 4. Obtén el enlace de invitación `!wa invite-link` y compártelo con tus amigxs o invita a las marionetas de WhatsApp a la sala.
23 | 5. Opcional: Activar relaybot, ver siguiente sección.
24 |
25 | ### Relaybot: Puentea un grupo para que varixs usuarixs de Matrix y varixs usuarixs de WhatsApp chateen juntxs.
26 | Para poder hacer puente no sólo con tu cuenta de Matrix conectada sino también con los amigxs de Matrix que invites a una sala, necesitas:
27 | 1. Habilitar la configuración de Relaybot en la sección del panel de configuración `Configuración principal -> Configuración del puente de marionetas` o en el archivo YAML de configuración del puente `relay: enabled: true`. También asegúrate de que lxs usuarixs que quieres invitar tienen al menos el nivel `relay` en la sección `permissions` (esto también se puede configurar en la sección del panel de configuración `Main Settings -> Permissions for using the bridge`).
28 | 2. Accede a tu cuenta de WhatsApp en la sala de administración.
29 | 3. Dependiendo de lo que se haya seleccionado durante la instalación, esto podrían hacerlo solo lxs administradorxs, pero también se puede cambiar en la sección del panel de configuración `Main Settings -> Puppetting Bridge Settings` o en el archivo YAML de configuración del puente `relay: admin_only`.
30 | 4. Escribe `!wa set-relay` en cada una de las salas que quieras retransmitir para (re)activar la función Relaybot.
31 |
32 | * En WhatsApp: todos los mensajes se verán como recibidos de la cuenta que ha iniciado sesión con un prefijo para el/la usuarix de Matrix de origen.
33 | * En el lado de Matrix: el puente creará marionetas de Matrix correspondientes a lxs usuarixs de WhatsApp cuando envíen un mensaje.
34 | Véase también [upstream wiki Relaybot page](https://docs.mau.fi/bridges/general/relay-mode.html)
--------------------------------------------------------------------------------
/doc/POST_INSTALL_fr.md:
--------------------------------------------------------------------------------
1 | ## Liste de passerelles publiques
2 | * Demandez sur un des salons suivants: #mautrix_yunohost:matrix.fdn.fr or #whatsapp:maunium.net
3 |
4 | ## Usages de la passerelle
5 | ** Notez que plusieurs comptes WhatsApp et Matrix peuvent être relayés, chaque compte WhatsApp connecté a son propre salle d'Administration. Si plusieurs utilisateur.ice.s du Robot sont dans un même groupe WhatsApp, seul une salle Matrix sera créé par la passerelle. **
6 |
7 | ### Relayer TOUTES les conversations entre UN compte WhatsApp et UN compte Matrix
8 | * Prérequis : votre compte Matrix ou le serveur sur lequel il est hébergé doit être autorisé dans la configuration de la passerelle (voir ci-dessous)
9 | * Invitez le Robot (par défaut @whatsappbot:synapse.votredomaine) à une nouvelle conversation.
10 | * Cette nouveau salle d'administration du Robot Mautrix-WhatsApp est appelé "Administration Room".
11 | * Tapez `login`
12 | * Scannez le QR-code avec la caméra Whatsapp de votre Machine Virtuelle ou ordiphone (option WhatsApp Web dans l'appli)
13 | * Envoyez `help` au Robot dans le "Administration Room" pour une liste des commandes d'administration de la passerelle.
14 | Voir aussi [upstream wiki Authentication page](https://docs.mau.fi/bridges/go/whatsapp/authentication.html)
15 |
16 | ### Passerelle vers une conversation existante
17 | Par défaut, la passerelle crée une salle pour chaque groupe WhatsApp que l'utilisateur WhatsApp utilise activement.
18 | Vous pouvez également créer un portail pour une salle Matrix existante. **Notez qu'il peut s'agir d'une salle créée par une autre passerelle, par exemple une salle de portail Signal.
19 | 1. Invitez le bot de la passerelle dans la salle (avec un utilisateur autorisé).
20 | 2. Tapez `!wa create`
21 | 3. Votre utilisateur connecté crée un nouveau groupe correspondant.
22 | 4. Obtenez le lien d'invitation `!wa invite-link` et partagez-le avec vos amis. Ou invitez les marionnettes WhatsApp dans la pièce.
23 | 5. Facultatif : Activez le relaybot, voir la section suivante.
24 |
25 | ### Relaybot: Relayer les conversations de TOUS les comptes Matrix et TOUS les comptes WhatsApp présents dans UN groupe/salle
26 | 1. Activer l'option `Should Relay Mode be allowed?` dans le panneau de configuration (section `Main Settings -> Puppetting Bridge Settings`) ou dans le fichier YAML de configuration du robot `relay: enabled: true`. Assurez-vous également que les utilisateurs que vous voulez inviter ont au moins le niveau `relay` dans la section `permissions` (ceci peut être configuré dans la section `Main Settings -> Permissions for using the bridge` du panneau de configuration).
27 | 2. Connectez-vous à votre compte WhatsApp dans la salle d'administration.
28 | 2. En fonction de ce qui a été sélectionné lors de l'installation, cela peut être fait uniquement par les administrateurs, mais peut également être modifié dans la section `Main Settings -> Puppetting Bridge Settings` du panneau de configuration ou dans le fichier YAML de configuration du robot `relay: admin_only`
29 | 3. Ecrivez `!wa set-relay` dans chacune des pièces que vous voulez relayer pour (ré)activer la fonction de relaybot.
30 |
31 | * Vous pouvez maintenant relayer un groupe WhatsApp en y invitant le numéro de téléphone du compte WhatsApp connecté au Relaybot. Côté WhatsApp, tous les messages venant de Matrix seront vus comme envoyés depuis le compte WhatsApp connecté, avec un préfix indiquant le compte Matrix correspondant. Côté Matrix, la passerelle va créer des comptes Matrix pour chaque compte WhatsApp présent dans le groupe relayé. Les messages sont indiqués comme provenant soit du numéro de téléphone, soit du pseudo WhatsApp.
32 | Voir aussi [la page wiki principale sur le Relaybot](https://docs.mau.fi/bridges/go/whatsapp/relaybot.html)
--------------------------------------------------------------------------------
/doc/PRE_INSTALL.md:
--------------------------------------------------------------------------------
1 | ## Multi-user support
2 | * Bot users are not related to Yunohost users. Any Matrix account or Synapse server autorized in the configuration of the bridge can invite/use the bot.
3 | * The WhatsApp bot is a local Matrix-Synapse user, but accessible through federation (synapse public or private).
4 | * Several WhatsApp and Matrix users can be bridged with one bridge, each user has its own bot administration room.
5 | * If several bot users are in a same WhatsApp group, only one Matrix room will be created by the bridge.
6 | * See https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support
7 |
8 | ## Limitations
9 | * Audio/Video calls are not bridged yet.
10 | * If WhatsApp loses connection, e.g. the phone is set in flight mode or push notifications are deactivated, the bot has sometimes to be restarted manually by sending `!wa reconnnect` in the Matrix administration room.
11 | * WhatsApp needs to get presence from the official app every two weeks at least, so bridge will send a reminder in the administration room.
12 |
13 | ## Additional information
14 | * It is recommended to install WhatsApp on a virtual android running on a server, see [upstream wiki Android-VM-Setup page](https://docs.mau.fi/bridges/go/whatsapp/android-vm-setup.html)
15 | **More information on the documentation page:**
16 | https://docs.mau.fi/bridges/go/whatsapp/index.html
17 |
18 | * To test communication between the App Service and Matrix-Synapse on a VM (e.g. with domain name: synapse.vm), you must install a certificate:
19 | ```
20 | echo | openssl s_client -showcerts -servername synapse.vm -connect synapse.vm:443 2>/dev/null | awk '/-----BEGIN CERTIFICATE-----/, /-----END CERTIFICATE-----/' >> /usr/local/share/ca-certificates/synapse.vm.crt
21 | update-ca-certificates
22 | ```
23 |
24 | ## Miscellaneous information
25 | * Matrix room (matrix bridges in YunoHost): #mautrix_yunohost:matrix.fdn.fr
26 | * Matrix room (upstream app): #whatsapp:maunium.net
27 | In case you need to upload your logs somewhere, be aware that they contain your contacts and your phone numbers. Strip them out with:
28 | ``| sed -r 's/[0-9]{10,}/📞/g' ``
29 | * "Mautrix-WhatsApp" bridge is based on the [Rhymen/go-whatsapp](https://github.com/Rhymen/go-whatsapp) implementation of the [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng) project.
--------------------------------------------------------------------------------
/doc/PRE_INSTALL_es.md:
--------------------------------------------------------------------------------
1 | ## Soporte multiusuarix
2 | * Lxs usuarixs del bot no están relacionadxs con lxs usuarixs de Yunohost. Cualquier cuenta Matrix o servidor Synapse autorizado en la configuración del puente puede invitar/usar el bot.
3 | * El bot de WhatsApp es un usuarix local Matrix-Synapse, pero accesible a través de federación (synapse público o privado).
4 | * Varios usuarixs de WhatsApp y Matrix pueden ser puenteadxs con un puente, cada usuarix tiene su propia sala de administración bot.
5 | * Si varixs usuarixs bot están en un mismo grupo de WhatsApp, el puente sólo creará una sala de Matrix.
6 | * Véase https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support
7 |
8 | ## Limitaciones
9 | * Las llamadas de audio/vídeo aún no están conectadas. Solo aparece una notificación.
10 | * Si WhatsApp pierde la conexión, por ejemplo, si el teléfono se pone en modo de vuelo o se desactivan las notificaciones push, a veces hay que reiniciar el bot manualmente enviando `!wa reconnnect` en la sala de administración de Matrix.
11 | * WhatsApp necesita obtener presencia de la app oficial cada dos semanas como mínimo, por lo que el puente enviará un recordatorio en la sala de administración.
12 |
13 | ## Información adicional
14 | * Se recomienda instalar WhatsApp en Android dentro de una máquina virtual que se ejecute en un servidor, consulte [wiki Android-VM-Setup page](https://docs.mau.fi/bridges/go/whatsapp/android-vm-setup.html)
15 | **Más información en la página de documentación:**
16 | https://docs.mau.fi/bridges/go/whatsapp/index.html
17 |
18 | * Para probar la comunicación entre el App Service y Matrix-Synapse en una máquina virtual (por ejemplo, con nombre de dominio: synapse.vm), se debe instalar un certificado:
19 | ```
20 | echo | openssl s_client -showcerts -servername synapse.vm -connect synapse.vm:443 2>/dev/null | awk '/-----BEGIN CERTIFICATE-----/, /-----END CERTIFICATE-----/' >> /usr/local/share/ca-certificates/synapse.vm.crt
21 | update-ca-certificates
22 | ```
23 |
24 | ## Informaciones diversas
25 | * Sala de Matrix (puentes de Matrix en YunoHost): #mautrix_yunohost:matrix.fdn.fr
26 | * Sala de Matrix (aplicación original): #mautrix_yunohost:matrix.fdn.fr
27 | En caso de que necesites subir tus logs a algún sitio, ten en cuenta que contienen tus contactos y sus números de teléfono. Elimínalos con:
28 | ``| sed -r 's/[0-9]{10,}/📞/g' ``
29 | * El puente "Mautrix-WhatsApp" está basado en la implementación [Rhymen/go-whatsapp](https://github.com/Rhymen/go-whatsapp) del proyecto [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng).
--------------------------------------------------------------------------------
/doc/PRE_INSTALL_fr.md:
--------------------------------------------------------------------------------
1 | ## Support multi-comptes
2 | * Les utilisateur.ice.s du Robot ne sont pas liés aux comptes Yunohost. N'importe quel compte Matrix ou serveur Synapse autorisés dans la configuration de la passerelle peut inviter/utiliser le Robot.
3 | * Le robot WhatsApp est un utilisateur.ice.s Matrix-Synapse local, mais accessible via la fédération (Synapse public ou privé).
4 | * Plusieurs comptes WhatsApp et Matrix peuvent être liés avec une seule passerelle, chaque compte a son propre salon d'administration.
5 | * Si plusieurs utilisateur.ice.s du Robot sont dans un même groupe WhatsApp, seul une salle de Matrix sera créé par la passerelle. Autrement dit, la passerelle construit un seul miroir du réseau de discussion existant sur WhatsApp (utilisateur.ice.s et salles).
6 | * Voir https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support
7 |
8 | ## Limitations
9 | * Les appels Audio/Video ne sont pas relayés. Seule une notification apparait.
10 | * Si WhatsApp perd la connexion, par ex. l'ordiphone est mis en mode avion ou les notifications poussées sont désactivées, le robot doit parfois être redémarré à la main en envoyant un message `!wa reconnnect` dans le salon d'administration.
11 | * WhatsApp doit obtenir la présence de l'application officielle toutes les deux semaines au moins, c'est pourquoi le robot enverra un rappel dans la salle d'administration.
12 |
13 | ## Informations additionnelles
14 | * Il est recommandé d'installer WhatsApp sur une machine Android virtuelle tournant sur un serveur, cf. le [page Android-VM-Setup du wiki](https://docs.mau.fi/bridges/go/whatsapp/android-vm-setup.html)
15 | **Plus d'informations sur la page de documentation:**
16 | https://docs.mau.fi/bridges/go/whatsapp/index.html
17 |
18 | * Pour tester la communication entre le Service d'Application et Matrix-Synapse sur une Machine Virtuelle (ex. avec un nom de domaine: synapse.vm), vous devez installer un certificat:
19 | ```
20 | echo | openssl s_client -showcerts -servername synapse.vm -connect synapse.vm:443 2>/dev/null | awk '/-----BEGIN CERTIFICATE-----/, /-----END CERTIFICATE-----/' >> /usr/local/share/ca-certificates/synapse.vm.crt
21 | update-ca-certificates
22 | ```
23 |
24 | ## Informations diverses
25 | * Salle Matrix sur les Passerelles dans Yunohost: #mautrix_yunohost:matrix.fdn.fr
26 | * Salle Matrix (application principale): #whatsapp:maunium.net
27 | Si vous devez téléverser vos fichiers log quelque-part, soyez avertis qu'ils contiennent des informations sur vos contacts et vos numéros de téléphone. Effacez-les avec:
28 | ``| sed -r 's/[0-9]{10,}/📞/g' ``
29 | * La passerelle "Mautrix-WhatsApp" repose sur l'implémentation [Rhymen/go-whatsapp](https://github.com/Rhymen/go-whatsapp) du projet [sigalor/whatsapp-web-reveng](https://github.com/sigalor/whatsapp-web-reveng).
--------------------------------------------------------------------------------
/manifest.toml:
--------------------------------------------------------------------------------
1 | #:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json
2 |
3 | packaging_format = 2
4 |
5 | id = "mautrix_whatsapp"
6 | name = "Matrix-WhatsApp bridge"
7 |
8 | description.en = "Matrix / Synapse puppeting bridge for WhatsApp"
9 | description.fr = "Passerelle Matrix / Synapse pour WhatsApp"
10 | version = "0.10.9~ynh1"
11 |
12 | maintainers = ["thardev"]
13 |
14 | [upstream]
15 | license = "AGPL-3.0-or-later"
16 | website = "https://maunium.net/go/mautrix-whatsapp/"
17 | code = "https://github.com/mautrix/whatsapp"
18 | admindoc = "https://docs.mau.fi/bridges/go/whatsapp/index.html"
19 | fund = "https://github.com/sponsors/tulir"
20 |
21 | [integration]
22 | yunohost = ">= 11.2"
23 | architectures = ["amd64", "arm64", "armhf"]
24 | multi_instance = true
25 | ldap = false
26 | sso = false
27 | disk = "100M"
28 | ram.build = "256M"
29 | ram.runtime = "1024M"
30 |
31 | [install]
32 |
33 | [install.synapse_instance]
34 | ask.en = "Choose the local Synapse instance to communicate with mautrix_whatsapp."
35 | ask.fr = "Choisissez l'instance Synapse qui doit communiquer avec mautrix_whatsapp."
36 | type = "app"
37 | #pattern.regexp = "synapse(__)*[0-9]*"
38 | #pattern.error = "Invalid app selected. Please select a Synapse instance."
39 | help.en = "Usually the Synapse instances contain a number after it is installed more than one time. E.g. synapse__1 will be the second instance."
40 | help.fr = "En général, les instances de Synapse contiennent un numéro après avoir été installées plus d'une fois. Par exemple, synapse__1 sera la deuxième instance."
41 | default = "synapse"
42 |
43 | [install.botname]
44 | ask.en = "Choose a local Synapse user name for the WhatsApp bot"
45 | ask.fr = "Choisissez un nom d'utilisateur Synapse local pour le robot WhatsApp"
46 | type = "string"
47 | example = "whatsappbot"
48 | help.en = "A system user will be created. Invite @whatsappbot:localsynapse.servername from an authorized Matrix account to start bridging.Give the Matrix server_name, not the full domain/URL."
49 | help.fr = "Un utilisateur système sera créé. Inviter @whatsappbot:localsynapse.servername depuis un compte Matrix autorisé pour démarrer une passerelle.Donner le nom du serveur Matrix, pas le domaine/URL complet."
50 | default = "whatsappbot"
51 |
52 | [install.bot_synapse_adm]
53 | ask.en = "Give the WhatsApp bot administrator rights to the Synapse instance?"
54 | ask.fr = "Donner au robot WhatsApp des droits administrateur à l'instance Synapse ?"
55 | type = "boolean"
56 | help.en = "If true, the bot can group WhatsApp chats in a Matrix space.Not required if you set up Synapse so that non-admins are authorized to create communities."
57 | help.fr = "Si true, le robot groupera les conversations WhatsApp dans une communauté Matrix.Pas nécessaire si vous avez réglé Synapse pour qu'il autorise les non-admin à créer des communautés."
58 | default = true
59 |
60 | [install.encryption]
61 | ask.en = "Enable end-to-bridge encryption?"
62 | ask.fr = "Activer le chiffrement entre Synapse et le bridge ?"
63 | type = "boolean"
64 | help.en = "Only activate if you know the prerequisites and constraints related to E2B."
65 | help.fr = "N'activer que si vous connaissez les prérequis et constraintes liées à E2B."
66 | default = true
67 |
68 | [install.botadmin]
69 | ask.en = "Choose the Matrix account administrator of the WhatsApp bot"
70 | ask.fr = "Choisissez le compte Matrix administrateur du robot WhatsApp"
71 | type = "string"
72 | example = "@johndoe:localsynapse.servername or @johndoe:matrix.org"
73 | help.en = "The administrator does not need to be a local Synapse account. Valid formats are @johndoe:localsynapse.servername or @johndoe:matrix.org"
74 | help.fr = "L'administrateur peut ne pas être un compte local Synapse. Les formats valables sont @johndoe:localsynapse.servername or @johndoe:matrix.org"
75 |
76 | [install.botusers]
77 | ask.en = "Choose Matrix user(s) authorized to bridge with the WhatsApp bot."
78 | ask.fr = "Choisissez le/les compte(s) Matrix autorisés à utiliser la passerelle WhatsApp."
79 | type = "string"
80 | example = "@johndoe:server.name or server.name or *"
81 | help.en = "A remote or local user (@johndoe:server.name),the local server (server.name), a remote server (matrix.org), or all remote/local servers (*) can be authorized. Give the Matrix server_name, not the full domain/URL. It is also possible to specify multiple values by separating them with comma. Example: @johndoe:server.name,domain.tld,matrix.org"
82 | help.fr = "Un compte local ou distant (@johndoe:server.name), le serveur local (server.name), un serveur distant (matrix.org), ou tous les serveurs remote/local (*). Donner le nom du serveur Matrix, pas le domaine/URL complet. Il est également possible de spécifier plusieurs valeurs en les séparant par une virgule. Exemple : @johndoe:server.name,domain.tld,matrix.org"
83 |
84 | [resources]
85 |
86 | [resources.permissions]
87 | main.allowed = "all_users"
88 | main.auth_header = false
89 |
90 | [resources.system_user]
91 |
92 | [resources.install_dir]
93 |
94 | [resources.ports]
95 | main.default = 8449
96 |
97 | [resources.sources]
98 |
99 | [resources.sources.main]
100 | in_subdir = false
101 | extract = false
102 | rename = "mautrix-whatsapp"
103 | amd64.url = "https://github.com/mautrix/whatsapp/releases/download/v0.10.9/mautrix-whatsapp-amd64"
104 | amd64.sha256 = "d63e377092763d463e9f716fc1c4edb23136dc9aa0b8861628b46d786ba852f1"
105 | arm64.url = "https://github.com/mautrix/whatsapp/releases/download/v0.10.9/mautrix-whatsapp-arm64"
106 | arm64.sha256 = "28120fce38b76617772a249194b3dd020fd5773c7dfebc5e0c443cacf8161d4c"
107 | armhf.url = "https://github.com/mautrix/whatsapp/releases/download/v0.10.9/mautrix-whatsapp-arm"
108 | armhf.sha256 = "597f9de165ceb2a37c07202fcfaa2c1e93c99e356afaff507dc0d278792898d1"
109 |
110 | autoupdate.strategy = "latest_github_release"
111 | autoupdate.asset.amd64 = "^mautrix-whatsapp-amd64$"
112 | autoupdate.asset.arm64 = "^mautrix-whatsapp-arm64$"
113 | autoupdate.asset.armhf = "^mautrix-whatsapp-arm$"
114 |
115 | [resources.apt]
116 | packages = "g++, postgresql, ffmpeg"
117 |
118 | [resources.database]
119 | type = "postgresql"
120 |
--------------------------------------------------------------------------------
/scripts/_common.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # PERSONAL HELPERS
5 | #=================================================
6 |
7 | get_synapse_db_name() {
8 | # Parameters: synapse instance identifier
9 | # Returns: database name
10 | ynh_app_setting_get --app="$1" --key=db_name
11 | }
12 |
13 | #=================================================
14 | # CONFIG PANEL SETTERS
15 | #=================================================
16 |
17 | apply_permissions() {
18 | set -o noglob # Disable globbing to avoid expansions when passing * as value.
19 | declare values="list$role"
20 | newValues="${!values}" # Here we expand the dynamic variable we created in the previous line. ! Does the trick
21 | newValues="${newValues//\"}"
22 | usersArray=(${newValues//,/ }) # Split the values using comma (,) as separator.
23 |
24 | if [ -n "$newValues" ]
25 | then
26 | #ynh_systemd_action --service_name="$app" --action=stop
27 | # Get all entries between "permissions:" and "relay:" keys, remove the role part, remove commented parts, format it with newlines and clean whitespaces and double quotes.
28 | allDefinedEntries=$(awk '/permissions:/{flag=1; next} /relay:/{flag=0} flag' "$install_dir/config.yaml" | sed "/: $role/d" | sed -r 's/: (admin|user|relay)//' | tr -d '[:blank:]' | sed '/^#/d' | tr -d '\"' | tr ',' '\n' )
29 | # Delete everything from the corresponding role to insert the new defined values. This way we also handle deletion of users.
30 | sed -i "/permissions:/,/relay:/{/: $role/d;}" "$install_dir/config.yaml"
31 | # Ensure that entries with value surrounded with quotes are deleted too. E.g. "users".
32 | sed -i "/permissions:/,/relay:/{/: \"$role\"/d;}" "$install_dir/config.yaml"
33 | for user in "${usersArray[@]}"
34 | do
35 | if grep -q -x "${user}" <<< "$allDefinedEntries"
36 | then
37 | ynh_print_info "User $user already defined in another role."
38 | else
39 | sed -i "/permissions:/a \ \\\"$user\": $role" "$install_dir/config.yaml" # Whitespaces are needed so that the file can be correctly parsed
40 | fi
41 | done
42 | fi
43 | set +o noglob
44 |
45 | ynh_print_info "Users with role $role added in $install_dir/config.yaml"
46 | }
47 |
48 |
49 |
50 | set__listuser() {
51 | role="user"
52 | ynh_app_setting_set --app=$app --key=listuser --value="$listuser"
53 | apply_permissions
54 | ynh_store_file_checksum --file="$install_dir/config.yaml"
55 | }
56 |
57 | set__listrelay() {
58 | role="relay"
59 | ynh_app_setting_set --app=$app --key=listrelay --value="$listrelay"
60 | apply_permissions
61 | ynh_store_file_checksum --file="$install_dir/config.yaml"
62 | }
63 |
64 | set__listadmin() {
65 | role="admin"
66 | ynh_app_setting_set --app=$app --key=listadmin --value="$listadmin"
67 | apply_permissions
68 | ynh_store_file_checksum --file="$install_dir/config.yaml"
69 | }
70 |
--------------------------------------------------------------------------------
/scripts/backup:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC START
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
10 | source ../settings/scripts/_common.sh
11 | source /usr/share/yunohost/helpers
12 |
13 | #=================================================
14 | # DECLARE DATA AND CONF FILES TO BACKUP
15 | #=================================================
16 | ynh_print_info --message="Declaring files to be backed up..."
17 |
18 | #=================================================
19 | # BACKUP THE APP MAIN DIR
20 | #=================================================
21 |
22 | ynh_backup --src_path="$install_dir"
23 |
24 | #=================================================
25 | # SYSTEM CONFIGURATION
26 | #=================================================
27 |
28 | ynh_backup --src_path="/etc/logrotate.d/$app"
29 |
30 | ynh_backup --src_path="/etc/systemd/system/$app.service"
31 |
32 | #=================================================
33 | # BACKUP THE POSTGRESQL DATABASE
34 | #=================================================
35 | ynh_print_info --message="Backing up the PostgreSQL database..."
36 |
37 | ynh_psql_dump_db --database="$db_name" > db.sql
38 |
39 | #=================================================
40 | # END OF SCRIPT
41 | #=================================================
42 |
43 | ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."
44 |
--------------------------------------------------------------------------------
/scripts/config:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | source _common.sh
3 | source /usr/share/yunohost/helpers
4 | ynh_abort_if_errors
5 |
6 | #=================================================
7 | # SPECIFIC GETTERS FOR TOML SHORT KEY
8 | #=================================================
9 |
10 | get__botname() {
11 | botname=$(ynh_app_setting_get --app $app --key botname)
12 | echo "${botname}"
13 | }
14 |
15 | get__listuser() {
16 | existingUsers=$(grep -- "\".*: user" "$install_dir/config.yaml" | sed -r 's/: user//' | tr -d '[:blank:]' | sed '/^#/d' | tr -d '\"' | tr '\n' ',')
17 |
18 | cat </dev/null
31 | then
32 | ynh_script_progression --message="Removing $app service integration..." --weight=3
33 | yunohost service remove $app
34 | fi
35 |
36 | # Remove the dedicated systemd config
37 | ynh_remove_systemd_config
38 |
39 | # Remove the app-specific logrotate config
40 | ynh_remove_logrotate
41 |
42 | #=================================================
43 | # SPECIFIC REMOVE
44 | #=================================================
45 | # REMOVE VARIOUS FILES
46 | #=================================================
47 | ynh_script_progression --message="Removing various files..." --weight=6
48 |
49 | # Remove a directory securely
50 | ynh_secure_remove --file="/etc/matrix-$synapse_instance/app-service/$app.yaml"
51 | /opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh || ynh_die --message="Synapse can't restart with the appservice configuration"
52 |
53 | #=================================================
54 | # END OF SCRIPT
55 | #=================================================
56 |
57 | ynh_script_progression --message="Removal of $app completed" --last
58 |
--------------------------------------------------------------------------------
/scripts/restore:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC START
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
10 | source ../settings/scripts/_common.sh
11 | source /usr/share/yunohost/helpers
12 |
13 | server_name=$(ynh_app_setting_get --app=$app --key=server_name)
14 |
15 | synapse_db_name="$(get_synapse_db_name $synapse_instance)"
16 | bot_synapse_db_user="@$botname:$server_name"
17 |
18 | #=================================================
19 | # RESTORE THE APP MAIN DIR
20 | #=================================================
21 | ynh_script_progression --message="Restoring the app main directory..." --weight=1
22 |
23 | ynh_restore_file --origin_path="$install_dir"
24 |
25 | chmod 750 "$install_dir"
26 | chmod -R 750 "$install_dir"
27 | chown -R $app:$app "$install_dir"
28 |
29 | #=================================================
30 | # SPECIFIC RESTORATION
31 | #=================================================
32 | # RESTORE THE POSTGRESQL DATABASE
33 | #=================================================
34 | ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=8
35 |
36 | ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name
37 |
38 | #=================================================
39 | # REGISTER SYNAPSE APP-SERVICE
40 | #=================================================
41 | ynh_script_progression --message="Registering Synapse app-service" --weight=1
42 |
43 | $install_dir/mautrix-whatsapp -g -c $install_dir/config.yaml -r /etc/matrix-$synapse_instance/app-service/$app.yaml
44 | /opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh || ynh_die "Synapse can't restart with the appservice configuration"
45 |
46 | chmod 400 "$install_dir/config.yaml"
47 | chown $app:$app "$install_dir/config.yaml"
48 |
49 | #=================================================
50 | # RESTORE SYSTEMD
51 | #=================================================
52 | ynh_script_progression --message="Restoring the systemd configuration..." --weight=3
53 |
54 | ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
55 | systemctl enable $app.service --quiet
56 |
57 | #=================================================
58 | # RESTORE THE LOGROTATE CONFIGURATION
59 | #=================================================
60 | ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1
61 |
62 | ynh_restore_file --origin_path="/etc/logrotate.d/$app"
63 | mkdir --parents "/var/log/$app"
64 | chmod -R 600 "/var/log/$app"
65 | chmod 700 "/var/log/$app"
66 | chown -R $app:$app /var/log/$app
67 |
68 | #=================================================
69 | # INTEGRATE SERVICE IN YUNOHOST
70 | #=================================================
71 | ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
72 |
73 | yunohost service add $app --description="$app daemon for bridging Whatsapp and Matrix messages" --log="/var/log/$app/$app.log"
74 |
75 | #=================================================
76 | # START SYSTEMD SERVICE
77 | #=================================================
78 | ynh_script_progression --message="Starting a systemd service..." --weight=30
79 |
80 | # Start a systemd service
81 | ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log"
82 | # Wait until the synapse user is created
83 | sleep 30
84 | # (Note that, by default, non-admins might not have your homeserver's permission to create communities.)
85 | if [ "$bot_synapse_adm" = true ]
86 | then
87 | ynh_psql_execute_as_root --database=$synapse_db_name --sql="UPDATE users SET admin = 1 WHERE name = ""$botname"";"
88 | #yunohost app action run $synapse_instance set_admin_user -a username=$botname
89 | fi
90 | ynh_systemd_action --service_name=$app --action="restart"
91 |
92 | #=================================================
93 | # END OF SCRIPT
94 | #=================================================
95 |
96 | ynh_script_progression --message="Restoration completed for $app" --last
97 |
--------------------------------------------------------------------------------
/scripts/upgrade:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #=================================================
4 | # GENERIC START
5 | #=================================================
6 | # IMPORT GENERIC HELPERS
7 | #=================================================
8 |
9 | source _common.sh
10 | source /usr/share/yunohost/helpers
11 |
12 | server_name=$(ynh_app_setting_get --app=$app --key=server_name)
13 |
14 | synapse_db_name="$(get_synapse_db_name $synapse_instance)"
15 | bot_synapse_db_user="@$botname:$server_name"
16 |
17 | #=================================================
18 | # GET CONFIG PANEL SETTINGS
19 | #=================================================
20 | async_media=$(ynh_app_setting_get --app=$app --key=async_media)
21 | displayname=$(ynh_app_setting_get --app=$app --key=displayname)
22 | avatar=$(ynh_app_setting_get --app=$app --key=avatar)
23 | ephemeral_events=$(ynh_app_setting_get --app=$app --key=ephemeral_events)
24 | enable_metrics=$(ynh_app_setting_get --app=$app --key=enable_metrics)
25 | listen_port=$(ynh_app_setting_get --app=$app --key=listen_port)
26 | os_name=$(ynh_app_setting_get --app=$app --key=os_name)
27 | browser_name=$(ynh_app_setting_get --app=$app --key=browser_name)
28 | username_template=$(ynh_app_setting_get --app=$app --key=username_template)
29 | personal_filtering_spaces=$(ynh_app_setting_get --app=$app --key=personal_filtering_spaces)
30 | delivery_receipts=$(ynh_app_setting_get --app=$app --key=delivery_receipts)
31 | send_presence_on_typing=$(ynh_app_setting_get --app=$app --key=send_presence_on_typing)
32 | url_previews=$(ynh_app_setting_get --app=$app --key=url_previews)
33 | encryption_default=$(ynh_app_setting_get --app=$app --key=encryption_default)
34 | encryption_require=$(ynh_app_setting_get --app=$app --key=encryption_require)
35 | enable_relaybot=$(ynh_app_setting_get --app=$app --key=enable_relaybot)
36 | admin_only=$(ynh_app_setting_get --app=$app --key=admin_only)
37 | print_level=$(ynh_app_setting_get --app=$app --key=print_level)
38 |
39 | listrelay=$(ynh_app_setting_get --app=$app --key=listrelay)
40 | listuser=$(ynh_app_setting_get --app=$app --key=listuser)
41 | listadmin=$(ynh_app_setting_get --app=$app --key=listadmin)
42 |
43 | #=================================================
44 | # CHECK VERSION
45 | #=================================================
46 | ynh_script_progression --message="Checking version..." --weight=1
47 |
48 | upgrade_type=$(ynh_check_app_version_changed)
49 |
50 | #=================================================
51 | # STANDARD UPGRADE STEPS
52 | #=================================================
53 | # STOP SYSTEMD SERVICE
54 | #=================================================
55 | ynh_script_progression --message="Stopping a systemd service..." --weight=1
56 |
57 | ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
58 |
59 | #=================================================
60 | # ENSURE DOWNWARD COMPATIBILITY
61 | #=================================================
62 | ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
63 |
64 | # DB Backup missing because of wrong Upgrade from <=0.2.0
65 | if [ -z "$botname" ]
66 | then
67 | botname=$(ynh_app_setting_get --app=$app --key=whatsappbot)
68 | ynh_app_setting_set --app=$app --key=botname --value=$botname
69 | fi
70 | if [ -z "$db_name" ]
71 | then
72 | db_name=$(ynh_app_setting_get --app=$app --key=mautrix_whatsapp_db_name)
73 | ynh_app_setting_set --app=$app --key=db_name --value=$db_name
74 | fi
75 | if [ -z "$db_pwd" ]
76 | then
77 | db_pwd=$(ynh_app_setting_get --app=$app --key=mautrix_whatsapp_db_pwd)
78 | ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
79 | fi
80 | ynh_app_setting_delete --app=$app --key=whatsappbot
81 | ynh_app_setting_delete --app=$app --key=mautrix_whatsapp_db_name
82 | ynh_app_setting_delete --app=$app --key=mautrix_whatsapp_db_pwd
83 |
84 | # SET STANDARD SETTINGS FROM DEFAULT CONFIG
85 |
86 | if [ -z "$async_media" ]
87 | then
88 | async_media="false"
89 | ynh_app_setting_set --app=$app --key=async_media --value=$async_media
90 | fi
91 | if [ -z "$displayname" ]
92 | then
93 | displayname="WhatsApp bridge bot"
94 | ynh_app_setting_set --app=$app --key=displayname --value=$displayname
95 | fi
96 | if [ -z "$avatar" ]
97 | then
98 | avatar="mxc://maunium.net/NeXNQarUbrlYBiPCpprYsRqr"
99 | ynh_app_setting_set --app=$app --key=avatar --value=$avatar
100 | fi
101 | if [ -z "$ephemeral_events" ]
102 | then
103 | ephemeral_events="true"
104 | ynh_app_setting_set --app=$app --key=ephemeral_events --value=$ephemeral_events
105 | fi
106 | if [ -z "$enable_metrics" ]
107 | then
108 | enable_metrics="false"
109 | ynh_app_setting_set --app=$app --key=enable_metrics --value=$enable_metrics
110 | fi
111 | if [ -z "$listen_port" ]
112 | then
113 | listen_port="127.0.0.1:8001"
114 | ynh_app_setting_set --app=$app --key=listen_port --value=$listen_port
115 | fi
116 | if [ -z "$os_name" ]
117 | then
118 | os_name="Mautrix-WhatsApp bridge"
119 | ynh_app_setting_set --app=$app --key=os_name --value=$os_name
120 | fi
121 | if [ -z "$browser_name" ]
122 | then
123 | browser_name="unknown"
124 | ynh_app_setting_set --app=$app --key=browser_name --value=$browser_name
125 | fi
126 | if [ -z "$username_template" ]
127 | then
128 | username_template="whatsapp_{{.}}"
129 | ynh_app_setting_set --app=$app --key=username_template --value=$username_template
130 | fi
131 | if [ -z "$personal_filtering_spaces" ]
132 | then
133 | personal_filtering_spaces="false"
134 | ynh_app_setting_set --app=$app --key=personal_filtering_spaces --value=$personal_filtering_spaces
135 | fi
136 | if [ -z "$delivery_receipts" ]
137 | then
138 | delivery_receipts="false"
139 | ynh_app_setting_set --app=$app --key=delivery_receipts --value=$delivery_receipts
140 | fi
141 | if [ -z "$send_presence_on_typing" ]
142 | then
143 | send_presence_on_typing="false"
144 | ynh_app_setting_set --app=$app --key=send_presence_on_typing --value=$send_presence_on_typing
145 | fi
146 | if [ -z "$url_previews" ]
147 | then
148 | url_previews="false"
149 | ynh_app_setting_set --app=$app --key=url_previews --value=$url_previews
150 | fi
151 | if [ -z "$encryption_default" ]
152 | then
153 | encryption_default="false"
154 | ynh_app_setting_set --app=$app --key=encryption_default --value=$encryption_default
155 | fi
156 | if [ -z "$encryption_require" ]
157 | then
158 | encryption_require="false"
159 | ynh_app_setting_set --app=$app --key=encryption_require --value=$encryption_require
160 | fi
161 | if [ -z "$enable_relaybot" ]
162 | then
163 | enable_relaybot="true"
164 | ynh_app_setting_set --app=$app --key=enable_relaybot --value=$enable_relaybot
165 | fi
166 | if [ -z "$admin_only" ]
167 | then
168 | admin_only="true"
169 | ynh_app_setting_set --app=$app --key=admin_only --value=$admin_only
170 | fi
171 | if [ -z "$print_level" ]
172 | then
173 | print_level="info"
174 | ynh_app_setting_set --app=$app --key=print_level --value=$print_level
175 | fi
176 | if [ -z "$listrelay" ]
177 | then
178 | listrelay="*"
179 | ynh_app_setting_set --app=$app --key=listrelay --value=$listrelay
180 | fi
181 | if [ -z "$enable_relaybot" ]
182 | then
183 | enable_relaybot="true"
184 | ynh_app_setting_set --app=$app --key=enable_relaybot --value=$enable_relaybot
185 | fi
186 |
187 | if [ -z "$listuser" ]
188 | then
189 | listuser=$(ynh_app_setting_get --app=$app --key=botusers)
190 | ynh_app_setting_set --app=$app --key=listuser --value=$listuser
191 | ynh_app_setting_delete --app=$app --key=botusers
192 | fi
193 |
194 | if [ -z "$listadmin" ]
195 | then
196 | listadmin=$(ynh_app_setting_get --app=$app --key=botadmin)
197 | ynh_app_setting_set --app=$app --key=listadmin --value=$listadmin
198 | ynh_app_setting_delete --app=$app --key=botadmin
199 | fi
200 |
201 | #=================================================
202 | # DOWNLOAD, CHECK AND UNPACK SOURCE
203 | #=================================================
204 |
205 | if [ "$upgrade_type" == "UPGRADE_APP" ]
206 | then
207 | ynh_script_progression --message="Upgrading source files..." --weight=2
208 |
209 | # Download, check integrity, uncompress and patch the source from app.src
210 | ynh_setup_source --dest_dir="$install_dir"
211 | fi
212 |
213 | chmod 750 "$install_dir"
214 | chmod -R 750 "$install_dir"
215 | chown -R $app:$app "$install_dir"
216 |
217 | #=================================================
218 | # SPECIFIC UPGRADE
219 | #=================================================
220 | # UPDATE A CONFIG FILE
221 | #=================================================
222 | ynh_script_progression --message="Updating a configuration file..." --weight=2
223 |
224 | # reset permissions to be able to apply_permissions with app_setting values after upgrade
225 | listrelay_=$listrelay
226 | listuser_=$listuser
227 | listadmin_=$listadmin
228 | listrelay="*"
229 | listuser="@user:domain.tld"
230 | listadmin="@admin:domain.tld"
231 |
232 | ynh_add_config --template="../conf/config.yaml" --destination="$install_dir/config.yaml"
233 |
234 | chmod 400 "$install_dir/config.yaml"
235 | chown $app:$app "$install_dir/config.yaml"
236 |
237 | listrelay=$listrelay_
238 | listuser=$listuser_
239 | listadmin=$listadmin_
240 |
241 | # apply_permissions to have correct syntax in config file
242 | set__listuser
243 | set__listrelay
244 | set__listadmin
245 |
246 | #=================================================
247 | # REGISTER SYNAPSE APP-SERVICE
248 | #=================================================
249 | ynh_script_progression --message="Registering Synapse app-service" --weight=1
250 |
251 | $install_dir/mautrix-whatsapp -g -c $install_dir/config.yaml -r /etc/matrix-$synapse_instance/app-service/$app.yaml
252 | /opt/yunohost/matrix-$synapse_instance/update_synapse_for_appservice.sh || ynh_die "Synapse can't restart with the appservice configuration"
253 |
254 | # Set permissions on app files
255 | chown -R $app:$app "$install_dir"
256 | ynh_store_file_checksum --file="/etc/matrix-$synapse_instance/app-service/$app.yaml"
257 | ynh_store_file_checksum --file="$install_dir/config.yaml"
258 |
259 | #=================================================
260 | # SETUP SYSTEMD
261 | #=================================================
262 | ynh_script_progression --message="Upgrading systemd configuration..." --weight=4
263 |
264 | # Create a dedicated systemd config
265 | ynh_add_systemd_config
266 |
267 | #=================================================
268 | # GENERIC FINALIZATION
269 | #=================================================
270 | # SETUP LOGROTATE
271 | #=================================================
272 | ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1
273 |
274 | # Use logrotate to manage application logfile(s)
275 | ynh_use_logrotate --logfile "/var/log/$app/$app.log" --nonappend --specific_user $app/$app
276 | chmod -R 600 "/var/log/$app"
277 | chmod 700 "/var/log/$app"
278 | chown -R $app:$app /var/log/$app
279 |
280 | #=================================================
281 | # INTEGRATE SERVICE IN YUNOHOST
282 | #=================================================
283 | ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
284 |
285 | yunohost service add $app --description="$app daemon for bridging Whatsapp and Matrix messages" --log="/var/log/$app/$app.log"
286 |
287 | #=================================================
288 | # START SYSTEMD SERVICE
289 | #=================================================
290 | ynh_script_progression --message="Starting a systemd service..." --weight=1
291 |
292 | # Start a systemd service
293 | ynh_systemd_action --service_name=$app --action="start"
294 |
295 | #=================================================
296 | # END OF SCRIPT
297 | #=================================================
298 |
299 | ynh_script_progression --message="Upgrade of $app completed" --last
300 |
--------------------------------------------------------------------------------
/tests.toml:
--------------------------------------------------------------------------------
1 | #:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/tests.v1.schema.json
2 |
3 | test_format = 1.0
4 |
5 | [default]
6 |
7 | # ------------
8 | # Tests to run
9 | # ------------
10 |
11 | # For special usecases, sometimes you need to setup other things on the machine
12 | # prior to installing the app (such as installing another app)
13 | # (Remove this key entirely if not needed)
14 | preinstall = """
15 | sudo yunohost tools update apps
16 | sudo yunohost app install https://github.com/YunoHost-Apps/synapse_ynh/ -a "domain=$domain&init_main_permission=all_users&server_name=$server_name&is_free_registration=$is_free_registration&jitsi_server=$jitsi_server" --force
17 | """
18 |
19 | # -------------------------------
20 | # Default args to use for install
21 | # -------------------------------
22 |
23 | # By default, the CI will automagically fill the 'standard' args
24 | # such as domain, path, admin, is_public and password with relevant values
25 | # and also install args with a "default" provided in the manifest..
26 | # It should only make sense to declare custom args here for args with no default values
27 |
28 | args.botadmin = "@johndoe:server.name"
29 | args.botusers = "server.name"
30 |
31 | # -------------------------------
32 | # Commits to test upgrade from
33 | # -------------------------------
34 |
35 | test_upgrade_from.1d57a3b.name = "Upgrade from 0.7.2" # After config panel was implemented
36 |
37 | test_upgrade_from.ede12ed.name = "Upgrade from 0.8.0"
38 |
39 |
40 | # This is an additional test suite
41 | [multiple_botusers]
42 |
43 | preinstall = """
44 | sudo yunohost tools update apps
45 | sudo yunohost app install https://github.com/YunoHost-Apps/synapse_ynh/ -a "domain=$domain&server_name=$server_name&is_free_registration=$is_free_registration&jitsi_server=$jitsi_server" --force
46 | """
47 |
48 | # On additional tests suites, you can decide to run only specific tests
49 |
50 | only = ["install.subdir"]
51 |
52 | args.botadmin = "@johndoe:server.name"
53 | args.botusers = "@john:server.name,@jdoe:server.name,@janedoe:server.name"
54 |
--------------------------------------------------------------------------------