* Prevent sql scanning into nil value in accounts_table
Signed-off-by: Andrew Morgan <andrewm@matrix.org>
* Remove uneccessary logging, null checking
* Don't forget to set the localpart
* Simplify error checking
* Store And Send Application Service Events
* Modify INSTALL.md and dendrite-config.yaml for the new appservice database
* Correct all instances of casing on 'application service' to align with
spec
* Store incoming events that an app service is interested in in the
database to be later read by transaction workers.
* Retrieve these events from transaction workers, one per AS.
* Minimal transaction ID data is stored as well to recover after
server failure.
* Send events to AS and exponentially backoff on failure.
Signed-off-by: Andrew Morgan <andrewm@matrix.org>
* Finish my own sentences.
* Fix up database interaction
* Change to event-based AS sending
* Reduce cyclomatic complexity
* Appease the errcheck gods
* Delete by int ID instead of string.
This was causing some events to not be deleted, as < an eventID doesn't
really make much sense.
* Check if there are more events to send before sleeping
* Send same transaction if last send attempt failed
* Don't backoff on non-200s, tight send loop, 1 event query
* Remove tight send loop. Fix events not being deleted
* Additionally order by event id, track main.go
* Return the last txnID, which our events are using
* Remove old main.go file
* Prevent duplicate events from being sent...
* Strip event content if it doesn't contain anything
Signed-off-by: Andrew Morgan <andrewm@matrix.org>
* Update gomatrixserverlib and use Unsigned AS event prop
* Fixes
* Fix sync server comment
* Remove unnecessary printlns
* Use logrus Fields
* Worker state methods
* Remove sillyness
* Fix up event filtering
* Handle transaction event limit in loop
* Switch to using a sequence for transaction IDs
* Don't verify self-signed AS certificates
* Fix logging
* Use gmsl.Event instead of AS-only event in transactions
Also clear up the logic on lookupStateEvents a little bit.
* Change invalid_txn_id to global (for efficiency)
* Use a bool for EventsReady instead of an int
* 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.
* Bump gomatrixserverlib
Mostly because I want to use Erik's go-faster jsoning.
* Update KeyDB for new KeyFetcher API
we now need to implement FetcherName.
* Attempt to fix integ tests
CanonicalJSON doesn't like the empty string, apparently, and anyway
canonicalising it is pointless.
* More integ test fix
* 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.
* 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
* Add comment
* gb vendor update github.com/matrix-org/gomatrixserverlib
* Add handler for the exchange_third_party_invite endpoint
* Doc
* Use SendEvents to send the invite to the roomserver
* Add missing error check
* Add checks
* Fix response to /invite to match the format expected by synapse
* gb vendor update github.com/matrix-org/gomatrixserverlib
* Use gomatrixserverlib.RespInvite
* gb vendor update github.com/matrix-org/gomatrixserverlib
* Add missing file headers
* Move the ID server's signatures verification to common
* Allow verification without specifying a server name
* Add third-party structs to membership events content
* Add processing of 3PID onbind requests
* Use reference for third party invite data
* Fix return arguments order
* Revert "Move the ID server's signatures verification to common"
This reverts commit 93442010316ce71a77ac58ffd3613754ce8fe969.
* Revert "Allow verification without specifying a server name"
This reverts commit fd27afbf82eac50fe9f7b83b26cfce3c66d530d2.
* Remove checks that are already occurring in gomatrixserverlib
* Change return type of createInviteFrom3PIDInvite
* Add doc, add checks in fillDisplayName
* Use MakeFedAPI
* Invert condition
* Use AuthEvents to retrieve the 3PID invite
* Update comment
* Remove unused parameter
* gb vendor update github.com/matrix-org/gomatrixserverlib
* vendor: Add bimg image processing library
bimg is MIT licensed. It depends on the C library libvips which is LGPL
v2.1+ licensed. libvips must be installed separately.
* mediaapi: Add YAML config file support
* mediaapi: Add thumbnail support
* mediaapi: Add missing thumbnail files
* travis: Add ppa and install libvips-dev
* travis: Another ppa and install libvips-dev attempt
* travis: Add sudo: required for sudo apt* usage
* mediaapi/thumbnailer: Make comparison code more readable
* mediaapi: Simplify logging of thumbnail properties
* mediaapi/thumbnailer: Rename metrics to fitness
Metrics is used in the context of monitoring with Prometheus so renaming
to avoid confusion.
* mediaapi/thumbnailer: Use math.Inf() for max aspect and size
* mediaapi/thumbnailer: Limit number of parallel generators
Fall back to selecting from already-/pre-generated thumbnails or serving
the original.
* mediaapi/thumbnailer: Split bimg code into separate file
* vendor: Add github.com/nfnt/resize pure go image scaler
* mediaapi/thumbnailer: Add nfnt/resize thumbnailer
* travis: Don't install libvips-dev via ppa
* mediaapi: Add notes to README about resizers
* mediaapi: Elaborate on scaling libs in README
* Start implementing the join room API
* Hacks to get join room working
* Make the TLS fingerprint configurable
* Fix the client API proxy to handle '#' correctly
* Return a 200 OK response
* Write the join event along with current state to the room server
* Comment on the error handling
* Fix typos
* Fix tab
* Add TODO for moving authEventIDs to gomatrixserverlib
* Comment on why we ignore the key ID argument for local keys
* Avoid 'preceeded'
* Neaten the control flow
* Neaten the control flow even more
* Return pointers
* Rename err to lastErr for the loop