Commit Graph

49 Commits

Author SHA1 Message Date
Marty-D
878060795f
Update modlog permission check 2018-01-27 22:12:46 +00:00
Guangcong Luo
66269d8e96 Fix Modlog maxLines passing 2018-01-18 20:39:44 -06:00
Guangcong Luo
8132ab5981 Use PM.isParentProcess to detect parent/child process 2018-01-18 04:24:49 -06:00
Guangcong Luo
6ae6a8daf2 Remove debug code 2018-01-18 03:45:41 -06:00
Guangcong Luo
ab1f995daa Rewrite Process Manager
Process Manager is now lib/process-manager.js

It's been entirely rewritten to reflect what I think a process manager
API should look like.

In particular, there are now two Process Managers, QueryProcessManager
and StreamProcessManager.

Pass QueryProcessManager a pure-ish query function (sync or async) that
takes a JSON value and returns a JSON value, and PM.query() will
execute that function in a subprocess, and return a Promise for its
return value.

StreamProcessManager is the same idea: Pass it a function to create an
ObjectReadWriteStream, and PM.createStream() will create a stream in a
subprocess and return a stream connected to it.
2018-01-18 03:34:16 -06:00
Guangcong Luo
8f3bed7e59 Make fsPath.read() return a string by default
This is an update to match how Streams work: .read() returns a string,
and .readBuffer() returns a Buffer.

Being able to statically predict what type .read() will return is
really useful to TypeScript, in addition to being generally useful for
readability.

