Installing and Running TextSecure (Signal) Server on Windows
Installing and Running TextSecure (Signal) Server on Windows
While working at Plexus, I had to implement Signal Server’s end to end encryption on certain project. Though Open Whisper System had the code in github, the instructions were quite unclear on installing the server on local machine. I stumbled upon few Github posts and got this amazing guide. So this is my take on installing TextSecure (Signal) Server on a local Windows 10 machine.
Meta
- Author: Abhishek Deb(vikz91.deb@gmail.com, abhishek@plexus365.com)
- Date: 1st Feb 2017
- Source: WhisperSystems Lucaconte.
About
If you are using Whatsapp then you must have seen “end-to-end” encryption thingy! Well, After Apple’s beef with FBI, Whatsapp just turned on encryption for a billion people.
(Image Courtesy : SecureBeam)
Prerequisites
- Java 1.7.
- Windows 10
- Redis (for caching purposes)
- PostgreSQL instance
- Twillio account for SMS registration process confirmation
- Amazon AWS S3 bucket service for messages’ attachments
- A GCM account from google developer console: a senderId add a ApiKey. Create a project, senderId is the projectNumber. For ApiKey, go to API management -> credentials -> create credentials -> API Keys -> Server Key and save this key
- APN account for Apple Push Notifications (two pem certificates) [ask]
Building and Compiling
- Clone TextSecure (Signal) Server
git clone https://github.com/lucaconte/Signal-Server.git
- Clone Push Server
git clone https://github.com/lucaconte/PushServer.git
- Clone WebSocket Resources
git clone https://github.com/lucaconte/WebSocket-Resources.git
- In Push Server pom.xml, change
capsule.maven.plugin.version
version to1.0.1
- Build Push Server (from inside this folder)
mvn clean install
- Download & install gpg4win gpg tool for signing)
https://www.gpg4win.org/download.html : https://files.gpg4win.org/gpg4win-vanilla-2.3.3.exe
- Make sure Environment Variables are set for gpg
GNUPGHOME : c:\Users\
\AppData\Roaming\gnupg //or whatever path it is - Create default
secring
andpubring
by opening gpg2.exe file from installed location - Exit the opened terminal which says “type message”
- Build Push Websocket-Resource (from inside thsi folder)
mvn clean install
- The build will fail at javadoc signing but its okay as we have got the main binary in target folder (websocket-resources-0.4.1)
- Link this file in maven repo ( make sure the versions are same in the file and in teh command)
mvn install:install-file -Dfile=./library/target/websocket-resources-0.4.1.jar -DgroupId=org.whispersystems -DartifactId=websocket-resources -Dversion=0.4.1 -Dpackaging=jar
- Now build the Signal Server (from inside the Signal Server folder)
mvn clean install -DskipTests
- We skip the tests because they will fail for not finding a key which we will cover later
Creating Config files
pushserver.yml
1 | redis: |
textsecure.yml
1 | # This is the sample config/textsecure.yml file for the TextSecure Server |
Place pushserver.yml in Push Server Folder.
Place textsecure.yml in Text Sexure /config folder.
Disabling iOS Features ( Temporarily)
useful part if you plan to test Android only as first
Remove @NotEmpty annotation above “private ApnConfiguration apn;” field definition into
org.whispersystems.pushserver.PushServerConfiguration
class, so into yml PushServers’s file the APN related params become optional.Into
org.whispersystems.pushserver.PushServer
‘s “run” method comment every row with apnSender var and pass null in the jersey Controller registration of the PushController:
environment.jersey().register(new PushController(null, gcmSender));
instead ofenvironment.jersey().register(new PushController(apnSender, gcmSender));
Lines : 55, 58 and 62
Configuring & Running Database
Postgresql
- Download and Install Postgres
https://www.postgresql.org/download/windows/
- Create Databases (Exit all postgres cli instances first)
createdb -U postgres accountsdb
createdb -U postgres messagedb
- Import Table Schemas: (from inside Signal-Server folder)
java -jar target/TextSecureServer-
.jar accountdb migrate config/textsecure.yml java -jar target/TextSecureServer-
.jar messagedb migrate config/textsecure.yml
Redis
- Download and Install Redis
https://github.com/rgl/redis/downloads
Running Everything Together
- Run Redis
redis-server
- Run Push Server
java -jar Push-Server-
-capsule-fat.jar server pushserver.yml - Run Text Secure ( Signal) Server
java -jar target/TextSecureServer-
.jar server config/textsecure.yml
Testing with Android App
Coming soon …