OpenBCM V1.08-3-g9b42 (Linux)

Packet Radio Mailbox

HB9ON

[OpenBCM Lugano JN46LA]

 Login: GUEST





  
PE1RRR > BPQ      08.09.21 06:22z 128 Lines 3839 Bytes #999 (0) @ WW
BID : 22758-PE1RRR
Read: GUEST
Subj: LinBPQ & GAMES (HowTo)
Path: HB9ON<IW8PGT<IZ3LSV<DB0ERF<DK0WUE<PE1RRR
Sent: 210908/0619Z @:PE1RRR.#NBW.NLD.EURO #:22758 [Rijen] $:22758-PE1RRR
From: PE1RRR@PE1RRR.#NBW.NLD.EURO
To  : BPQ@WW


Here is a menu and a selection of games that I have been running on a
node for a while now:

This is aimed at those with intermediate to advanced linux experience.
Inititally created on a Raspberry Pi, this can be adapted to any
Linux system, including those running Kernel based AX25 so long
as there is knowledge on how to wire ax25 port-SSID to a telnet service.

Browse/grab the shell script and games here:

https://github.com/pe1rrr/packet-scriptlets/tree/main/games


To put it together:

Dfrotz Z-Machine Emulator
=========================

Download and compile the sources of frotz, this will build "dumb-frotz",
necessary as standard frotz is not able to produce plain text.

 git clone https://github.com/DavidGriffith/frotz

The above repo contains the documentation to build the sources.


OpenBSD Inetd
=============

Install and set up the openbsd inetd to listen for a simple telnet
connection on a TCP port

sudo apt install openbsd-inetd

The textgamesmenu script included in the repo above has been tailored
to work with two ports as BPQ automatically passes the connected
callsign first before anything happens, so when someone connects over
ax25 it automatically uses their callsign in prompts and such. For
plain telnet connects (alternate port), the interactive menu will
request the user to input their callsign first.

/etc/inetd.conf:

games stream tcp nowait zorkuser /usr/local/bin/textgamemenu client ax25

ipgames stream tcp nowait zorkuser /usr/local/bin/textgamemenu client ip

Add games and ipgames to /etc/services, with a TCP port number.

E.g.

games 62000/tcp # LinBPQ Login for games

ipgames 61999/tcp # IP Login for games


Modify LinBPQ Configuration
===========================

Add a line to bpq32.cfg to assign an application that uses your BPQ
telnet port (assuming you have one configured in bpq).

There are two ways to do this in BPQ, the legacy method is to list the
TCP ports on the CMDPORT= parameter, and then specify the offset number
of that list in the APPLICATION clause.

Example CMDPORT parameters:

CMDPORT=63000 23 63001 63002 62000 63003 63004 63005 63007

Example APPLICATION definition:

APPLICATION 7,GAMES,C 10 HOST 4 S

Where 4 is the offset meaning port 63002 (CMDPORT begins at zero) in
the above example.

Where 10 is the PORTNUM of your BPQ telnet port.

The alternative way supported by v6.0.21.1 and above is simply using
the attach command in the application definition:

APPLICATION 7,GAMES,ATTACH 10 127.0.0.1 63002 S

Make sure you restart inetd and test the port by using telnet localhost
63002

Security Notes:
===============

Make sure you put the games in a directory that is owned by the user ID
running the dfrotz emulator. I run the dfrotz under a unique user ID
'zorkuser' that has its shell set to rbash (restricted bash) with
rbash set up according to the link below:

See https://veliovgroup.com/article/BmtWycSfZL37zXMZc/how-to-rbash

The dfrotz emulator can write save files anywhere on the filesystem
where the userid has permission to do so, so be careful when
implementing this before exposing it to the world and the potential
dangers that come with that.

Example:

drwxr-xr-x 3 myuserid myuserid 4096 Jan 31 19:32 games

drwxr-xr-x 2 zorkuser zorkuser 4096 Jan 5 09:07 saves

As the game files are owned by myuserid rather than the 'zorkuser' ID
that dfrotz is running, dfrotz won't be able to overwrite the game
files with save files if someone malicious tries to do that.

For simplicity, a symlink to the saves directory from the filesystem
root is practical to use as it is always required to type out the full
path to a save file in dfrotz. It can make it a lot shorter and easier
to remember with a symlink.

ln -s /saves /path/to/actual/saves



--
PE1RRR <PE1RRR@PE1RRR.#NBW.NLD.EURO>


Read previous mail | Read next mail


 05.05.2024 08:15:57zGo back Go up