Add ability to customize a history server for different channels #2586
-
What should be added? Ability to customize a history server for different channels. The custom history server should return json like this {
"messages": []
} Why should it be added? Current history server deletes all messages after 24 hours if there were no requests. I want to have an ability to add my own history server for some channels. Probably this feature won't be very popular and it probably don't need GUI in the settings. {
/* ... */
"historyServers": {
"channel_name_1": "https://my-custom-history-server/recent-messages/%1",
"channel_name_2": [
"https://my-custom-history-server-1/recent-messages/%1",
"https://my-custom-history-server-2/recent-messages/%1"
]
}
} If custom history server is not specified for the channel (or returns an error or 404) it uses the default one. Related issues #1311 #982 (comment) |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
The provider for message history can be configured via the Not sure about your exact use case but if you run your own message history server, you could provide your own logs for the channels you want to, and forward all other requests to https://recent-messages.robotty.de/ (given that @RAnders00 would be okay with that!). |
Beta Was this translation helpful? Give feedback.
-
Yes, you could probably solve this as well with a nginx config and by forwarding requests to your own instance or my public instance depending on channel name. That‘s a fine solution as far as I‘m concerned. |
Beta Was this translation helpful? Give feedback.
-
So I added redirects to https://recent-messages.robotty.de/ in my custom history server on node.js (NestJS). Added But in chatterino history loads only for channels without redirects. Redirect examplehttps://honeykingdom.herokuapp.com/api/v1/recent-messages/forsen |
Beta Was this translation helpful? Give feedback.
-
Chatterino might not follow redirects when trying to fetch recent messages; I'm not sure about that at the moment. If it does not, that could be considered as a feature. For the meanwhile, maybe fetch the logs from https://recent-messages.robotty.de/ and send them as a response to the request yourself. I'm aware that this is not an ideal solution but probably would be the fastest to get you up and running for now. |
Beta Was this translation helpful? Give feedback.
-
Are you using nginx as a reverse-proxy on your server? If yes, try this config:
Might need some tinkering to get working, I didn't test the config. |
Beta Was this translation helpful? Give feedback.
-
Also, although this is a bit off-topic, I saw you implemented the recent-messages service yourself, any reason why you didnt opt to run my implementation instead? (https://github.com/robotty/recent-messages2) |
Beta Was this translation helpful? Give feedback.
-
I wanted to write it on node.js. |
Beta Was this translation helpful? Give feedback.
-
The added complexity does not seem worth it from Chatterino's perspective when this is a pretty easy solve from the server side (e.g. with Randers nginx config). Happy to continue this as a discussion instead as it still relates to Chatterino in a meaningful way |
Beta Was this translation helpful? Give feedback.
The added complexity does not seem worth it from Chatterino's perspective when this is a pretty easy solve from the server side (e.g. with Randers nginx config). Happy to continue this as a discussion instead as it still relates to Chatterino in a meaningful way