From 246f5cfdb8f581214b99e30d0ab592cd54f6c1e3 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 25 Nov 2015 20:02:26 +0100 Subject: [PATCH 1/4] started working on "Getting Started" section --- README.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ac537d9..d775970 100644 --- a/README.md +++ b/README.md @@ -2,20 +2,42 @@ transWhat is a WhatsApp XMPP Gateway based on [Spectrum 2](http://www.spectrum.im) and [Yowsup 2](https://github.com/tgalal/yowsup). -## Dependencies +## Getting started + +I assume that you have a basic understanding of XMPP and the transport concept. +transWhat is a XMPP transport. It is based on the Spectrum 2 XMPP transport framework and the Yowsup 2 library to interface with WhatsApp. + +Before getting started, please make sure that you have a XMPP server running. +I am using Prosody for this. + +After this we have to install several dependencies: + +### Dependencies #### Python packages - pip install e4u protobuf mysql dateutil + pip install --pre e4u protobuf mysql dateutil - **e4u**: is a simple emoji4unicode python bindings - [**yowsup**](https://github.com/tgalal/yowsup): is a python library that enables you build application which use WhatsApp service. - **mysqldb**: MySQL client python bindings #### Spectrum 2 -is a XMPP transport -Manual compile latest version from https://github.com/hanzz/libtransport. +Manual compile latest version from [Github](https://github.com/hanzz/libtransport). +You can use the following guide: http://spectrum.im/documentation/installation/from_source_code.html. + +### Installation + + git clone git@github.com:stv0g/transwhat.git + +### Configuration of Prosody + +http://prosody.im/doc/components + +### Configuration of Spectrum + +### Configuration of transWhat ## Contributors From 02e6b89bd1841dc71ae91ca24d36f4766457fda1 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 25 Nov 2015 22:30:11 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d775970..7a3a56b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ After this we have to install several dependencies: #### Python packages - pip install --pre e4u protobuf mysql dateutil + pip install --pre e4u protobuf mysql python-dateutil - **e4u**: is a simple emoji4unicode python bindings - [**yowsup**](https://github.com/tgalal/yowsup): is a python library that enables you build application which use WhatsApp service. @@ -33,12 +33,23 @@ You can use the following guide: http://spectrum.im/documentation/installation/f ### Configuration of Prosody -http://prosody.im/doc/components +See http://prosody.im/doc/components. + + Component "whatsapp.0l.de" + component_secret = "whatsappsucks" + component_ports = { 5221 } + component_interface = "127.0.0.1" ### Configuration of Spectrum ### Configuration of transWhat +First create a mySQL database named `transwhat` and fill it with the [schema](https://raw.githubusercontent.com/stv0g/transwhat/yowsup-2/conf/schema.sql) provided in the repo. + +## Docker + +In near future, there will be a Dockerfile for transWhat. + ## Contributors Pull requests, bug reports etc. are welcome. Help us to provide a open implementation of the WhatsApp protocol. From 0421df20a32c26fba1fafd23083802e4d1d83196 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 29 Nov 2015 17:14:38 +0100 Subject: [PATCH 3/4] added dazzlle to credits --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7a3a56b..93d314e 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,9 @@ Pull requests, bug reports etc. are welcome. Help us to provide a open implement The following persons have contributed major parts of this code: - - **Steffen Vogel** (@stv0g): Idea and initial implementation based on Yowsup 1 - - **Mohammed Yaseen Mowzer** (@moyamo): Port to Yowsup 2 + - @stv0g (Steffen Vogel): Idea and initial implementation based on Yowsup 1 + - @moyamo (Mohammed Yaseen Mowzer): Port to Yowsup 2 + - @DaZZZl: Improvements to group chats, media & message receipts ## Documentation From 5c90783bc4753197ecd4e1dc7032794dadd4f0da Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 29 Nov 2015 17:34:39 +0100 Subject: [PATCH 4/4] added transwhat and spectrum example confirmations --- README.md | 111 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 83 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 93d314e..e303b76 100644 --- a/README.md +++ b/README.md @@ -4,47 +4,102 @@ transWhat is a WhatsApp XMPP Gateway based on [Spectrum 2](http://www.spectrum.i ## Getting started -I assume that you have a basic understanding of XMPP and the transport concept. -transWhat is a XMPP transport. It is based on the Spectrum 2 XMPP transport framework and the Yowsup 2 library to interface with WhatsApp. +I assume that you have a basic understanding of XMPP and the the concept of a XMPP component / transport. If not, please get a book about Jabber or read the standards. -Before getting started, please make sure that you have a XMPP server running. -I am using Prosody for this. +transWhat is a XMPP transport. By this means it extends the functionallity of an existing XMPP server. It acts as a gateway between the XMPP and WhatsApp networks. It receives WhatsApp messages and forwards them to your XMPP client (and vice-versa). -After this we have to install several dependencies: +The implementation of transWhat is based on the [Spectrum 2](http://www.spectrum.im) framework and the [Yowsup 2](https://github.com/tgalal/yowsup) library to interface with WhatsApp. -### Dependencies +The following chart summarizes the involved components and the protocols they use to communicate. -#### Python packages +### Prosody - pip install --pre e4u protobuf mysql python-dateutil +##### Installation + +I will not cover the installation of Prosody in this guide. Please look for some other tutorials on how to do that. + +##### Configuration + +The only important thing for us is the configuration of a XMPP component (Spectrum 2 in our case). +See http://prosody.im/doc/components. + +Append the following at the end of `/etc/prosody/prosody.cfg.lua` + + Component "whatsapp.0l.de" + component_secret = "whatsappsucks" + component_ports = { 5221 } + component_interface = "127.0.0.1" + +### Spectrum 2 + +##### Installation + +Manual compile latest version from [Github](https://github.com/hanzz/libtransport). +You can use the following guide: http://spectrum.im/documentation/installation/from_source_code.html. + +##### Configuration + +Create a new file `/etc/spectrum2/transports/whatsapp.cfg` with the following content: + + [service] + user = spectrum + group = spectrum + + jid = whatsapp.0l.de + + server = localhost + password = whatsappsucks + port = 5221 + + backend_host = localhost + backend = /location/to/transwhat/transwhat.py + + users_per_backend = 10 + more_resources = 1 + + admin_jid = your@jid.example + + [identity] + name = transWhat + type = xmpp + category = gateway + + [logging] + config = /etc/spectrum2/logging.cfg + backend_config = /etc/spectrum2/backend-logging.cfg + +### transWhat + +##### Installation + +Checkout the latest version of transWhat from GitHub: + + $ git clone git@github.com:stv0g/transwhat.git + +Install required dependencies: + + $ pip install --pre e4u protobuf mysql python-dateutil - **e4u**: is a simple emoji4unicode python bindings - [**yowsup**](https://github.com/tgalal/yowsup): is a python library that enables you build application which use WhatsApp service. - **mysqldb**: MySQL client python bindings -#### Spectrum 2 +##### Configuration -Manual compile latest version from [Github](https://github.com/hanzz/libtransport). -You can use the following guide: http://spectrum.im/documentation/installation/from_source_code.html. +First create a new mySQL database named `transwhat` and fill it with the [schema](https://raw.githubusercontent.com/stv0g/transwhat/yowsup-2/conf/schema.sql) provided in the repo. -### Installation +Then create a new file called `constants.py` in the newly checked out transWhat Git repository: - git clone git@github.com:stv0g/transwhat.git - -### Configuration of Prosody - -See http://prosody.im/doc/components. - - Component "whatsapp.0l.de" - component_secret = "whatsappsucks" - component_ports = { 5221 } - component_interface = "127.0.0.1" - -### Configuration of Spectrum - -### Configuration of transWhat - -First create a mySQL database named `transwhat` and fill it with the [schema](https://raw.githubusercontent.com/stv0g/transwhat/yowsup-2/conf/schema.sql) provided in the repo. + DB_HOST = "localhost" + DB_USER = "**fillin**" + DB_PASS = "**fillin**" + DB_TABLE = "transwhat" + + BASE_PATH = "/location/to/transwhat" + + TOKEN_FILE = BASE_PATH + "/logs/tokens" + MOTD_FILE = BASE_PATH + "/conf/motd" + REQUESTS_FILE = BASE_PATH + "/logs/requests" ## Docker