From a360d5909ea74835a8b5549861893722b10853db Mon Sep 17 00:00:00 2001 From: Carl Hultay <144816337+crhultay@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:18:51 -0500 Subject: [PATCH 01/27] Enhance install.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added selection menu to install all steps, or individual Added reference to autoexec.sh Added Python Runtime Environment installation workflow The new Python workflow will allow users to run ENiGMA½ on modern Linux distributions such as Ubuntu 24.04 per my note in #537. It is my strong recommendation that we offer the user the use of pyenv, as this will decouple the distribution's Python interpreter from that of ENiGMA½ -- this will make the software more portable. It is poor advice to give a user that they upgrade their OS Python Interpreter; doing so can break the operating system if there are incompatibilities. --- misc/install.sh | 105 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 89 insertions(+), 16 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index 1945e5bd7..ef82550a3 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -8,6 +8,7 @@ ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} ENIGMA_SOURCE=${ENIGMA_SOURCE:=https://github.com/NuSkooler/enigma-bbs.git} TIME_FORMAT=`date "+%Y-%m-%d %H:%M:%S"` WAIT_BEFORE_INSTALL=10 +PYTHON_VERSION="3.10" enigma_header() { clear @@ -31,14 +32,6 @@ Installing ENiGMA½: >> Installation will continue in ${WAIT_BEFORE_INSTALL} seconds... EndOfMessage - - SECS=10 - while [ $SECS -gt 0 ]; do - echo -ne "${SECS}... " - sleep 1 - ((SECS --)) - done - echo "" } fatal_error() { @@ -147,9 +140,33 @@ install_node_packages() { } copy_template_files() { - if [[ ! -f "./gopher/gophermap" ]]; then - cp "./misc/gophermap" "./gopher/gophermap" + echo $ENIGMA_INSTALL_DIR + if [[ ! -f "$ENIGMA_INSTALL_DIR/gopher/gophermap" ]]; then + cp "$ENIGMA_INSTALL_DIR/misc/gophermap" "$ENIGMA_INSTALL_DIR/gopher/gophermap" + fi +} + +install_python_environment() { + log "Installing required Python Runtime Environment..." + log "Note that on some systems such as RPi, this can take a VERY long time. Be patient!" + + cd ${ENIGMA_INSTALL_DIR} + curl -o- https://pyenv.run | bash + export PYENV_ROOT="$HOME/.pyenv" + [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" + + if [ $? -eq 0 ]; then + log "Python 3.10 installation complete" + else + log "NOTE: The following build dependencies must be installed:" + log "bzip2 libncurses-dev libffi-dev libz-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev" + + fatal_error "Failed to install Python 3.10 runtime environment. Please report this!" fi + + eval "$(pyenv init -)" + pyenv install $PYTHON_VERSION + pyenv local $PYTHON_VERSION } enigma_footer() { @@ -185,17 +202,73 @@ ADDITIONAL ACTIONS ARE REQUIRED! See docs for more information including other useful binaries! +4 - Start ENiGMA½ BBS! + + ./autoexec.sh + EndOfMessage echo -e "\e[39m" } +countdown() { + SECS=10 + while [ $SECS -gt 0 ]; do + echo -ne "${SECS}... " + sleep 1 + ((SECS --)) + done + echo "" +} + +install_node_runtime_environment() { + enigma_install_init + install_nvm + configure_nvm + install_node_packages +} + +install_bbs() { + download_enigma_source + copy_template_files +} + +install_everything() { + countdown + enigma_install_init + install_nvm + configure_nvm + download_enigma_source + install_node_packages + install_python_environment + copy_template_files +} + +menu() { + title="Installation Options" + prompt="Pick an option:" + options=( + "Install Python $PYTHON_VERSION Runtime Environment" + "Install Node $ENIGMA_NODE_VERSION Runtime Environment" + "Install ENiGMA½" + "Install Everything" + ) + + echo "$title" + PS3="$prompt " + select opt in "${options[@]}" "Quit"; do + case "$REPLY" in + 1) enigma_install_init; install_python_environment; break;; + 2) enigma_install_init; install_node_runtime_environment; break;; + 3) install_bbs; break;; + 4) enigma_install_init; install_everything; break;; + $((${#options[@]}+1))) echo "Goodbye!"; break;; + *) echo "Invalid option. Try another one.";continue;; + esac + done +} + enigma_header -enigma_install_init -install_nvm -configure_nvm -download_enigma_source -install_node_packages -copy_template_files +menu enigma_footer } # this ensures the entire script is downloaded before execution From 7ec986abeee9299a386bf6f75775a268fe612105 Mon Sep 17 00:00:00 2001 From: Carl Hultay <144816337+crhultay@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:20:19 -0500 Subject: [PATCH 02/27] Create autoexec.sh --- autoexec.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 autoexec.sh diff --git a/autoexec.sh b/autoexec.sh new file mode 100644 index 000000000..d547de109 --- /dev/null +++ b/autoexec.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Setup Node Environment +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +nvm use 18 + +# Setup Python Environment +export PYENV_ROOT="$HOME/.pyenv" +[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init -)" +pyenv local 3.10 + +# Start BBS +/home/egonis/enigma-bbs/main.js +result=$? + +# Determine whether a Startup Crash Occurred +if [ $result -eq 0 ]; then + echo "$result" +else + echo "FAIL: ENiGMA½ exited with $result" + + # TODO: Notify via SMS / Email of Startup Failure +fi From 54ce7fefff3bc400589b6245377d0a4ccbbe7a1e Mon Sep 17 00:00:00 2001 From: Carl Hultay <144816337+crhultay@users.noreply.github.com> Date: Sun, 24 Nov 2024 20:22:38 -0500 Subject: [PATCH 03/27] Fixed Gopher Template Installation Bug --- misc/install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/install.sh b/misc/install.sh index ef82550a3..67b6665e9 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -140,7 +140,6 @@ install_node_packages() { } copy_template_files() { - echo $ENIGMA_INSTALL_DIR if [[ ! -f "$ENIGMA_INSTALL_DIR/gopher/gophermap" ]]; then cp "$ENIGMA_INSTALL_DIR/misc/gophermap" "$ENIGMA_INSTALL_DIR/gopher/gophermap" fi From 286d9a2fd8030b8d60ea79a8f619371560c522f5 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Sun, 24 Nov 2024 21:13:42 -0500 Subject: [PATCH 04/27] Convert to mise-en-place --- misc/install.sh | 99 +++++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 65 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index 67b6665e9..4fa5219c1 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -3,12 +3,12 @@ { # this ensures the entire script is downloaded before execution ENIGMA_NODE_VERSION=${ENIGMA_NODE_VERSION:=18} +ENIGMA_PYTHON_VERSION="3.10" ENIGMA_BRANCH=${ENIGMA_BRANCH:=master} ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} ENIGMA_SOURCE=${ENIGMA_SOURCE:=https://github.com/NuSkooler/enigma-bbs.git} TIME_FORMAT=`date "+%Y-%m-%d %H:%M:%S"` WAIT_BEFORE_INSTALL=10 -PYTHON_VERSION="3.10" enigma_header() { clear @@ -26,7 +26,8 @@ _____________________ _____ ____________________ __________\\_ / Installing ENiGMA½: Source : ${ENIGMA_SOURCE} (${ENIGMA_BRANCH} branch) Destination: ${ENIGMA_INSTALL_DIR} - Node.js : ${ENIGMA_NODE_VERSION}.x via NVM (If you have NVM it will be updated to the latest version) + Node.js : ${ENIGMA_NODE_VERSION} via mise-en-place + Python : ${ENIGMA_PYTHON_VERSION} via mise-en-place >> If this isn't what you were expecting, hit CTRL-C now! >> Installation will continue in ${WAIT_BEFORE_INSTALL} seconds... @@ -67,6 +68,16 @@ enigma_install_needs() { enigma_install_needs_ex $1 "Examples:\n sudo apt install $1 # Debian/Ubuntu\n sudo yum install $1 # CentOS" } +enigma_has_mise() { + echo -ne "Checking for an installation of mise-en-place (https://mise.jdx.dev/)" + if check_exists "mise"; then + echo " Found!" + else + echo "" + fatal_error "ENiGMA½ requires mise-enplace to install dependencies." + fi +} + log() { printf "${TIME_FORMAT} %b\n" "$*"; } @@ -80,16 +91,19 @@ enigma_install_init() { enigma_install_needs gcc } -install_nvm() { - log "Installing nvm" - curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash +install_mise_en_place() { + curl https://mise.run | sh + echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc + eval ~/.local/bin/mise activate bash } -configure_nvm() { - log "Installing Node ${ENIGMA_NODE_VERSION} via nvm" - . ~/.nvm/nvm.sh - nvm install ${ENIGMA_NODE_VERSION} - nvm use ${ENIGMA_NODE_VERSION} +install_node_runtime_environment() { + mise use --global node@$ENIGMA_NODE_VERSION +} + +install_python_runtime_environment() { + mise settings python.compile=1 + mise use --global python@$ENIGMA_PYTHON_VERSION } download_enigma_source() { @@ -117,14 +131,6 @@ is_arch_arm() { fi } -extra_npm_install_args() { - if is_arch_arm ; then - echo "--build-from-source" - else - echo "" - fi -} - install_node_packages() { log "Installing required Node packages..." log "Note that on some systems such as RPi, this can take a VERY long time. Be patient!" @@ -140,34 +146,12 @@ install_node_packages() { } copy_template_files() { + echo $ENIGMA_INSTALL_DIR if [[ ! -f "$ENIGMA_INSTALL_DIR/gopher/gophermap" ]]; then cp "$ENIGMA_INSTALL_DIR/misc/gophermap" "$ENIGMA_INSTALL_DIR/gopher/gophermap" fi } -install_python_environment() { - log "Installing required Python Runtime Environment..." - log "Note that on some systems such as RPi, this can take a VERY long time. Be patient!" - - cd ${ENIGMA_INSTALL_DIR} - curl -o- https://pyenv.run | bash - export PYENV_ROOT="$HOME/.pyenv" - [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" - - if [ $? -eq 0 ]; then - log "Python 3.10 installation complete" - else - log "NOTE: The following build dependencies must be installed:" - log "bzip2 libncurses-dev libffi-dev libz-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev" - - fatal_error "Failed to install Python 3.10 runtime environment. Please report this!" - fi - - eval "$(pyenv init -)" - pyenv install $PYTHON_VERSION - pyenv local $PYTHON_VERSION -} - enigma_footer() { log "ENiGMA½ installation complete!" echo -e "\e[1;33m" @@ -209,20 +193,11 @@ EndOfMessage echo -e "\e[39m" } -countdown() { - SECS=10 - while [ $SECS -gt 0 ]; do - echo -ne "${SECS}... " - sleep 1 - ((SECS --)) - done - echo "" -} - -install_node_runtime_environment() { +install_dependencies() { enigma_install_init - install_nvm - configure_nvm + install_mise_en_place + install_node_runtime_environment + install_python_runtime_environment install_node_packages } @@ -232,13 +207,9 @@ install_bbs() { } install_everything() { - countdown - enigma_install_init - install_nvm - configure_nvm + install_dependencies download_enigma_source install_node_packages - install_python_environment copy_template_files } @@ -246,8 +217,7 @@ menu() { title="Installation Options" prompt="Pick an option:" options=( - "Install Python $PYTHON_VERSION Runtime Environment" - "Install Node $ENIGMA_NODE_VERSION Runtime Environment" + "Install Dependencies" "Install ENiGMA½" "Install Everything" ) @@ -256,10 +226,9 @@ menu() { PS3="$prompt " select opt in "${options[@]}" "Quit"; do case "$REPLY" in - 1) enigma_install_init; install_python_environment; break;; - 2) enigma_install_init; install_node_runtime_environment; break;; - 3) install_bbs; break;; - 4) enigma_install_init; install_everything; break;; + 1) enigma_install_init; install_dependencies; break;; + 2) install_bbs; break;; + 3) enigma_install_init; install_everything; break;; $((${#options[@]}+1))) echo "Goodbye!"; break;; *) echo "Invalid option. Try another one.";continue;; esac From 98bc72700b6a87cb2f9c7c337dd98d9cc42f06a7 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Sun, 24 Nov 2024 21:21:40 -0500 Subject: [PATCH 05/27] Convert to mise-en-place --- misc/install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/misc/install.sh b/misc/install.sh index 4fa5219c1..129745889 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -93,7 +93,6 @@ enigma_install_init() { install_mise_en_place() { curl https://mise.run | sh - echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc eval ~/.local/bin/mise activate bash } @@ -131,6 +130,14 @@ is_arch_arm() { fi } +extra_npm_install_args() { + if is_arch_arm ; then + echo "--build-from-source" + else + echo "" + fi +} + install_node_packages() { log "Installing required Node packages..." log "Note that on some systems such as RPi, this can take a VERY long time. Be patient!" From 8877b1d3afc0f0e2ae799e575a25ec0424a11172 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Sun, 24 Nov 2024 22:29:15 -0500 Subject: [PATCH 06/27] Update autoexec.sh --- autoexec.sh | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/autoexec.sh b/autoexec.sh index d547de109..831c420fa 100644 --- a/autoexec.sh +++ b/autoexec.sh @@ -1,26 +1,16 @@ #!/bin/bash -# Setup Node Environment -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion -nvm use 18 - -# Setup Python Environment -export PYENV_ROOT="$HOME/.pyenv" -[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init -)" -pyenv local 3.10 +# Activate Mise +eval "$(~/.local/bin/mise activate bash)" # Start BBS /home/egonis/enigma-bbs/main.js result=$? # Determine whether a Startup Crash Occurred -if [ $result -eq 0 ]; then - echo "$result" -else - echo "FAIL: ENiGMA½ exited with $result" +# if [ $result -eq 0 ]; then +# # TODO: Notify via SMS / Email of Startup Failure +# fi - # TODO: Notify via SMS / Email of Startup Failure -fi +echo "ENiGMA½ exited with $result" +exit $result From 921f8c6a5888fce79c38a2606b92a63e35901860 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Sun, 24 Nov 2024 22:29:45 -0500 Subject: [PATCH 07/27] Create mise.toml --- mise.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 mise.toml diff --git a/mise.toml b/mise.toml new file mode 100644 index 000000000..92efa94f5 --- /dev/null +++ b/mise.toml @@ -0,0 +1,7 @@ +[tools] +node = '18' +python = '3.10' + +[env] +NODE_ENV = 'production' +_.python.venv = { path = ".venv", create = true } From bc2ce168db87596cb79341b97f68d5ac65aa88d6 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Sun, 24 Nov 2024 22:31:12 -0500 Subject: [PATCH 08/27] Update .gitignore --- .gitignore | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7479afc17..be693d239 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # Don't check in SSH keys! *.pem -# Various directories +# Exclude User-Customized Directories config/ db/ drop/ @@ -11,5 +11,13 @@ mail/ node_modules/ docs/_site/ docs/.sass-cache/ - docs/.jekyll-cache/ + +# Ignore Web Assets not included with enigma-bbs +www/* +www/assets/* +!www/otp_register_template.html +!www/reset_password.template.html + +# Runtime Environment +.venv From fddf02eec29ee0f50ee054837015332862ef915f Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:21:41 -0500 Subject: [PATCH 09/27] Update autoexec.sh --- autoexec.sh | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/autoexec.sh b/autoexec.sh index 831c420fa..f9659e01b 100644 --- a/autoexec.sh +++ b/autoexec.sh @@ -1,10 +1,75 @@ -#!/bin/bash +#!/usr/bin/env bash -# Activate Mise +# Environment +ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} +AUTOEXEC_LOGFILE="$ENIGMA_INSTALL_DIR/logs/autoexec.log" + +# Environment Versions (would be awesome to read this from mise.toml) +ENIGMA_NODE_VERSION=${ENIGMA_NODE_VERSION:=18} +ENIGMA_PYTHON_VERSION=${ENIGMA_PYTHON_VERSION:=3.10} + +# Mise en place eval "$(~/.local/bin/mise activate bash)" +export PYTHON_VENV_PATH="$HOME/enigma-bbs/.venv/bin" +export PYTHON_PATH="$HOME/.local/share/mise/installs/python/$ENIGMA_PYTHON_VERSION/bin" +export MISE_PATH="$HOME/.local/bin" +export NODE_PATH="$HOME/.local/share/mise/installs/node/$ENIGMA_NODE_VERSION/bin" +export PATH="$PYTHON_VENV_PATH:$PYTHON_PATH:$MISE_PATH:$NODE_PATH:$PATH" + +# Validate Environment +DEPENDENCIES_VALIDATED=1 + +echo "$(date '+%Y-%m-%d %H:%M:%S') - START:" | tee -a $AUTOEXEC_LOGFILE +echo "$(date '+%Y-%m-%d %H:%M:%S') - PATH: $PATH" | tee -a $AUTOEXEC_LOGFILE +echo "$(date '+%Y-%m-%d %H:%M:%S') - CURRENT DIR: ${PWD##}" | tee -a $AUTOEXEC_LOGFILE + +if ! command -v "mise" 2>&1 >/dev/null +then + echo "$(date '+%Y-%m-%d %H:%M:%S') - mise is not in your PATH, activating" | tee -a $AUTOEXEC_LOGFILE +fi + +if ! command -v "node" 2>&1 >/dev/null +then + echo "$(date '+%Y-%m-%d %H:%M:%S') - Node environment is not in your PATH" | tee -a $AUTOEXEC_LOGFILE + echo "$(date '+%Y-%m-%d %H:%M:%S') - ERROR END" | tee -a $AUTOEXEC_LOGFILE + exit 1 +else + NODE_VERSION=$(node --version | tee /dev/null) + echo "$(date '+%Y-%m-%d %H:%M:%S') - NODE VERSION: $NODE_VERSION" | tee -a $AUTOEXEC_LOGFILE + if [[ $NODE_VERSION != "v$ENIGMA_NODE_VERSION."* ]]; then + echo "$(date '+%Y-%m-%d %H:%M:%S') - Node version found in your PATH is $NODE_VERSION, was expecting v$ENIGMA_NODE_VERSION.*; you may encounter compatibility issues" | tee -a $AUTOEXEC_LOGFILE + DEPENDENCIES_VALIDATED=0 + fi +fi + +if ! command -v "python" 2>&1 >/dev/null +then + echo "$(date '+%Y-%m-%d %H:%M:%S') - Python environment is not in your PATH" + echo "$(date '+%Y-%m-%d %H:%M:%S') - ERROR END" | tee -a $AUTOEXEC_LOGFILE + exit 1 +else + PYTHON_VERSION=$(python --version | tee /dev/null) + echo "$(date '+%Y-%m-%d %H:%M:%S') - PYTHON VERSION: $PYTHON_VERSION" | tee -a $AUTOEXEC_LOGFILE + if [[ $PYTHON_VERSION != "Python $ENIGMA_PYTHON_VERSION"* ]]; then + echo "$(date '+%Y-%m-%d %H:%M:%S') - Python version found in your PATH is $PYTHON_VERSION, was expecting Python $ENIGMA_PYTHON_VERSION.*; you may encounter compatibility issues" | tee -a $AUTOEXEC_LOGFILE + DEPENDENCIES_VALIDATED=0 + fi +fi + +# Validate whether we are good to Start +if [ "$DEPENDENCIES_VALIDATED" == "0" ]; then + if [ -v ENIGMA_IGNORE_DEPENDENCIES ] && [ "${ENIGMA_IGNORE_DEPENDENCIES}" == "1" ]; then + echo "$(date '+%Y-%m-%d %H:%M:%S') - ENIGMA_IGNORE_DEPENDENCIES=1 detected, starting up..." | tee -a $AUTOEXEC_LOGFILE + else + echo "$(date '+%Y-%m-%d %H:%M:%S') - NOTE: Please re-run with 'ENIGMA_IGNORE_DEPENDENCIES=1 /path/to/autoexec.sh' to force startup" | tee $AUTOEXEC_LOGFILE + echo "$(date '+%Y-%m-%d %H:%M:%S') - ERROR END" | tee -a $AUTOEXEC_LOGFILE + exit 1 + fi +fi # Start BBS -/home/egonis/enigma-bbs/main.js +echo "$(date '+%Y-%m-%d %H:%M:%S') - Starting ENiGMA½" | tee -a $AUTOEXEC_LOGFILE +~/enigma-bbs/main.js result=$? # Determine whether a Startup Crash Occurred @@ -12,5 +77,6 @@ result=$? # # TODO: Notify via SMS / Email of Startup Failure # fi -echo "ENiGMA½ exited with $result" +echo "$(date '+%Y-%m-%d %H:%M:%S') - ENiGMA½ exited with $result" | tee -a $AUTOEXEC_LOGFILE +echo "$(date '+%Y-%m-%d %H:%M:%S') - END" | tee -a $AUTOEXEC_LOGFILE exit $result From d2e09a36fa15fca7d4ad8a849f4f4c870ef16ead Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:25:36 -0500 Subject: [PATCH 10/27] Update install.sh --- misc/install.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/misc/install.sh b/misc/install.sh index 129745889..3af885cb0 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -196,6 +196,25 @@ ADDITIONAL ACTIONS ARE REQUIRED! ./autoexec.sh +5 - Enable Automatic Startup via systemd (optional) + + Write a file in /etc/systemd/system/bbs.service containing: + [Unit] + Description=Enigma½ BBS + + [Install] + WantedBy=multi-user.target + + [Service] + ExecStart=/home//enigma-bbs/autoexec.sh + Type=simple + User= + Group= + WorkingDirectory=/home//enigma-bbs/ + Restart=on-failure + + Run 'sudo systemctl enable bbs.service' to start at boot + EndOfMessage echo -e "\e[39m" } From b47dcff9d24282c509bbfd63ad4f2a89ba55241c Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:34:34 -0500 Subject: [PATCH 11/27] Update install.sh --- misc/install.sh | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index 3af885cb0..9a9b2d36d 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash { # this ensures the entire script is downloaded before execution - -ENIGMA_NODE_VERSION=${ENIGMA_NODE_VERSION:=18} -ENIGMA_PYTHON_VERSION="3.10" ENIGMA_BRANCH=${ENIGMA_BRANCH:=master} ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} ENIGMA_SOURCE=${ENIGMA_SOURCE:=https://github.com/NuSkooler/enigma-bbs.git} TIME_FORMAT=`date "+%Y-%m-%d %H:%M:%S"` -WAIT_BEFORE_INSTALL=10 enigma_header() { clear @@ -26,8 +22,6 @@ _____________________ _____ ____________________ __________\\_ / Installing ENiGMA½: Source : ${ENIGMA_SOURCE} (${ENIGMA_BRANCH} branch) Destination: ${ENIGMA_INSTALL_DIR} - Node.js : ${ENIGMA_NODE_VERSION} via mise-en-place - Python : ${ENIGMA_PYTHON_VERSION} via mise-en-place >> If this isn't what you were expecting, hit CTRL-C now! >> Installation will continue in ${WAIT_BEFORE_INSTALL} seconds... @@ -93,16 +87,13 @@ enigma_install_init() { install_mise_en_place() { curl https://mise.run | sh - eval ~/.local/bin/mise activate bash -} -install_node_runtime_environment() { - mise use --global node@$ENIGMA_NODE_VERSION + mise install } -install_python_runtime_environment() { - mise settings python.compile=1 - mise use --global python@$ENIGMA_PYTHON_VERSION +install_tools() { + # Used to read toml files from bash scripts + python -m pip install toml-cli } download_enigma_source() { @@ -196,25 +187,6 @@ ADDITIONAL ACTIONS ARE REQUIRED! ./autoexec.sh -5 - Enable Automatic Startup via systemd (optional) - - Write a file in /etc/systemd/system/bbs.service containing: - [Unit] - Description=Enigma½ BBS - - [Install] - WantedBy=multi-user.target - - [Service] - ExecStart=/home//enigma-bbs/autoexec.sh - Type=simple - User= - Group= - WorkingDirectory=/home//enigma-bbs/ - Restart=on-failure - - Run 'sudo systemctl enable bbs.service' to start at boot - EndOfMessage echo -e "\e[39m" } @@ -222,8 +194,6 @@ EndOfMessage install_dependencies() { enigma_install_init install_mise_en_place - install_node_runtime_environment - install_python_runtime_environment install_node_packages } From b720050abf3ea3977f8a85588e7e2c1af5b70072 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:34:50 -0500 Subject: [PATCH 12/27] Update autoexec.sh --- autoexec.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoexec.sh b/autoexec.sh index f9659e01b..acca6c4b2 100644 --- a/autoexec.sh +++ b/autoexec.sh @@ -5,8 +5,8 @@ ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} AUTOEXEC_LOGFILE="$ENIGMA_INSTALL_DIR/logs/autoexec.log" # Environment Versions (would be awesome to read this from mise.toml) -ENIGMA_NODE_VERSION=${ENIGMA_NODE_VERSION:=18} -ENIGMA_PYTHON_VERSION=${ENIGMA_PYTHON_VERSION:=3.10} +ENIGMA_NODE_VERSION=${ENIGMA_NODE_VERSION:=$(toml get --toml-path=$ENIGMA_INSTALL_DIR/mise.toml tools.node)} +ENIGMA_PYTHON_VERSION=${ENIGMA_PYTHON_VERSION:=$(toml get --toml-path=$ENIGMA_INSTALL_DIR/mise.toml tools.python)} # Mise en place eval "$(~/.local/bin/mise activate bash)" From baca3c55f0fdba3313a3118dc99cb70d25a5ddc5 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:35:31 -0500 Subject: [PATCH 13/27] Update autoexec.sh --- autoexec.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoexec.sh b/autoexec.sh index acca6c4b2..b702ce84e 100644 --- a/autoexec.sh +++ b/autoexec.sh @@ -4,10 +4,6 @@ ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} AUTOEXEC_LOGFILE="$ENIGMA_INSTALL_DIR/logs/autoexec.log" -# Environment Versions (would be awesome to read this from mise.toml) -ENIGMA_NODE_VERSION=${ENIGMA_NODE_VERSION:=$(toml get --toml-path=$ENIGMA_INSTALL_DIR/mise.toml tools.node)} -ENIGMA_PYTHON_VERSION=${ENIGMA_PYTHON_VERSION:=$(toml get --toml-path=$ENIGMA_INSTALL_DIR/mise.toml tools.python)} - # Mise en place eval "$(~/.local/bin/mise activate bash)" export PYTHON_VENV_PATH="$HOME/enigma-bbs/.venv/bin" @@ -16,6 +12,10 @@ export MISE_PATH="$HOME/.local/bin" export NODE_PATH="$HOME/.local/share/mise/installs/node/$ENIGMA_NODE_VERSION/bin" export PATH="$PYTHON_VENV_PATH:$PYTHON_PATH:$MISE_PATH:$NODE_PATH:$PATH" +# Environment Versions +ENIGMA_NODE_VERSION=${ENIGMA_NODE_VERSION:=$(toml get --toml-path=$ENIGMA_INSTALL_DIR/mise.toml tools.node)} +ENIGMA_PYTHON_VERSION=${ENIGMA_PYTHON_VERSION:=$(toml get --toml-path=$ENIGMA_INSTALL_DIR/mise.toml tools.python)} + # Validate Environment DEPENDENCIES_VALIDATED=1 From 59735b97f420b1fe231850d38d357f56a494fb4b Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 09:36:58 -0500 Subject: [PATCH 14/27] Update autoexec.sh --- autoexec.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/autoexec.sh b/autoexec.sh index b702ce84e..0e6401723 100644 --- a/autoexec.sh +++ b/autoexec.sh @@ -26,6 +26,7 @@ echo "$(date '+%Y-%m-%d %H:%M:%S') - CURRENT DIR: ${PWD##}" | tee -a $AUTOEXEC_L if ! command -v "mise" 2>&1 >/dev/null then echo "$(date '+%Y-%m-%d %H:%M:%S') - mise is not in your PATH, activating" | tee -a $AUTOEXEC_LOGFILE + eval "$(~/.local/bin/mise activate bash)" fi if ! command -v "node" 2>&1 >/dev/null From d9b980559d22fce85eb6e81613ae8d6f47c9d444 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:27:08 -0500 Subject: [PATCH 15/27] Update install.sh --- misc/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index 9a9b2d36d..be77f23d8 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -225,10 +225,12 @@ menu() { 1) enigma_install_init; install_dependencies; break;; 2) install_bbs; break;; 3) enigma_install_init; install_everything; break;; - $((${#options[@]}+1))) echo "Goodbye!"; break;; + $((${#options[@]}+1))) echo "Goodbye!"; exit 0;; *) echo "Invalid option. Try another one.";continue;; esac - done + done < /dev/tty + + unset PS3 } enigma_header From 669efdcfae3860d652f669442787dc4d8aa63cee Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:14:13 -0500 Subject: [PATCH 16/27] Update install.sh --- misc/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index be77f23d8..4a0996d6b 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -89,6 +89,8 @@ install_mise_en_place() { curl https://mise.run | sh mise install + + ~/.local/bin/mise activate bash >> bash } install_tools() { @@ -195,6 +197,7 @@ install_dependencies() { enigma_install_init install_mise_en_place install_node_packages + install_tools } install_bbs() { @@ -203,9 +206,8 @@ install_bbs() { } install_everything() { - install_dependencies download_enigma_source - install_node_packages + install_dependencies copy_template_files } From 99fd67d2bd079ebab398d43fd08715f8fae7c725 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:15:23 -0500 Subject: [PATCH 17/27] Update autoexec.sh --- autoexec.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/autoexec.sh b/autoexec.sh index 0e6401723..c52b9d47c 100644 --- a/autoexec.sh +++ b/autoexec.sh @@ -5,12 +5,7 @@ ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} AUTOEXEC_LOGFILE="$ENIGMA_INSTALL_DIR/logs/autoexec.log" # Mise en place -eval "$(~/.local/bin/mise activate bash)" -export PYTHON_VENV_PATH="$HOME/enigma-bbs/.venv/bin" -export PYTHON_PATH="$HOME/.local/share/mise/installs/python/$ENIGMA_PYTHON_VERSION/bin" -export MISE_PATH="$HOME/.local/bin" -export NODE_PATH="$HOME/.local/share/mise/installs/node/$ENIGMA_NODE_VERSION/bin" -export PATH="$PYTHON_VENV_PATH:$PYTHON_PATH:$MISE_PATH:$NODE_PATH:$PATH" +~/.local/bin/mise activate bash >> bash # Environment Versions ENIGMA_NODE_VERSION=${ENIGMA_NODE_VERSION:=$(toml get --toml-path=$ENIGMA_INSTALL_DIR/mise.toml tools.node)} From c69849943a3d79f5c6ca97420d6182336f74c401 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:08:45 -0500 Subject: [PATCH 18/27] Update install.sh --- misc/install.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index 4a0996d6b..84e93fa86 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -88,14 +88,21 @@ enigma_install_init() { install_mise_en_place() { curl https://mise.run | sh + # ~/.local/bin/mise activate bash >> bash + eval "$(~/.local/bin/mise activate bash)" + + cd $ENIGMA_INSTALL_DIR + mise install - ~/.local/bin/mise activate bash >> bash + NODE_PATH="~/.local/share/mise/installs/node/latest/bin" + PYTHON_PATH="~/.local/share/mise/installs/python/latest/bin" + export PATH=$NODE_PATH:$PYTHON_PATH:$PATH } install_tools() { # Used to read toml files from bash scripts - python -m pip install toml-cli + ~/.local/share/mise/installs/python/latest/bin/python -m pip install toml-cli } download_enigma_source() { @@ -137,7 +144,9 @@ install_node_packages() { cd ${ENIGMA_INSTALL_DIR} local EXTRA_NPM_ARGS=$(extra_npm_install_args) - git checkout ${ENIGMA_BRANCH} && npm install ${EXTRA_NPM_ARGS} + git checkout ${ENIGMA_BRANCH} + + npm install ${EXTRA_NPM_ARGS} if [ $? -eq 0 ]; then log "npm package installation complete" else @@ -196,8 +205,8 @@ EndOfMessage install_dependencies() { enigma_install_init install_mise_en_place - install_node_packages install_tools + install_node_packages } install_bbs() { From 00bad37f4da54d383a19cdcb9e2666f28124a7dd Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:23:43 -0500 Subject: [PATCH 19/27] Update install.sh --- misc/install.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index 84e93fa86..a9ef30706 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -95,14 +95,12 @@ install_mise_en_place() { mise install - NODE_PATH="~/.local/share/mise/installs/node/latest/bin" - PYTHON_PATH="~/.local/share/mise/installs/python/latest/bin" - export PATH=$NODE_PATH:$PYTHON_PATH:$PATH + PATH="$HOME/.local/share/mise/shims:$PATH" } install_tools() { # Used to read toml files from bash scripts - ~/.local/share/mise/installs/python/latest/bin/python -m pip install toml-cli + python -m pip install toml-cli } download_enigma_source() { From 1bb9aeb09d2f7fbb9f15b25a1290e841e82dc0ea Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:34:48 -0500 Subject: [PATCH 20/27] Update install.sh --- misc/install.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/misc/install.sh b/misc/install.sh index a9ef30706..d7871ffcc 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -196,6 +196,25 @@ ADDITIONAL ACTIONS ARE REQUIRED! ./autoexec.sh +5 - Enable Automated Startup on Boot (optional) + + Create a file in /etc/systemd/system/bbs.service with the following contents: + [Unit] + Description=Enigma½ BBS + + [Install] + WantedBy=multi-user.target + + [Service] + ExecStart=/home//enigma-bbs/autoexec.sh + Type=simple + User= + Group= + WorkingDirectory=/home//enigma-bbs/ + Restart=on-failure + + Run 'sudo systemctl enable bbs.service' + EndOfMessage echo -e "\e[39m" } From 595ade9a3cc9c7c40ccaa4c906589855490ca0d6 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:35:07 -0500 Subject: [PATCH 21/27] Update install.sh --- misc/install.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/misc/install.sh b/misc/install.sh index d7871ffcc..2767f9efb 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -95,7 +95,7 @@ install_mise_en_place() { mise install - PATH="$HOME/.local/share/mise/shims:$PATH" + export PATH="$HOME/.local/share/mise/shims:$PATH" } install_tools() { @@ -219,11 +219,21 @@ EndOfMessage echo -e "\e[39m" } +post_install() { + MISE_SHIM_PATH_COMMAND='export PATH="$HOME/.local/share/mise/shims:$PATH"' + if ! grep -Fxq "$MISE_SHIM_PATH_COMMAND" ~/.bashrc + then + echo $MISE_SHIM_PATH_COMMAND >> ~/.bashrc + echo -e "\e[0;32mInstalled Mise Shims into your ~/.bashrc\e[39m" + fi +} + install_dependencies() { enigma_install_init install_mise_en_place install_tools install_node_packages + post_install } install_bbs() { From f200182cb3063378f9ee4575de83712a3da47949 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Tue, 26 Nov 2024 19:30:28 -0500 Subject: [PATCH 22/27] Flourishes --- misc/install.sh | 114 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 38 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index 2767f9efb..0c2219adb 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -4,10 +4,50 @@ ENIGMA_BRANCH=${ENIGMA_BRANCH:=master} ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} ENIGMA_SOURCE=${ENIGMA_SOURCE:=https://github.com/NuSkooler/enigma-bbs.git} +ENIGMA_INSTALL_LOG=~/enigma-install.log TIME_FORMAT=`date "+%Y-%m-%d %H:%M:%S"` +# ANSI Codes +RESET="\e[0m" +BOLD="\e[1m" +UNDERLINE="\e[4m" +INVERSE="\e7m" +FOREGROUND_BLACK="\e[30m" +FOREGROUND_RED="\e[31m" +FOREGROUND_GREEN="\e[32m" +FOREGROUND_YELLOW="\e[33m" +FOREGROUND_BLUE="\e[34m" +FOREGROUND_MAGENTA="\e[35m" +FOREGROUND_CYAN="\e[36m" +FOREGROUND_WHITE="\e[37m" +BACKGROUND_BLACK="\e[40m" +BACKGROUND_RED="\e[41m" +BACKGROUND_GREEN="\e[42m" +BACKGROUND_YELLOW="\e[43m" +BACKGROUND_BLUE="\e[44m" +BACKGROUND_MAGENTA="\e[45m" +BACKGROUND_CYAN="\e[46m" +BACKGROUND_WHITE="\e[47m" +FOREGROUND_STRONG_WHITE="\e[90m" +FOREGROUND_STRONG_RED="\e[91m" +FOREGROUND_STRONG_GREEN="\e[92m" +FOREGROUND_STRONG_YELLOW="\e[93m" +FOREGROUND_STRONG_BLUE="\e[94m" +FOREGROUND_STRONG_MAGENTA="\e[95m" +FOREGROUND_STRONG_CYAN="\e[96m" +FOREGROUND_STRONG_WHITE="\e[97m" +BACKGROUND_STRONG_BLACK="\e[100m" +BACKGROUND_STRONG_RED="\e[101m" +BACKGROUND_STRONG_GREEN="\e[102m" +BACKGROUND_STRONG_YELLOW="\e[103m" +BACKGROUND_STRONG_BLUE="\w[104m" +BACKGROUND_STRONG_MAGENTA="\e[105m" +BACKGROUND_STRONG_CYAN="\e[106m" +BACKGROUND_STRONG_WHITE="\e[107m" + enigma_header() { clear + echo -e "$FOREGROUND_STRONG_WHITE" cat << EndOfMessage ______ _____________________ _____ ____________________ __________\\_ / @@ -19,18 +59,16 @@ _____________________ _____ ____________________ __________\\_ / <*> ENiGMA½ // https://github.com/NuSkooler/enigma-bbs <*> /__/ -Installing ENiGMA½: +ENiGMA½: Source : ${ENIGMA_SOURCE} (${ENIGMA_BRANCH} branch) Destination: ${ENIGMA_INSTALL_DIR} ->> If this isn't what you were expecting, hit CTRL-C now! ->> Installation will continue in ${WAIT_BEFORE_INSTALL} seconds... - EndOfMessage + echo -e "$RESET" } fatal_error() { - printf "${TIME_FORMAT} \e[41mERROR:\033[0m %b\n" "$*" >&2; + echo -e "${TIME_FORMAT} \e[41mERROR:\033[0m %b\n" "$*" >&2; exit 1 } @@ -39,22 +77,12 @@ check_exists() { } enigma_install_needs_ex() { - echo -ne "Checking for '$1'..." + echo -ne "${FOREGROUND_GREEN}Checking for '$1'...${RESET}" if check_exists $1 ; then - echo " Found!" + echo -e "${FOREGROUND_STRONG_GREEN} Found!${RESET}" else echo "" - fatal_error "ENiGMA½ requires '$1' but it was not found. Please install it and/or make sure it is in your path then restart the installer.\n\n$2" - fi -} - -enigma_install_needs_python() { - echo -ne "Checking for a suitable Python installation..." - if check_exists "python" || check_exists "python7" || check_exists "python3" ; then - echo " Found!" - else - echo "" - fatal_error "ENiGMA½ requires Python for node-gyp to build binaries. Please see https://www.npmjs.com/package/node-gyp for details." + fatal_error "${FOREGROUND_STRONG_RED}ENiGMA½ requires '$1' but it was not found. Please install it and/or make sure it is in your path then restart the installer.\n\n$2${RESET}" fi } @@ -63,23 +91,22 @@ enigma_install_needs() { } enigma_has_mise() { - echo -ne "Checking for an installation of mise-en-place (https://mise.jdx.dev/)" + echo -e "${FOREGROUND_GREEN}Checking for an installation of mise-en-place (https://mise.jdx.dev/)${RESET}" if check_exists "mise"; then - echo " Found!" + echo -e "${FOREGROUND_STRONG_GREEN} Found!${RESET}" else echo "" - fatal_error "ENiGMA½ requires mise-enplace to install dependencies." + fatal_error "${FOREGROUND_STRONG_RED}ENiGMA½ requires mise-enplace to install dependencies.${RESET}" fi } log() { - printf "${TIME_FORMAT} %b\n" "$*"; + echo -e "${TIME_FORMAT} %b\n" "$*"; } enigma_install_init() { enigma_install_needs git enigma_install_needs curl - enigma_install_needs_python enigma_install_needs_ex make "Examples:\n sudo apt install build-essential # Debian/Ubuntu\n sudo yum groupinstall 'Development Tools' # CentOS" enigma_install_needs make enigma_install_needs gcc @@ -93,7 +120,7 @@ install_mise_en_place() { cd $ENIGMA_INSTALL_DIR - mise install + mise install >> ${ENIGMA_INSTALL_LOG} export PATH="$HOME/.local/share/mise/shims:$PATH" } @@ -108,14 +135,14 @@ download_enigma_source() { INSTALL_DIR=${ENIGMA_INSTALL_DIR} if [ -d "$INSTALL_DIR/.git" ]; then - log "ENiGMA½ is already installed in $INSTALL_DIR, trying to update using git" + log "${FOREGROUND_YELLOW}ENiGMA½ is already installed in $INSTALL_DIR, trying to update using git...${RESET}" command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch 2> /dev/null || - fatal_error "Failed to update ENiGMA½, run 'git fetch' in $INSTALL_DIR yourself." + fatal_error "${FOREGROUND_STRONG_RED}Failed to update ENiGMA½, run 'git fetch' in $INSTALL_DIR yourself.${RESET}" else - log "Downloading ENiGMA½ from git to '$INSTALL_DIR'" + log "${FOREGROUND_GREEN}Downloading ENiGMA½ from git to '$INSTALL_DIR'${RESET}" mkdir -p "$INSTALL_DIR" command git clone ${ENIGMA_SOURCE} "$INSTALL_DIR" || - fatal_error "Failed to clone ENiGMA½ repo. Please report this!" + fatal_error "${FOREGROUND_STRONG_RED}Failed to clone ENiGMA½ repo. Please report this!${RESET}" fi } @@ -137,22 +164,23 @@ extra_npm_install_args() { } install_node_packages() { - log "Installing required Node packages..." - log "Note that on some systems such as RPi, this can take a VERY long time. Be patient!" + log "${FOREGROUND_GREEN}Installing required Node packages...${RESET}" + log "${FOREGROUND_YELLOW}Note that on some systems such as RPi, this can take a VERY long time. Be patient!${RESET}" cd ${ENIGMA_INSTALL_DIR} local EXTRA_NPM_ARGS=$(extra_npm_install_args) git checkout ${ENIGMA_BRANCH} - npm install ${EXTRA_NPM_ARGS} + npm install ${EXTRA_NPM_ARGS} >> $ENIGMA_INSTALL_LOG if [ $? -eq 0 ]; then - log "npm package installation complete" + log "${FOREGROUND_STRONG_GREEN}npm package installation complete${RESET}" else - fatal_error "Failed to install ENiGMA½ npm packages. Please report this!" + fatal_error "${FOREGROUND_STRONG_RED}Failed to install ENiGMA½ npm packages. Please report this and refer to ~/enigma-install.log!{$RESET}" fi } copy_template_files() { + log "${FOREGROUND_GREEN}Copying Template Files to ${ENIGMA_INSTALL_DIR}/misc/gophermap${RESET}" echo $ENIGMA_INSTALL_DIR if [[ ! -f "$ENIGMA_INSTALL_DIR/gopher/gophermap" ]]; then cp "$ENIGMA_INSTALL_DIR/misc/gophermap" "$ENIGMA_INSTALL_DIR/gopher/gophermap" @@ -161,7 +189,7 @@ copy_template_files() { enigma_footer() { log "ENiGMA½ installation complete!" - echo -e "\e[1;33m" + echo -e "${FOREGROUND_YELLOW}" cat << EndOfMessage ADDITIONAL ACTIONS ARE REQUIRED! @@ -216,19 +244,23 @@ ADDITIONAL ACTIONS ARE REQUIRED! Run 'sudo systemctl enable bbs.service' EndOfMessage - echo -e "\e[39m" + echo -e "${RESET}" } post_install() { MISE_SHIM_PATH_COMMAND='export PATH="$HOME/.local/share/mise/shims:$PATH"' - if ! grep -Fxq "$MISE_SHIM_PATH_COMMAND" ~/.bashrc + if grep -Fxq "$MISE_SHIM_PATH_COMMAND" ~/.bashrc then + log "${FOREGROUND_STRONG_GREEN}Mise Shims found in your ~/.bashrc${RESET}" + else echo $MISE_SHIM_PATH_COMMAND >> ~/.bashrc - echo -e "\e[0;32mInstalled Mise Shims into your ~/.bashrc\e[39m" + log "${FOREGROUND_STRONG_YELLOW}Installed Mise Shims into your ~/.bashrc${RESET}" fi } install_dependencies() { + log "${FOREGROUND_GREEN}Installing Dependencies...$RESET" + enigma_install_init install_mise_en_place install_tools @@ -237,11 +269,14 @@ install_dependencies() { } install_bbs() { + log "${FOREGROUND_GREEN}Installing ENiGMA½...$RESET" + download_enigma_source copy_template_files } install_everything() { + log "${FOREGROUND_STRONG_GREEN}Installing Everything...$RESET" download_enigma_source install_dependencies copy_template_files @@ -264,13 +299,16 @@ menu() { 2) install_bbs; break;; 3) enigma_install_init; install_everything; break;; $((${#options[@]}+1))) echo "Goodbye!"; exit 0;; - *) echo "Invalid option. Try another one.";continue;; + *) echo -e "${FOREGROUND_STRONG_RED}Invalid option.${RESET}";continue;; esac done < /dev/tty unset PS3 } +# Reset Logfile +rm $ENIGMA_INSTALL_LOG + enigma_header menu enigma_footer From 918e4249c334830d3032bb08f28453a46ead67be Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Tue, 26 Nov 2024 20:11:40 -0500 Subject: [PATCH 23/27] Update install.sh Flourish clean-up --- misc/install.sh | 81 ++++++++++++++++++++++++++++--------------------- 1 file changed, 46 insertions(+), 35 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index 0c2219adb..6e98d6730 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -47,7 +47,7 @@ BACKGROUND_STRONG_WHITE="\e[107m" enigma_header() { clear - echo -e "$FOREGROUND_STRONG_WHITE" + printf "$FOREGROUND_STRONG_WHITE" cat << EndOfMessage ______ _____________________ _____ ____________________ __________\\_ / @@ -64,11 +64,11 @@ ENiGMA½: Destination: ${ENIGMA_INSTALL_DIR} EndOfMessage - echo -e "$RESET" + printf "$RESET" } fatal_error() { - echo -e "${TIME_FORMAT} \e[41mERROR:\033[0m %b\n" "$*" >&2; + log "${TIME_FORMAT} ERROR: %b\n $*" >&2; exit 1 } @@ -77,12 +77,11 @@ check_exists() { } enigma_install_needs_ex() { - echo -ne "${FOREGROUND_GREEN}Checking for '$1'...${RESET}" + log "Checking for '$1'...${RESET}" if check_exists $1 ; then - echo -e "${FOREGROUND_STRONG_GREEN} Found!${RESET}" + log " Found!" else - echo "" - fatal_error "${FOREGROUND_STRONG_RED}ENiGMA½ requires '$1' but it was not found. Please install it and/or make sure it is in your path then restart the installer.\n\n$2${RESET}" + fatal_error "ENiGMA½ requires '$1' but it was not found. Please install it and/or make sure it is in your path then restart the installer.\n\n$2" fi } @@ -91,17 +90,30 @@ enigma_install_needs() { } enigma_has_mise() { - echo -e "${FOREGROUND_GREEN}Checking for an installation of mise-en-place (https://mise.jdx.dev/)${RESET}" + log "Checking for an installation of mise-en-place (https://mise.jdx.dev/)" if check_exists "mise"; then - echo -e "${FOREGROUND_STRONG_GREEN} Found!${RESET}" + log "Found!" else - echo "" - fatal_error "${FOREGROUND_STRONG_RED}ENiGMA½ requires mise-enplace to install dependencies.${RESET}" + log "" + fatal_error "ENiGMA½ requires mise-enplace to install dependencies." fi } -log() { - echo -e "${TIME_FORMAT} %b\n" "$*"; +log() { + local LOG_CONTENT=$1 + + local COLOUR="" + case $LOG_CONTENT in + "ERROR") + COLOUR="${FOREGROUND_STRONG_RED}" + ;; + *) + COLOUR="${FOREGROUND_GREEN}" + ;; + esac + + printf "${TIME_FORMAT} %b\n" "${COLOUR}${LOG_CONTENT}${RESET}"; + echo $LOG_CONTENT >> $ENIGMA_INSTALL_LOG } enigma_install_init() { @@ -135,14 +147,14 @@ download_enigma_source() { INSTALL_DIR=${ENIGMA_INSTALL_DIR} if [ -d "$INSTALL_DIR/.git" ]; then - log "${FOREGROUND_YELLOW}ENiGMA½ is already installed in $INSTALL_DIR, trying to update using git...${RESET}" + log "ENiGMA½ is already installed in $INSTALL_DIR, trying to update using git..." command git --git-dir="$INSTALL_DIR"/.git --work-tree="$INSTALL_DIR" fetch 2> /dev/null || - fatal_error "${FOREGROUND_STRONG_RED}Failed to update ENiGMA½, run 'git fetch' in $INSTALL_DIR yourself.${RESET}" + fatal_error "Failed to update ENiGMA½, run 'git fetch' in $INSTALL_DIR yourself." else - log "${FOREGROUND_GREEN}Downloading ENiGMA½ from git to '$INSTALL_DIR'${RESET}" + log "Downloading ENiGMA½ from git to '$INSTALL_DIR'" mkdir -p "$INSTALL_DIR" command git clone ${ENIGMA_SOURCE} "$INSTALL_DIR" || - fatal_error "${FOREGROUND_STRONG_RED}Failed to clone ENiGMA½ repo. Please report this!${RESET}" + fatal_error "Failed to clone ENiGMA½ repo. Please report this!" fi } @@ -157,15 +169,15 @@ is_arch_arm() { extra_npm_install_args() { if is_arch_arm ; then - echo "--build-from-source" + printf "--build-from-source" else - echo "" + printf "" fi } install_node_packages() { - log "${FOREGROUND_GREEN}Installing required Node packages...${RESET}" - log "${FOREGROUND_YELLOW}Note that on some systems such as RPi, this can take a VERY long time. Be patient!${RESET}" + log "Installing required Node packages..." + printf "Note that on some systems such as RPi, this can take a VERY long time. Be patient!" cd ${ENIGMA_INSTALL_DIR} local EXTRA_NPM_ARGS=$(extra_npm_install_args) @@ -173,15 +185,14 @@ install_node_packages() { npm install ${EXTRA_NPM_ARGS} >> $ENIGMA_INSTALL_LOG if [ $? -eq 0 ]; then - log "${FOREGROUND_STRONG_GREEN}npm package installation complete${RESET}" + log "npm package installation complete" else - fatal_error "${FOREGROUND_STRONG_RED}Failed to install ENiGMA½ npm packages. Please report this and refer to ~/enigma-install.log!{$RESET}" + fatal_error "Failed to install ENiGMA½ npm packages. Please report this and refer to ${ENIGMA_INSTALL_LOG}!" fi } copy_template_files() { - log "${FOREGROUND_GREEN}Copying Template Files to ${ENIGMA_INSTALL_DIR}/misc/gophermap${RESET}" - echo $ENIGMA_INSTALL_DIR + log "Copying Template Files to ${ENIGMA_INSTALL_DIR}/misc/gophermap" if [[ ! -f "$ENIGMA_INSTALL_DIR/gopher/gophermap" ]]; then cp "$ENIGMA_INSTALL_DIR/misc/gophermap" "$ENIGMA_INSTALL_DIR/gopher/gophermap" fi @@ -189,7 +200,7 @@ copy_template_files() { enigma_footer() { log "ENiGMA½ installation complete!" - echo -e "${FOREGROUND_YELLOW}" + printf "${FOREGROUND_YELLOW}" cat << EndOfMessage ADDITIONAL ACTIONS ARE REQUIRED! @@ -244,22 +255,22 @@ ADDITIONAL ACTIONS ARE REQUIRED! Run 'sudo systemctl enable bbs.service' EndOfMessage - echo -e "${RESET}" + printf "${RESET}" } post_install() { MISE_SHIM_PATH_COMMAND='export PATH="$HOME/.local/share/mise/shims:$PATH"' if grep -Fxq "$MISE_SHIM_PATH_COMMAND" ~/.bashrc then - log "${FOREGROUND_STRONG_GREEN}Mise Shims found in your ~/.bashrc${RESET}" + log "Mise Shims found in your ~/.bashrc" else echo $MISE_SHIM_PATH_COMMAND >> ~/.bashrc - log "${FOREGROUND_STRONG_YELLOW}Installed Mise Shims into your ~/.bashrc${RESET}" + log "Installed Mise Shims into your ~/.bashrc" fi } install_dependencies() { - log "${FOREGROUND_GREEN}Installing Dependencies...$RESET" + log "Installing Dependencies..." enigma_install_init install_mise_en_place @@ -269,14 +280,14 @@ install_dependencies() { } install_bbs() { - log "${FOREGROUND_GREEN}Installing ENiGMA½...$RESET" + log "Installing ENiGMA½..." download_enigma_source copy_template_files } install_everything() { - log "${FOREGROUND_STRONG_GREEN}Installing Everything...$RESET" + log "Installing Everything..." download_enigma_source install_dependencies copy_template_files @@ -284,7 +295,7 @@ install_everything() { menu() { title="Installation Options" - prompt="Pick an option:" + prompt="Select>" options=( "Install Dependencies" "Install ENiGMA½" @@ -298,8 +309,8 @@ menu() { 1) enigma_install_init; install_dependencies; break;; 2) install_bbs; break;; 3) enigma_install_init; install_everything; break;; - $((${#options[@]}+1))) echo "Goodbye!"; exit 0;; - *) echo -e "${FOREGROUND_STRONG_RED}Invalid option.${RESET}";continue;; + $((${#options[@]}+1))) printf "Goodbye!"; exit 0;; + *) printf "${FOREGROUND_STRONG_RED}Invalid option.${RESET}\n";continue;; esac done < /dev/tty From 350e2d576d7bc53c866dd83056395f6416f9be91 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Tue, 26 Nov 2024 20:15:27 -0500 Subject: [PATCH 24/27] Update install.sh --- misc/install.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/misc/install.sh b/misc/install.sh index 6e98d6730..6ca6587de 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -4,7 +4,6 @@ ENIGMA_BRANCH=${ENIGMA_BRANCH:=master} ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} ENIGMA_SOURCE=${ENIGMA_SOURCE:=https://github.com/NuSkooler/enigma-bbs.git} -ENIGMA_INSTALL_LOG=~/enigma-install.log TIME_FORMAT=`date "+%Y-%m-%d %H:%M:%S"` # ANSI Codes @@ -113,7 +112,6 @@ log() { esac printf "${TIME_FORMAT} %b\n" "${COLOUR}${LOG_CONTENT}${RESET}"; - echo $LOG_CONTENT >> $ENIGMA_INSTALL_LOG } enigma_install_init() { @@ -132,7 +130,7 @@ install_mise_en_place() { cd $ENIGMA_INSTALL_DIR - mise install >> ${ENIGMA_INSTALL_LOG} + mise install export PATH="$HOME/.local/share/mise/shims:$PATH" } @@ -183,11 +181,11 @@ install_node_packages() { local EXTRA_NPM_ARGS=$(extra_npm_install_args) git checkout ${ENIGMA_BRANCH} - npm install ${EXTRA_NPM_ARGS} >> $ENIGMA_INSTALL_LOG + npm install ${EXTRA_NPM_ARGS} if [ $? -eq 0 ]; then log "npm package installation complete" else - fatal_error "Failed to install ENiGMA½ npm packages. Please report this and refer to ${ENIGMA_INSTALL_LOG}!" + fatal_error "Failed to install ENiGMA½ npm packages. Please report this!" fi } @@ -317,9 +315,6 @@ menu() { unset PS3 } -# Reset Logfile -rm $ENIGMA_INSTALL_LOG - enigma_header menu enigma_footer From dec1d6acb0d4c64f6ce9bc9febee7383378eb4a6 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Wed, 27 Nov 2024 07:34:51 -0500 Subject: [PATCH 25/27] Updated autoexec.sh per feedback --- autoexec.sh | 48 ++++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/autoexec.sh b/autoexec.sh index c52b9d47c..7a67a4b4c 100644 --- a/autoexec.sh +++ b/autoexec.sh @@ -3,6 +3,7 @@ # Environment ENIGMA_INSTALL_DIR=${ENIGMA_INSTALL_DIR:=$HOME/enigma-bbs} AUTOEXEC_LOGFILE="$ENIGMA_INSTALL_DIR/logs/autoexec.log" +TIME_FORMAT=`date "+%Y-%m-%d %H:%M:%S"` # Mise en place ~/.local/bin/mise activate bash >> bash @@ -14,40 +15,51 @@ ENIGMA_PYTHON_VERSION=${ENIGMA_PYTHON_VERSION:=$(toml get --toml-path=$ENIGMA_IN # Validate Environment DEPENDENCIES_VALIDATED=1 -echo "$(date '+%Y-%m-%d %H:%M:%S') - START:" | tee -a $AUTOEXEC_LOGFILE -echo "$(date '+%Y-%m-%d %H:%M:%S') - PATH: $PATH" | tee -a $AUTOEXEC_LOGFILE -echo "$(date '+%Y-%m-%d %H:%M:%S') - CURRENT DIR: ${PWD##}" | tee -a $AUTOEXEC_LOGFILE +# Shared Functions +log() { + echo "${TIME_FORMAT} " "$*" >> $AUTOEXEC_LOGFILE +} + +# If this is a first run, the log path will not yet exist and must be created +if [ ! -d "$ENIGMA_INSTALL_DIR/logs" ] +then + mkdir -p $ENIGMA_INSTALL_DIR/logs +fi + +log "START:" +log "- PATH: $PATH" +log "- CURRENT DIR: ${PWD##}" if ! command -v "mise" 2>&1 >/dev/null then - echo "$(date '+%Y-%m-%d %H:%M:%S') - mise is not in your PATH, activating" | tee -a $AUTOEXEC_LOGFILE + log "mise is not in your PATH, activating" eval "$(~/.local/bin/mise activate bash)" fi if ! command -v "node" 2>&1 >/dev/null then - echo "$(date '+%Y-%m-%d %H:%M:%S') - Node environment is not in your PATH" | tee -a $AUTOEXEC_LOGFILE - echo "$(date '+%Y-%m-%d %H:%M:%S') - ERROR END" | tee -a $AUTOEXEC_LOGFILE + log "Node environment is not in your PATH" + log "ERROR END" exit 1 else NODE_VERSION=$(node --version | tee /dev/null) - echo "$(date '+%Y-%m-%d %H:%M:%S') - NODE VERSION: $NODE_VERSION" | tee -a $AUTOEXEC_LOGFILE + log "- NODE VERSION: $NODE_VERSION" if [[ $NODE_VERSION != "v$ENIGMA_NODE_VERSION."* ]]; then - echo "$(date '+%Y-%m-%d %H:%M:%S') - Node version found in your PATH is $NODE_VERSION, was expecting v$ENIGMA_NODE_VERSION.*; you may encounter compatibility issues" | tee -a $AUTOEXEC_LOGFILE + log "Node version found in your PATH is $NODE_VERSION, was expecting v$ENIGMA_NODE_VERSION.*; you may encounter compatibility issues" DEPENDENCIES_VALIDATED=0 fi fi if ! command -v "python" 2>&1 >/dev/null then - echo "$(date '+%Y-%m-%d %H:%M:%S') - Python environment is not in your PATH" - echo "$(date '+%Y-%m-%d %H:%M:%S') - ERROR END" | tee -a $AUTOEXEC_LOGFILE + log "Python environment is not in your PATH" + log "ERROR END" exit 1 else PYTHON_VERSION=$(python --version | tee /dev/null) - echo "$(date '+%Y-%m-%d %H:%M:%S') - PYTHON VERSION: $PYTHON_VERSION" | tee -a $AUTOEXEC_LOGFILE + log "- PYTHON VERSION: $PYTHON_VERSION" if [[ $PYTHON_VERSION != "Python $ENIGMA_PYTHON_VERSION"* ]]; then - echo "$(date '+%Y-%m-%d %H:%M:%S') - Python version found in your PATH is $PYTHON_VERSION, was expecting Python $ENIGMA_PYTHON_VERSION.*; you may encounter compatibility issues" | tee -a $AUTOEXEC_LOGFILE + log "Python version found in your PATH is $PYTHON_VERSION, was expecting Python $ENIGMA_PYTHON_VERSION.*; you may encounter compatibility issues" DEPENDENCIES_VALIDATED=0 fi fi @@ -55,16 +67,16 @@ fi # Validate whether we are good to Start if [ "$DEPENDENCIES_VALIDATED" == "0" ]; then if [ -v ENIGMA_IGNORE_DEPENDENCIES ] && [ "${ENIGMA_IGNORE_DEPENDENCIES}" == "1" ]; then - echo "$(date '+%Y-%m-%d %H:%M:%S') - ENIGMA_IGNORE_DEPENDENCIES=1 detected, starting up..." | tee -a $AUTOEXEC_LOGFILE + log "ENIGMA_IGNORE_DEPENDENCIES=1 detected, starting up..." else - echo "$(date '+%Y-%m-%d %H:%M:%S') - NOTE: Please re-run with 'ENIGMA_IGNORE_DEPENDENCIES=1 /path/to/autoexec.sh' to force startup" | tee $AUTOEXEC_LOGFILE - echo "$(date '+%Y-%m-%d %H:%M:%S') - ERROR END" | tee -a $AUTOEXEC_LOGFILE + log "NOTE: Please re-run with 'ENIGMA_IGNORE_DEPENDENCIES=1 /path/to/autoexec.sh' to force startup" + log "ERROR END" exit 1 fi fi # Start BBS -echo "$(date '+%Y-%m-%d %H:%M:%S') - Starting ENiGMA½" | tee -a $AUTOEXEC_LOGFILE +log "Starting ENiGMA½" ~/enigma-bbs/main.js result=$? @@ -73,6 +85,6 @@ result=$? # # TODO: Notify via SMS / Email of Startup Failure # fi -echo "$(date '+%Y-%m-%d %H:%M:%S') - ENiGMA½ exited with $result" | tee -a $AUTOEXEC_LOGFILE -echo "$(date '+%Y-%m-%d %H:%M:%S') - END" | tee -a $AUTOEXEC_LOGFILE +log "ENiGMA½ exited with $result" +log "END" exit $result From 79a238ad768b96efe0c3c1774cb517e8350ffe02 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Wed, 27 Nov 2024 07:39:39 -0500 Subject: [PATCH 26/27] Update install.sh --- misc/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/install.sh b/misc/install.sh index 6ca6587de..d45e8d3d2 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -205,7 +205,7 @@ ADDITIONAL ACTIONS ARE REQUIRED! -------------------------------- 1 - If you did not have Node.js and/or NVM installed previous to this please open a new shell/terminal now! - (!) Not doing so will prevent 'nvm' or 'node' commands from functioning! + (!) Not doing so will prevent 'nvm', 'node', or 'python' commands from functioning! 2 - If this is the first time you've installed ENiGMA½, you now need to generate a minimal configuration: From ed04b28e7c346e5b9d74b15e686d100e380a3d10 Mon Sep 17 00:00:00 2001 From: Carl Roman Hultay <144816337+crhultay@users.noreply.github.com> Date: Wed, 27 Nov 2024 07:40:48 -0500 Subject: [PATCH 27/27] Update install.sh --- misc/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/install.sh b/misc/install.sh index d45e8d3d2..a694cf661 100755 --- a/misc/install.sh +++ b/misc/install.sh @@ -204,7 +204,7 @@ enigma_footer() { ADDITIONAL ACTIONS ARE REQUIRED! -------------------------------- -1 - If you did not have Node.js and/or NVM installed previous to this please open a new shell/terminal now! +1 - If you did not have Node.js and/or mise installed previous to this please open a new shell/terminal now! (!) Not doing so will prevent 'nvm', 'node', or 'python' commands from functioning! 2 - If this is the first time you've installed ENiGMA½, you now need to generate a minimal configuration: