231 Commits

Author SHA1 Message Date
FoxxMD
fb3047ca82 Remove error wording (may be normal shutdown) 2021-07-27 13:08:56 -04:00
FoxxMD
193ecfba2f Fix truthy condition for notifyOnTrigger 2021-07-27 12:56:53 -04:00
FoxxMD
ef3475e519 Add a blank notification manager for initial manager creation 2021-07-27 12:42:31 -04:00
FoxxMD
a003e18360 Add log statement when sending notification 2021-07-27 12:33:27 -04:00
FoxxMD
6b6124d76e Implement event hooks for notifications
* Implemented a generic notification manager with several event types
* Implemented discord notification provider
2021-07-27 12:24:36 -04:00
FoxxMD
e4f18e8f06 Fix cache call request rate when over 10 minutes 2021-07-26 18:45:53 -04:00
FoxxMD
802884f686 Add operator configuration documentation 2021-07-26 17:06:02 -04:00
FoxxMD
67ed8ab4ee Add more caching info and tooltips for major components 2021-07-26 14:47:58 -04:00
FoxxMD
1e6d61ac31 Add 401 http status to retry handler
Seen this occasionally on polling and is actually a reddit issue, not client, so should be able to retry on it
2021-07-26 12:20:10 -04:00
FoxxMD
7cda47183f Simplify cli options and improve web server checks
* Check for in-use web port before starting so we can display a useful error message
* Remove 'web' command and instead make it an optional argument for `run` (default to web)
* Update dockerfile to use run command
* Remove remaining commander option defaults since they are defined in config builder now
2021-07-26 12:18:51 -04:00
FoxxMD
a9edd4b998 Fix miss percent formatting 2021-07-26 09:55:03 -04:00
FoxxMD
9e1d5f1dd4 Ui polish
* Add more caching information
* Add more visual distinction for selected subreddit
* Add querystring based on shown subreddit so view persists between reload
2021-07-23 17:03:30 -04:00
FoxxMD
4617e06459 Fix missing await on usernote cache call 2021-07-23 16:44:21 -04:00
FoxxMD
b2b4988246 Consolidate all caching
* Use cache manager instance in UserNotes and callback to report stats
* Simplify sub resource config interface and setter
* Use cache manager for express session
* Add session cache provider to operator config
2021-07-23 14:48:33 -04:00
FoxxMD
e1c24133dd Use name instead of user id for banning 2021-07-23 13:26:53 -04:00
FoxxMD
12a4e0436e Simplify resource stats generation 2021-07-23 11:46:37 -04:00
FoxxMD
484931d8b5 Fix bool middleware running on wrong route 2021-07-23 11:10:53 -04:00
FoxxMD
abf2674f80 Detect noisy html errors from reddit 2021-07-22 21:37:43 -04:00
FoxxMD
1f3cfbeef9 Fix cache miss value comparison 2021-07-22 21:37:08 -04:00
FoxxMD
2b21885a55 Fix default cache stuff when subreddit manager isn't built 2021-07-22 17:59:45 -04:00
FoxxMD
232925e691 Maybe fix error on ban 2021-07-22 17:53:47 -04:00
FoxxMD
a91b9ab146 Use more robust caching implementation
* use node-cache-manager so operator has a choice of memory or redis
* BC update TTL values to be in seconds instead of milliseconds
* Count requests and misses for cache
* display cache stats in ui
2021-07-22 17:47:19 -04:00
FoxxMD
73c3052c69 Refactor how configuration is parsed
* Implement a weak/strong interface for operator (app) config
* Consolidate config parsing code into ConfigBuilder
* Implement parsing configuration from a json file
* Refactor configuration parsing so there is a clear hierarchy to where and how config is overridden
2021-07-22 15:17:41 -04:00
FoxxMD
4fbb3edf8b Lots of regex fixes 2021-07-21 16:50:49 -04:00
FoxxMD
c69d66c001 Initial implementation of Regex Rule 2021-07-21 15:47:26 -04:00
FoxxMD
9b53974152 Fix formatting for rolling average 2021-07-21 12:14:28 -04:00
FoxxMD
13d3ed2314 Improve repeat pattern detection for repeat activity rule
* Fuzzy match on all identifiers to enable detecting small variations in title/body
* For reddit media submissions (image/video) check title instead of url
* For submissions with external url also check title
2021-07-21 12:09:51 -04:00
FoxxMD
9d7505fa38 More UI improvements
* Move theme toggle to title to make room in the subreddit tabs when there are many, many subreddits
* Implement check permalink with subreddit context -- can run any permalink on a subreddit's config
2021-07-21 12:07:37 -04:00
FoxxMD
1b94316987 Fix log level for api nanny 2021-07-20 20:30:06 -04:00
FoxxMD
9316019b01 Implement api nanny mode to help with heavy api usage 2021-07-20 20:15:15 -04:00
FoxxMD
4642f67104 Implement loading operator arguments (main program) from file 2021-07-20 16:38:35 -04:00
FoxxMD
a78692d7a0 Even more polish 2021-07-20 13:11:37 -04:00
FoxxMD
3627a5f60a More UI polish 2021-07-20 12:48:32 -04:00
FoxxMD
6b04ea0a9d Compact stats/info 2021-07-20 00:57:47 -04:00
FoxxMD
f6217547ae Some ui cleanup 2021-07-20 00:23:48 -04:00
FoxxMD
f1b24eb4a2 Add unmoderated/modqueue check actions to ui 2021-07-19 23:16:27 -04:00
FoxxMD
c9bdae66dd Implement configurable shared modqueue for operator convenience
If operator is running subreddits for lop-sided traffic burdens then /r/mod may be over the 100 activity limit, all from subreddit X while sub Y and Z have few activities. In this scenario Y and Z would never run since X would take up all results. Therefore default to individual modqueues and make shared modqueue opt-in by operator
2021-07-19 23:04:47 -04:00
FoxxMD
6ab162888b try-catch all the things 2021-07-19 22:37:50 -04:00
FoxxMD
dd202ac790 Add console to error/rejection transports 2021-07-19 22:37:39 -04:00
FoxxMD
eead88c9a7 Remove secondary client usage which was causing bug
For some reason using client *again* here was causing the primary client usage to lose response data. I think perhaps it needs to be cloned or need to create a new instance all-together rather than trying to re-use.
2021-07-19 22:37:22 -04:00
FoxxMD
f548be8060 Fix "All" actions type 2021-07-19 16:44:03 -04:00
FoxxMD
5df4fd5ccc Separate event polling and activity processing systems to improve robustness
* Use async/queue for handling activity processing on each manager
* Refactor polling to push activities into activity queue
* Refactor manager state to control activity processing queue and event polling independently
* Pause activity processing and wait until no work is being done to do config update
* Add way more logging for new systems
* Add basic ui controls/view for new systems
2021-07-19 16:32:41 -04:00
FoxxMD
b25001b7af Reduce false positives for repeat self/comment activities
* For self submissions use "title + body" to identify repeats instead of just body -- body could potentially be empty
* Add "minWordCount" with default of 1 so that blank comments are ignored
2021-07-18 21:30:44 -04:00
FoxxMD
8733717cda Remove submission title on comment item peek
Erroneously returning proxy object instead of actual submission. Dont' really need the title since its in the permalink so remove it entirely to avoid another api call
2021-07-18 21:05:56 -04:00
FoxxMD
6167d45e49 Refactor configuration loading to be independent of manager initialization
* Makes it easier to deal with never-successful subs (from startup) and invalid configs during run
* Paves the way for adding managers in-situ
* Add validConfig property to manager to track this and in UI
* Track if user manually stopped manager so we don't try to restart on heartbeat
2021-07-16 16:57:25 -04:00
FoxxMD
694842226b Cover case where user declines oauth 2021-07-16 15:35:25 -04:00
FoxxMD
02ad661226 Cover case where outside user logs in 2021-07-16 15:18:38 -04:00
FoxxMD
3be62f5560 Use partials for rendering head/title 2021-07-16 15:18:01 -04:00
FoxxMD
eb84df5133 Set dark theme as default 2021-07-16 12:12:17 -04:00
FoxxMD
4b11e348ba Update some logging to be more subreddit specific 2021-07-16 12:08:19 -04:00