76 lines
2.8 KiB
Text
76 lines
2.8 KiB
Text
===== RLGWebD =====
|
|
|
|
RLGWebD is a node.js app that enables playing roguelike games in the
|
|
browser. It is intended to be compatible with dgamelaunch.
|
|
|
|
Node
|
|
---
|
|
RLGWebD currently works with Node v0.10.
|
|
|
|
It requires the 'posix', 'pty.js', and 'websocket' modules. Currently,
|
|
it expects them to be installed in the global location, which is
|
|
"/usr/lib/node_modules". It is planned to eventually use a different
|
|
location so that npm will not need to run as root.
|
|
|
|
init
|
|
---
|
|
RLGWebD now includes a systemd unit file, which is the recommended way
|
|
to run it. See below for more instructions.
|
|
|
|
For other init systems, a shell script is provided. This is not really
|
|
a proper initscript, but it could form the basis of one.
|
|
|
|
Configuration
|
|
---
|
|
You can change the location of the chroot, the name of the dgamelaunch
|
|
user, and the port number by editing the first few lines of the rlgwebd
|
|
script. If you change the chroot location, change it in the Makefile
|
|
too.
|
|
|
|
Installation
|
|
---
|
|
RLGWebD expects to be run in a chroot used by dgamelaunch, and it makes
|
|
some assumptions about the configuration. It expects the dgamelaunch
|
|
playground to be at /dgldir inside the chroot. It expects the
|
|
in-progress files to be in /dgldir/inprogress/<gamename>. RLGWebD
|
|
creates in-progress files in those locations, and dgamelaunch must be
|
|
patched to prevent it from deleting them.
|
|
|
|
It needs the devpts filesystem mounted inside the chroot. This can be
|
|
done with a line in /etc/fstab like the following:
|
|
devpts CHROOT/dev/pts devpts newinstance,ptmxmode=666 0 0
|
|
|
|
RLGWebD uses two separate programs written in C. sqlickrypt operates
|
|
on the dgamelaunch user database. dglwatcher monitors the inprogress
|
|
directories. Run "make" to build both of them.
|
|
|
|
sqlickrypt needs /dev/urandom to exist in the chroot. Run as root:
|
|
mknod CHROOT/dev/urandom c 1 9
|
|
|
|
Running "make install" will:
|
|
Copy the Web assets into the chroot
|
|
Copy the C programs and the libraries they need into the chroot
|
|
Install the main RLGWebD script in /usr/local/bin
|
|
Place the systemd unit file in the proper directory
|
|
|
|
If you don't use systemd, or want to change the installation locations,
|
|
you will have to edit the Makefile.
|
|
|
|
You will still need to run "systemctl enable rlgwebd" to make the
|
|
server start on boot, and "systemctl start rlgwebd" to make it start
|
|
immediately.
|
|
|
|
Starting and stopping RLGWebD
|
|
---
|
|
If you are using systemd, "systemctl start" and "systemctl stop" should
|
|
work as with any other service.
|
|
|
|
If you are using the initscript, running it with no arguments will
|
|
start RLGWebD. Stop by running it with 'stop' as an argument. (This
|
|
requires socat to be installed.)
|
|
|
|
webtty
|
|
---
|
|
webtty.js is a Node app which uses the terminal emulator to run a shell. It
|
|
includes NO SECURITY WHATSOEVER and should only be used for testing the
|
|
terminal emulator. Copy index-sh.html to index.html before running it.
|