John "Elwin" Edwards
29f17aa874
Fix race condition related to watching DGL games.
...
It's possible for a dgamelaunch game to end and cause rlgwebd to stop watching
it before rlgwebd has started watching it.
2020-08-16 20:56:18 -04:00
John "Elwin" Edwards
c38fb5d107
rlgwebd: use some newer Javascript features.
2020-04-03 15:15:02 -04:00
John "Elwin" Edwards
9004afebdc
Terminal emulation: implement the CSI b sequence.
...
CSI b repeats the previous character, if it was printable and not an
escape sequence.
2019-09-05 15:19:27 -04:00
John "Elwin" Edwards
f2256500e1
Changes for compatibility with recent versions of NodeJS.
...
The pty.js module is replaced with node-pty, now-mandatory callbacks
are added to various fs functions, and deprecated Buffer() calls are
replaced with Buffer.from() or Buffer.alloc().
2019-08-25 21:27:31 -04:00
John "Elwin" Edwards
4940bf86ae
Move the NODE_PATH location.
...
Modules are now expected to be in /var/local/lib/node_modules. This is
intended to make it easier to avoid running npm as root.
2017-12-26 13:23:55 -05:00
John "Elwin" Edwards
4059bf2983
Fix possibly insecure permissions on the control socket.
...
The server's control socket is now in a private directory.
2017-01-28 09:57:31 -05:00
John "Elwin" Edwards
c4d10ba33d
rlgwebd-stop: avoid the deprecated domain module.
...
Instead of catching connection errors with domains, install an error
listener on the socket before connecting.
2017-01-27 19:18:31 -05:00
John "Elwin" Edwards
2f40fc5387
RLGWebD: replace deprecated fs.exists() with fs.access().
2017-01-27 15:43:10 -05:00
John "Elwin" Edwards
c824ea924c
Fix syntax error in Makefile.
2017-01-12 19:02:20 -05:00
John "Elwin" Edwards
5b790718d8
Use either HTTP or HTTPS.
...
If HTTPS is enabled, RLGWebD will not use insecure HTTP.
2017-01-08 16:17:11 -05:00
John "Elwin" Edwards
2e9d5071d9
Fail cleanly if necessary files can't be opened.
2017-01-04 21:25:43 -05:00
John "Elwin" Edwards
61ddb2eaea
Move RLGWebD configuration options into a configuration file.
...
On startup, rlgwebd now reads /etc/rlgwebd.conf. If the options for
HTTPS are not found, it will only use HTTP.
2017-01-04 20:28:29 -05:00
John "Elwin" Edwards
37bd2e8c28
Initial support for TLS.
...
RLGWebD now serves via encrypted connections on port 8081.
The client-side script now uses secure WebSockets if the page is being
accessed via HTTPS.
2017-01-01 20:18:01 -05:00
John "Elwin" Edwards
2baaad79dd
Actually restart RLGWebD if it crashes.
...
Also, rlgwebd-stop will no longer crash if RLGWebD has already stopped.
2016-04-23 18:53:08 -04:00
John "Elwin" Edwards
ba487995e0
Some fixes to the documentation.
2016-02-01 21:20:12 -05:00
John "Elwin" Edwards
a94e700b58
Make sure games have saved and exited before stopping the server.
...
This should make the systemd version safe for production, though
it can't yet deal with a game that hangs and doesn't exit.
2016-01-28 21:17:06 -05:00
John "Elwin" Edwards
48e068778e
Update the documentation.
2016-01-14 21:31:23 -05:00
John "Elwin" Edwards
3b00718e59
Add an uninstall target to the Makefile.
...
Also a fix to the install target, and the initscript.
2016-01-14 21:30:14 -05:00
John "Elwin" Edwards
6457f18b36
Change various filenames.
...
The shell script previously used to launch the daemon is now called
"initscript". The script files have had the ".js" extension removed
from their names.
2016-01-14 20:52:29 -05:00
John "Elwin" Edwards
ff0814c7ac
RLGWebD: move the control socket into /var/run.
...
This is a more standard location. /run is preferred by systemd, but
portability to non-systemd systems is important.
2016-01-14 19:10:46 -05:00
John "Elwin" Edwards
9a709adc58
Add a script to stop RLGWebD.
...
socat is no longer needed, nor is preventing systemd from sending
signals.
2016-01-02 14:33:48 -05:00
John "Elwin" Edwards
ec5c79d46e
Begin adding systemd compatibility.
...
The Makefile can be used to build and install rlgwebd. On systems with
systemd, the unit file controls starting and stopping the service, and
the shell script is not needed.
The unit file uses KillMode=none because socat does not actually stop
rlgwebd, it only asks it to stop and exits without waiting for a
response. Until a better stopping method is introduced, this setting
prevents systemd from killing all the rlgwebd processes as soon as
socat exits.
2016-01-01 16:11:34 -05:00
John "Elwin" Edwards
bf9661169d
Add support for Advanced Rogue 7 and XRogue.
2015-06-23 12:09:02 -04:00
John "Elwin" Edwards
e20fd76cab
Stop printing credentials in the logfile.
...
This was nice for debugging, but could lead to security problems.
2015-01-31 18:13:24 -05:00
John "Elwin" Edwards
490b1eac1e
Update the documentation, removing the betas.
2015-01-24 10:18:26 -05:00
John "Elwin" Edwards
d2b3cef6ce
Additions to the help page.
2015-01-21 17:33:30 -05:00
John "Elwin" Edwards
f2e02e930d
Fix a use of the wrong variable name.
2015-01-21 17:21:35 -05:00
John "Elwin" Edwards
4a4bb390e8
Client: improve messages at the end of watching a game.
...
The messages differentiate between the user stopping watching and the
watched game coming to an end.
2015-01-20 16:06:12 -05:00
John "Elwin" Edwards
583514764f
Finish moving DglSession methods into the prototype.
2015-01-20 10:17:05 -05:00
John "Elwin" Edwards
677d739bed
Move TermSession and DglSession common code into a base class.
2015-01-19 14:44:27 -05:00
John "Elwin" Edwards
a2bb3fe97d
Move all TermSession methods into the prototype.
2015-01-19 08:32:29 -05:00
John "Elwin" Edwards
4034ab16ef
Begin moving TermSession methods into the prototype.
...
This should make a clearer line between general functionality and the
initialization of specific instances.
2015-01-17 19:57:40 -05:00
John "Elwin" Edwards
071f4c5fbf
Print metadata at the beginning of ttyrec files.
2015-01-17 15:48:41 -05:00
John "Elwin" Edwards
a5bb3837ff
Improve the clear-command recognition.
...
xterm and screen use different control sequences to clear the screen.
Both are now recognized.
2015-01-16 08:25:25 -05:00
John "Elwin" Edwards
c0a0939b0d
Added tag beta8 for changeset b5df69715001
2015-01-14 20:45:12 -05:00
John "Elwin" Edwards
6872cd6ae1
Update the documentation.
2015-01-14 15:32:21 -05:00
John "Elwin" Edwards
e7aa19136d
Move index.html files.
...
The RLGWebD index.html no longer needs to be renamed when installing.
2015-01-14 15:16:31 -05:00
John "Elwin" Edwards
2e0cec33ba
Add client-side support for watching dgamelaunch games.
2015-01-14 07:44:22 -05:00
John "Elwin" Edwards
7332b95a30
Add server-side support for watching dgamelaunch games.
2015-01-13 20:30:10 -05:00
John "Elwin" Edwards
56024418c3
Fix further crashes when following dgamelaunch games.
...
The crashes apparently resulted from reading a ttyrec header and
then trying to read the data chunk before dgamelaunch produced it.
When the data chunk did become available, it would be read by the
header function.
The simplest solution was to store the position for reading the
ttyrec file in the DGLSession, and to leave it unchanged if anything
unexpected occurs when reading.
2015-01-12 17:10:35 +00:00
John "Elwin" Edwards
6b0ed5280b
Added tag beta7 for changeset db27b91578f0
2015-01-11 07:41:36 -05:00
John "Elwin" Edwards
e988e849a4
Update documentation and bump the version number.
2015-01-11 07:39:59 -05:00
John "Elwin" Edwards
60b83c4944
RLGWebD: fix simultaneous watcher bugs.
...
WebSockets should now only receive the intended data, no matter how
many of them there are or what they are doing. They should...
2015-01-10 18:54:55 -05:00
John "Elwin" Edwards
6373e70361
RLGWebD: fix simultaneous player bug.
...
Multiple games can now run at the same time, and data will be sent to
the proper place. The interaction of multiple players with watchers
has not yet been tested.
2015-01-09 13:06:41 -05:00
John "Elwin" Edwards
ef4cb9ac8d
rlgwebd.js: clean up TermSession parameters.
...
Use the player name instead of a login key that has already been
verified and resolved to a player name.
2015-01-09 09:43:21 -05:00
John "Elwin" Edwards
ee8782bbf4
Remove the TermSession 'open' event.
...
Failure is now signaled with a TermSession.failed flag.
Playing two games at the same time no longer causes crashes, but it
does send the same output to both players.
2015-01-09 08:55:38 -05:00
John "Elwin" Edwards
2369fa45d4
Rename watcher to dglwatcher.
2015-01-07 13:49:37 -05:00
John "Elwin" Edwards
537c227f87
watcher: exit if errors occur.
2015-01-07 13:22:05 -05:00
John "Elwin" Edwards
3c88c233b4
rlgwebd.js: prevent races when reading ttyrecs.
...
DglSession objects read a 12-byte TTYREC header, extract therefrom the
length of the data chunk, and then read the data. In between these two
reads, the file watcher could trigger another readchunk() invocation,
which might attempt to read a header from the beginning of the data
chunk. This usually results in expecting a data chunk of several GB
and failing to create a Buffer for it.
The race is remedied by setting a flag on the DglSession object
whenever readchunk() is called, clearing it when both reads complete,
and refusing to read if it is already set.
2015-01-07 13:18:35 -05:00
John "Elwin" Edwards
547387846f
rlgwebd.js: read ttyrecs created by dgamelaunch.
...
TTYREC files created by dgamelaunch are tracked by DglSession objects,
as a first step toward making them watchable.
2015-01-06 16:59:12 -05:00