* Prevent Reciever from querying postgres
Before this commit, the Receiver would query Postgres for the name
associated with a hashtag when it encountered one not in its cache.
This ensured that the Receiver never encountered a (valid) hashtag id
that it couldn't handle, but caused a extra DB query and made
independent sections of the code more entangled than they need to be.
Now, we pass the relevant tag name to the Receiver when it first
starts managing a new subscription and it adds the tag name to its
cache then.
* Improve module boundary/privacy
* Reorganize Receiver to cut RedisStream
* Fix tests for code reorganization
Note that this change includes testing some private functionality by
exposing it publicly in tests via conditional compilation. This
doesn't expose that functionality for the benchmarks, so the benchmark
tests do not currently pass without adding a few `pub use`
statements. This might be worth changing later, but benchmark tests
aren't part of our CI and it's not hard to change when we want to test
performance.
This change also cuts the benchmark tests that were benchmarking old
ways Flodgatt functioned. Those were useful for comparison purposes,
but have served their purpose – we've firmly moved away from the
older/slower approach.
* Fix Receiver for tests
Previously, if a toot's language was `null`, then it would be
permitted regardless of the user's language filter; however, if it
were `""` (the empty string) it was rejected. Now, the empty string
is treated like `null` and the toot is allowed.
When the `WHITELIST_MODE` environmental variable is set, Flodgatt
requires users to authenticate with a valid access token before
subscribing to any timelines (even those that are typically public).
Previously, the language filter was incorrectly applied to all
`update` messages. With this change, it is only applied to public
timelines (i.e., the local timeline and the federated timeline) which
is the behavior described in the docs.
* Fix panic on delete events
Previously, the code attempted to check the toot's language regardless
of event types. That caused a panic for `delete` events, which lack a
language.
* WIP implementation of Message refactor
* Major refactor
* Refactor scope managment to use enum
* Use Timeline type instead of String
* Clean up Receiver's use of Timeline
* Make debug output more readable
* Block statuses from blocking users
This commit fixes an issue where a status from A would be displayed on
B's public timelines even when A had B blocked (i.e., it would treat B
as though they were muted rather than blocked for the purpose of
public timelines).
* Fix bug with incorrect parsing of incomming timeline
* Disable outdated tests
* Bump version
* Read user and domain blocks from Postgres
This commit reads the blocks from pg and stores them in the User
struct; it does not yet actually filter the responses. It also does
not update the tests.
* Update tests
* Filter out toots involving blocked/muted users
* Add support for domain blocks
* Update test and bump version
* 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
* 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
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.
* 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``
* Upgrade postgres dependency to support ssl
* Clean up configuration code
* Add support for SSL with postgres [WIP]
* Add unit tests with mock Postgres
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.
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.