-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installation Script Enhancement and Startup Script #580
Conversation
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 NuSkooler#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.
autoexec.sh confirmed working with systemctl |
@NuSkooler I have completed writing for this PR and have tested installation, autoexec, and systemd startup with success on my Ubuntu Server 24.04 installation. Versions of node and python are now configurable via mise.toml and read automatically into autoexec.sh for pre-startup dependency configuration. |
This looks awesome! Since this is a fairly large change to the initial setup, I'm going to create 1-2 from scratch VM's and run through the paces before merging in (1 Debian/Ubuntu, another RHEL based). Skimming over the code, I don't expect any major issues. |
Makes perfect sense to me. |
Okay, that's interesting... :) Will evaluate this after some day job stuff, thank you for testing and pardon the issue. |
Tested by piping through bash -- reproduced the same issue. I predict this same issue will occur in all distros. That is interesting. I don't understand why that is however will continue to investigate. |
I'll poke around as well, at least it's consistent! |
https://stackoverflow.com/questions/46402174/bash-built-in-command-select-not-work-via-pipe-in-shell-script talks about this exact issue |
Fixed, try again |
Progress -- here are the results from AlmaLinux 9: _____________________ _____ ____________________ __________\_ /
\__ ____/\_ ____ \ /____/ / _____ __ \ / ______/ // /___jp!
// __|___// | \// |// | \// | | \// \ /___ /_____
/____ _____| __________ ___|__| ____| \ / _____ \
---- \______\ -- |______\ ------ /______/ ---- |______\ - |______\ /__/ // ___/
/__ _\
<*> ENiGMA½ // https://github.com/NuSkooler/enigma-bbs <*> /__/
Installing ENiGMA½:
Source : https://github.com/NuSkooler/enigma-bbs.git (master branch)
Destination: /home/nuskooler/enigma-bbs
>> If this isn't what you were expecting, hit CTRL-C now!
>> Installation will continue in seconds...
Installation Options
1) Install Dependencies
2) Install ENiGMA½
3) Install Everything
4) Quit
Pick an option: 3
Checking for 'git'... Found!
Checking for 'curl'... Found!
Checking for a suitable Python installation... Found!
Checking for 'make'... Found!
Checking for 'make'... Found!
Checking for 'gcc'... Found!
Checking for 'git'... Found!
Checking for 'curl'... Found!
Checking for a suitable Python installation... Found!
Checking for 'make'... Found!
Checking for 'make'... Found!
Checking for 'gcc'... Found!
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6333 100 6333 0 0 17640 0 --:--:-- --:--:-- --:--:-- 17689
mise: installing mise...
######################################################################## 100.0%
mise: installed successfully to /home/nuskooler/.local/bin/mise
mise: run the following to activate mise in your shell:
echo "eval \"\$(/home/nuskooler/.local/bin/mise activate bash)\"" >> ~/.bashrc
mise: this must be run in order to use mise in the terminal
mise: run `mise doctor` to verify this is setup correctly
mise all runtimes are installed
2024-11-25 12:39:59 Installing required Node packages...
2024-11-25 12:39:59 Note that on some systems such as RPi, this can take a VERY long time. Be patient!
main: line 136: cd: /home/nuskooler/enigma-bbs: No such file or directory
fatal: not a git repository (or any of the parent directories): .git
2024-11-25 12:39:59 ERROR: Failed to install ENiGMA½ npm packages. Please report this!
[nuskooler@localhost ~]$ I will re-test Ubuntu in one moment and post here. Update |
Committed the latest install.sh version; however I get this error during 'npm install':
The issue is that 'node' is an alias, and not found in the PATH. When I run 'which node', nothing is returned. I'm not entirely sure how to get around this nuance, however it is the final blocker for an install script that works on a vanilla machine. |
Spoke too soon -- SORTED! The solution was to use shims per https://mise.jdx.dev/cli/activate.html |
I was able to get a bit further, but |
If you run autoexec.sh, it will work because it adds the shim to your PATH. What we could do is echo this into the user's ~/.bashrc and then they would be free to run ./main.js without having to init the mise environment or having to run autoexec.sh. What do you think? |
Previously we'd install |
Please note that you must be in the enigma-bbs dir in order for your node/npm/python commands to be functional as the .venv and mise.toml are present in enigma-bbs. Let me know what you think. |
Added some ANSI codes to make it look 31337, I tested this thoroughly in Ubuntu 24.04 with no node installed, and Python 3.12 used by system -- this appears to work great. |
Just tried out the latest on Ubuntu right before you pushed the ANSI I believe. Worked great! I like that it localizes the install to the enigma directory now 👍 One note: The first message output in final steps notes I'll try Alma next, should pick up your latest ANSI stuff. Update: AlmaLinux 9 worked like a charm. |
I don't want to hold this up, so when you're comfortable let me know. It's working great on my end. |
autoexec.sh cleaned up to use a common log function, and also auto-detect whether the logs directory exists; turns out it's created on first-run but this will cause an error scenario for new BBSes if ./main.js has not been run the first time. Please do me a favour and:
That is, if this is easy enough for you to do. I am unable to do this in my remote repo without getting fancy. |
Nice catch, replaced 'nvm' with 'mise' and some other touch-ups. Please note that when you merge this commit, you can probably close out a lot of the issues pertaining to "Enigma isn't compatible with modern distros, etc." since this environment isolation will fix that. |
Unrelated note -- my user 'egonis' on your BBS is getting 'That user is already logged in' when I try to connect by telnet, and I get 'Error -21 activating session' via SSH via Syncterm (could be my issue). Could I get you to look at this? I am missing out on my LoRD character and Dank Dungeons daily routines. :) |
Updated - There is a bug in which SSH gets stuck at times :D Merging and will apply +x! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to help a lot of new users!
Do we have an issue for the SSH issue and how to reproduce? |
I could have sworn there was a issue, but I don't see it. Feel free to create. It's something I want to start looking at as well as I get some time here. |
Added Selection Menu to choose Dependencies, or to Install Everything
Added Python Environment Installation Option
Added Bugfix for Gopher Template Installation which was throwing path errors
They key motivation is:
This enhancement will allow the user to auto-install the Python Runtime Environment with a version proven to work with ENiGMA½. It will remove the inability for a user to run the latest Linux Distro and decouples ENiGMA½ from the operating system's Python environment.
It is a common, and poor practice to downgrade the OS Python Environment as it can break operating system functionality.
It is becoming common, and recommended practice to build your own python environment for resiliency in production systems, and this makes ENiGMA½ more versatile and reliable.