1
Fork 0
mirror of https://github.com/swarmcom/jSynapse.git synced 2025-12-07 13:45:05 +00:00
[Pull Mirror] jSynapse - the Java implementation of matrix.org homeserver
  • Java 99.7%
  • Dockerfile 0.3%
Find a file
Mircea Carasel 70587ce0c1 add m.room.aliases event GET
-add tests
2015-04-24 19:04:28 +03:00
src add m.room.aliases event GET 2015-04-24 19:04:28 +03:00
.gitignore Improve Readme, gitignore target dir 2015-03-18 01:20:42 +01:00
Dockerfile Fix Docker build 2015-04-21 23:32:04 +02:00
LICENSE Add license file 2015-03-19 20:42:24 +01:00
pom.xml Add ContentAPI with GridFS support. TODO: implement thumbnail generator + add tests 2015-04-07 00:25:48 +02:00
README.md prevent set/get display name or avatar_url if access_token is not specified 2015-04-01 18:57:39 +03:00

jSynapse

jSynapse is the Java implementation of matrix.org homeserver. Full spec: http://matrix.org/docs/spec/

Steps to get it running:

  • install MongoDB and intialize replica set
  • git clone git@github.com:swarmcom/jSynapse.git
  • mvn clean install
  • java -jar target/jSynapse-1.0-SNAPSHOT.jar (or import Maven project in IDE of choice and run JSynapseServer class)

Install and start from Docker image:

  • sudo docker pull dizzy/mongodb

  • sudo docker run --name mongo_swarm -p 27017:27017 -d dizzy/mongodb:latest --noprealloc --smallfiles --replSet=jsynapse then intiate replicaset as: mongo --eval "rs.initiate()"

  • sudo docker pull dizzy/jsynapse

  • sudo docker run -d --name synapse1 -p 5555:5555 --link mongo_swarm:mongo_swarm dizzy/jsynapse:latest --spring.data.mongodb.uri=mongodb://mongo_swarm:27017/matrix

You can run a farm of jSynapse servers, pointing all to the same MongoDB instance:

  • sudo docker run -d --name synapse2 -p 5556:5555 --link mongo_swarm:mongo_swarm dizzy/jsynapse:latest --spring.data.mongodb.uri=mongodb://mongo_swarm:27017/matrix
  • sudo docker run -d --name synapse3 -p 5557:5555 --link mongo_swarm:mongo_swarm dizzy/jsynapse:latest --spring.data.mongodb.uri=mongodb://mongo_swarm:27017/matrix

By deafult jSynapse homeserver accepts requests on port 5555. You can change this by passing --port.server={PORT} To start with a different domain (default swarmcom.org) use --domain=mydomain.org

To check server health point browser to http://localhost:5555/health

Examples to get/set user display name and avatar url

curl -X PUT -H "Content-Type: application/json" -d '{"displayname":"John Doe"}' http://localhost:5555/_matrix/client/api/v1/profile/@mirceac:swarmcom.org/displayname?access_token=VEJbwzztYLhcIkKM

curl http://localhost:5555/_matrix/client/api/v1/profile/@mirceac:swarmcom.org/displayname?access_token=VEJbwzztYLhcIkKM {"displayname":"John Doe"}

curl -X PUT -H "Content-Type: application/json" -d '{"avatar_url":"url"}' http://localhost:5555/_matrix/client/api/v1/profile/@mirceac:swarmcom.org/avatar_url?access_token=VEJbwzztYLhcIkKM

curl http://localhost:5555/_matrix/client/api/v1/profile/@mirceac:swarmcom.org/avatar_url?access_token=VEJbwzztYLhcIkKM {"avatar_url":"url"}