32 Commits

Author SHA1 Message Date
FoxxMD
4457e3957d Implement json pretty print to html on config view 2021-08-03 23:38:48 -04:00
FoxxMD
54905da782 Implement extended memory store to allow pruning 2021-07-30 13:48:58 -04:00
FoxxMD
897802b234 Update npm start command 2021-07-28 16:04:49 -04:00
FoxxMD
ceb98d04bb Update application version 2021-07-28 11:30:04 -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
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
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
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
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
4642f67104 Implement loading operator arguments (main program) from file 2021-07-20 16:38:35 -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
15e031d448 Implement web ui
* Refactor program options to allow running as web
* Implement authentication using reddit oauth
* Use session in memory to store identification and accessible subreddits
* Implement socket.io with shared session to enable streaming logs
* Implement log streaming with per-subreddit views
2021-07-15 01:18:21 -04:00
FoxxMD
f591c3a05a Implement more powerful content parsing options
* Can get wiki pages from other subreddits
* Can fetch from an external url
2021-07-06 10:27:30 -04:00
FoxxMD
e0f18dc0a2 Add typescript dep 2021-06-25 10:28:39 -04:00
FoxxMD
08413dbe16 Implement YAML parsing 2021-06-16 21:27:48 -04:00
FoxxMD
7761372091 Implement toolbox usernote read/write 2021-06-14 22:45:48 -04:00
FoxxMD
f6b3f02e05 unescape content before report/comment 2021-06-11 10:36:37 -04:00
FoxxMD
788af401b3 Support JSON5 for parsing configuration 2021-06-10 13:20:11 -04:00
FoxxMD
6bc74b383f Implement resource caching
User-configurable global/subreddit-level caching for author activities, wiki pages, and author checks
2021-06-10 13:13:57 -04:00
FoxxMD
0eeb204371 Update ajv and fix schema generation issues
* Update ajv to fix #ref warning
* Consolidate ajv instantiation so config is always the same
* Remove propOrder flag for schema generation since its out of spec
2021-06-09 14:39:23 -04:00
FoxxMD
5905c910b0 Implement name references for actions and rules
Action/Rule objects they can now be referenced by name from anywhere in the configuration
2021-06-08 12:40:00 -04:00
FoxxMD
01161c3493 Implement specific activity checking through cli
* Refactor application input to use commando for extensibility
* Add all args/env as options for easy readout on command line
* Add 'check' command to allow running checks against a specific activity
* BC: must specify 'run' to run regular manager/unattended operation
2021-06-07 13:38:37 -04:00
FoxxMD
bd1ad7bffa Specify minimum node level 2021-06-03 23:15:42 -04:00
FoxxMD
bf70a23a25 Refactor json parsing to use ajv for all validation instead of guards
* Generate individual schemas for root objects from config (Rule, RuleSet, Action)
* Using ajv validation means we can also report all validation errors
* Remove noisy generated guard files
2021-06-03 15:19:47 -04:00
FoxxMD
c632efbbb2 More annotation improvements 2021-06-03 14:32:56 -04:00
FoxxMD
81e95e2cc8 Further improvements for json schema 2021-06-03 12:05:51 -04:00
FoxxMD
4ccec4021a Refactor winston to use nested labels for better context
Closes #3
2021-06-02 18:29:02 -04:00
FoxxMD
6eeef81d66 Make rule return value useful for information and subsequent rule runs
* Return plain data (RuleResult) with setup (premise), boolean triggered, and optional result text/data (for later use in action maybe?)
* Use RuleResult to prevent running a rule that has already been run with the same setup (premise) -- will speed up execution and prevent extraneous api calls
2021-06-02 15:11:00 -04:00
FoxxMD
69eea271cb Implement wiki comment action
* Get comment text from wiki page with 'wiki:' prefix in content
* Cache for 5 minutes (will make configurable later)
* Render comment content with Mustache template

Closes #2
2021-06-01 23:24:47 -04:00
FoxxMD
fc854d3d73 Implement repeat submissions rule 2021-06-01 15:38:07 -04:00
FoxxMD
18023b1edc Initial commit 2021-05-27 17:27:26 -04:00