Scripted MineOS Installation

Scripted MineOS Installation 19/06/2023

victort

Guru
Joined
Dec 31, 2021
Messages
973
victort submitted a new resource:

Scripted MineOS Installation - scripted installation of mineos in iocage jail

Scripted Installation of MineOS with Caddy with options to run behind a reverse proxy, self-signed cert, or completely independent and managing/renewing its own certs automatically using Caddy.

This script will create a jail and install MineOS and Caddy using a $FQDN of your choosing. It will also acquire a valid Let’s Encrypt certificate and keep it renewed using Caddy.

Reinstall is not supported because of some issues with the webui not loading. So make sure to export or copy your...

Read more about this resource...
 

Sniper-sama

Cadet
Joined
Jul 22, 2023
Messages
2
victort submitted a new resource:

Scripted MineOS Installation - scripted installation of mineos in iocage jail



Read more about this resource...
Hey. I'm sorry to reach out like this but I really need help with this. I've been trying to run this script for days now to no success. I'm obviously doing something wrong here.

Here's all my steps so far:
- Created another dataset (mineos)
- Using shell I went straight to the directory cd /mnt/MyNas/mineos
- Used git clone https://github.com/tschettervictor/truenas-iocage-mineos. Every thing seemed to go fine and it generated the truenas-iocage-mineos folder
- Got into the folder directory using FileZilla and created the mineos_config file
- Used shell to go in to the cd /mnt/MyNas/mineos/truenas-iocage-mineos directory and I tried to run the script mineos.log ./mineos-jail.sh
- It is not seeing the mineos_config file inside the same directory it's in. This is the error it gives me: /mnt/MyNAS/mineos/truenas-iocage-mineos/mineos-config must exist.

Am I missing a step or doing something wrong? This is as far as I've gotten. I'm absolutely new to this.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
The mineos-config file has to be named with a “-“ (dash) and not a “_” (underscore) notice yours is mineos_config

I would also encourage you to store the script somewhere like /usr/local and not in the directory where you plan to store you mineos files.
 

Sniper-sama

Cadet
Joined
Jul 22, 2023
Messages
2
The mineos-config file has to be named with a “-“ (dash) and not a “_” (underscore) notice yours is mineos_config

I would also encourage you to store the script somewhere like /usr/local and not in the directory where you plan to store you mineos files.
Oh my goodness. I didn't even realize I got the file name wrong. Well you can clearly see why I needed help. And I moved everything to /usr/local like you suggested. I can get to the MineOS interface now. Thank you so much.
 

ResoBoy

Cadet
Joined
Nov 20, 2021
Messages
7
Hi,
the script is not working anymore. I am using TrueNAS-13.0-U5.3.

Error Code::
npm ERR! code 1
npm ERR! path /usr/local/games/minecraft/node_modules/userid
npm ERR! command failed
npm ERR! command sh -c npm run build
npm ERR! > userid@1.0.0-beta.9 build
npm ERR! > node-gyp rebuild
npm ERR!
npm ERR! gmake: Entering directory '/usr/local/games/minecraft/node_modules/userid/build'
npm ERR! CXX(target) Release/obj.target/userid/src/Gid.o
npm ERR! CXX(target) Release/obj.target/userid/src/Gids.o
npm ERR! gmake: Leaving directory '/usr/local/games/minecraft/node_modules/userid/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@16.20.1 | freebsd | x64
npm ERR! gyp info find Python using Python version 3.9.18 found at "/usr/local/bin/python3.9"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.1/node-v16.20.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.1/node-v16.20.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.20.1/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.20.1/SHASUMS256.txt
npm ERR! gyp info spawn /usr/local/bin/python3.9
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/games/minecraft/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/games/minecraft/node_modules/userid/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/games/minecraft/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/16.20.1/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/16.20.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/games/minecraft/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.20.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/local/games/minecraft/node_modules/userid',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn gmake
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../src/Gids.cc:114:19: error: use of undeclared identifier 'getgrouplist'
npm ERR! foundGroups = getgrouplist(username.c_str(), pw->pw_gid, groups, &ngroups);
npm ERR! ^
npm ERR! 1 error generated.
npm ERR! gmake: *** [userid.target.mk:112: Release/obj.target/userid/src/Gids.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `gmake` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/local/games/minecraft/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System FreeBSD 13.1-RELEASE-p7
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/games/minecraft/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /usr/local/games/minecraft/node_modules/userid
npm ERR! gyp ERR! node -v v16.20.1
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-10-31T14_49_09_778Z-debug-0.log
Command: /bin/sh -c cd /usr/local/games/minecraft && npm install npm@9 && npm install jsegaert/node-userid && npm install failed!
Failed to install MineOS.
 

ResoBoy

Cadet
Joined
Nov 20, 2021
Messages
7
Updated. Try again.
Ok, the script run to the end without errors. Great. Now i cant access the mineos webpage.
I login to the jail and run "supervisorctl status mineos":
mineos STARTING
after a few seconds again:
mineos BACKOFF Exited too quickly (process log may have details)
It is now a problem with mineos itself. It starts and crashd.
 

ResoBoy

Cadet
Joined
Nov 20, 2021
Messages
7
How long did you wait before running the “status” command?

I just did a fresh install without issue.
A couple of minutes, after the fresh install. End even now still the same error.
I have lookt into the logfile of supervisorctl and hier is a snippet of it:
2023-10-31 21:16:27,139 INFO success: mineos entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-10-31 21:16:27,139 INFO exited: mineos (exit status 1; not expected)
2023-10-31 21:16:28,142 INFO spawned: 'mineos' with pid 32583
2023-10-31 21:16:29,329 INFO success: mineos entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-10-31 21:16:29,329 INFO exited: mineos (exit status 1; not expected)
2023-10-31 21:16:30,352 INFO spawned: 'mineos' with pid 32584
2023-10-31 21:16:31,537 INFO success: mineos entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-10-31 21:16:31,537 INFO exited: mineos (exit status 1; not expected)
After a quick google search i found a thread with the same error. It seems the mineos installation ist missing something.
I am using the minimal mineos-config, only with diffrent IP-Adress, no-cert.
 

ResoBoy

Cadet
Joined
Nov 20, 2021
Messages
7
That’s all I have. Maybe delete any files located at /mnt/Datengrab-1/mineos and try a fresh install.
I did that with the same error. Now i create a VM with a fresh TrueNAS core install and run the script with no errors. Mineos is runnig fine in the VM Jail. So the problem is with my TrueNAS system itself. For now i exportet the Jail from the VM and inportet it in my real TrueNAS system and it's working fine there.

Thanks for all your help.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
@victort can I install this withouth using caddy or let's encrypt? Just exposing the jail.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Yes you can. Caddy is just there for easy management of Let’s Encrypt.

The MineOS port is 8443 I believe.

I usually just do Ctrl C at the caddy installation, when I want to skip it.
 
Top