From d63032d3077e1d70bb308902f187fdfe2be2fca0 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Tue, 25 Mar 2025 06:53:23 -0700 Subject: [PATCH] et-bbs-server - Added initial et-bbs-server wrapper script a minimum configuration. Not yet tested. --- overlay/opt/emcomm-tools/bin/et-bbs-server | 90 +++++++++++++++++ .../conf/template.d/bbs/bpq32.simple.conf | 96 +++++++++++++++++++ 2 files changed, 186 insertions(+) create mode 100755 overlay/opt/emcomm-tools/bin/et-bbs-server create mode 100644 overlay/opt/emcomm-tools/conf/template.d/bbs/bpq32.simple.conf diff --git a/overlay/opt/emcomm-tools/bin/et-bbs-server b/overlay/opt/emcomm-tools/bin/et-bbs-server new file mode 100755 index 0000000..e995ef0 --- /dev/null +++ b/overlay/opt/emcomm-tools/bin/et-bbs-server @@ -0,0 +1,90 @@ +#!/bin/bash +# +# Author : Gaston Gonzalez +# Date : 25 March 2025 +# Purpose : Wrapper script for starting the BBS with PnP support +# +# Preconditions: +# 1. Supported radio and audio interface are connected and properly detected +# +# Postconditions: +# 1. Dire Wolf is started in 1200 baud packet mode +# 2. LinBPQ is started +source /opt/emcomm-tools/bin/et-common + +BBS_CONF_DIR=${HOME}/.local/share/emcomm-tools/bbs-server +BBS_CONF_FILE=${BBS_CONF_DIR}/bpq32.conf +BBS_CONF_FILE_TEMPLATE=/opt/emcomm-tools/conf/template.d/bbs/bpq32.simple.conf + +usage() { + echo "usage: $(basename $0) " + echo " " + echo " start - Start BBS" + echo " update-config - Update configuration" +} + +if [[ $# -ne 1 ]]; then + usage + exit 1 +fi + +start() { + update-config + + if [[ $? -eq 0 ]]; then + + PS_OUT=$(ps -ef | grep [d]irewolf) + if [[ $? -ne 0 ]]; then + echo -e "${RED}Can't start BBS. Dire Wolf not running.${NC}" + exit 1 + fi + + CWD_DIR=$(pwd) + + cd ${BBS_CONF_DIR} + CMD="linbpq" + et-log "Starting LinBPQ in ${BBS_CONF_DIR} with: ${CMD}" + + ${CMD} + + cd ${CWD_DIR} + + else + et-log "Error updating configuration. Can't start BBS" + exit 1 + fi +} + +update-config () { + + [ -z "$ET_USER_CONFIG" ] && ET_USER_CONFIG="${HOME}/.config/emcomm-tools/user.json" + + CALLSIGN=$(cat ${ET_USER_CONFIG} | jq -r .callsign) + GRID=$(cat ${ET_USER_CONFIG} | jq -r .grid) + WINLINK_PASSWD=$(cat ${ET_USER_CONFIG} | jq -r .winlinkPasswd) + + if [[ "${CALLSIGN}" = "N0CALL" ]]; then + echo -e "${RED}Can't start BBS. No callsign set. Run: ${WHITE}et-user${NC}." + exit 1 + fi + + echo "Updating BBS configuration: ${BBS_CONF_FILE}..." + cp -v ${BBS_CONF_FILE_TEMPLATE} ${BBS_CONF_FILE} + sed -i "s|{{ET_CALLSIGN}}|${CALLSIGN}|g" ${BBS_CONF_FILE} + sed -i "s|{{ET_WINLINK_PASSWD}}|${WINLINK_PASSWD}|g" ${BBS_CONF_FILE} + sed -i "s|{{ET_GRID}}|${GRID}|g" ${BBS_CONF_FILE} +} + +case $1 in + start) + start + ;; + update-config) + update-config + ;; + *) + echo "Invalid command." + usage + exit 1 + ;; +esac diff --git a/overlay/opt/emcomm-tools/conf/template.d/bbs/bpq32.simple.conf b/overlay/opt/emcomm-tools/conf/template.d/bbs/bpq32.simple.conf new file mode 100644 index 0000000..11034f7 --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/bbs/bpq32.simple.conf @@ -0,0 +1,96 @@ +SIMPLE +LOCATOR={{{{ET_GRID}} +NODECALL={{ET_CALLSIGN}}-7 +NODEALIAS=ETCNDE + +CTEXT: + _____ _____ ____ ____ ____ ____ +| ____|_ _/ ___| __ )| __ ) ___| +| _| | || | | _ \| _ \___ \ +| |___ | || |___| |_) | |_) |__) | +|_____| |_| \____|____/|____/____/ + +Command Description +? Show help +BBS Connect to BBS +CHAT Chat with other users +INFO Contact information +*** + +FULL_CTEXT=1 + +BTEXT: +{{ET_CALLSIGN}} ETC BPQ node +*** + +BTINTERVAL=15 + +IDMSG: +{{ET_CALLSIGN}}-7 Network node (ETC BPQ) +*** + +INFOMSG: +Welcome to the ETC BPQ node in {{ET_GRID}}. +*** + +MAPCOMMENT={{ET_CALLSIGN}} ETC BPQ Node + +IDINTERVAL=15 +NODESINTERVAL=25 + +PORT + PORTNUM=1 + ID=1200 baud packet + TYPE=ASYNC + PROTOCOL=KISS ; Use KISS for the 1200 baud packet port + IPADDR=127.0.0.1 ; Connect to direwolf on this host + TCPPORT=8001 ; Connect to direwolf on the KISS TCP port + CHANNEL=A ; single channel TNC + NOKEEPALIVES=0 + PERSIST=160 + SLOTTIME=180 + TXDELAY=270 ; The TX delay in milliseconds + TXTAIL=23 ; The TX tail delay in millisconds + QUALITY=203 ; Quality factor applied to node broadcasts + MINQUAL=201 ; Entries in the nodes table with qualities + ; greater or equal to MINQUAL will be sent on + ; this port. A value of 0 sends everything. + MAXFRAME=6 ; Max outstanding frames (1 thru 7) + FRACK=5000 ; Level 2 timout in milliseconds + RESPTIME=1000 ; Level 2 delayed ack timer in milliseconds + RETRIES=100 ; Level 2 maximum retry value + PACLEN=236 ; Default max packet length for this port + UNPROTO=FBB ; BTEXT broadcast addrs format: + ; DEST[,digi1[,digi2]] + L3ONLY=0 ; 1=No user downlink connects on this port + DIGIFLAG=1 ; Digipeat: 0=OFF, 1=ALL, 255=UI Only + DIGIPORT=0 ; Port on which to send digi'd frames + USERS=0 ; Maximum number of L2 sessions, 0 = no limit +ENDPORT + +PORT + PORTNUM=2 + ID=Telnet + DRIVER=Telnet + QUALITY=0 + CONFIG + CMS=1 + CMSCALL={{ET_CALLSIGN}} + CMSPASS= + RELAYAPPL=BBS + SECURETELNET=1 + LOGGING=1 + DisconnectOnClose=0 + TCPPORT=8010 + HTTPPORT=8012 + LOGINPROMPT=user: + PASSWORDPROMPT=password: + MAXSESSIONS=15 + CTEXT=Welcome to {{ET_CALLSIGN}}'s Telnet Server\nEnter ? for list of commands\n\n + USER=admin,{{ET_WINLINK_PASSWD}},{{ET_CALLSIGN}},"",sysop +ENDPORT + +APPLICATION 1,BBS,,{{ET_CALLSIGN}}-11,ETCBBS,255 +APPLICATION 2,CHAT,,{{ET_CALLSIGN}}-12,ETCCHT,255 +LINMAIL +LINCHAT