Commit graph

279 commits

Author SHA1 Message Date
Mark Haines 867c6fc16e Merge branch 'master' into babolivier/public-rooms-component 2017-08-22 11:07:25 +01:00
Richard van der Hoff 46877b6baa Add installation instructions to repo (#192) 2017-08-21 17:34:05 +01:00
Mark Haines 808c2e09f6 Make txn *sql.Tx arguments optional everywhere using a utility function (#191)
* Make txn *sql.Tx arguments optional everywhere using a utility function

* Clarify that if the txn is nil the stmt will run outside a transaction
2017-08-21 17:20:23 +01:00
Mark Haines 57b7097368 Add input API for adding invites to the roomserver. (#187)
* Add input API for adding invites to the roomserver.

This API handles invites received over federation that occur outside of a room.

* Add some docstring for withTransaction

* Use a nicer pattern for wrapping transactions

* Fix MembershipUpdater method to not commit the transaction before returning it

* Use the Transaction interface from common
2017-08-21 16:37:11 +01:00
Brendan Abolivier 5950293e79 Membership viewing API (#174)
* Basic memberships retrieval

* Change the way the memberships are saved in the client API database

* Retrieve single membership

* Get memberships only if the user is or has been in the room

* Check server name on room ID instead of user ID

* Save the join membership event and updates it when necessary

* Membership events retrieval + update on leave

* Implement the API on the roomserver and client API server

* Fix comments

* Remove the functions and attributes used before the new query API

* Explicitely state what we return in query

* Remove tab
2017-08-21 16:34:26 +01:00
Mark Haines 81179a0595 Fix integration test proxy certificate arguments (#190) 2017-08-21 16:23:59 +01:00
Brendan Abolivier 35df4767c6 Remove defaults for TLS so the proxy can more easily serve over HTTP (#189) 2017-08-21 14:25:47 +01:00
Brendan Abolivier f2a2e75424
Use event.RoomID() 2017-08-21 12:45:40 +01:00
Brendan Abolivier 8ce6334353
Improve the joined members counter computation 2017-08-21 12:42:06 +01:00
Mark Haines efbc14f7b9 vars["txnID"] is always empty for state events (#188) 2017-08-18 16:10:28 +01:00
Brendan Abolivier f607ef29c2 Add a route matching the trailing slash on the state event sending route (#182)
* Add a route matching the trailing slash on the state event sending route

* Use single route for both cases

* Use synapse regexp
2017-08-18 15:33:40 +01:00
Mark Haines 877ea5cb62 Remove StopProcessingAfter from the roomserver consumer as it is unused (#186) 2017-08-18 11:33:10 +01:00
Brendan Abolivier fe47ed6051
Use event type to detect duplicate joins 2017-08-17 15:19:08 +01:00
Brendan Abolivier ab2aae2862
Split update of string or boolean attribute in two separate functions 2017-08-17 15:12:54 +01:00
Brendan Abolivier ed86011704
Retrieve state events from the roomserver query API + avoid dupes on join 2017-08-17 15:07:45 +01:00
Brendan Abolivier 1cdea0fd02
Fix computation of next public rooms batch 2017-08-16 17:29:18 +01:00
Brendan Abolivier 90ea505dbe
Various fixes 2017-08-16 17:19:21 +01:00
Brendan Abolivier ebea9244d9 Get latest changes from master 2017-08-16 16:58:06 +01:00
Mark Haines ba8b5d8bf9 Fix kafka consumer setup in monolith. (#184)
We can't consume the same topic on a single kafka consumer more than
once. So when using kafka we have to create a new consumer for each
component in the monolith.
2017-08-16 16:55:34 +01:00
Brendan Abolivier 1740e54ac9
Add component to monolith 2017-08-16 16:28:33 +01:00
Brendan Abolivier 40d31b7e73 Merge latest changes from master 2017-08-16 16:08:18 +01:00
Brendan Abolivier 82e5f6038b
Support filtering 2017-08-16 16:07:13 +01:00
Brendan Abolivier 0afa14b153
Use auth API for visibility update 2017-08-16 15:11:18 +01:00
Brendan Abolivier 83f8effbed
Implement public rooms directory 2017-08-16 15:00:09 +01:00
Brendan Abolivier 6ecefebcd1
Add a check on type 2017-08-16 14:12:37 +01:00
Brendan Abolivier 10c2bb3743
Fix a bug in aliases creation 2017-08-16 14:10:09 +01:00
Brendan Abolivier 115b1e57a7
Add roomserver consumer 2017-08-16 14:01:08 +01:00
Mark Haines c27d1fdfb4 Optionally use naffka in the monolithic server (#183)
* dependency injection for the kafka consumers/producers

* Optionally use naffka in the monolithic server

* remember to call setupKafka()

* tweak imports

* fix integration tests

* Add use_naffka to the example config

* Update comment on the listen APIs
2017-08-16 13:36:41 +01:00
Brendan Abolivier f883b04e9e
Fix failing test 2017-08-16 12:31:27 +01:00
Brendan Abolivier 8613b7ee9e
Create public rooms component 2017-08-16 12:14:30 +01:00
Brendan Abolivier 2f01f8ca23
Fix attribute update statements 2017-08-16 12:13:48 +01:00
Brendan Abolivier bd7e43bcab
Add a listener for the new component 2017-08-16 11:16:17 +01:00
Brendan Abolivier af95c8c879
Add the database for the new component 2017-08-16 11:13:28 +01:00
Brendan Abolivier e7ddcb13b9
Add HTTP methods for visibility update and retrieval 2017-08-15 18:17:45 +01:00
Brendan Abolivier 9a96f94918
Support visibility update and retrieval 2017-08-15 17:24:32 +01:00
Brendan Abolivier 4ff7c33e05
Complete database update 2017-08-15 16:55:05 +01:00
Mark Haines 0d894e3da5 gb vendor fetch github.com/matrix-org/naffka 2017-08-15 16:06:09 +01:00
Brendan Abolivier 056d6d8cc1
Basic database structure 2017-08-15 12:00:07 +01:00
Brendan Abolivier 1e0641c625
Move events contents to common 2017-08-15 11:28:51 +01:00
Mark Haines 2071387f3c Add tables for tracking the state of invites to the room server. (#165)
* Storage functions for invite events

* Add table for tracking membership state

* More stuff

* More stuff

* Use utility methods from gomatrixserverlib, rather than reimplementing them

* More stuff

* Return string rather than pointer to string

* Update gomatrixserverlib

* Use HTTP API for roomserver input.

* Use synchronous HTTP API for writing events to the roomserver

* Remove unused config for kafka topic

* Add new output types to roomserver for invites

* Write membership updates

* Separate filtering from pairing up changes in membershipChanges

* Fix SQL

* Fix SQL

* Namespace the tables

* Fix SQL

* Use clearer names for some of the variables

* Rename senderID for consistency

* Restructure update membership

* Comments

* More comment

* Fix SQL

* More comments

* Assign state keys inside the transaction

* Comment on the purpose of the latestEventsUpdater

* Comment on the purpose of updateMembership

* Remove duplicate fields from stateChange

* Attempt to rewrite comment in 'english'

* More comments

* Fix comment

* Comment

* more comments
2017-08-08 16:38:03 +01:00
Brendan Abolivier c35803c9d8 Add TLS (https) support to the monolithic server (#180)
* Add HTTPS listen and serve, and move both listen and serve to goroutines

* Add some log so we know the initialisation went well
2017-08-07 13:39:53 +01:00
Mark Haines 4d1504ee93 Add prefixes to namespace the SQL tables. (#177)
* Add prefixes to namespace the SQL tables.

This means that multiple components can share a single database schema
without colliding with each other.

Once this lands it will be possible to run a single monolithic dendrite
against a single postgresql schema.

Hopefully this will make trivial deployments and development easier.

* Comment
2017-08-07 11:51:46 +01:00
Jonas Platte 21a8c24d5f Add .editorconfig (#179) 2017-08-05 02:25:40 +01:00
Jonas Platte c15e4572ff Fix typo: ed2519 -> ed25519 (#178) 2017-08-05 02:25:03 +01:00
Brendan Abolivier 8ccc5d108b Implement membership APIs (#171)
* Implement membership endpoints

* Use FillBuilder when possible

* Fix typo in membership event content

* Fix state key invite membership events not being correctly set

* Set membership content to match the profile of the user in state_key

* Move event building and rename common function

* Doc getMembershipStateKey

* Check if user is local before lookin up their profile
2017-08-04 16:32:10 +01:00
Brendan Abolivier 03dd456b47 Fix bad initialisation of sync API notifier in monolith (#176) 2017-08-04 14:54:08 +01:00
Mark Haines 1a28cf9767 Add a monolithic server that combines all the components into one (#175)
* Add a monolithic server that combines all the components into one

* Review comments

* Expose the matrix APIs directly
2017-08-04 13:12:36 +01:00
Mark Haines 4975eb9074 Move setting up the api mux to outside the routing.Setup functions. (#173)
This makes it possible to setup all the component APIs on a single http
listener which is necessary if we want to combine all the components
into a single monolith.
2017-08-03 15:10:39 +01:00
Mark Haines 3b07633326 Simplify preparing the roomserver SQL (#172) 2017-08-02 16:50:34 +01:00
Brendan Abolivier 0fbb8b7824 Make account data sync incremental (#170)
* Clean roomserver consumer

* Make account data sync incremental

* Use a different name for the sync AD table

* Improved error logging

* Created missing topic in tests

* Add client API topic to tests

* Add client API topic to common

* Move data batch retrieval

* Add database index for data retrieval

* Fix typo in table name

* Fix indentation
2017-08-02 16:21:35 +01:00