23 Commits

Author SHA1 Message Date
e4ea970f28 Release v0.2.0 2025-05-16 16:08:29 +00:00
5a203d70ba Add support for access token based authentication
* Extend the configuration format in order to allow access_token,
   user_id and device_id instead of username and password
 * Move the matrix login logic outside of login_and_sync for clarity
 * Add support for access token based session resuming instead of
   logging in every time (thus creating a new device each time the
   service starts up)
 * Delay the startup of feed reader loops until after the matrix module
   has had a chance to actually check authentication

This change is quite involved and there are a few caveats, namely an
intentional race condition between the feed reader loops and matrix
authentication, as well as significantly different behaviors depending
on which authentication scheme is being used: password based
authentication requires an API call while resuming a session using an
access token does not.
2025-05-16 15:21:49 +00:00
a66517d24f state: Remove useless clone() 2025-05-15 22:01:47 +00:00
121943afa7 state: Properly propagate errors when persisting state 2025-05-15 21:54:30 +00:00
f5edc44717 config: Make error handling a little bit nicer
* Implement the std::error::Error trait and add a Result type
 * Propagate generic io::Error and serde_yaml::Error using From
 * Move the Result and Error types to the bottom of the module
2025-05-15 21:27:57 +00:00
73ee8114ca matrix: login_and_sync does not need to be generic 2025-05-15 21:06:54 +00:00
3fee20f0cf main: Panic explicitely when failing to initialize the state db 2025-05-15 21:01:59 +00:00
86c6ec26f5 state: Send a warning trace whenever the state db lock is poisoned 2025-05-15 19:30:05 +00:00
e771639856 config: Rework error handling into explicit error types 2025-05-15 19:09:41 +00:00
e79dfe9fc5 Run cargo update and bump package version 2025-05-03 16:05:38 +00:00
cdb0277c57 main: Fix silly logic bug in the exponential backoff code 2025-05-03 16:03:01 +00:00
40455f0365 feedreader: format_entry does not need to return a Result 2025-05-03 15:28:18 +00:00
c8c9021b78 main: Implement exponential backoff in the feed fetcher loop
Backoff with an exponentially increasing delay when feeds can't be
fetched or parsed, with a maximum of 6h (after which retry every 6h)
2025-05-03 15:09:13 +00:00
5c009476d6 matrix: Rework room send error handling
* Use the tracing crate instead of println macros
 * Do not panic on failure to send messages
 * Move the send code to a separate function in preparation for adding
   a proper retry implementation
2025-04-30 15:49:53 +00:00
cacbf4af45 matrix: Handle sync errors more gracefully
* Retry failed sync immediately
 * Trace the underlying error when sync fails
2025-04-28 18:29:40 +00:00
6dddbfb1e9 main: Add a randomized delay before fetching feeds 2024-11-26 21:34:21 +00:00
24d824f759 src: Unclutter logs by switching some info messages to debug 2024-11-25 18:54:22 +00:00
e951fcdf83 Dockerfile: Install ca-certificates in the built container image 2024-11-25 04:08:38 +00:00
d0ac11ea89 main: Improve feed parse error handling 2024-11-25 04:06:53 +00:00
b93f921bcb main: Increase the broadcast channel capacity 2024-11-25 04:06:01 +00:00
148d4e7e43 matrix: Panic when the message-passing channel overflows 2024-11-25 04:04:43 +00:00
50f0bcd3c7 feedreader: Handle entries with no link attribute 2024-11-25 04:03:19 +00:00
cd590b73fe Initial code dump: matrix feedbot, aka bender
This is a rewrite of our old feedbot in rust, heavily inspired from
rek2's INN matrix bot and making use of some bits from matrix-rust-sdk

This is an asynchronous tokio-based matrix client using a stateless feed
fetcher implementation based on reqwest, it uses feed_rs for parsing RSS
and Atom feeds. State persistence is achieved using a simple file-backed
datastore with serde_yaml as a serialization format.

Published under the GNU General Public License version 3 or later.
2024-11-22 13:08:34 +00:00