Commit graph

435 commits

Author SHA1 Message Date
Thibaut CHARLES da417c0dc9
Merge abee5d1305 into b72ed3e38c 2018-03-09 10:21:14 +00:00
Parminder Singh b72ed3e38c Add MacOS kafka setup instructions (#396)
* add macos kafka setup instructions

* Removed stop service steps, were too obvious
2018-03-09 10:12:29 +00:00
Vincent Glize 6b55972183 Fix error when keyblock is nil (#394) 2018-03-03 12:18:28 +00:00
Richard van der Hoff 139cb7a01e
INSTALL.md: fix list format, remove duplication 2018-03-02 14:34:47 +00:00
Nikita Voloboev 7c60a79e77 Update install instructions for mac (#397) 2018-03-02 14:33:49 +00:00
Andrew Morgan 72a1bdffd6 Fix typo (#402)
accouqnt -> account

Signed-off-by: Andrew Morgan (https://amorgan.xyz) <andrew@amorgan.xyz>
2018-03-02 09:08:02 +00:00
Andrew Morgan dfcf31f293 Prevent AS user check if no AS registered (#392)
When a user registered on a homeserver with no application services
 registered, registration would check if the meta-regexp object matched
 the proposed user's new username.

 Apparently "" is a regex that matches everything, so every user was
 then barred from registering as they were supposedly registering inside
 an AS' exclusive namespace.

 This change prevents that check from happening by setting the exclusive
 regex to ^$ instead, preventing any matches from occurring.

 We also prevent the check for exclusivity if there are no namespaces
 registered for performance.

Signed-off-by: Andrew Morgan (https://amorgan.xyz) <andrew@amorgan.xyz>
2018-02-27 11:42:10 +00:00
Andrew Morgan 08274bab5a Application Service Registration (#390)
* Add ability for App Services to register users

AS Tokens are pulled from their respective configs, which are then
checked against when an AS tries to register using
m.login.application_service. If the token exists and the new username is
within their specified namespace, then the user is created as a
password-less user.

Signed-off-by: Andrew Morgan (https://amorgan.xyz) <andrew@amorgan.xyz>

* Validate loaded Application Services

* Ensure no two app services have the same token or ID
* Check namespaces are valid regex
* Ensure users can't register inside an exclusive app service namespace
* Ensure exclusive app service namespaces are exclusive with each other
* Precompile application service namespace regexes so we don't need to
do so every time a user is registered

Signed-off-by: Andrew Morgan (https://amorgan.xyz) <andrew@amorgan.xyz>
2018-02-08 11:02:48 +00:00
Crom (Thibaut CHARLES) abee5d1305
Removed checked TODO
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-29 17:08:12 +01:00
Crom (Thibaut CHARLES) c3e87f19be
Reverted rename selectRecentEvents => selectRoomRecentEvents
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-18 02:18:11 +01:00
Crom (Thibaut CHARLES) 38767efff0
Fix lint legitimate warnings :)
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-18 02:14:53 +01:00
Crom (Thibaut CHARLES) be96370e30
Filter contains_url implementation
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-18 02:03:43 +01:00
Crom (Thibaut CHARLES) 97a5882d81
Limit room state events
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-15 00:08:21 +01:00
Crom (Thibaut CHARLES) cc56e0b88e
Account data filtering
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-14 23:28:41 +01:00
Crom (Thibaut CHARLES) a8daf97a13
Invite events filtering
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-14 14:16:31 +01:00
Crom (Thibaut CHARLES) 4ef80a4e48
Handling "m.room.*" type filters
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-12 19:10:43 +01:00
Crom (Thibaut CHARLES) 65e36484d6
Fix GET filter sending a base64 encoded json
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-12 18:42:14 +01:00
Crom (Thibaut CHARLES) 350e6cbfed
Filter retrieval from db
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-12 18:27:24 +01:00
Crom (Thibaut CHARLES) 7b80e6d51b
Fix timeline.limited detection
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-10 15:34:28 +01:00
Crom (Thibaut CHARLES) 2ec5a1cec9
Removed state filter limit usage
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-10 15:28:44 +01:00
Crom (Thibaut CHARLES) dd65a8fe68
Room state filtering
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-10 15:15:19 +01:00
Crom (Thibaut CHARLES) 2c3e55c7d3
moved event_json->>property to separate columns
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-10 14:28:27 +01:00
Crom (Thibaut CHARLES) a762aecc62
Fix room timeline-specific filtering & linter warns
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-05 15:06:58 +01:00
Crom (Thibaut CHARLES) da0658dc67
Timeline filtering
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-05 14:25:36 +01:00
mujx 1bcb673e3c Set up a development environment with docker (#387)
Signed-off-by: Konstantinos Sideris <sideris.konstantin@gmail.com>
2018-01-02 18:26:37 +00:00
Crom (Thibaut CHARLES) cdd6b0a3d3
Merge branch 'master' into filter_sync_impl 2018-01-02 13:09:07 +01:00
Thibaut CHARLES 27c335438f selectRecentEvents: reverse events in SQL query (#386)
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2018-01-02 10:33:25 +00:00
Thibaut CHARLES 8a3f9b0561 Implement some createRoom parameters (#374)
* Impl some createRoom parameters

* Fix linter warnings

* Cleaned comments
2018-01-02 10:32:53 +00:00
Erik Johnston d22fb24a66
Factor out component setup from commands (#384)
* Add base component

* Convert clientapi to using base component

* Convert federationapi to using base component

* Convert federationsender to using base component

* Convert mediaapi to using base component

* Convert publicroomsapi to using base component

* Convert roomserver to using base component

* Convert syncapi to using base component

* Convert monolith to using base component

* Split out config parsing and roomserver API creation
2018-01-02 10:26:56 +00:00
Crom (Thibaut CHARLES) 9af5e73fdf
Filter unmarshal & validation before storing
Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2017-12-23 15:09:29 +01:00
Andrew Morgan fa362ecef2 Load Application Service Configuration Files (#377)
Signed-off-by: Andrew Morgan (https://amorgan.xyz) <andrew@amorgan.xyz>
2017-12-19 17:00:44 +00:00
Richard van der Hoff 7e2362cd2e
Make travis builds a bit faster (#382)
* travis: clone depth=1
* cache kafka download
2017-12-19 14:09:15 +00:00
Richard van der Hoff b64f8b5912
kill kafka after integ tests (#383)
If kafka is still running when our test script exits, travis gets stuck.
2017-12-19 13:56:41 +00:00
Richard van der Hoff 0c26735bbd
console folding for travis (#381)
Make the travis output a little more legible with some folding.
2017-12-19 13:45:14 +00:00
Richard van der Hoff 899f267c47
Fix roomserver deadlock (#380)
Move the mutex lock outside the loop so that we don't lock up if there is more
than one event
2017-12-19 11:29:49 +00:00
Thibaut CHARLES ec30d143cd User registration return M_USER_IN_USE when username is already taken (#372)
When registering a new user using POST `/_matrix/client/r0/register`, the server was returning a 500 error when user name was already taken.

I added a check in `completeRegistration` to verify if the username is available before inserting it, and return a 400 `M_USER_IN_USE` error if there is a conflict, as [defined in matrix-doc](https://matrix.org/speculator/spec/HEAD/client_server/unstable.html#post-matrix-client-r0-register)

Signed-off-by: Thibaut CHARLES cromfr@gmail.com
2017-12-19 09:49:42 +00:00
Erik Johnston b835e585c4
Add transaction ID to events if sending device (#368) 2017-12-15 15:42:55 +00:00
Erik Johnston de6529d766
Ensure we only process one event at a time (#376) 2017-12-15 15:22:06 +00:00
Erik Johnston 4bb862864c Remove unused webhook 2017-12-15 14:10:28 +00:00
Richard van der Hoff 58e228fc3a s/VerifyEventSignatures/VerifyAllEventSignatures/
gomatrixserverlib API has been updated
2017-12-12 10:26:25 +00:00
Richard van der Hoff e2f88f3889 gb vendor update github.com/matrix-org/gomatrixserverlib 2017-12-12 10:26:25 +00:00
Richard van der Hoff d118eced54
Use the right linter versions (#370)
Prefer the gometalinter and linters that we build to anything else kicking
around on our PATH
2017-12-12 10:25:38 +00:00
Richard van der Hoff 568c6f7c66
Use latest versions of go (#369) 2017-12-12 10:25:24 +00:00
Richard van der Hoff c3cb6f8767 Update gometalinter, and disable gas (#371)
* Update gometalinter

* Disable gas linter

According to the gas github page:

> Gas is still in alpha and accepting feedback from early adopters. We do not
> consider it production ready at this time.

Generally it seems to shout about a lot of things which aren't very errory,
like executing subprocesses with anything other than a hardcoded commandline,
and creating directories with anything other than 700 perms.
2017-12-08 19:13:17 +00:00
Erik Johnston 16f593f786 Fix some linting errors 2017-12-06 13:55:51 +00:00
Erik Johnston 75aa316a6a
Write and read transaction id from sync DB (#367) 2017-12-06 09:37:18 +00:00
Erik Johnston 578d8cf492
Add CORS headers to all responses including errors (#364) 2017-12-06 09:36:50 +00:00
Andrew Morgan bc3dd821f9 Implemented ReCaptcha registration method (#343)
Signed-off-by: Andrew (anoa) <anoa@openmailbox.org>
2017-12-05 16:16:14 +00:00
Erik Johnston 8da05cc413
Add some basic docs about opentracing (#366) 2017-12-05 14:55:27 +00:00
Erik Johnston ff78a99604 Disable the maligned lint (#365)
We don't really care about ensuring our structs are small, and sometimes
its clearer to group struct fields together.
2017-12-05 11:37:34 +00:00