Mercurial > hg > rlgwebd
annotate README.txt @ 165:59e62710cbb5
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.
author | John "Elwin" Edwards |
---|---|
date | Wed, 07 Jan 2015 13:18:35 -0500 |
parents | 9f9bc41d5006 |
children | b5df69715001 |
rev | line source |
---|---|
146
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
1 ===== RLGWebD ===== |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
2 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
3 RLGWebD is a node.js app that enables playing roguelike games in the |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
4 browser. It is intended to be compatible with dgamelaunch. |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
5 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
6 Node |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
7 --- |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
8 RLGWebD currently works with Node v0.10. |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
9 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
10 It requires the 'posix', 'pty.js', and 'websocket' modules. |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
11 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
12 Installation |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
13 --- |
151 | 14 RLGWebD expects to be run in a chroot used by dgamelaunch, and it makes |
146
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
15 some assumptions about the configuration. It expects the dgamelaunch |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
16 playground to be at /dgldir inside the chroot. It expects the |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
17 in-progress files to be in /dgldir/inprogress/<gamename>. RLGWebD |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
18 creates in-progress files in those locations, and dgamelaunch must be |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
19 patched to prevent it from deleting them. |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
20 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
21 It needs the devpts filesystem mounted inside the chroot. This can be |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
22 done with a line in /etc/fstab like the following: |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
23 devpts CHROOT/dev/pts devpts newinstance,ptmxmode=666 0 0 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
24 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
25 It creates a socket in the filesystem which is used to control the |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
26 server. |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
27 |
151 | 28 The following files need to be copied into CHROOT/var/www: |
29 about.html | |
30 bell.svg | |
31 options.html | |
32 options.js | |
33 rlgterm.js | |
34 style-rlg.css | |
35 termemu.js | |
36 termemu-keys.js | |
37 tty.css | |
38 Copy index-rlg.html to CHROOT/var/www/index.html. | |
39 | |
146
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
40 sqlickrypt |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
41 --- |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
42 RLGWebD uses a separate program written in C to operate on the |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
43 dgamelaunch user database. Compile this with: |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
44 cc -o sqlickrypt sqlickrypt.c -lcrypt -lsqlite3 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
45 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
46 The binary should be placed in /bin inside the chroot. It requires |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
47 libcrypt and libsqlite3 to be installed in the chroot. Depending on |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
48 your system, these may have other dependencies. Make sure to check by |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
49 running ldd. |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
50 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
51 sqlickrypt needs /dev/urandom to exist in the chroot. Run as root: |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
52 mknod CHROOT/dev/urandom c 1 9 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
53 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
54 Starting and stopping |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
55 --- |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
56 Run the 'rlgwebd' shell script as root. |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
57 |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
58 Stop by passing 'stop' as an argument. (This requires socat to be |
5baa2d4d798b
Add a README though it's still incomplete.
John "Elwin" Edwards
parents:
diff
changeset
|
59 installed.) |
151 | 60 |
61 webtty | |
62 --- | |
63 webtty.js is a Node app which uses the terminal emulator to run a shell. It | |
64 includes NO SECURITY WHATSOEVER and should only be used for testing the | |
65 terminal emulator. Copy index-sh.html to index.html before running it. |