Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Cadair/matrix-appservice-hangouts
A prototype Matrix<->Hangouts appservice written in Python 3.6 using asyncio.
https://github.com/Cadair/matrix-appservice-hangouts
Last synced: 5 days ago
JSON representation
A prototype Matrix<->Hangouts appservice written in Python 3.6 using asyncio.
- Host: GitHub
- URL: https://github.com/Cadair/matrix-appservice-hangouts
- Owner: Cadair
- License: mit
- Created: 2016-12-31T12:51:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T14:06:40.000Z (over 6 years ago)
- Last Synced: 2024-06-26T13:31:46.877Z (5 months ago)
- Language: Python
- Size: 117 KB
- Stars: 12
- Watchers: 6
- Forks: 4
- Open Issues: 13
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-matrix - matrix-appservice-hangouts
- awesome-starred - Cadair/matrix-appservice-hangouts - A prototype Matrix<->Hangouts appservice written in Python 3.6 using asyncio. (others)
README
matrix-appservice-hangouts
==========================This is a `matrix appservice `_
with the objective of being a fully featured puppeting multi-user hangouts bridge.This bridge is implemented in Python 3.6+ using asyncio and the
`hangups `_ library. This library contains an
asyncio implementation of parts of the matrix client-server API and the
application service API.Why Python 3.6
--------------I wanted to implement this using asyncio and using the `async def` and `await`
syntax. Python 3.6 is because I am lazy and love
`f-strings `_.Usage
-----The appservice can be run with the `hangoutsas` command. The default options for
this command connect to the localhost testing homeserver... code-block:: none
$ hangoutsas --help
Usage: hangoutsas [OPTIONS]Options:
-m, --mxid TEXT
-t, --token TEXT
--matrix_server TEXT
--server_domain TEXT
--database-uri TEXT
--access_token TEXT
--debug / --no-debug
--help Show this message and exit.You need to provide the matrix user id and hangouts authentication tokens for any users (technically only on first run, as they are then stored in the database). This may change in the future, but it is very hard to obtain hangouts tokens and there are security concerns over allowing people to login with the bridge. (Also I haven't implemented support for an admin chat channel yet!)
Example
^^^^^^^.. code-block:: none
hangoutsas --matrix_server=http://localhost:8008 --server_domain=homeserver.org --access_token=xeehahR5eibXesEicohPh3Yisoi2osh5 --database-uri=sqlite:////opt/matrix-appservice-hangouts/hangouts.sqlite --mxid @bob:homeserver.org --token 1/7bVBdycv6hS2Su1F0jej2FTs9TJrNaCMkyX2_ARSnE4
where `mxid` is your matrix login which must receive messages from hangouts, `--token` is access_token of needed hangouts user (hangouts username is not needed, only access token). `mxid` and `token` pair can be set multiple times for add several hangouts bridges to different matrix users.The best way to get your personal hangouts login token is to `follow these instructions `_. When logged in, you can find the refresh token in `~/.cache/hangups/refresh_token.txt` and use it to log in with the bridge.
Installation
------------**NOTE**: Currently the `appservice_framework` package requires a branch of the
`matrix-python-sdk` so it's probably better if you clone both this repo and the
`appservice-framework
`_ repo and install
using `requirements.txt` in both...
Install using pip:.. code-block:: none
pip install git+https://github.com/Cadair/python-appservice-framework.git
pip install git+https://github.com/Cadair/matrix-appservice-hangoutsRequirements
^^^^^^^^^^^^* aiohttp
* hangups
* click
* https://github.com/Cadair/python-appservice-framework.gitTesting and Development
#######################This repo also contains configuration for a vagrant VM running a matrix
homeserver, this can be used to develop or test the appservice. It can be run
with:.. code-block:: none
$ vagrant up --provision
You can then connect your matrix client to the address `http://localhost:8008`
with the username `@admin:localhost` and password `admin`.TODO List
---------* Handle hangouts events:
- Join room
- Part room
- Typing
- Online / Offline (bidirectional)* Add some way of joining hangouts rooms before getting a message in the room. This might be made easier once communities are easily filterable on the matrix side.
Licence
-------MIT
Authors
-------`matrix_appservice_hangouts` was written by `Stuart Mumford `_.