diff --git a/overlay/etc/skel/notes/bbs-admin.md b/overlay/etc/skel/notes/bbs-admin.md new file mode 100644 index 0000000..eaf9ff1 --- /dev/null +++ b/overlay/etc/skel/notes/bbs-admin.md @@ -0,0 +1,17 @@ +# BBS Admin + +## Logging in as the System Operator (SysOp) + +To access the BBS as an administrator (also called the sysop), perform +the following: + +1. Launch the Min web browser. + +2. Visit http://localhost:8012. + +3. Click on "SYSOP Signin". + +4. For the user use: `admin` + +5. For the password use: your Winlink password that you set with + `et-user`. diff --git a/overlay/etc/skel/notes/OFFLINE_SITES.md b/overlay/etc/skel/notes/offline-sites.md similarity index 100% rename from overlay/etc/skel/notes/OFFLINE_SITES.md rename to overlay/etc/skel/notes/offline-sites.md 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..05abd25 --- /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.cfg +BBS_CONF_FILE_TEMPLATE=/opt/emcomm-tools/conf/template.d/bbs/bpq32.simple.cfg + +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/bin/et-mode b/overlay/opt/emcomm-tools/bin/et-mode index aaf735b..762ed3d 100755 --- a/overlay/opt/emcomm-tools/bin/et-mode +++ b/overlay/opt/emcomm-tools/bin/et-mode @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 6 November 2024 -# Updated : 18 March 2025 +# Updated : 25 March 2025 # Purpose : Configures the system for a specific mode of operation # Use a simple text file to save the state of the last mode selected @@ -16,6 +16,7 @@ MODE_ID_APRS_DIGIPEATER="aprs-digipeater" MODE_ID_APRS_CLIENT="aprs-client" MODE_ID_BBS_CLIENT="bbs-client" MODE_ID_BBS_CLIENT2="bbs-client2" +MODE_ID_BBS_SERVER="bbs-server" MODE_ID_CHAT_CLIENT="chat-chattervox" MODE_ID_PACKET_DIGIPEATER="packet-digipeater" MODE_ID_WINLINK_ARDOP="winlink-ardop" @@ -133,6 +134,7 @@ options+=("${MODE_ID_NONE}" "No mode selected") options+=("${MODE_ID_APRS_CLIENT}" "APRS Client (YAAC)") options+=("${MODE_ID_BBS_CLIENT}" "BBS Client (Paracon)") options+=("${MODE_ID_BBS_CLIENT2}" "BBS Client (QtTermTCP)") +options+=("${MODE_ID_BBS_SERVER}" "BBS Server (LinBPQ)") options+=("${MODE_ID_CHAT_CLIENT}" "Chat (chattervox)") options+=("${MODE_ID_APRS_DIGIPEATER}" "APRS Digipeater") options+=("${MODE_ID_PACKET_DIGIPEATER}" "Packet Digipeater") @@ -220,6 +222,11 @@ if [ $exit_status -eq 0 ]; then et-log "Starting QtTermTCP." et-qttermtcp start ;; + ${MODE_ID_BBS_SERVER}) + start_and_wait_for_service et-service-direwolf-simple + et-log "Starting BBS server." + et-bbs-server start + ;; ${MODE_ID_CHAT_CLIENT}) start_and_wait_for_service et-service-direwolf-simple et-log "Starting chattervox" diff --git a/overlay/opt/emcomm-tools/bin/et-system-info b/overlay/opt/emcomm-tools/bin/et-system-info index 529de30..416c79d 100755 --- a/overlay/opt/emcomm-tools/bin/et-system-info +++ b/overlay/opt/emcomm-tools/bin/et-system-info @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 6 October 2024 -# Updated : 7 February 2025 +# Updated : 25 March 2025 # Purpose : Utility script for dumping system information function usage() { @@ -178,6 +178,7 @@ case $1 in MODE_ID_APRS_DIGIPEATER="aprs-digipeater" MODE_ID_BBS_CLIENT="bbs-client" MODE_ID_BBS_CLIENT2="bbs-client2" + MODE_ID_BBS_SERVER="bbs-server" MODE_ID_CHAT_CLIENT="chat-chattervox" MODE_ID_PACKET_DIGIPEATER="packet-digipeater" MODE_ID_APRS_CLIENT="aprs-client" @@ -208,6 +209,9 @@ case $1 in ${MODE_ID_BBS_CLIENT2}) echo "BBS Client" ;; + ${MODE_ID_BBS_SERVER}) + echo "BBS Server" + ;; ${MODE_ID_CHAT_CLIENT}) echo "Chat (chattervox)" ;; diff --git a/overlay/opt/emcomm-tools/conf/template.d/bbs/bpq32.simple.cfg b/overlay/opt/emcomm-tools/conf/template.d/bbs/bpq32.simple.cfg new file mode 100644 index 0000000..6eef1f7 --- /dev/null +++ b/overlay/opt/emcomm-tools/conf/template.d/bbs/bpq32.simple.cfg @@ -0,0 +1,105 @@ +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}}. + +To leave me a message. + +1. Access the BBS by typing: bbs +2. Send a private message to me by typing: sp {{ET_CALLSIGN}} +3. Enter a title for the message when prompted, then press [ENTER]. +4. Type your message one line at a time. Press [ENTER] after each line. +5. When done, type the following on its own line: /ex +6. Press [ENTER] +*** + +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 diff --git a/scripts/install-bbs-server.sh b/scripts/install-bbs-server.sh index d1d0a25..d39c68e 100755 --- a/scripts/install-bbs-server.sh +++ b/scripts/install-bbs-server.sh @@ -1,7 +1,7 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 8 November 2024 -# Updated : 28 November 2024 +# Updated : 26 March 2025 # Purpose : Install Linbpq # # Notes: @@ -19,6 +19,36 @@ apt install ucspi-tcp -y et-log "Installing Linbpq..." +# Install the web interface for LinBPQ +HTML_ZIP_FILE=HTMLPages.zip +HTML_ZIP_URL="http://www.cantab.net/users/john.wiseman/Downloads/Beta/${HTML_ZIP_FILE}" +BBS_HOME="/etc/skel/.local/share/emcomm-tools/bbs-server" +BBS_HOME_FILES="${BBS_HOME}/Files" + +et-log "Downloading web interface for LinBPQ from ${HTML_ZIP_URL}" +curl -s -f -L -o ${HTML_ZIP_FILE} ${HTML_ZIP_URL} + +if [[ $? -eq 0 ]]; then + + CWD_DIR=$(pwd) + + et-log "Installing web interface under ${BBS_HOME}" + + [[ ! -e ${BBS_HOME_FILES} ]] && mkdir -p ${BBS_HOME_FILES} + mv ${HTML_ZIP_FILE} ${BBS_HOME} && cd ${BBS_HOME} && unzip ${HTML_ZIP_FILE} + + cd ${CWD_DIR} + + if [[ -e "${BBS_HOME}/index.htmlx" ]]; then + et-log "Web interface installation successful" + else + et-log "Web interface installation failed" + fi +else + et-log "Unable install web interface for LinBPQ" +fi + +# Install Linbpq et-log "Installing 32-bit dependencies for Linbpq..." dpkg --add-architecture i386 && apt update && apt install \ libpcap0.8-dev:i386 \ @@ -45,3 +75,4 @@ ln -s ${INSTALL_DIR} ${LINK_PATH} stow -v -d /opt linbpq -t /usr/local cd ${CWD_DIR} +