Commit Graph

1514 Commits

Author SHA1 Message Date
Erik Johnston
4b280943dc Fix SQL 2017-11-16 15:28:15 +00:00
Erik Johnston
561315e1d6
Add gofmt linter (#339)
* Check that gofmt has been run

* gofmt files

* Tabs and spaces
2017-11-16 10:12:02 +00:00
Richard van der Hoff
4124ce2ac0
Store keys rather than json in the keydatabase (#330)
* bump gomatrixserverlib

(changes to KeyFetcher and KeyDatabase interfaces)

* Store keys rather than json in the keydatabase

Rather than storing the raw JSON returned from a /keys/v1/query call in the
table, store the key itself.

This makes keydb.Database implement the updated KeyDatabase interface.
2017-11-15 17:46:16 +00:00
Erik Johnston
7f85422471
Move /state request handling out of RequestPool (#333)
We should probably move the handling out from the syncapi, but that
requires the clientapi to stream the current state which it currently
doesn't. This at least stops the sync and state handling being done in
one file.
2017-11-15 15:42:39 +00:00
Richard van der Hoff
db32692f2e
Just run the linter in the commit hook (#334)
The pre-commit hook took 45 seconds to run on my machine, which was more than
enough time for me to get distracted by a swordfight in the corridor.

Let's just run the linters (which still take 6 seconds). It's not the place of
a commit hook to run every test we can think of - that is what CI is for.
2017-11-15 11:14:21 +00:00
Erik Johnston
139fae988e Fix linting errors in go1.9.1 (#336)
Fix linting errors in go1.9.1
2017-11-15 11:13:09 +00:00
Erik Johnston
ff8b229192 Remove vendor/bin from PATH in script (#335)
We should no longer be building anything into vendor/bin in the scripts,
so adding it to the path can lead to all sorts of confusion if old
binaries are there.
2017-11-15 11:12:21 +00:00
Richard van der Hoff
8fff0e887c Update gometalinter config (#331)
* Update gometalinter config

gometalinter now uses `maligned` instead of `aligncheck`
(https://github.com/alecthomas/gometalinter/pull/367), so we need to update our
config accordingly.

* Update gometalinter

* Disable gotype linter

gotype does not seem to play nicely with the gb vendor directory. In
particular, it wants each of our dependencies to be built and installed (see
https://github.com/golang/go/issues/10969), but (empirically) it will not
accept them being installed in `pkg` but insists on them being in `vendor/pkg`.

This presents a problem because `gb build` builds the packages into `pkg`
(which doesn't seem entirely unreasonable since `.` comes before `vendor` in
`$GOPATH`). `go install github.com/x/y` does install in `vendor/pkg` but
requires us to know the name of each package.

The general conclusion of https://github.com/alecthomas/gometalinter/issues/91
seems to have been that the easiest thing to do is to disable `gotype` for now.

* Fix `unparam` lint

* Fix goshadow lint
2017-11-15 10:25:48 +00:00
Erik Johnston
dc782ec399
Split travis into multiple jobs (#322)
The motivation for this is to make it easier to see whether a travis failure is due to linting, unit tests or integration test failures, without having to look in the logs.

It also means that each job is independent, so if e.g. the linting fails then the unit tests will still be run.
2017-11-14 14:58:27 +00:00
Paul Tötterman
bad701c703 Add device display names (#319) 2017-11-14 09:59:02 +00:00
Andrew Morgan
8720570bb0 Check for existing filter before inserting a new one (#318)
Signed-off-by: Andrew (anoa) <anoa@openmailbox.org>
2017-11-14 09:56:23 +00:00
Richard van der Hoff
bf855a7e5c
Factor out keyring initialisation (#329)
Take the keyring init from the client-api-server and the monolith out to a
shared file
2017-11-13 18:39:09 +00:00
Michael Telatynski
90396b5620 implement voip/turnServer API endpoint (#323)
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-11-09 09:58:45 +00:00
Andrew Morgan
b7cfc2e057 Federation: Implement Query Profile API (#317)
* Federation: Implement Query Profile API

Implements the server portion of: `GET
/_matrix/federation/v1/query/profile?user_id=...&field=...`

Closes #278

Signed-off-by: Andrew (anoa) <anoa@openmailbox.org>

* Properly export profile-related structs and fix wording

Signed-off-by: Andrew (anoa) <anoa@openmailbox.org>

* Check provided user's domain matches our own.
2017-11-05 14:03:54 -04:00
Erik Johnston
49c040c89f Refactor Notifier to return channel (#311)
This has two benefits:

1. Using channels makes it easier to time out while waiting
2. Allows us to clean up goroutines that were waiting if we timeout the
   request
2017-10-26 11:34:54 +01:00
Erik Johnston
e5944e0fdb Move BuildEvent to common package (#315)
This is in preperation for implementing various federation APIs that
need to build events.
2017-10-25 14:44:33 +01:00
Erik Johnston
3790a8da40 Move federationapi.readers package into routing (#314)
This seems to have been missed when we folded all the readers and
writers packages into routing.
2017-10-25 11:27:44 +01:00
Erik Johnston
ce562d96f6 Don't add empty room entries to sync responses (#312) 2017-10-18 10:36:45 +01:00
Paul Tötterman
6d15aec8d3 Add /devices/ and /device/{deviceID} (#313)
Signed-off-by: Paul Tötterman <paul.totterman@iki.fi>
2017-10-17 19:12:54 +01:00
Erik Johnston
5a6a950ee8 Factor out addRoomDeltaToResponse from IncrementalSync (#306) 2017-10-17 17:13:41 +01:00
Erik Johnston
7b0f62208f Mention how to run the linters in documentation (#310)
Closes #309
2017-10-17 17:11:00 +01:00
Erik Johnston
bd07447abe Fix some edge cases with /sync (#302)
Including:
- Handle timeout=0 correctly
- Always return immediately on initial sync
- Handle spurious wake ups from the notifier
2017-10-16 13:34:08 +01:00
Erik Johnston
35b628f5bf Handle duplicate kafka messages (#301)
The way we store the partition offsets for kafka streams means that when
we start after a crash we may get the last message we processed again.
This means that we have to be careful to ensure that the processing
handles consecutive duplicates correctly.
2017-10-16 13:20:24 +01:00
Remi Reuvekamp
1a026f16d5 Implement /logout/all (#307)
Signed-off-by: Remi Reuvekamp <git@remireuvekamp.nl>
2017-10-15 11:29:47 +01:00
Erik Johnston
32a2b3a5c0 Update vendor libraries and dendrite to s/Sirupsen/sirupsen/ (#304) (#305) 2017-10-13 14:57:54 +01:00
Erik Johnston
464fb5de1c Update vendor libraries and dendrite to s/Sirupsen/sirupsen/ (#304) 2017-10-13 14:42:57 +01:00
Erik Johnston
d66244cb0a Merge readers/writers/routing packages (#295)
The HTTP handlers in the components are split into reader and writer directories. This was a fairly arbitrary distinction, and turns out to not be so helpful. Most read APIs have a corresponding write API, and it is more natural for them to be in the same file rather than in different directories.
2017-10-11 18:16:53 +01:00
Erik Johnston
ba0d0672ea Rename kafka consumers to *Consumer (#294)
The prior naming was confusing, OutputRoomEvent consumed
OutputNewRoomEvents
2017-10-11 18:13:43 +01:00
Erik Johnston
cf5ea25322 Update CONTRIBUTING.md 2017-10-11 18:08:35 +01:00
Erik Johnston
996b7d4198 Update dendrite-config.yaml to use server.crt, not .pem (#299) 2017-10-10 16:04:39 +01:00
Erik Johnston
c0271c2462 Use returned ID from INSERT in create filter (#297) 2017-10-10 15:17:29 +01:00
Erik Johnston
f6bda82366 Implement filter POSTing and GETting. (#296)
* Implement filter POSTing and GETting.

Signed-off-by: Jan Christian Grünhage <jan.christian@gruenhage.xyz>

* Add missing '}' typo introduced during merge

* Still trying to fix that merge...

* Fix linting
2017-10-10 14:28:49 +01:00
Erik Johnston
e9314e5b30 Untangle precommit and travis test scripts (#288) 2017-10-10 11:02:39 +01:00
Erik Johnston
38999c54e1 Generate new devices for each new /login (#281) 2017-10-10 10:40:52 +01:00
Erik Johnston
c78d9a5952 Clean up README a bit (#289) 2017-10-10 09:33:41 +01:00
Marcel
13107c6b2b Implement /register/available API (#291)
Signed-off-by: MTRNord <mtrnord1@gmail.com>
2017-10-09 15:24:38 +01:00
Erik Johnston
619fec6113 Add bug number 2017-10-06 14:13:53 +01:00
Erik Johnston
f36269d9b1 Implement GET /rooms/{roomID}/state/{type}/{stateKey} (#276)
* Implement GET /rooms/{roomID}/state/{type}/{stateKey}

* Add comments
2017-10-06 11:23:58 +01:00
Erik Johnston
1e6fc74d4f Add Code Style and some dev docs (#286) 2017-10-06 11:23:49 +01:00
Erik Johnston
5229dbf310 Create CONTRIBUTING.md (#264) 2017-10-06 02:11:51 +01:00
Erik Johnston
bcf58fad84 gb vendor update github.com/matrix-org/gomatrix 2017-10-03 13:05:57 +01:00
Richard van der Hoff
831a76ae91 gb vendor updates
gb vendor update github.com/matrix-org/gomatrixserverlib
gb vendor update github.com/matrix-org/util
2017-10-02 10:33:43 +01:00
Richard van der Hoff
b7687310fe gb vendor update github.com/matrix-org/gomatrixserverlib 2017-09-29 15:14:17 +01:00
Mark Haines
847621bc5d Add config for setting up a jaeger opentracing reporter (#271)
* Add config for setting up a jaeger opentracing reporter

* Remove redundant comment
2017-09-28 17:00:23 +01:00
Mark Haines
4a0b24c7f4 gb vendor fetch github.com/jaegertracing/jaeger 2017-09-28 15:03:21 +01:00
Mark Haines
c4947c2ffb Add opentracing Spans to the HTTP APIs (#270)
* Add opentracing Spans to the HTTP APIs

* Add opentracing spans to the HTTP RPC clients

* Set the span in the request context

* More docstring
2017-09-28 14:50:40 +01:00
Mark Haines
88dde65efc gb vendor fetch github.com/opentracing/go-opentracing 2017-09-28 13:51:56 +01:00
Erik Johnston
f11af1e78f Implement setting alias during room create (#268)
* Implement setting alias during room create
2017-09-27 16:44:40 +01:00
Erik Johnston
00adbb38c6 Add POST /send/ api (#265) 2017-09-26 12:55:48 +01:00
Richard van der Hoff
f7aa96fc9e gb vendor update github.com/matrix-org/gomatrixserverlib 2017-09-26 12:54:39 +01:00