Age | Commit message (Collapse) | Author |
|
* Specify interfaces used by appservice, do half of clientapi
* convert more deps of clientapi to finer-grained interfaces
* Convert mediaapi and rest of clientapi
* Somehow this got missed
|
|
* Simplify federation API `AddPublicRoutes`
* Simplify client API `AddPublicRoutes`
* Simplify media API `AddPublicRoutes`
* Simplify sync API `AddPublicRoutes`
* Simplify `AddAllPublicRoutes`
|
|
* Allow monolith components to share a single database pool
* Don't yell about missing connection strings
* Rename field
* Setup tweaks
* Fix panic
* Improve configuration checks
* Update config
* Fix lint errors
* Update comments
|
|
* Return "null" if MaxFileSizeBytes is 0
* Add comment and nil check (better save than sorry)
* Simplify config
|
|
non-deterministic order; silence expected
error when tests are run multiple times against the same postgres database (cherry-picked from #2395)
Signed-off-by: Brian Meek <brian@hntlabs.com>
|
|
* Refactor mediaapi storage layer
* Verify filetype before trying to create thumbnails
* Add media api storage tests
* Fix returned values
|
|
|
|
`fetchRemoteFile`
|
|
* Return error from remote download requests
* Remove redundant err check, return better message if file does not exist
|
|
|
|
* Media endpoints on `/v3`
* Keep `/v1` too?
|
|
* Modify some log levels
* Update gomatrixserverlib to matrix-org/gomatrixserverlib@336334f
* Update gomatrixserverlib to matrix-org/gomatrixserverlib@cde7ac8
* Demote warning about key change producer
* Add more useful roomserver logging
* Further tweaking
|
|
* Add /media/r0/config handler
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
* Add rate limiting to media api
* Rename variable
* Add passing tests
* Don't send multiple headers
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
|
|
|
|
|
|
Co-authored-by: Felix Freeman <libsys@hacktivista.org>
|
|
- Lower cased error messages
Signed-off-by: Ryan Whittington <twentybitdev@gmail.com>
Co-authored-by: kegsay <kegan@matrix.org>
|
|
* Only include go-sqlite3 on the relevant binaries
* The driver name is always sqlite3 now
* Update to matrix-org/go-sqlite3-js@e537baa
|
|
* Revert "Set MaxFileSizeBytes <= 0 to "unlimited" (#1875)"
This reverts commit 9ed044042156a9bdfafb4ae9830b3ed41225444e.
* Actually allow unlimited upload
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
Co-authored-by: kegsay <kegan@matrix.org>
|
|
|
|
* Set MaxFileSizeBytes < 0 to "unlimited"
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
* int64 overflows later in mediaapi/routing/upload.go[doUpload]
* Prevent int overflow when uploading
|
|
* Use LimitReader to prevent DoS risk
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
* Check if bytesWritten is equal to the maxFileSize
Add tests
Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
* Use oldschool defer to cleanup after the tests
* Let LimitReader read MaxFileSizeBytes + 1
Co-authored-by: Kegsay <kegan@matrix.org>
|
|
|
|
* Remove the Content-Length requirement
* Make sure that the file size does not exceed max content size
* Address review comment - universally check if temp file size exceeds max file size
|
|
* Get downloaded file size regardless of the Content-Size header
Signed-off-by: Florian Le Minoux <darkgallium+git@deuxfleurs.fr>
* fixing lint issues
* Don't exhaust memory for large files, don't limit more than necessary
* Don't use errors.Wrap in download.go
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
|
|
* Move config, setup, mscs into "setup" top-level folder
* oops, forgot the EDU server
* Add setup
* goimports
|
|
|
|
- Make sure we always cleanup the temp directory on error.
- Complain about it having an error prone API shape.
|
|
* Filenames based on hashes but media IDs randomly generated and per-upload metadata
* Lint
* Comment generateMediaID
|
|
* Offset updates take place using TransactionWriter
* Refactor TransactionWriter in current state server
* Refactor TransactionWriter in federation sender
* Refactor TransactionWriter in key server
* Refactor TransactionWriter in media API
* Refactor TransactionWriter in server key API
* Refactor TransactionWriter in sync API
* Refactor TransactionWriter in user API
* Fix deadlocking Sync API tests
* Un-deadlock device database
* Fix appservice API
* Rename TransactionWriters to Writers
* Move writers up a layer in sync API
* Document sqlutil.Writer interface
* Add note to Writer documentation
|
|
* Updated TransactionWriters, moved locks in roomserver, various other tweaks
* Fix redaction deadlocks
* Fix lint issue
* Rename SQLiteTransactionWriter to ExclusiveTransactionWriter
* Fix us not sending transactions through in latest events updater
|
|
* Start HTTP endpoint refactoring
* Update SetupAndServeHTTP
* Fix builds
* Don't set up external listener if no address configured
* TLS HTTP setup
* Break apart client/federation/key/media muxes
* Tweaks
* Fix P2P demos
* Fix media API routing
* Review comments @Kegsay
* Update sample config
* Fix gobind build
* Fix External -> Public in federation API test
|
|
* Initial pass at refactoring config (not finished)
* Don't forget current state and EDU servers
* More shifting around
* Update server key API tests
* Fix roomserver test
* Fix more tests
* Further tweaks
* Fix current state server test (sort of)
* Maybe fix appservices
* Fix client API test
* Include database connection string in database options
* Fix sync API build
* Update config test
* Fix unit tests
* Fix federation sender build
* Fix gobind build
* Set Listen address for all services in HTTP monolith mode
* Validate config, reinstate appservice derived in directory, tweaks
* Tweak federation API test
* Set MaxOpenConnections/MaxIdleConnections to previous values
* Update generate-config
|
|
* Use TransactionWriter on other component SQLites
* Fix sync API tests
* Fix panic in media API
* Fix a couple of transactions
* Fix wrong query, add some logging output
* Add debug logging into StoreEvent
* Adjust InsertRoomNID
* Update logging
|
|
|
|
|
|
* Derive content ID from hash+filename but preserve dedupe, improve Content-Disposition handling and ASCII handling
* Linter fix
* Some more comments
* Update sytest-whitelist
|
|
* Update sytest-whitelist, are-we-synapse-yet.list
* Update gomatrixserverlib
* Update gomatrixserverlib
* Loop avoidance
* Return UTF-8 filenames
* Replace quotes only, instead of using strconv.Quote
* Update sytest-whitelist
* Update sytest-whitelist
|
|
* Fix media API for demos and possibly Synapse
* User API
* goimports
|
|
* Make userapi responsible for checking access tokens
There's still plenty of dependencies on account/device DBs, but this
is a start. This is a breaking change as it adds a required config
value `listen.user_api`.
* Cleanup
* Review comments and test fix
|
|
renamed: internal/eventcontent.go -> internal/eventutil/eventcontent.go
renamed: internal/events.go -> internal/eventutil/events.go
renamed: internal/types.go -> internal/eventutil/types.go
renamed: internal/http/http.go -> internal/httputil/http.go
renamed: internal/httpapi.go -> internal/httputil/httpapi.go
renamed: internal/httpapi_test.go -> internal/httputil/httpapi_test.go
renamed: internal/httpapis/paths.go -> internal/httputil/paths.go
renamed: internal/routing.go -> internal/httputil/routing.go
renamed: internal/basecomponent/base.go -> internal/setup/base.go
renamed: internal/basecomponent/flags.go -> internal/setup/flags.go
renamed: internal/partition_offset_table.go -> internal/sqlutil/partition_offset_table.go
renamed: internal/postgres.go -> internal/sqlutil/postgres.go
renamed: internal/postgres_wasm.go -> internal/sqlutil/postgres_wasm.go
renamed: internal/sql.go -> internal/sqlutil/sql.go
|
|
* Split out adding HTTP routes from making internal APIs for clarity
* Split out more components
* Split out more things
* Finish converting
* internal mux for internal routes
|
|
* Add ParseFileURI and use it when dealing with file URIs
Fixes #1059
* Missing file
* Linting
|
|
* Use uri.path so we don't have file: in the filename
* New go-sqlite-js version
|
|
* Separate muxes for public and internal APIs
* Update client-api-proxy and federation-api-proxy so they don't add /api to the path
* Tidy up
* Consistent HTTP setup
* Set up prefixes properly
|
|
* Fix #897 and shuffle directory around
* Update find-lint
* goimports
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
|
|
Error messages indicate that:
> mediaId must be a non-empty string using only characters in `mediaIDCharacters`
However the regex used only required that some characters in the filename match
the restriction, not that the entire filename does. This commit ensures that
the filename must entirely fullfill the `mediaIDCharacters` restriction
Signed-off-by: Sid Karunaratne <sid@karunaratne.net>
Co-authored-by: Kegsay <kegan@matrix.org>
|
|
|
|
* Limit database connections (#564)
- Add new options to the config file database:
max_open_conns: 100
max_idle_conns: 2
conn_max_lifetime: -1
- Implement connection parameter setup on the *DB (database/sql) in internal/sqlutil/trace.go:Open()
- Propagate the values in the form of DbProperties interface via all the
Open() and NewDatabase() functions
Signed-off-by: Tomas Jirka <tomas.jirka@email.cz>
* Fix wasm builds
* Remove file accidentally added from working tree
Co-authored-by: Tomas Jirka <tomas.jirka@email.cz>
|
|
* Add SQL tracing via DENDRITE_TRACE_SQL
Add this to `internal/sqlutil` in preparation for #897
* Not entirely
|