As a side benefit, readTextIfExists() is renamed readIfExists().
2018-01-18 03:31:13 -06:00
Charlie Kobayashi
331af4e794 Refactor Modlog Formatting (#3972) 2018-01-08 15:18:24 -06:00
Kris Johnson
a6ce5c9dc1 Refactor chat-plugins and formats to for...of (#4288) 2017-12-28 05:22:28 -06:00
Jeremy Piemonte
e0c08eafba Standardize help commands (#4285) 2017-12-27 19:35:32 -06:00
HoeenHero
227f7b4741 Modlog: Fix search all rooms (#4266) 2017-12-19 15:13:56 -06:00
Guangcong Luo
193e948592 Move crashlogger.js -> lib/crashlogger.js 2017-12-16 15:40:45 -06:00
Guangcong Luo
738c60ed8b Move repl.js -> lib/repl.js 2017-12-16 15:40:45 -06:00
Guangcong Luo
a9540917f5 Move fs.js -> lib/fs.js 2017-12-16 15:40:45 -06:00
Guangcong Luo
c63e57f2e9 Defer joining restricted HTML rooms until login
This makes it so staff-only HTML rooms can defer rendering until the
user has logged in.

This also introduces a new constant `Rooms.RETRY_AFTER_LOGIN` which
makes it clearer what returning `null` means in context.
2017-12-13 23:33:33 -06:00
Guangcong Luo
32673acb59 Improve modlog link API 2017-12-12 04:26:11 -05:00
Guangcong Luo
c8ad406de5 Use new HTML-room system for Modlog 2017-12-12 03:22:09 -06:00
Guangcong Luo
800dbadd53 Use new HTML-room API for modlog 2017-11-23 05:25:14 -06:00
asgdf
a25da567ad Modlog: fix result count display being off by one (#4044) 2017-10-07 16:20:00 -05:00
Ben Davies
48230ee8fc Modlog: cap search queries at 2500 characters (#4011)
Prevents crashes in the modlog child process when PS is configured not
to use ripgrep.
2017-09-23 01:37:16 -05:00
asgdf
1ef2c6ba94 Modlog: Fix user search for usernames containing certain non-alphanum characters (#3919) 2017-08-26 12:59:16 -07:00
asgdf
b0e3ced5cc Modlog: fix various small issues (#3853)
* Don't show "More..." button if the amount of results is already less than the max
* Properly pass on whether an exact search was performed to the prettifying function
* Improve phrasing in reaction to whether an exact search was performed
* Allow "More..." button to do a literal modlog query instead of always doing a username search
* Reorder some lines pertaining to the line count so they're not needlessly scattered all over the place
2017-08-07 03:46:41 -05:00
panpawn
5a2dba75e8 Modlog: Don't hardcode LINES_SEPARATOR length (#3849) 2017-07-31 16:19:25 -04:00
panpawn
236c65aeca Modlog: Fix typo in help command (#3845) 2017-07-29 15:46:50 -04:00
panpawn
048ee759ff Modlog: Refactor line specification (#3820)
Before, if you wanted to specify how many results you wanted from a modlog search:
1. You could not search for any text
2. It was capped at 100 results

Now, we drop support for the old means of specifying lines, and instead we have a "More results..." button in modlog's UI.

We also support an undocumented means of specifying lines in the form of: /modlog [roomid], [search] [lines=integer], where integer is the number of lines of results you would like to see.
NOTE: We purposely are not documenting this behavior, as it is mostly made use of in the UI

We also update the help command here to reflect these changes.
2017-07-28 14:32:28 -04:00
panpawn
f724b355f4 Modlog: Enable command in private messages (#3817)
When dealing with reports, especially when in single panel mode, this can be useful
2017-07-22 14:00:44 -07:00
Guangcong Luo
6c40884426 Make modlog non-modal 2017-07-20 12:50:41 -05:00
HoeenHero
341648c8ea Modlog: Use a popup for no results (#3807) 2017-07-20 11:22:03 -05:00
panpawn
daf6a95fd9 Modlog: Use connection.send for sending popup (#3797) 2017-07-17 18:47:34 -05:00
HoeenHero
49d569f85f Modlog: Fix modal issue (#3796) 2017-07-17 16:55:19 -05:00
panpawn
5ae05456d9 Modlog: Make popup modal (#3783)
This will prevent the classic waiting for modlog and accidentally clicking it away
2017-07-15 06:03:39 -05:00
CheeseMuffin
69128a0205 Modlog: Fix double message in groupchats (#3749) 2017-07-10 17:00:45 +09:00
asgdf
30c766af2a Fix /modlog all (#3731) 2017-07-06 16:45:38 +09:00
Ben Davies
d09ce242a8 Modlog: crash log uncaught exceptions (#3733) 2017-07-06 15:20:14 +09:00
Guangcong Luo
ab7bd2d4e7 Fix modlog 2017-07-03 00:17:04 +09:00
Guangcong Luo
95e8bebeaf Revert "ProcessManager: refactor, fix memory leak, use Typescript (#3706)"
This reverts commit c9b93d3529.
2017-07-02 08:11:18 -04:00
Ben Davies
c9b93d3529 ProcessManager: refactor, fix memory leak, use Typescript (#3706)
- spawning and setting up child processes is now handled by
ProcessManager#constructor rather than needing to be done manually for
each module that uses ProcessManager
- direct references to ProcessManager in ProcessWrapper were removed to
prevent dead ProcessWrapper instances from being leaked when hotpatching
- process-manager.js and verifier.js now use Typescript
2017-06-30 09:09:13 +09:00
Konrad Borowski
380aced69b Use FS module for modlog (#3691) 2017-06-28 15:36:41 +08:00
asgdf
17b41a39d8 Fix crash in /modlog public (#3693) 2017-06-27 17:24:20 -07:00
asgdf
bf85c96ac4 Modlog: properly spawn processes (#3672) 2017-06-22 04:39:18 -07:00
Guangcong Luo
1d7d4ff837 Fix deprecated fs.close call signature 2017-06-19 14:54:42 -07:00
Bär Halberkamp
961ffc3f9b Upgrade eslint to 4.x (#3657) 2017-06-18 22:37:43 -07:00
asgdf
1935f220e1 Modlog: allow userid search to find names with underscores (#3654) 2017-06-18 13:50:23 -07:00
asgdf
510f912761 Modlog: don't escape characters unnecessarily (#3639) 2017-06-15 11:25:55 -05:00
asgdf
6631aced03 Modlog: properly trim and sanitize search string (#3606) 2017-06-11 22:37:01 -05:00
panpawn
f3d5e59103 Modlog: Fix when to link in modlog output (#3613)
Orda-Y pointed this out; basically, it should be like this "since hidden rooms still give roomlog access"
2017-06-11 22:33:31 -05:00
panpawn
602560a132 Modlog: Add permission checking back
This was not included in the recent modlog refactor
2017-06-11 21:06:11 +02:00
Konrad Borowski
ece7db83fd Improve regex escaping in modlog (#3607) 2017-06-11 10:05:25 -05:00
asgdf
92c0a84dc8 Fix modlog (#3603) 2017-06-11 01:25:48 -05:00
asgdf
c25d23a7f0 Refactor modlog (#3569) 2017-06-10 12:32:55 -05:00