Commit Graph

152 Commits

Author SHA1 Message Date
Daniel Sockwell 67c59401fd
Unix sockets WIP (#77)
* Initial WIP Unix socket implementation

* Bump version to v0.4.5

* Update type data
2020-01-08 09:51:25 -05:00
Daniel Sockwell 597d024b8f Add api/v1/streaming/health API endpoint (#74) 2020-01-08 09:30:42 -05:00
Daniel Sockwell b216a81e26
Add api/v1/streaming/health API endpoint (#74) 2020-01-07 17:27:46 -05:00
Daniel Sockwell bf529a901b
Treat env vars set to "" as if they were unset (#73)
* Treat env vars set to "" as if they were unset

* Bump version to 0.4.4
2020-01-07 13:07:54 -05:00
Daniel Sockwell 07e8776090
Redis hostname (#71)
* Allow hostname in REDIS_HOST

* Bump version to 0.4.3
2020-01-06 14:20:00 -05:00
Daniel Sockwell 0de3d3c484
Postgres config (#70)
* Add logging for known env variables

* Update postgres config to match other configs

* Update README and bump version to 0.4.2
2020-01-05 21:58:18 -05:00
Daniel Sockwell 4a2d08c693
Refactor/reorganize streaming code (#64) 2019-10-09 14:46:56 -04:00
Daniel Sockwell c281418f25
Enforce type safety in config (#63)
* Add type-safe wrapper types to deployement_cfg

* Before deleting redundnat macros

* Store error messages as data

* Significant progress on type safety

* Add type safety to RedisConfig
2019-10-08 20:35:26 -04:00
Daniel Sockwell e19524738b
Add WS keepalive ping (#62)
* Modify code to use forked Warp

* Add keepalive WS ping
2019-10-05 18:18:11 -04:00
Daniel Sockwell 9d96907406
Functional config (#59) 2019-10-03 18:02:23 -04:00
Daniel Sockwell 7c40f7173f
Update README with config instructions (#58) 2019-10-03 01:14:38 -04:00
Daniel Sockwell e8145275b5
Config refactor (#57)
* Refactor configuration

* Fix bug with incorrect Host env variable

* Improve logging of REDIS_NAMESPACE

* Update test for Postgres configuration

* Conform Redis config to Postgres changes
2019-10-03 00:34:41 -04:00
Daniel Sockwell 11661d2fdc
Redis config (#56)
* Add most Redis config variables

* Add REDIS_NAMESPACE env var

* Fix Clippy lints
2019-10-02 00:03:18 -04:00
Daniel Sockwell 5b663d110e
Unicode fix (#54)
* Increase detail of error logging; bump version

* Fix panic caused by spliting a message inside a Unicode char
2019-10-01 09:28:43 -04:00
Daniel Sockwell d347b8e2dc
Fix CPU issue caused by blocking code (#53)
* Fix blocking read

* Update logging for long polling
2019-09-28 17:57:37 -04:00
Daniel Sockwell fc7feb6694
Speed improvment to redis_parse (#52) 2019-09-28 12:27:45 -04:00
Daniel Sockwell 2ac08c5316
Parse redis messages (#51)
* Initial version of Redis parsing fix

* Refactor parsing for more maintainability

* Add benchmarks for new parsing strategy

* Add tests for parsing
2019-09-27 23:29:11 -04:00
Daniel Sockwell ceb38c2689
Add initial benchmarks (#50) 2019-09-11 17:28:27 -04:00
Daniel Sockwell 0dec8c4124
Solve SendErrors (#47)
This commit solves the SendErrors that were triggered by attempting
to use a WebSocket connection after it had been closed by the client
2019-09-11 00:13:45 -04:00
Daniel Sockwell 11163237bc
Prepare binary release (#46) 2019-09-10 12:11:09 -04:00
Daniel Sockwell 7fb7a3e5c9
Temporarily remove Postgres SSL support (#45)
Remove Postgres SSL support, which was not working at the moment and
was preventing flogatt from running on servers without openssl.

We should re-enable SSL support at a later time.
2019-09-10 11:46:05 -04:00
Daniel Sockwell 0a8abde664
Read `access_token` from WS header (#44) 2019-09-10 08:51:36 -04:00
Daniel Sockwell 989c71059e
Remove debug statements (#43) 2019-09-09 14:23:48 -04:00
Daniel Sockwell ecfdda093c
Add tests for websocket routes (#38)
* Refactor organazation of SSE

This commit refactors how SSE requests are handled to bring them into
line with how WS requests are handled and increase consistency.

* Add websocket tests

* Bump version to 0.2.0

Bump version and update name from ragequit to flodgatt.

* Add test for non-existant endpoints

* Update documentation for recent changes``
2019-09-09 13:06:24 -04:00
Daniel Sockwell 90602d17ed
Replace integration tests with unit tests (#37)
* Upgrade postgres dependency to support ssl

* Clean up configuration code

* Add support for SSL with postgres [WIP]

* Add unit tests with mock Postgres
2019-09-04 21:48:29 -04:00
Daniel Sockwell a27fb0d605
Postgres ssl (#36)
* Upgrade postgres dependency to support ssl

* Clean up configuration code

* Add support for SSL with postgres [WIP]
2019-09-04 21:31:52 -04:00
Daniel Sockwell cf9aa8fc84
Finish adding Postgres env options (#35)
This PR adds all relevant Postgres configuration options.
2019-08-27 22:34:45 -04:00
Daniel Sockwell a8345bd234
Fix bug leading to dropped messages (#34)
This commit fixes an issue where messages would be dropped if
multiple messages arrived from Redis at the same time.
2019-08-27 20:29:37 -04:00
Daniel Sockwell 161da3f456 Add aditional Postgres config options
This commit adds several aditional Postgres config options, such
as PORT, USER, DB_NAME and similar.  It also relocates the .env
file so that it will be picked up even if flodgat isn't run from
the src/ directory.
2019-08-27 18:31:56 -04:00
Daniel Sockwell 2fca5ec327
Store each Redis message as a growable String (#30)
This commit stores each message received from Redis as a growable string
rather than in a buffer of fixed size.  This allows the server to
receive messages of any length.
2019-07-11 15:10:56 -04:00
Daniel Sockwell 1925710e8e
Exclude all non-`message` data from Redis results (#29) 2019-07-11 08:45:53 -04:00
Daniel Sockwell 4327216eb1
correctly parse notification/delete messages (#28) 2019-07-10 23:44:04 -04:00
Eugen Rochko f1f0c8e705 Change name of project in README.md (#25) 2019-07-10 17:37:41 -04:00
Eugen Rochko 4097783b56
Create FUNDING.yml 2019-07-10 23:21:18 +02:00
Eugen Rochko fbf72ebb85
Merge pull request #26 from tootsuite/fix-add-travis
Add Travis CI
2019-07-10 23:20:31 +02:00
Eugen Rochko c441b19939 Add Travis CI 2019-07-10 23:17:40 +02:00
Daniel Sockwell 6953b325cf
Merge pull request #24 from tootsuite/hotfix
Hotfix for typo and logging
2019-07-09 22:26:31 -04:00
Daniel Sockwell 9ec245ccdb Add additional logging for postgres connection/server status 2019-07-09 22:20:11 -04:00
Daniel Sockwell 00cf62cd09 Hotfix to correct typo and set default log level to `warn` 2019-07-09 22:18:04 -04:00
Daniel Sockwell a67317b0a2
Merge pull request #22 from tootsuite/cleanup_and_document
Refactor, cleanup, and document
2019-07-09 13:19:50 -04:00
Daniel Sockwell 8f930d437a Merge branch 'master' of github.com:tootsuite/ragequit into cleanup_and_document 2019-07-09 13:12:26 -04:00
Daniel Sockwell b0a28875bc
Merge pull request #21 from tootsuite/improve-security
Improve security to match Node.js version
2019-07-09 13:11:20 -04:00
Daniel Sockwell 866f3ee34d Update documentation and restructure code 2019-07-08 15:21:02 -04:00
Daniel Sockwell d6ae45b292 Code reorganization 2019-07-08 07:31:42 -04:00
Daniel Sockwell 1732008840 Initial cleanup/refactor 2019-07-05 20:08:50 -04:00
Daniel Sockwell f3b86ddac8 Add CORS support
Cross-Origin requests were already implicitly allowed, but this
commit allows them explicitly and prohibits request methods other
than GET.
2019-07-04 14:00:35 -04:00
Daniel Sockwell 1765dc39ee Check oauth scopes and reject unauthorized requests 2019-07-04 13:27:11 -04:00
Daniel Sockwell f8a82caa2d Support passing access tokens via Sec-WebSocket-Protocol header
Previously, the access token needed to be passed via the query string;
with this commit, the token can be passed *either* through the query
string or the Sec-WebSocket-Protocol header.

This was done to correspond to the changes made to the streaming.js
version in [Improve streaming server security](https://github.com/tootsuite/mastodon/pull/10818).
However, I am not sure that it *does* increase security; as explained
at <https://support.ably.io/support/solutions/articles/3000075120-is-it-secure-to-send-the-access-token-as-part-of-the-websocket-url-query-params->,
there is generally no security advantage to passing sensitive information
via websocket headers instead of the query string—the entire connection
is encrypted and is not stored in the browser history, so the typical
reasons to keep sensitive info out of the query string don't apply.

I would welcome any corrections on this/reasons this change improves
security.
2019-07-04 10:57:15 -04:00
Daniel Sockwell 280cc60be9 Add hard-coded "sec-websocket-protocol" response header 2019-07-04 09:33:50 -04:00
Daniel Sockwell 839f04a2e6
Merge pull request #17 from tootsuite/dotenv
Dotenv
2019-05-10 07:47:56 -04:00