Skip to content

Commit

Permalink
Sync up with master
Browse files Browse the repository at this point in the history
  • Loading branch information
NuSkooler committed Oct 13, 2023
2 parents ca985dd + c84b3ee commit 83636cb
Show file tree
Hide file tree
Showing 62 changed files with 511 additions and 167 deletions.
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM library/node:lts-bookworm

ARG DEBIAN_FRONTEND=noninteractive
RUN apt update \
&& apt install -y --no-install-recommends sudo telnet \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& echo "node ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/node \
&& chmod 0440 /etc/sudoers.d/node
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "Basic Node.js",
"build": { "dockerfile": "Dockerfile" },
"remoteUser": "root",
"forwardPorts": [8888, 4000],
"postCreateCommand": "gem install jekyll bundler && /bin/rm -rf node_modules && npm install && cd docs && bundle install && cd ..",
"features": {
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"version": "3.11"
},
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/jungaretti/features/ripgrep:1": {},
"ghcr.io/warrenbuckley/codespace-features/sqlite:1": {},
"ghcr.io/devcontainers/features/ruby:1": {
"version": "3.1"
}
},
"customizations": {
"vscode": {
"extensions": ["ms-azuretools.vscode-docker","alexcvzz.vscode-sqlite","yzhang.markdown-all-in-one", "DavidAnson.vscode-markdownlint", "christian-kohler.npm-intellisense", "dbaeumer.vscode-eslint", "bierner.markdown-yaml-preamble"]
}
}
}
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
package-lock.json
yarn.lock

filebase
db
drop
file_base
logs
mail
docs/_site
docs/.sass-cache
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@
*.TXT eol=crlf
*.diz eol=crlf
*.DIZ eol=crlf

# Don't mess with shell script line endings
*.sh text eol=lf

# Same thing for optutil.js which functions as a shell script
optutil.js text eol=lf

# The devcontainer is also unix
.devcontainer/Dockerfile text eol=lf
.devcontainer/devcontainer.json text eol=lf
10 changes: 5 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
tags: enigmabbs/enigma-bbs:latest
file: docker/Dockerfile
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ mail/
node_modules/
docs/_site/
docs/.sass-cache/
.vscode/

docs/.jekyll-cache/
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-vscode-remote.remote-containers",
"laktak.hjson"
]
}
26 changes: 26 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Jekyll (ENiGMA½ documentation server)",
"command": "cd docs && bundle exec jekyll serve",
"isBackground": true,
"type": "shell"
},
{
"label": "(re)build Jekyll bundles",
"command": "cd docs && bundle install",
"type": "shell"
},
{
"label": "(re)build node modules",
"command": "/bin/rm -rf node_modules && npm install",
"type": "shell"
},
{
"label": "ENiGMA½ new configuration",
"command": "./oputil.js config new",
"type": "shell"
}
]
}
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ npm install # or simply 'yarn'
## 0.0.13-beta to 0.0.14-beta

* Due to changes to supported algorithms in newer versions of openssl, the default list of supported algorithms for the ssh login server has changed. There are both removed ciphers as well as optional new kex algorithms available now. ***NOTE:*** Changes to supported algorithms are only needed to support keys generated with new versions of openssl, if you already have a ssl key in use you should not have to make any changes to your config.
* Removed ciphers: 'blowfish-cbc', 'arcfour256', 'arcfour128', and 'cast128-cbc'
* Added kex: 'curve25519-sha256', '[email protected]', 'curve25519-sha256', '[email protected]', 'ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521'

## 0.0.12-beta to 0.0.13-beta
* To enable the new Waiting for Caller (WFC) support, please see [WFC](docs/modding/wfc.md).
* :exclamation: The SSH server's `ssh2` module has gone through a major upgrade. Existing users will need to comment out two SSH KEX algorithms from their `config.hjson` if present else clients such as NetRunner will not be able to connect over SSH. Comment out `diffie-hellman-group-exchange-sha256` and `diffie-hellman-group-exchange-sha1`
Expand Down
2 changes: 2 additions & 0 deletions WHATSNEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This document attempts to track **major** changes and additions in ENiGMA½. For
* Finally, the system will search for `index.html` and `index.htm` in that order, if another suitable route cannot be established.
* CombatNet has shut down, so the module (`combatnet.js`) has been removed.
* The Menu Flag `popParent` has been removed and `noHistory` has been updated to work as expected. In general things should "Just Work", but check your `menu.hjson` entries if you see menu stack issues.
* Various New User Application (NUA) properties are now optional. If you would like to reduce the information users are required, remove optional fields from NUA artwork and collect less. These properties will be stored as "" (empty). Optional properties are as follows: Real name, Birth date, Sex, Location, Affiliations (Affils), Email, and Web address.
* Art handling has been changed to respect the art width contained in SAUCE when present in the case where the terminal width is greater than the art width. This fixes art files that assume wrapping at 80 columns on wide (mostly new utf8) terminals.

