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 12, 2023
2 parents de4e3a1 + c84b3ee commit 2bf4540
Show file tree
Hide file tree
Showing 41 changed files with 801 additions and 770 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"features": {
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"version": "latest"
"version": "3.11"
},
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/jungaretti/features/ripgrep:1": {},
Expand Down
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ logs/
mail/
node_modules/
docs/_site/
docs/.sass-cache/
docs/.sass-cache/

docs/.jekyll-cache/
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"configurations": [
{
"type": "node",
"runtimeExecutable": "/home/nuskooler/.local/share/rtx/installs/nodejs/16.20.2/bin/node",
"request": "launch",
"name": "Launch Program",
"skipFiles": ["<node_internals>/**"],
Expand Down
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ fileBaseListEntriesNoResults: {
See also: [Menu Modules](./docs/_docs/modding/menu-module.md).


* 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
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 @@ -344,7 +344,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 @@ -418,7 +418,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 @@ -620,7 +620,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 @@ -786,7 +786,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 @@ -1217,7 +1217,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.
28 changes: 10 additions & 18 deletions core/config_default.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,15 @@ module.exports = () => {
//
// 1 - Generate a Private Key (PK):
// Currently ENiGMA 1/2 requires a PKCS#1 PEM formatted PK.
// To generate a secure PK, issue the following command:
//
// > openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 \
// -pkeyopt rsa_keygen_pubexp:65537 | openssl rsa \
// -out ./config/security/ssh_private_key.pem -aes128
//
// (The above is a more modern equivalent of the following):
// > openssl genrsa -aes128 -out ./config/security/ssh_private_key.pem 2048
// For information on generating a key, see:
// https://nuskooler.github.io/enigma-bbs/servers/loginservers/ssh.html#generate-a-ssh-private-key
//
// 2 - Set 'privateKeyPass' to the password you used in step #1
//
// 3 - Finally, set 'enabled' to 'true'
//
// Additional reading:
// - https://blog.sleeplessbeastie.eu/2017/12/28/how-to-generate-private-key/
// - https://gist.github.com/briansmith/2ee42439923d8e65a266994d0f70180b
// - https://nuskooler.github.io/enigma-bbs/servers/loginservers/ssh.html
//
privateKeyPem: paths.join(
__dirname,
Expand All @@ -238,14 +231,18 @@ module.exports = () => {
//
algorithms: {
kex: [
'curve25519-sha256',
'[email protected]',
'ecdh-sha2-nistp256',
'ecdh-sha2-nistp384',
'ecdh-sha2-nistp521',
'diffie-hellman-group14-sha1',
'diffie-hellman-group1-sha1',
// Group exchange not currnetly supported
// 'diffie-hellman-group-exchange-sha256',
// 'diffie-hellman-group-exchange-sha1',
'curve25519-sha256',
'[email protected]',
'ecdh-sha2-nistp256',
'ecdh-sha2-nistp384',
'ecdh-sha2-nistp521',
],
cipher: [
'aes128-ctr',
Expand All @@ -258,12 +255,7 @@ module.exports = () => {
'aes256-cbc',
'aes192-cbc',
'aes128-cbc',
'blowfish-cbc',
'3des-cbc',
'arcfour256',
'arcfour128',
'cast128-cbc',
'arcfour',
],
hmac: [
'hmac-sha2-256',
Expand Down
6 changes: 4 additions & 2 deletions core/door.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ module.exports = class Door {
run(exeInfo, cb) {
this.encoding = (exeInfo.encoding || 'cp437').toLowerCase();

if ('socket' === this.io && !this.sockServer) {
return cb(Errors.UnexpectedState('Socket server is not running'));
if ('socket' === this.io) {
if (!this.sockServer) {
return cb(Errors.UnexpectedState('Socket server is not running'));
}
} else if ('stdio' !== this.io) {
return cb(Errors.Invalid(`"${this.io}" is not a valid io type!`));
}
Expand Down
16 changes: 14 additions & 2 deletions core/fse.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ exports.FullScreenEditorModule =
);
if (errMsgView) {
if (err) {
errMsgView.setText(err.friendlyText);
errMsgView.clearText();
errMsgView.setText(err.friendlyText || err.message);

if (MciViewIds.header.subject === err.view.getId()) {
// :TODO: for "area" mode, should probably just bail if this is emtpy (e.g. cancel)
}
} else {
errMsgView.clearText();
}
Expand All @@ -208,6 +213,13 @@ exports.FullScreenEditorModule =
return cb(null);
},
editModeEscPressed: function (formData, extraArgs, cb) {
const errMsgView = self.viewControllers.header.getView(
MciViewIds.header.errorMsg
);
if (errMsgView) {
errMsgView.clearText();
}

self.footerMode =
'editor' === self.footerMode ? 'editorMenu' : 'editor';

Expand Down Expand Up @@ -1085,7 +1097,7 @@ exports.FullScreenEditorModule =
posView.setText(
_.padStart(String(pos.row + 1), 2, '0') +
',' +
_.padEnd(String(pos.col + 1), 2, '0')
_.padStart(String(pos.col + 1), 2, '0')
);
this.client.term.rawWrite(ansi.restorePos());
}
Expand Down
2 changes: 1 addition & 1 deletion core/ftn_address.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ module.exports = class Address {
static fromString(addrStr) {
const m = FTN_ADDRESS_REGEXP.exec(addrStr);

if (m) {
if (m && m[2] && m[3]) {
// start with a 2D
let addr = {
net: parseInt(m[2]),
Expand Down
5 changes: 5 additions & 0 deletions core/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,11 @@ module.exports = class Message {
}

persist(cb) {
const containsNonWhitespaceCharacterRegEx = /\S/;
if (!containsNonWhitespaceCharacterRegEx.test(this.message)) {
return cb(Errors.Invalid('Empty message'));
}

if (!this.isValid()) {
return cb(Errors.Invalid('Cannot persist invalid message!'));
}
Expand Down
59 changes: 49 additions & 10 deletions core/msg_area_post_fse.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,39 @@ exports.moduleInfo = {
author: 'NuSkooler',
};

const MciViewIds = {
header: {
from: 1,
to: 2,
subject: 3,
errorMsg: 4,
modTimestamp: 5,
msgNum: 6,
msgTotal: 7,

customRangeStart: 10, // 10+ = customs
},

body: {
message: 1,
},

// :TODO: quote builder MCIs - remove all magic #'s

// :TODO: consolidate all footer MCI's - remove all magic #'s
ViewModeFooter: {
MsgNum: 6,
MsgTotal: 7,
// :TODO: Just use custom ranges
},

quoteBuilder: {
quotedMsg: 1,
// 2 NYI
quoteLines: 3,
},
};

exports.getModule = class AreaPostFSEModule extends FullScreenEditorModule {
constructor(options) {
super(options);
Expand Down Expand Up @@ -42,19 +75,25 @@ exports.getModule = class AreaPostFSEModule extends FullScreenEditorModule {
],
function complete(err) {
if (err) {
// :TODO:... sooooo now what?
} else {
// note: not logging 'from' here as it's part of client.log.xxxx()
self.client.log.info(
{
to: msg.toUserName,
subject: msg.subject,
uuid: msg.messageUuid,
},
`User "${self.client.user.username}" posted message to "${msg.toUserName}" (${msg.areaTag})`
const errMsgView = self.viewControllers.header.getView(
MciViewIds.header.errorMsg
);
if (errMsgView) {
errMsgView.setText(err.message);
}
return cb(err);
}

// note: not logging 'from' here as it's part of client.log.xxxx()
self.client.log.info(
{
to: msg.toUserName,
subject: msg.subject,
uuid: msg.messageUuid,
},
`User "${self.client.user.username}" posted message to "${msg.toUserName}" (${msg.areaTag})`
);

return self.nextMenu(cb);
}
);
Expand Down
7 changes: 7 additions & 0 deletions core/system_view_validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ exports.validateEmailAvail = validateEmailAvail;
exports.validateBirthdate = validateBirthdate;
exports.validatePasswordSpec = validatePasswordSpec;

const emptyFieldError = () => new Error('Field cannot be empty');

function validateNonEmpty(data, cb) {
return cb(
data && data.length > 0
Expand Down Expand Up @@ -136,6 +138,11 @@ function validateGeneralMailAddressedTo(data, cb) {
// - Supported remote flavors such as FTN, email, ...
//
const addressedToInfo = getAddressedToInfo(data);

if (addressedToInfo.name.length === 0) {
return cb(emptyFieldError());
}

if (Message.AddressFlavor.Local !== addressedToInfo.flavor) {
return cb(null);
}
Expand Down
4 changes: 4 additions & 0 deletions core/text_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ TextView.prototype.setText = function (text, redraw) {
};

TextView.prototype.clearText = function () {
if (this.text) {
this.setText(this.fillChar.repeat(this.text.length));
}

this.setText('');
};

Expand Down
3 changes: 3 additions & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ GEM
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
minitest (5.19.0)
nokogiri (1.15.4-aarch64-linux)
racc (~> 1.4)
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
Expand All @@ -101,6 +103,7 @@ GEM
webrick (1.8.1)

PLATFORMS
aarch64-linux
x86_64-linux

DEPENDENCIES
Expand Down
1 change: 1 addition & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,5 @@ collections:
- admin/oputil.md
- admin/updating.md
- troubleshooting/monitoring-logs.md
- troubleshooting/ssh-troubleshooting.md

Loading

0 comments on commit 2bf4540

Please sign in to comment.