Skip to content

Commit 7d0248e

Browse files
committed
Sync with master
2 parents 59f9d54 + 6766f6e commit 7d0248e

File tree

19 files changed

+908
-494
lines changed

19 files changed

+908
-494
lines changed

.gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Don't check in SSH keys!
22
*.pem
33

4-
# Various directories
4+
# Exclude User-Customized Directories
55
config/
66
db/
77
drop/
@@ -11,5 +11,13 @@ mail/
1111
node_modules/
1212
docs/_site/
1313
docs/.sass-cache/
14-
1514
docs/.jekyll-cache/
15+
16+
# Ignore Web Assets not included with enigma-bbs
17+
www/*
18+
www/assets/*
19+
!www/otp_register_template.html
20+
!www/reset_password.template.html
21+
22+
# Runtime Environment
23+
.venv

README.md

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ENiGMA½ is a modern BBS software with a nostalgic flair!
88
Below are just some of the features ENiGMA½ supports out of the box:
99
* **Multi platform** — Anywhere [Node.js](https://nodejs.org/) runs likely works (known to work under Linux, FreeBSD, OpenBSD, OS X and Windows)
1010
* Unlimited multi node support (for all those BBS "callers"!)
11-
* **Highly customizable** via [HJSON](http://hjson.org/) based configuration, menus, and themes in addition to JavaScript based [mods](./docs/_docs/modding/existing-mods.md)
11+
* **Highly customizable** via [HJSON](https://hjson.github.io/) based configuration, menus, and themes in addition to JavaScript based [mods](./docs/_docs/modding/existing-mods.md)
1212
* [MCI support](./docs/_docs/art/mci.md) for lightbars, toggles, input areas, and so on plus many other other bells and whistles
1313
* Telnet, **SSH**, and both secure and non-secure [WebSocket](https://en.wikipedia.org/wiki/WebSocket) access built in! Additional servers are easy to implement
1414
* [CP437](http://www.ascii-codes.com/) and UTF-8 output
@@ -87,31 +87,9 @@ ENiGMA has been tested with many terminals. However, the following are suggested
8787
* Alpha for the [FTN-style configuration guide](https://medium.com/@alpha_11845/setting-up-ftn-style-message-networks-with-enigma%C2%BD-bbs-709b22a1ae0d)!
8888
* Huge shout out to [cognitivegears ](https://github.com/cognitivegears) for the various fixes, improvements, and **removing the need for cursor position reports** providing a much better terminal experience!
8989

90-
...and so many others! This project would be nothing without the BBS and artscene communities!
90+
...and so many others! This project would be nothing without the BBS and art scene communities!
91+
92+
[![Star History Chart](https://api.star-history.com/svg?repos=nuskooler/enigma-bbs&type=Date)](https://star-history.com/#nuskooler/enigma-bbs&Date)
9193

9294
## License
93-
Released under the [BSD 2-clause](https://opensource.org/licenses/BSD-2-Clause) license:
94-
95-
Copyright (c) 2015-2024, Bryan D. Ashby
96-
All rights reserved.
97-
98-
Redistribution and use in source and binary forms, with or without
99-
modification, are permitted provided that the following conditions are met:
100-
101-
* Redistributions of source code must retain the above copyright notice, this
102-
list of conditions and the following disclaimer.
103-
104-
* Redistributions in binary form must reproduce the above copyright notice,
105-
this list of conditions and the following disclaimer in the documentation
106-
and/or other materials provided with the distribution.
107-
108-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
109-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
110-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
111-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
112-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
113-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
114-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
115-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
116-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
117-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
95+
Released under [BSD 2-clause](https://opensource.org/licenses/BSD-2-Clause). See [LICENSE.TXT](LICENSE.TXT)

autoexec.sh

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/usr/bin/env bash
2+
3+
# Environment
4+
ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs}
5+
AUTOEXEC_LOGFILE="$ENIGMA_INSTALL_DIR/logs/autoexec.log"
6+
TIME_FORMAT=`date "+%Y-%m-%d %H:%M:%S"`
7+
8+
# Mise en place
9+
export PATH="$HOME/.local/bin:$PATH"
10+
export PATH="$HOME/.local/share/mise/shims:$PATH"
11+
export PATH="$HOME/.local/share/mise/installs/python/latest/bin:$PATH"
12+
13+
# Environment Versions
14+
ENIGMA_NODE_VERSION=${ENIGMA_NODE_VERSION:=$(toml get --toml-path=$ENIGMA_INSTALL_DIR/mise.toml tools.node)}
15+
ENIGMA_PYTHON_VERSION=${ENIGMA_PYTHON_VERSION:=$(toml get --toml-path=$ENIGMA_INSTALL_DIR/mise.toml tools.python)}
16+
17+
# Validate Environment
18+
DEPENDENCIES_VALIDATED=1
19+
20+
# Shared Functions
21+
log() {
22+
echo "${TIME_FORMAT} " "$*" >> $AUTOEXEC_LOGFILE
23+
}
24+
25+
# If this is a first run, the log path will not yet exist and must be created
26+
if [ ! -d "$ENIGMA_INSTALL_DIR/logs" ]
27+
then
28+
mkdir -p $ENIGMA_INSTALL_DIR/logs
29+
fi
30+
31+
log "START:"
32+
log "- PATH: $PATH"
33+
log "- CURRENT DIR: ${PWD##}"
34+
35+
if ! command -v "mise" 2>&1 >/dev/null
36+
then
37+
log "mise is not in your PATH"
38+
log "ERROR END"
39+
exit 1
40+
fi
41+
42+
if ! command -v "node" 2>&1 >/dev/null
43+
then
44+
log "Node environment is not in your PATH"
45+
log "ERROR END"
46+
exit 1
47+
else
48+
NODE_VERSION=$(node --version | tee /dev/null)
49+
log "- NODE VERSION: $NODE_VERSION"
50+
if [[ $NODE_VERSION != "v$ENIGMA_NODE_VERSION."* ]]; then
51+
log "Node version found in your PATH is $NODE_VERSION, was expecting v$ENIGMA_NODE_VERSION.*; you may encounter compatibility issues"
52+
DEPENDENCIES_VALIDATED=0
53+
fi
54+
fi
55+
56+
if ! command -v "python" 2>&1 >/dev/null
57+
then
58+
log "Python environment is not in your PATH"
59+
log "ERROR END"
60+
exit 1
61+
else
62+
PYTHON_VERSION=$(python --version | tee /dev/null)
63+
log "- PYTHON VERSION: $PYTHON_VERSION"
64+
if [[ $PYTHON_VERSION != "Python $ENIGMA_PYTHON_VERSION"* ]]; then
65+
log "Python version found in your PATH is $PYTHON_VERSION, was expecting Python $ENIGMA_PYTHON_VERSION.*; you may encounter compatibility issues"
66+
DEPENDENCIES_VALIDATED=0
67+
fi
68+
fi
69+
70+
# Validate whether we are good to Start
71+
if [ "$DEPENDENCIES_VALIDATED" == "0" ]; then
72+
if [ -v ENIGMA_IGNORE_DEPENDENCIES ] && [ "${ENIGMA_IGNORE_DEPENDENCIES}" == "1" ]; then
73+
log "ENIGMA_IGNORE_DEPENDENCIES=1 detected, starting up..."
74+
else
75+
log "NOTE: Please re-run with 'ENIGMA_IGNORE_DEPENDENCIES=1 /path/to/autoexec.sh' to force startup"
76+
log "ERROR END"
77+
exit 1
78+
fi
79+
fi
80+
81+
# Start BBS
82+
log "Starting ENiGMA½"
83+
~/enigma-bbs/main.js
84+
result=$?
85+
86+
# Determine whether a Startup Crash Occurred
87+
# if [ $result -eq 0 ]; then
88+
# # TODO: Notify via SMS / Email of Startup Failure
89+
# fi
90+
91+
log "ENiGMA½ exited with $result"
92+
log "END"
93+
exit $result

core/bbs.js

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,18 @@ function main() {
8585
// then it's a fatal error
8686
//
8787
if (err) {
88+
errorDisplayed = true;
89+
console.error(`Configuration error: ${err.message}`); // eslint-disable-line no-console
90+
8891
if ('ENOENT' === err.code) {
89-
if (configPathSupplied) {
90-
console.error(
91-
'Configuration file does not exist: ' + configFile
92-
);
93-
} else {
94-
configPathSupplied = null; // make non-fatal; we'll go with defaults
95-
}
96-
} else {
97-
errorDisplayed = true;
98-
console.error(`Configuration error: ${err.message}`); // eslint-disable-line no-console
99-
if (err.hint) {
100-
console.error(`Hint: ${err.hint}`);
101-
}
102-
if (err.configPath) {
103-
console.error(`Note: ${err.configPath}`);
104-
}
92+
console.error("\nConfiguration file does not exist: '{configFile}'\n\nIf this is a new installation please run './oputil.js config new' from the enigma-bbs directory");
93+
}
94+
95+
if (err.hint) {
96+
console.error(`Hint: ${err.hint}`);
97+
}
98+
if (err.configPath) {
99+
console.error(`Note: ${err.configPath}`);
105100
}
106101
}
107102
return callback(err);
@@ -134,7 +129,7 @@ function main() {
134129

135130
if (err && !errorDisplayed) {
136131
console.error('Error initializing: ' + util.inspect(err));
137-
return process.exit();
132+
return process.exit(1);
138133
}
139134
}
140135
);

core/goldmine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ exports.getModule = class GoldmineModule extends MenuModule {
2525
this.setConfigWithExtraArgs(options);
2626

2727
// http://goldminebbs.com/
28-
this.config.host = this.config.host || '165.232.153.209';
29-
this.config.rloginPort = this.config.rloginPort || 513;
28+
this.config.host = this.config.host || 'goldminedoors.com';
29+
this.config.rloginPort = this.config.rloginPort || 2513;
3030
}
3131

3232
initSequence() {

core/oputil/oputil_config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,14 @@ function catCurrentConfig() {
297297
keepWsc: false === argv.comments ? false : true,
298298
});
299299

300+
if (argv.meow) {
301+
console.info(
302+
` /\\_/\\
303+
( o.o )
304+
> ^ < ... mrow...`);
305+
return;
306+
}
307+
300308
console.log(hjson.stringify(config, hjsonOpts));
301309
} catch (e) {
302310
if ('ENOENT' == e.code) {

core/oputil/oputil_help.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Commands:
2020
config Configuration management
2121
fb File base management
2222
mb Message base management
23+
ssh SSH key management
2324
`,
2425
User: `usage: oputil.js user <action> [<arguments>]
2526
@@ -101,7 +102,7 @@ Actions:
101102
cat Write current configuration to stdout
102103
103104
cat arguments:
104-
--no-color Disable color
105+
--no-colors Disable color
105106
--no-comments Strip any comments
106107
`,
107108
FileBase: `usage: oputil.js fb <action> [<arguments>]
@@ -219,6 +220,11 @@ qwk-export arguments:
219220
TIMESTAMP.
220221
--no-qwke Disable QWKE extensions.
221222
--no-synchronet Disable Synchronet style extensions.
223+
`,
224+
SSH: `usage: oputil.js ssh <action>
225+
226+
Actions:
227+
create Create new SSH Keys
222228
`,
223229
});
224230

core/oputil/oputil_main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const handleFileBaseCommand = require('./oputil_file_base.js').handleFileBaseCom
1010
const handleMessageBaseCommand =
1111
require('./oputil_message_base.js').handleMessageBaseCommand;
1212
const handleConfigCommand = require('./oputil_config.js').handleConfigCommand;
13+
const handleSSHKeyCommand = require('./oputil_ssh_key.js').handleSSHKeyCommand;
1314
const getHelpFor = require('./oputil_help.js').getHelpFor;
1415

1516
module.exports = function () {
@@ -32,6 +33,8 @@ module.exports = function () {
3233
return handleFileBaseCommand();
3334
case 'mb':
3435
return handleMessageBaseCommand();
36+
case 'ssh':
37+
return handleSSHKeyCommand();
3538
default:
3639
return printUsageAndSetExitCode(getHelpFor('General'), ExitCodes.BAD_COMMAND);
3740
}

0 commit comments

Comments
 (0)