Skip to content

Commit

Permalink
Upgrade to 0.3.0 (#2)
Browse files Browse the repository at this point in the history
* v0.3.0

* Changes to match the signal_ynh package and
improve backup, restore, and upgrade.
It should fix issue #4

* Change: fix error in multi_instance
install with the pre-installation of synapse.

* Auto-update README

* new url upstream repo

Co-authored-by: Alexandre Aubin <[email protected]>
Co-authored-by: nathanael-h <[email protected]>
Co-authored-by: tituspijean <[email protected]>
Co-authored-by: Yunohost-Bot <>
  • Loading branch information
4 people authored Mar 8, 2022
1 parent 846f76e commit 0b7c2eb
Show file tree
Hide file tree
Showing 21 changed files with 1,016 additions and 1,058 deletions.
663 changes: 660 additions & 3 deletions LICENSE

Large diffs are not rendered by default.

112 changes: 17 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,36 @@
# A Matrix-Facebook puppeting bridge for YunoHost
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->

# Matrix-Facebook bridge for YunoHost

[![Integration level](https://dash.yunohost.org/integration/mautrix_facebook.svg)](https://dash.yunohost.org/appci/app/mautrix_facebook) ![](https://ci-apps.yunohost.org/ci/badges/mautrix_facebook.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mautrix_facebook.maintain.svg)
[![Install Mautrix-Facebook with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mautrix_facebook)
[![Install Matrix-Facebook bridge with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mautrix_facebook)

*[Lire ce readme en français.](./README_fr.md)*

> *This package allows you to install Mautrix-Facebook quickly and simply on a YunoHost server.
> *This package allows you to install Matrix-Facebook bridge quickly and simply on a YunoHost server.
If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*

## Overview
A puppeting bridge between Matrix and Facebook packaged as a YunoHost service. Messages, notifications (and sometimes media) are bridged between a Facebook user and a Matrix user. Currently the Matrix user can NOT invite other Matrix user in a bridged Facebook room, so only someone with a Facebook account can participate to Facebook group conversations. The ["Mautrix-Facebook"](https://docs.mau.fi/bridges/python/facebook/index.html) bridge consists in a Synapse App Service and relies on postgresql (mysql also possible). Therefore, [Synapse for YunoHost](https://github.com/YunoHost-Apps/synapse_ynh) should be installed beforehand.

**Shipped version:** 0.2.0

## Screenshots

![](Link to a screenshot of this app.)

## List of known public services

* Ask on one of the following rooms: #mautrix_yunohost:matrix.fdn.fr or #facebook:maunium.net

## Bridging usage
** Note that several Facebook and Matrix users can be bridged, each Facebook account has its own bot administration room. If they are in a same Facebook group, only one matrix room will be created. **

### Bridge a Facebook user and a Matrix user
* First your Matrix user or Synapse Server has to be authorized in the Configuration of the bridge (see below)
* Then, invite the bot (default @facebookbot:yoursynapse.domain)
* If the Bot does bot accept, see the [troubleshooting page](https://docs.mau.fi/bridges/general/troubleshooting.html)
* Type ``!fb login <email> <password>``, where ``<email>`` and ``<password>`` are your Facebook email and password, e.g. ``!fb login [email protected] facebookpwd``
* If you have 2FA enabled, the bot will ask you to send the 2FA token.
* By defaults, only conversations with very recent messages will be bridged
* Accept invitations to the bridged chat rooms
* Send ``!sg help`` to the bot in this new Mautrix-Facebook bot administration room to know how to control the bot.
See also [upstream wiki Authentication page](https://docs.mau.fi/bridges/python/facebook/authentication.html)

### Double puppeting
* First login as described in the previous section
* Connect to the Matrix-Synapse Server to get an access token, for example with the command ``curl -XPOST -d '{"type":"m.login.password","identifier":{"type": "m.id.user", "user": "matrixusername"},"password":"matrixpassword","initial_device_display_name":"mautrix-facebook"}' https://yoursynapse.domain/_matrix/client/r0/login``
* Send ``login-matrix <access token>``, where ``<access token>`` is the token received from the Server.
* After logging in, the default Matrix puppet of your Facebook account should leave rooms and your account should join all rooms the puppet was in automatically.


### Relaybot: Bridge a group for several Matrix and several Facebook users to chat together
Not yet available

## Configuration of the bridge

The bridge is [roughly configured at installation](https://github.com/YunoHost-Apps/mautrix_facebook_ynh/blob/master/conf/config.yaml), e.g. allowed admin and user of the bot. Finer configuration can be done by modifying the
following configuration file with SSH:
```/opt/yunohost/mautrix_facebook/config.yaml```
and then restarting the mautrix_facebook service.

## Documentation
A Facebook puppeting bridge for Matrix/Synapse.

* Official "Mautrix-Facebook" documentation: https://docs.mau.fi/bridges/python/facebook/index.html
* Matrix room (Matrix Bridges in Yunohost): #mautrix_yunohost:matrix.fdn.fr
* Matrix room (upstream app): #facebook:maunium.net
In case you need to upload your logs somewhere, be aware that they contain your contacts' and your phone numbers. Strip them out with
``| sed -r 's/[0-9]{10,}/📞/g' ``
* YunoHost documentation: If more specific documentation is needed, feel free to contribute.
**Shipped version:** 0.3.0~ynh1

## YunoHost specific features

#### Multi-user support

* 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.
* The Facebook bot is a local Matrix-Synapse user, but accessible through federation (synapse public or private).
* Several Facebook and Matrix users can be bridged with one bridge, each user has its own bot administration room.
* If several bot users are in a same Facebook group, only one Matrix room will be created by the bridge.
* See https://github.com/YunoHost-Apps/synapse_ynh#multi-users-support
## Documentation and resources

#### Multi-instance support

* Multi-instance installation should work. Several bridge instances could be installed for one Matrix-Synapse instance so that one Matrix user can bridge several Facebook accounts.
* Several bridge instances could be installed for each Matrix-Synapse instance to benefit from it. But one bridge can be used by users from several Matrix-Synapse instances.

#### Supported architectures

* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/mautrix_facebook%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/mautrix_facebook/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/mautrix_facebook%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/mautrix_facebook/)

## Limitations

* It looks like media are not bridged.

## Additional information

* Other info you would like to add about this app.

**More info on the documentation page:**
https://docs.mau.fi/bridges/python/facebook/index.html

## Links

* Report a bug: https://github.com/YunoHost-Apps/mautrix_facebook_ynh/issues
* App website: https://github.com/YunoHost-Apps/mautrix-whatsapp_ynh
* Upstream app documentation: https://docs.mau.fi/bridges/python/facebook/index.html
* Upstream app repository: https://github.com/tulir/mautrix-facebook
* YunoHost website: https://yunohost.org/

---
* Official user documentation: https://docs.mau.fi/bridges/python/facebook/index.html
* Official admin documentation: https://docs.mau.fi/bridges/python/setup/index.html?bridge=facebook
* Upstream app code repository: https://github.com/mautrix/facebook
* YunoHost documentation for this app: https://yunohost.org/app_mautrix_facebook
* Report a bug: https://github.com/YunoHost-Apps/mautrix_facebook_ynh/issues

## Developer info

**Only if you want to use a testing branch for coding, instead of merging directly into master.**
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/mautrix_facebook_ynh/tree/testing).

To try the testing branch, please proceed like that.
Expand All @@ -114,8 +40,4 @@ or
sudo yunohost app upgrade mautrix_facebook -u https://github.com/YunoHost-Apps/mautrix_facebook_ynh/tree/testing --debug
```

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:
```
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
update-ca-certificates
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps
76 changes: 20 additions & 56 deletions README_fr.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,39 @@
# App exemple pour YunoHost
# Matrix-Facebook bridge pour YunoHost

[![Niveau d'intégration](https://dash.yunohost.org/integration/REPLACEBYYOURAPP.svg)](https://dash.yunohost.org/appci/app/REPLACEBYYOURAPP) ![](https://ci-apps.yunohost.org/ci/badges/REPLACEBYYOURAPP.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/REPLACEBYYOURAPP.maintain.svg)
[![Installer REPLACEBYYOURAPP avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=REPLACEBYYOURAPP)
[![Niveau d'intégration](https://dash.yunohost.org/integration/mautrix_facebook.svg)](https://dash.yunohost.org/appci/app/mautrix_facebook) ![](https://ci-apps.yunohost.org/ci/badges/mautrix_facebook.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/mautrix_facebook.maintain.svg)
[![Installer Matrix-Facebook bridge avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mautrix_facebook)

*[Read this readme in english.](./README.md)*
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*

> *Ce package vous permet d'installer REPLACEBYYOURAPP rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.*
> *Ce package vous permet d'installer Matrix-Facebook bridge rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*

## Vue d'ensemble
Description rapide de cette application.

**Version incluse :** 1.0
Passerelle Facebook pour Matrix/Synapse.

## Captures d'écran
**Version incluse :** 0.3.0~ynh1

![](Lien vers une capture d'écran de cette application.)

## Démo

* [Démo officielle](Lien vers un site de démonstration de cette application.)
## Documentations et ressources

## Configuration

Comment configurer cette application : via le panneau d'administration, un fichier brut en SSH ou tout autre moyen.

## Documentation

* Documentation officielle : Lien vers la documentation officielle de cette application.
* Documentation YunoHost : Si une documentation spécifique est nécessaire, n'hésitez pas à contribuer.

## Caractéristiques spécifiques YunoHost

#### Support multi-utilisateur

* L'authentification LDAP et HTTP est-elle prise en charge ?
* L'application peut-elle être utilisée par plusieurs utilisateurs ?

#### Architectures supportées

* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/REPLACEBYYOURAPP/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/REPLACEBYYOURAPP%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/REPLACEBYYOURAPP/)

## Limitations

* Limitations connues.

## Informations additionnelles

* Autres informations que vous souhaitez ajouter sur cette application.

**Plus d'informations sur la page de documentation :**
https://yunohost.org/packaging_apps

## Liens

* Signaler un bug : https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/issues
* Site de l'application : Lien vers le site officiel de cette application.
* Dépôt de l'application principale : Lien vers le dépôt officiel de l'application principale.
* Site web YunoHost : https://yunohost.org/

---
* Documentation officielle utilisateur : https://docs.mau.fi/bridges/python/facebook/index.html
* Documentation officielle de l'admin : https://docs.mau.fi/bridges/python/setup/index.html?bridge=facebook
* Dépôt de code officiel de l'app : https://github.com/mautrix/facebook
* Documentation YunoHost pour cette app : https://yunohost.org/app_mautrix_facebook
* Signaler un bug : https://github.com/YunoHost-Apps/mautrix_facebook_ynh/issues

## Informations pour les développeurs

**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.**
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing).
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/mautrix_facebook_ynh/tree/testing).

Pour essayer la branche testing, procédez comme suit.
```
sudo yunohost app install https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug
sudo yunohost app install https://github.com/YunoHost-Apps/mautrix_facebook_ynh/tree/testing --debug
ou
sudo yunohost app upgrade REPLACEBYYOURAPP -u https://github.com/YunoHost-Apps/REPLACEBYYOURAPP_ynh/tree/testing --debug
sudo yunohost app upgrade mautrix_facebook -u https://github.com/YunoHost-Apps/mautrix_facebook_ynh/tree/testing --debug
```

**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
33 changes: 33 additions & 0 deletions check_process
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# See here for more information
# https://github.com/YunoHost/package_check#syntax-check_process-file

;; Default test serie
; pre-install
sudo yunohost tools update apps
sudo yunohost app info synapse --quiet > /dev/null || sudo yunohost app install https://github.com/YunoHost-Apps/synapse_ynh/ -a "domain=$domain&server_name=$server_name&is_public=$is_public&jitsi_server=$jitsi_server" --force
; Manifest
port="8449" (PORT)
synapsenumber="1"
botname="facebookbot"
bot_synapse_adm=0
encryption=0
botadmin="@johndoe:synapsedomain.tld" (USER)
botusers="@johndoe:synapsedomain.tld"
; Checks
pkg_linter=1
setup_sub_dir=0
setup_root=0
setup_nourl=1
setup_private=0
setup_public=0
upgrade=1
upgrade=1 from_commit=01514cf02f52773a8164d512d59687c121852152
backup_restore=1
multi_instance=1
port_already_use=1
change_url=0
actions=0
config_panel=0
;;; Upgrade options
; commit=01514cf02f52773a8164d512d59687c121852152
name=0.2.0
35 changes: 0 additions & 35 deletions check_process.default

This file was deleted.

4 changes: 2 additions & 2 deletions conf/app.src
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/tulir/mautrix-facebook/tarball/7b2246099d3d6ac52061f82315460415eb22219b
SOURCE_SUM=fd9d4f2b2feec390fb35b56f3a5e4a26234f9ed5029eb3950bea4b7dc55bef49
SOURCE_URL=https://github.com/mautrix/facebook/archive/v0.3.0.tar.gz
SOURCE_SUM=0b31c0a865d71bc76bed541ee8e57dd790a67197f62883032a7ae05b9658642b
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
Expand Down
34 changes: 19 additions & 15 deletions conf/config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Homeserver details
homeserver:
# The address that this appservice can use to connect to the homeserver.
# address: https://example.com
address: __DOMAIN__
address: https://__DOMAIN__
# The domain of the homeserver (for MXIDs, etc).
# domain: example.com
domain: __SERVER_NAME__
# Whether or not to verify the SSL certificate of the homeserver.
# Only applies if address starts with https://
# verify_ssl: true
verify_ssl: __VERIFY_SERVER_SSL_CERTIFICATES__
# Whether or not the homeserver supports asmux-specific endpoints,
# such as /_matrix/client/unstable/net.maunium.asmux/dms for atomically
Expand All @@ -20,21 +17,26 @@ homeserver:
# Changing these values requires regeneration of the registration.
appservice:
# The address that the homeserver can use to connect to this appservice.
# address: http://localhost:29319
address: http://localhost:__PORT__
# When using https:// the TLS certificate and key files for the address.
tls_cert: false
tls_key: false

# The hostname and port where this appservice should listen.
# hostname: localhost
hostname: 0.0.0.0
# port: 29319
port: __PORT__
# The maximum body size of appservice API requests (from the homeserver) in mebibytes
# Usually 1 is enough, but on high-traffic bridges you might need to increase this to avoid 413s
max_body_size: 1

# The full URI to the database. Only Postgres is currently supported.
# database: postgres://username:password@hostname/db
database: postgres://__MAUTRIX_FACEBOOK_USER__:__MAUTRIX_FACEBOOK_DB_PWD__@localhost:5432/__MAUTRIX_FACEBOOK_DB_NAME__
database: postgres://__MAUTRIX_BRIDGE_USER__:__MAUTRIX_BRIDGE_DB_PWD__@localhost:5432/__MAUTRIX_BRIDGE_DB_NAME__
# Additional arguments for asyncpg.create_pool()
# https://magicstack.github.io/asyncpg/current/api/index.html#asyncpg.pool.create_pool
database_opts:
min_size: 5
max_size: 10


# Public part of web server for out-of-Matrix interaction with the bridge.
public:
Expand All @@ -51,17 +53,19 @@ appservice:
shared_secret: generate

# The unique ID of this appservice.
id: __FACEBOOKBOT__
id: __BOTNAME__
# Username of the appservice bot.
bot_username: __FACEBOOKBOT__
bot_username: __BOTNAME__
# Display name and avatar for bot. Set to "remove" to remove display name/avatar, leave empty
# to leave display name/avatar as-is.
bot_displayname: FB bridge bot
bot_avatar: mxc://maunium.net/ygtkteZsXnGJLJHRchUwYWak

# Community ID for bridged users (changes registration file) and rooms.
# Must be created manually. Example: "+facebook:example.com"
community_id: null
# Must be created manually.
#
# Example: "+fb:example.com". Set to false to disable.
community_id: +fb:__SERVER_NAME__

# Whether or not to receive ephemeral events via appservice transactions.
# Requires MSC2409 support (i.e. Synapse 1.22+).
Expand Down Expand Up @@ -244,11 +248,11 @@ logging:
formatter: colored
loggers:
mau:
level: DEBUG
level: __LOG_LEVEL__
paho:
level: INFO
aiohttp:
level: INFO
root:
level: DEBUG
level: __LOG_LEVEL__
handlers: [file, console]
Loading

0 comments on commit 0b7c2eb

Please sign in to comment.