Commit graph

59 commits

Author SHA1 Message Date
38e5a1d9f2
Change image API port, added TLS support, fixed content-type header 2021-12-02 18:01:33 -06:00
871979105c
Fixed tag parameter stuff, added tag to Rinit, added format checking 2021-11-29 15:27:13 -06:00
19638966bb
Add docs for API 2021-11-27 17:13:12 -06:00
41992769ef
god dammit 2021-11-27 16:45:33 -06:00
fe321e00b4
Some fixes 2021-11-26 23:24:13 -06:00
41068ae763
Initial draft for new image API design 2021-11-26 23:05:09 -06:00
fec3d7303c
Add queued image jobs to server selection logic 2021-09-01 00:21:13 -05:00
ae2ebe0337
Port to ESM modules (haha funny), removed cache request, many other changes that I forgot about 2021-08-19 09:19:14 -05:00
f7923c19cb
Added a very basic image API authentication system 2021-08-06 17:13:29 -05:00
97050f0cf1
Attempt to move image processing to an eris-fleet service 2021-07-05 19:20:21 -05:00
4a516329e5
Remove POST from allowed HTTP methods on api server 2021-06-29 17:49:13 -05:00
4d3e1655e0
A little bit more image work 2021-06-18 19:10:13 -05:00
a0a32c31b9
Switched image API from raw TCP to websockets, removed selective image reading code 2021-06-18 00:10:11 -05:00
ff461e52f5 imagemagick time policy literally does nothing 2021-05-11 11:23:19 -05:00
2b810c7c86 Re-add image job timeout, split dockerfiles, removed api from docker-compose, more fixes 2021-05-10 22:59:19 -05:00
f0734bba00 pain, lots of pain 2021-05-06 17:40:06 -05:00
e8834c072a Properly handle closing an image server connection, switch some "on" instances to "once" 2021-05-06 16:40:05 -05:00
108afc3626 might be a stupid idea 2021-05-06 15:17:04 -05:00
84e20308f2 i don't even know 2021-05-02 12:00:41 -05:00
5a60e4be70 hotfix moment 2021-04-29 18:55:58 -05:00
e33d7fca5b Only delete image job after time limit if it's finished 2021-04-21 12:36:59 -05:00
7670cce279 this works better for some goddamn reason 2021-04-16 13:21:27 -05:00
7cc8ac7b6b Reduced prefix/disabled channel cache to 512, made API delete images if they haven't been requested after 5 minutes 2021-04-14 18:02:03 -05:00
40223ec8b5
Class commands, improved sharding, and many other changes (#88)
* Load commands recursively

* Sort commands

* Missed a couple of spots

* missed even more spots apparently

* Ported commands in "fun" category to new class-based format, added babel eslint plugin

* Ported general commands, removed old/unneeded stuff, replaced moment with day, many more fixes I lost track of

* Missed a spot

* Removed unnecessary abort-controller package, add deprecation warning for mongo database

* Added imagereload, clarified premature end message

* Fixed docker-compose path issue, added total bot uptime to stats, more fixes for various parts

* Converted image commands into classes, fixed reload, ignore another WS event, cleaned up command handler and image runner

* Converted music/soundboard commands to class format

* Cleanup unnecessary logs

* awful tag command class port

* I literally somehow just learned that you can leave out the constructor in classes

* Pass client directly to commands/events, cleaned up command handler

* Migrated bot to eris-sharder, fixed some error handling stuff

* Remove unused modules

* Fixed type returning

* Switched back to Eris stable

* Some fixes and cleanup

* might wanna correct this

* Implement image command ratelimiting

* Added Bot token prefix, added imagestats, added running endpoint to API
2021-04-12 11:16:12 -05:00
43e0f7f447 Send error back to API client when the API server stops 2021-03-31 21:44:13 -05:00
5d2e2b5274 Upgraded retrotext and DBL posting packages, fixed mention prefixes and DM commands 2021-03-18 09:29:03 -05:00
74baa29684 Send unsanitized content to commands via content parameter, fixed emote command, removed another async promise 2021-03-16 13:24:21 -05:00
adroitwhiz
d25639c0ec
Pass sock in recursive acceptJob calls (#65) 2021-02-19 21:01:41 -06:00
62346cbae4 Rework image API again, replaced many calls to replace with replaceAll 2021-01-18 14:11:28 -06:00
adroitwhiz
3de4858b5a
Clean up image API code paths (#49)
* Document image.js a bit

* Close image.js sockets in all code paths

I'm not sure whether sockets get GC'd when the function returns

* Remove getFormat

It was only called from one place, and the object property names were
quite confusing

* Clean up image.js conditional a bit

I had to write out an entire truth table for this and work it all out
Thinking hard

* Move actual ImageMagick calling into separate file

This gets rid of the weird, brain-melting ouroboros of code that
recurses across threads and processes.

* Reduce amount of getType wrangling

This amounted to an awful lot of dead conditionals after the image
commands were all modified to pass in image types anyway. This has also
led to two different implementations diverging, which causes bugs like
GIF commands applied to non-GIFs erroring instead of providing a
user-friendly message.

* Unify image-runner return type, clarify image type

This allows us to remove the fromAPI parameter from image-runner, and
helps greatly clarify the behavior around image types.

* Deduplicate GIF code, fix "not a GIF" handling

The special "nogif" value is now stored as the image type instead of its
value, as the value must always be a Buffer now--no loosely-typed
shenanigans.
2021-01-09 19:50:29 -06:00
c2bd68263b Made image API node chooser sort by job amount instead of CPU usage, added soundreload 2021-01-08 12:08:10 -06:00
55da0db479 The image API no longer uses a unique thread for each job (due to image processing using its own thread anyway), added dummy DB driver 2021-01-06 16:10:31 -06:00
7b64c4ca2a Fixed some queue related stuff 2021-01-04 23:19:59 -06:00
9f2bd1fecb Make the bot itself get the image file type again 2021-01-04 20:53:34 -06:00
10ee3c6a31 Removed unnecessary message to main thread 2021-01-04 17:33:13 -06:00
adroitwhiz
66743d6fa9 Close image API resources instead of forcing exit 2021-01-03 01:13:38 -05:00
be53f8d352 Handle errors properly *and* also hopefully fix the file descriptor issue for real 2021-01-02 23:56:27 -06:00
adroitwhiz
ae32a3f9f1
Initialize cpuLoad to 0 (#46) 2021-01-02 23:02:41 -06:00
87ab7d39d4 Another attempt to fix the EMFILE error, update license for the new year 2021-01-02 22:40:44 -06:00
67ca7d79d0 Fixed events overloading file descriptor limit 2020-12-30 18:46:17 -06:00
8a2d4e6669 Fixed image API request closing prematurely, disabled music commands in production, various fixes regarding direct messages, fixed reply image checking, and removed yoda 2020-12-26 12:17:10 -06:00
7a254a5139 Added load-based api node selection 2020-12-25 20:27:45 -06:00
69d8100f23 Actually made screenshot owner-only, made image API interaction more secure 2020-12-14 12:39:18 -06:00
78ae47dbbb Handle API errors more gracefully, fixed sharpen, restrict screenshot to the bot owner 2020-12-14 10:58:31 -06:00
3deb2b4986 Added warning message for Win32, fixed api not getting env data 2020-12-03 10:30:33 -06:00
94b0bc19a4 Added reply support to image detection, added stealth plugin to screenshot, made credits static, more fixes 2020-11-26 09:31:24 -06:00
ca6cffa67c Some security fixes 2020-11-20 15:16:52 -06:00
ad149156ad Switched to an image API implementation by Terradice 2020-11-17 08:52:12 -06:00
Samuel Hernandez
66cf9dc518
utils/image.js: fix getType on local files 2020-11-07 20:50:32 -05:00
0600cf230f Caption now supports more unicode characters, more api work, fixed multiple bugs 2020-11-05 15:40:18 -06:00