view README.txt @ 213:08665c56c6a0 default tip

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.
author John "Elwin" Edwards
date Sun, 16 Aug 2020 20:56:18 -0400
parents b04313038a0b
children
line wrap: on
line source

                        =====   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 is currently being updated to work with Node v10.x.

It requires the 'posix', 'node-pty', and 'websocket' modules.  Currently,
it expects them to be installed in "/var/local/lib/node_modules".  It
is not recommended to run npm as root when installing the modules.

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
---
A configuration file is installed at /etc/rlgwebd.conf.  It contains a
list of options.

If the domain_name option and the SSL-related options are set, rlgwebd
will use HTTPS instead of insecure HTTP.

If you change the chroot location, change it in the first line of 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
  Copy a configuration file into /etc

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" 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.

Copyright status
---
All files in this project are in the public domain.