Commit graph

1954 commits

Author SHA1 Message Date
Andrew Morgan 4410acc673 Add filepath and function name to log output (#755)
Adds detailed logging, describing which file/line a log message came from, as well as the name of the function that it was contained within.
2019-07-24 12:44:05 +08:00
Andrew Morgan 78032b3f4c
Correctly create new device when device_id is passed to /login (#753)
Fixes https://github.com/matrix-org/dendrite/issues/401

Currently when passing a `device_id` parameter to `/login`, which is [supposed](https://matrix.org/docs/spec/client_server/unstable#post-matrix-client-r0-login) to return a device with that ID set, it instead just generates a random `device_id` and hands that back to you.

The code was already there to do this correctly, it looks like it had just been broken during some change. Hopefully sytest will prevent this from becoming broken again.
2019-07-22 15:05:38 +01:00
Andrew Morgan bdd1a87d4d Add appservice API to config unit test (#744)
Fixes #558
2019-07-19 14:04:06 +08:00
Andrew Morgan 6ff7b6a72a Clarify that POST publicRooms is implemented (#743)
As a response to #638, it seems that POST /publicRooms is already implemented. It is, however, unclear from the code that it is.

Add some comments and change a method name to make this more clear.
2019-07-19 00:21:06 +08:00
Andrew Morgan e56d6e41fd Remove the trailing slash from /send/{txnID} and /backfill/{roomID} (#746)
In conjunction with matrix-org/sytest#651, /send/{txnID} and /backfill/{roomID} should not have trailing slashes according to the spec.
2019-07-18 15:41:29 +08:00
Andrew Morgan 504d23f468 Remove unnecessary http method checks (#747)
Closes #523

There were a lot of unnecessary checks for HTTP methods of requests. gorilla/mux makes sure that these methods will only be called if certain HTTP methods are used, thus there's no reason to have these extra checks.
2019-07-18 15:40:10 +08:00
Andrew Morgan bff60953f3 Prevent duplicate entries in the completed registration flows (#741) 2019-07-17 11:55:25 +08:00
Andrew Morgan c494d81235
Small clarification for method (#742) 2019-07-16 18:01:16 +01:00
Alex Chen 9bef5d52f4 Fix broken Kafka download URL in INSTALL.md (#740)
Signed-off-by: Alex Chen <minecnly@gmail.com>
2019-07-16 16:16:43 +01:00
Sumukha Pk fd4ea78dbf Moved to gomatrix latest in gomod (#738)
Moved to gomatrix latest in gomod
2019-07-13 08:32:47 +01:00
Andrew Morgan e2251199a4
Lots of small typo fixes (#737) 2019-07-12 16:43:01 +01:00
Alex Chen 29841bed6b
Add typing notifications to /sync responses - fixes #635 (#718)
This PR adds a new consumer for typing notifications in syncapi. It also brings changes to syncserver.go and some related files so EDUs can better fit in /sync responses.

Fixes #635.
Fixes #574.
2019-07-12 22:59:53 +08:00
Alex Chen f8463063ac
Fix #661 appservice can't set aliases in its own namespace (#731)
Fixes #661.
2019-07-12 21:36:17 +08:00
Andrew Morgan 7edf197ecc
Fix response to /rooms/{roomId}/join v2 (#734)
Continuation of #684 but merged-forward.

Also did a little code cleanup and added a new, passing test to the testfile.
2019-07-12 14:29:30 +01:00
Andrew Morgan d4918b83c6
Backup and restore go.mod & go.sum during linting (#735)
Every time before sending a PR I like to run ./scripts/build-test-lint.sh to make sure the CI won't complain about anything.

The problem is that this script attempts to install golangci-lint, which causes modifications to go.mod/go.sum. This PR backs up and restores those files before and after linting.

Ideally instead of this hacky backing up/restoring we'd use go gets -mod=readonly option, but that still modifies go.sum. This will be fixed in go 1.13 apparently. golang/go#30667
2019-07-12 14:23:27 +01:00
Alex Chen 86e65bb22d Add back missing returns for httputil.LogThenError calls (#730)
Signed-off-by: Alex Chen <minecnly@gmail.com>
2019-07-09 17:33:52 +01:00
Alex Chen 6106ec1399 Fix getAliasesForRoomID has no HTTP handler in aliasAPI (#705)
This PR adds back the HTTP handler for internal API GetAliasesForRoomID in roomserver, which seemed to be missing.
2019-07-09 17:13:43 +01:00
Anant Prakash c725176878 Fix http responses in validateRecaptcha (#431)
fixes #421
2019-07-09 14:21:33 +01:00
Behouba Manassé 69f8d5a77e Content-Disposition HTTP header in mediaapi's responses added (#685)
This should fix #628
I also Noticed that GET /_matrix/media/r0/download/{serverName}/{mediaId}/{fileName} is not yet implemented, but it should work for both.

Signed-off-by: Kouamé Behouba Manassé behouba@gmail.com
2019-07-08 14:06:17 +01:00
Alex Chen da0dd06475 Update testfile and fix empty warning in show-expected-fail-tests.sh (#729)
This PR adds the test that matrix-org/sytest#642 will allow to pass to testfile and also contains a minor fix for show-expected-fail-tests.sh so it doesn't show an empty warning.

Signed-off-by: Alex Chen minecnly@gmail.com
2019-07-05 12:42:23 +01:00
Andrew Morgan 33a1392541
Encode URLs properly (#728)
We were escaping the URL before performing any pattern matching on it.
This meant that if you sent data that URLdecoded to a "/", it would count as
a "/" in the URL, potentially causing a 404. This was causing some flaky tests
with some randomly-generated query parameters.

Now, we keep URLs encoded while doing the pattern matching, and only afterwards
do we URL decode each query parameter individually before passing them to their
respective handler functions.

github.com/gorilla/mux was also updated to v1.7.3 to fix a bug with URL encoding and subrouters.
2019-07-03 16:38:50 +01:00
Andrew Morgan 1eb77b8161
Don't print Sending EDU if there is noone to send to (#721)
The logs had a lot of:

```
Sending EDU event                             destinations="[]" edu_type=m.typing
```

Which is useless if it isn't actually sending the event anywhere (destinations is empty).
2019-07-01 16:04:49 +01:00
Serra Allgood a0dec456c1 rommserver/alias: Do not call appserviceAPI in GetRoomIDForAlias if local alias found #631 (#702)
A conditional is added to wrap the call to appserviceAPI if a local alias is not found in the database.

Fixes #631

Signed-off-by: Serra Allgood <serra@allgood.dev>
2019-06-25 13:43:18 +01:00
Alex Chen 7792f12e6f Fix testfile path hardcoded in show-expected-fail-tests.sh (#719)
Signed-off-by: Alex Chen <minecnly@gmail.com>
2019-06-25 11:50:19 +01:00
Alex Chen b88112b05d Make federation state request 404 when event not in the room - fixes #625 (#716)
Signed-off-by: Alex Chen <minecnly@gmail.com>
2019-06-25 11:32:15 +01:00
Andrew Morgan eaf38ae87e
Not all systems have bash (#720)
As not all systems have bash.

Helpful for not making debugging alpine docker images a pain :>
2019-06-24 13:35:29 +01:00
Alex Chen ce189a737d Update dependency gomatrixserverlib to 178ed5e (#695)
Update dependency gomatrixserverlib to 178ed5e
2019-06-22 14:40:55 +01:00
Alex Chen adaec7c8e7 Refine config and docs for sytest (#714)
This PR adds the "passed but expected fail" tests to testfile, as well as instructions on finding which tests to add for new PRs.
2019-06-21 16:49:37 +01:00
Andrew Morgan bc382bba46
Fix pipeline, emoji and syntax (#713)
Fixes #697

Switched to golangci-lint, fixes issues with buildkite and does some linting fixes to appease the new linters.
2019-06-19 14:05:03 +01:00
Andrew Morgan 7a2d5b17b9
Switch to Buildkite (#712) 2019-05-29 15:17:00 +01:00
Brendan Abolivier bcd6bdb8de
Fix CircleCI badge (#711)
The current one is directed towards @anoadragon453's repo, not the main Matrix.org one.
2019-05-29 14:48:43 +01:00
Andrew Morgan ade4b9c978
Run CircleCI on pull request branches (#710)
We were previously only running CircleCI on master, but we want it to PRs as well.
2019-05-29 11:34:36 +01:00
Andrew Morgan c7c5e8d8e8
Add CircleCI build status 2019-05-29 10:54:44 +01:00
Andrew Morgan 1667a4b09f
Add SyTest support to CI (#704)
Adds SyTest CI through CircleCI.

Also need to add all the tests that currently pass to testfile, but I don't think that's a hard blocker for merging.
2019-05-24 15:00:03 +01:00
Brendan Abolivier e1ec98e248
Update Docker files and remove references to gb (#703)
Fix Docker files which had been forgotten in #594 and update scripts and docs to remove references to gb.

I also removed the `jenkins` directory which is outdated. We can revert f8d7e99 if we realise that it was a mistake to do so.
2019-05-22 10:44:25 +01:00
ruben 74827428bd use go module for dependencies (#594) 2019-05-21 21:56:55 +01:00
Andrew Morgan 4d588f7008
Add #dendrite-dev to the README (#699)
I suspect this is why we're getting a lot of people coming in to #dendrite asking dev-related questions.
2019-03-27 17:36:45 +00:00
Travis Ralston f8f9965cc5
Ensure appservices have their devices checked (#554)
The regular device check will return the device for the appservice's bot user instead of going through the user_id branch. The check has been moved to below the user_id check to ensure the right virtual user's device is chosen.
2019-03-21 08:48:21 -06:00
Alex Chen 5d2d0484d1 Fix build conflict between docker environment and host - #596 (#598)
Signed-off-by: Alex Chen <minecnly@gmail.com>
2019-03-04 14:47:29 +00:00
Sumukha Pk 6baaf8c36c Improved clarity for setup in INSTALL.md (#691)
* Improved clarity for setup in INSTALL.md
2019-03-04 14:26:30 +00:00
Andrew Morgan ce9f3ea362
Bump to go version 1.10 (#690) 2019-01-31 11:14:16 +00:00
Aaron Raimist 76a81e51b3 Remove riot.im from the list of trusted ID servers in the default config (#688)
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2019-01-31 10:06:11 +00:00
Andrew Morgan 0d6d72631b
Add matrix chatroom badge to readme (#689)
* Add matrix chatroom badge to readme

* Update URLs and add dendrite:matrix.org
2019-01-28 15:10:44 +00:00
Aaron Raimist ac3ebcb3ed Fix PR templates and use matrix.to instead of riot.im/develop (#687)
* Use absolute links in pull request template

Relative links don't work in most places

Signed-off-by: Aaron Raimist <aaron@raim.ist>

* Use matrix.to (for now) instead of linking to riot.im/develop

Signed-off-by: Aaron Raimist <aaron@raim.ist>
2019-01-28 10:15:33 +00:00
Andrew Morgan 4452cb4a65
Add PR template (#686) 2019-01-25 16:00:59 +00:00
MANASSE 3465f6727b "v1" replaced with "r0" in pathPrefixR0 in mediaapi's routing (#681) 2019-01-17 09:25:13 +00:00
Alex Chen 4c5bd91e1c POST /join/{roomId}: Allow joining even when not invited #663 (#680)
* POST /join/{roomId}: Allow joining even when not invited #663

Signed-off-by: Alex Chen <minecnly@gmail.com>

* POST /join/{roomId}: Use server in roomID as last resort to join

Signed-off-by: Alex Chen <minecnly@gmail.com>
2019-01-15 18:20:46 +00:00
Alex Chen e063433b74 Fix POST /get_missing_events/{roomId} #622 (#678)
* Fix #622 /get_missing_events/{roomId}

Signed-off-by: Alex Chen <minecnly@gmail.com>

* Set initial size for eventsToFilter in /get_missing_events/{roomId}

Signed-off-by: Alex Chen <minecnly@gmail.com>
2019-01-14 10:20:19 +00:00
Reto 088a939461 Fix default timeout for /sync (#615) (#679)
The sync timeout should be 0 according to the spec[1]

[1] https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-sync

Signed-off-by: Reto Brunner <brunnre8@gmail.com>
2019-01-10 10:28:13 +00:00
Brendan Abolivier 170264404e
Fix the sync api returning an empty sync response when reaching timeout, regardless of the since token (#595)
* Fix the sync api returning an empty sync response when reaching timeout, regardless of the since token

* Declare syncData from the start to avoid declaration shadowing

* Bump Kafka version
Since this is a huge bump, it might completely blow up - I'll revert it if that's the case

* Put the loop and the IsEmpty() check back in sync handler

* Add doc and allow returning if timeout is reached
2018-12-18 17:56:08 +00:00