## 0.0.13-beta
* **Note for contributors**: ENiGMA has switched to [Prettier](https://prettier.io) for formatting/style. Please see [CONTRIBUTING](CONTRIBUTING.md) and the Prettier website for more information.
Expand Down
Binary file modified art/themes/luciano_blocktronics/2FACONFSCR.ans
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/BBSADD.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/BBSLIST.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/FBLISTEXP.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/FDLMGR.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/FWDLMGR.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/MSGLIST.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/MSRCHLST.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/MYMSGLST.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/NEWMSGS.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/ONELINER.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/PRVMSGLIST.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/STATUS.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/SYSSTAT.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/ULDETAIL.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/USERLST.ANS
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/WHOSON.ANS
Binary file not shown.
12 changes: 6 additions & 6 deletions art/themes/luciano_blocktronics/theme.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
}
mci: {
VM1: {
height: 15,
height: 14
width: 50
itemFormat: "|00|11{userName:<17.17}|03{affils:<21.21}|11{location:<19.19}|03{lastLoginTs}"
focusItemFormat: "|00|19|15{userName:<17.17}{affils:<21.21}{location:<19.19}{lastLoginTs}"
Expand Down Expand Up @@ -343,7 +343,7 @@
}
mci: {
VM1: {
height: 14
height: 13
width: 70
itemFormat: "|00|15{msgNum:>4} |03{subject:<28.27} |11{fromUserName:<20.20} |03{ts:<15.16} |15{newIndicator}"
focusItemFormat: "|00|19|15{msgNum:>4} {subject:<28.27} {fromUserName:<20.20} {ts:<15.16} {newIndicator}"
Expand Down Expand Up @@ -416,7 +416,7 @@
}
mci: {
VM1: {
height: 14
height: 12
width: 70
itemFormat: "|00|15{msgNum:>4} |03{subject:<28.27} |11{fromUserName:<20.20} |03{ts} |15{newIndicator}"
focusItemFormat: "|00|19|15{msgNum:>4} {subject:<28.27} {fromUserName:<20.20} {ts} {newIndicator}"
Expand Down Expand Up @@ -618,7 +618,7 @@
}
mci: {
VM1: {
height: 16
height: 12
width: 71
itemFormat: "|00|15 {msgNum:<4.4} |03{subject:<34.33} {fromUserName:<19.18} |03{ts:<12.12}"
focusItemFormat: "|00|19> |15{msgNum:<4.4} {subject:<34.33} {fromUserName:<19.18} {ts:<12.12}"
Expand Down Expand Up @@ -783,7 +783,7 @@
}
mci: {
VM1: {
height: 14
height: 12
width: 70
itemFormat: "|00|15 {msgNum:<5.5}|03{subject:<28.27} |15{fromUserName:<20.20} {ts}"
focusItemFormat: "|00|19> |15{msgNum:<5.5}{subject:<28.27} {fromUserName:<20.20} {ts}"
Expand Down Expand Up @@ -1214,7 +1214,7 @@
2: {
mci: {
MT1: {
height: 14
height: 13
width: 45
}

Expand Down
Binary file modified art/themes/luciano_blocktronics/wfc.ans
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/wfchelp.ans
Binary file not shown.
Binary file modified art/themes/luciano_blocktronics/wfckicknodeprompt.ans
Binary file not shown.
6 changes: 3 additions & 3 deletions core/achievement.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,9 @@ class Achievements {
getFormatObject(info) {
return {
userName: info.user.username,
userRealName: info.user.properties[UserProps.RealName],
userLocation: info.user.properties[UserProps.Location],
userAffils: info.user.properties[UserProps.Affiliations],
userRealName: info.user.realName(false) || 'N/A',
userLocation: info.user.properties[UserProps.Location] || 'N/A',
userAffils: info.user.properties[UserProps.Affiliations] || 'N/A',
nodeId: info.client.node,
title: info.details.title,
//text : info.global ? info.details.globalText : info.details.text,
Expand Down
27 changes: 18 additions & 9 deletions core/ansi_escape_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function ANSIEscapeParser(options) {
this.graphicRendition = {};

this.parseState = {
re: /(?:\x1b\x5b)([?=;0-9]*?)([ABCDHJKfhlmnpsu])/g, // eslint-disable-line no-control-regex
re: /(?:\x1b\x5b)([?=;0-9]*?)([ABCDHJKfhlmnpsutEFGST])/g, // eslint-disable-line no-control-regex
};

options = miscUtil.valueWithDefault(options, {
Expand All @@ -37,6 +37,12 @@ function ANSIEscapeParser(options) {
this.mciReplaceChar = miscUtil.valueWithDefault(options.mciReplaceChar, '');
this.termHeight = miscUtil.valueWithDefault(options.termHeight, 25);
this.termWidth = miscUtil.valueWithDefault(options.termWidth, 80);
this.breakWidth = this.termWidth;
// toNumber takes care of null, undefined etc as well.
let artWidth = _.toNumber(options.artWidth);
if(!(_.isNaN(artWidth)) && artWidth > 0 && artWidth < this.breakWidth) {
this.breakWidth = options.artWidth;
}
this.trailingLF = miscUtil.valueWithDefault(options.trailingLF, 'default');

this.row = Math.min(options?.startRow ?? 1, this.termHeight);
Expand Down Expand Up @@ -90,8 +96,8 @@ function ANSIEscapeParser(options) {

switch (charCode) {
case CR:
self.emit('literal', text.slice(start, pos));
start = pos;
self.emit('literal', text.slice(start, pos + 1));
start = pos + 1;

self.column = 1;

Expand All @@ -105,22 +111,25 @@ function ANSIEscapeParser(options) {
self.column = 1;
}

self.emit('literal', text.slice(start, pos));
start = pos;
self.emit('literal', text.slice(start, pos + 1));
start = pos + 1;

self.row += 1;

self.positionUpdated();
break;

default:
if (self.column === self.termWidth) {
if (self.column === self.breakWidth) {
self.emit('literal', text.slice(start, pos + 1));
start = pos + 1;

// If we hit breakWidth before termWidth then we need to force the terminal to go to the next line.
if(self.column < self.termWidth) {
self.emit('literal', '\r\n');
}
self.column = 1;
self.row += 1;

self.positionUpdated();
} else {
self.column += 1;
Expand All @@ -135,7 +144,7 @@ function ANSIEscapeParser(options) {
//
// Finalize this chunk
//
if (self.column > self.termWidth) {
if (self.column > self.breakWidth) {
self.column = 1;
self.row += 1;

Expand Down Expand Up @@ -222,7 +231,7 @@ function ANSIEscapeParser(options) {
self.parseState = {
// ignore anything past EOF marker, if any
buffer: input.split(String.fromCharCode(0x1a), 1)[0],
re: /(?:\x1b\x5b)([?=;0-9]*?)([ABCDHJKfhlmnpsu])/g, // eslint-disable-line no-control-regex
re: /(?:\x1b\x5b)([?=;0-9]*?)([ABCDHJKfhlmnpsutEFGST])/g, // eslint-disable-line no-control-regex
stop: false,
};
};
Expand Down
13 changes: 12 additions & 1 deletion core/art.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,21 @@ const SUPPORTED_ART_TYPES = {
};

function getFontNameFromSAUCE(sauce) {
if (sauce.Character) {
if (sauce && sauce.Character) {
return sauce.Character.fontName;
}
}

function getWidthFromSAUCE(sauce) {
if (sauce && sauce.Character) {
let sauceWidth = _.toNumber(sauce.Character.characterWidth);
if(!(_.isNaN(sauceWidth)) && sauceWidth > 0) {
return sauceWidth;
}
}
return null;
}

function sliceAtEOF(data, eofMarker) {
let eof = data.length;
const stopPos = Math.max(data.length - 256, 0); // 256 = 2 * sizeof(SAUCE)
Expand Down Expand Up @@ -274,6 +284,7 @@ function display(client, art, options, cb) {
mciReplaceChar: options.mciReplaceChar,
termHeight: client.term.termHeight,
termWidth: client.term.termWidth,
artWidth: getWidthFromSAUCE(options.sauce),
trailingLF: options.trailingLF,
startRow: options.startRow,
});
Expand Down
2 changes: 1 addition & 1 deletion core/client_connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function getActiveConnectionList(
//
entry.text = ac.user?.username || 'N/A';
entry.userName = ac.user?.username || 'N/A';
entry.realName = ac.user?.getProperty(UserProps.RealName) || 'N/A';
entry.realName = ac.user?.realName(false) || 'N/A';
entry.location = ac.user?.getProperty(UserProps.Location) || 'N/A';
entry.affils = entry.affiliation =
ac.user?.getProperty(UserProps.Affiliations) || 'N/A';
Expand Down
Loading

0 comments on commit 83636cb

Please sign in to comment.