diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 165fc5226..630786ae9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,14 +11,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub uses: docker/login-action@v2 @@ -31,5 +31,5 @@ jobs: with: tags: enigmabbs/enigma-bbs:latest file: docker/Dockerfile - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true \ No newline at end of file diff --git a/LICENSE.TXT b/LICENSE.TXT index c2ae489c5..2cb867d73 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -1,4 +1,4 @@ -Copyright (c) 2015-2023, Bryan D. Ashby +Copyright (c) 2015-2024, Bryan D. Ashby All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index ced993660..96292c142 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ ENiGMA has been tested with many terminals. However, the following are suggested ## License Released under the [BSD 2-clause](https://opensource.org/licenses/BSD-2-Clause) license: -Copyright (c) 2015-2023, Bryan D. Ashby +Copyright (c) 2015-2024, Bryan D. Ashby All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/art/themes/luciano_blocktronics/CONFSCR.ANS b/art/themes/luciano_blocktronics/CONFSCR.ANS index e3db0cbb0..1c010f6a5 100644 Binary files a/art/themes/luciano_blocktronics/CONFSCR.ANS and b/art/themes/luciano_blocktronics/CONFSCR.ANS differ diff --git a/art/themes/luciano_blocktronics/NUA.ANS b/art/themes/luciano_blocktronics/NUA.ANS index b57cc0568..7693f0a70 100644 Binary files a/art/themes/luciano_blocktronics/NUA.ANS and b/art/themes/luciano_blocktronics/NUA.ANS differ diff --git a/core/color_codes.js b/core/color_codes.js index 5c81f3ec1..9c3e4192d 100644 --- a/core/color_codes.js +++ b/core/color_codes.js @@ -98,6 +98,9 @@ function ansiSgrFromCnetStyleColorCode(cc) { } function renegadeToAnsi(s, client) { + if (!s) { + return ''; + } if (-1 == s.indexOf('|')) { return s; // no pipe codes present } diff --git a/core/connect.js b/core/connect.js index 489fd1874..911353e68 100644 --- a/core/connect.js +++ b/core/connect.js @@ -234,7 +234,7 @@ function displayBanner(term) { // note: intentional formatting: term.pipeWrite(` |06Connected to |02EN|10i|02GMA|10½ |06BBS version |12|VN -|06Copyright (c) 2014-2023 Bryan Ashby |14- |12http://l33t.codes/ +|06Copyright (c) 2014-2024 Bryan Ashby |14- |12http://l33t.codes/ |06Updates & source |14- |12https://github.com/NuSkooler/enigma-bbs/ |00`); } diff --git a/core/qwk_mail_packet.js b/core/qwk_mail_packet.js index bf71da5af..831199312 100644 --- a/core/qwk_mail_packet.js +++ b/core/qwk_mail_packet.js @@ -1076,7 +1076,7 @@ class QWKPacketWriter extends EventEmitter { } // First block is a space padded ID - const id = `Created with ENiGMA 1/2 BBS v${enigmaVersion} Copyright (c) 2015-2023 Bryan Ashby`; + const id = `Created with ENiGMA 1/2 BBS v${enigmaVersion} Copyright (c) 2015-2024 Bryan Ashby`; this.messagesStream.write( id.padEnd(QWKMessageBlockSize, ' '), 'ascii' diff --git a/core/string_util.js b/core/string_util.js index 2ff418eac..6b2b5225c 100644 --- a/core/string_util.js +++ b/core/string_util.js @@ -46,6 +46,10 @@ const SIMPLE_ELITE_MAP = { }; function stylizeString(s, style) { + if (!s) { + return ''; + } + var len = s.length; var c; var i; diff --git a/core/text_view.js b/core/text_view.js index 67da1bdb1..9e73cd31a 100644 --- a/core/text_view.js +++ b/core/text_view.js @@ -173,7 +173,11 @@ TextView.prototype.setText = function (text, redraw) { if (!_.isString(text)) { // allow |text| to be numbers/etc. - text = text.toString(); + if (_.isUndefined(text) || null === text) { + text = ''; + } else { + text = text.toString(); + } } const formatObj = getPredefinedMCIFormatObject(this.client, text); diff --git a/docker/Dockerfile b/docker/Dockerfile index c09b7a5c6..e10f62610 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,19 +1,25 @@ -FROM node:18-buster-slim +FROM --platform=${BUILDPLATFORM:-linux/amd64} node:20-bookworm-slim + +ARG TARGETPLATFORM +ARG BUILDPLATFORM +ARG TARGETOS +ARG TARGETBRANCH LABEL maintainer="dave@force9.org" ENV NVM_DIR /root/.nvm ENV DEBIAN_FRONTEND noninteractive -COPY . /enigma-bbs -# Do some installing! (and alot of cleaning up) keeping it in one step for less docker layers -# - if you need to debug i recommend to break the steps with individual RUNs) + +# Just copy the package.json so it only needs to build once +COPY package.json /enigma-bbs/ + +# Install APT and NPM packages RUN apt-get update \ && apt-get install -y \ git \ curl \ build-essential \ - python \ python3 \ libssl-dev \ lrzsz \ @@ -22,9 +28,21 @@ RUN apt-get update \ unrar-free \ p7zip-full \ dos2unix \ + && npm set progress=false && npm config set depth 0 \ && npm install -g npm@latest \ && npm install -g pm2 \ - && cd /enigma-bbs && npm install \ + && cd /enigma-bbs && npm install + + +# Do this after npm install to avoid cache-miss on every code change +COPY . /enigma-bbs + +# Then run post source copy steps that have to happen every time +RUN dos2unix /enigma-bbs/docker/bin/docker-entrypoint.sh \ + && apt-get remove dos2unix -y \ + && chmod +x /enigma-bbs/docker/bin/docker-entrypoint.sh \ + && cp -f /enigma-bbs/docker/bin/sexyz /usr/local/bin \ + && cd /enigma-bbs \ && pm2 start main.js \ && mkdir -p /enigma-bbs-pre/art \ && mkdir /enigma-bbs-pre/mods \ @@ -32,16 +50,11 @@ RUN apt-get update \ && cp -rp art/* ../enigma-bbs-pre/art/ \ && cp -rp mods/* ../enigma-bbs-pre/mods/ \ && cp -rp config/* ../enigma-bbs-pre/config/ \ - && apt-get remove build-essential python python3 libssl-dev git curl -y \ + && apt-get remove build-essential python3 libssl-dev git curl -y \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ && apt-get clean -# sexyz -COPY docker/bin/sexyz /usr/local/bin -RUN dos2unix /enigma-bbs/docker/bin/docker-entrypoint.sh && apt-get remove dos2unix -y -RUN chmod +x /enigma-bbs/docker/bin/docker-entrypoint.sh - # enigma storage mounts VOLUME /enigma-bbs/art VOLUME /enigma-bbs/config diff --git a/docs/_docs/admin/administration.md b/docs/_docs/admin/administration.md index 63ffb7a21..8bd308df6 100644 --- a/docs/_docs/admin/administration.md +++ b/docs/_docs/admin/administration.md @@ -15,9 +15,9 @@ Monitor your system via the [Waiting For Caller (WFC)](../modding/wfc.md) screen User management is currently handled via the [oputil CLI](oputil.md). ## Backing Up Your System -It is *highly* recommended to perform **regular backups** of your system. Nothing is worse than spending a lot of time setting up a system only to have to go away unexpectedly! +It is *highly* recommended to perform **regular backups** of your system. Nothing is worse than spending a lot of time setting up a system only to have it go away unexpectedly! -In general, simply creating a copy/archive of your system is enough for the default configuration. If you have changed default paths to point outside of your main ENiGMA½ installation take special care to ensure these are preserved as well. Database files may be in a state of flux when simply copying files. See [Database Backups](#database-backups) below for details on consistent backups. +In general, simply creating a copy/archive of your system is enough for the default configuration. If you have changed default paths to point outside of your main ENiGMA½ installation, take special care to ensure these are preserved as well. Database files may be in a state of flux when simply copying files. See [Database Backups](#database-backups) below for details on consistent backups. ### Database Backups [SQLite's CLI backup command](https://sqlite.org/cli.html#special_commands_to_sqlite3_dot_commands_) can be used for creating database backup files. This can be performed as an additional step to a full backup to ensure the database is backed up in a consistent state (whereas simply copying the files does not make any guarantees). diff --git a/docs/_docs/admin/oputil.md b/docs/_docs/admin/oputil.md index f1463cc93..a78210d7f 100644 --- a/docs/_docs/admin/oputil.md +++ b/docs/_docs/admin/oputil.md @@ -34,7 +34,7 @@ Commands break up operations by groups: Global arguments apply to most commands and actions: * `--config`: Specify configuration directory if it is not the default of `./config/`. -* `--no-prompt`: Assume defaults and do not prompt when posisible. +* `--no-prompt`: Assume defaults and do not prompt when possible. Type `./oputil.js --help` for additional help on a particular command. The following sections will describe them. diff --git a/docs/_docs/installation/hardware/rpi.md b/docs/_docs/installation/hardware/rpi.md index 17fd6b5de..2dd591cd0 100644 --- a/docs/_docs/installation/hardware/rpi.md +++ b/docs/_docs/installation/hardware/rpi.md @@ -18,10 +18,10 @@ to get it written to an SD card. 2. Enable SSH (option 5, option P2) 3. Expand the filesystem to use the entire SD card (option 7, option A1) -3. Update & upgrade all packages: `apt-get update && apt-get upgrade` +3. Update & upgrade all packages: `sudo apt-get update && sudo apt-get upgrade` -4. Install required packages: `sudo apt install lrzsz p7zip-full` +4. Install required packages: `sudo apt install git lrzsz p7zip-full` -5. Follow the [installation instructions](../installation/) to install ENiGMA½. +5. Follow the [installation instructions](../install-script.html) to install ENiGMA½. 6. Profit! diff --git a/docs/_docs/installation/testing.md b/docs/_docs/installation/testing.md index fb095c752..4c5fb6896 100644 --- a/docs/_docs/installation/testing.md +++ b/docs/_docs/installation/testing.md @@ -13,7 +13,7 @@ _Note that if you've used the [Docker](docker.md) installation method, you've al If everything went OK: ```text -ENiGMA½ Copyright (c) 2014-2023, Bryan Ashby +ENiGMA½ Copyright (c) 2014-2024, Bryan Ashby _____________________ _____ ____________________ __________\_ / \__ ____/\_ ____ \ /____/ / _____ __ \ / ______/ // /___jp! // __|___// | \// |// | \// | | \// \ /___ /_____ diff --git a/docs/_docs/modding/wfc.md b/docs/_docs/modding/wfc.md index b017caab0..11638d275 100644 --- a/docs/_docs/modding/wfc.md +++ b/docs/_docs/modding/wfc.md @@ -22,7 +22,7 @@ The system allows any user with the proper security to access the WFC / system o Adding your user to the `wfc` group: ```bash -# Repalce USERNAME with your leet +op username +# Replace USERNAME with your leet +op username ./oputil.js user group USERNAME "+wfc" ``` @@ -43,6 +43,7 @@ mainMenuWaitingForCaller: { ## Configuration ### Config Block The WFC `config` block allows for the following keys: + | Key | Required | Description | |-----|----------|-------------| | `acs` | :+1: | See [Security](#security) above. |