Skip to content

Commit

Permalink
v9.9
Browse files Browse the repository at this point in the history
- DietPi-Software | MineOS: Fix install on Bookworm by using latest userid Node module version. The defined v1.0.0-beta.9 fails to build on all Bookworm systems, for unknown reasons, the latest stable v1.2.5 however builds fine.
- DietPi-Software | Create again a dedicated mineos login user to manage the Minecraft servers. We switched to root, due to insufficient permissions, but I could not replicate any issues, after changing owner of /mnt/dietpi_userdata/mineos/serverdata accordingly. Apply SHA512 password algorithm for this user explicitly, as MineOS does not support the new default yescrypt: #5759
  • Loading branch information
MichaIng committed Nov 8, 2024
1 parent 70181b0 commit 1d742ce
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -8433,6 +8433,9 @@ _EOF_
G_EXEC git config core.filemode false
G_EXEC chmod +x mineos_console.js webui.js update_webui.sh reset_webui.sh generate-sslcert.sh

# Bookworm: Workaround for failing userid 1.0.0-beta.9 build on weirdly Bookworm only. Latest stable 1.2.5 seems to work well: https://github.com/MichaIng/DietPi/issues/7265
G_CONFIG_INJECT '"userid"' ' "userid": "1.2.5",' package.json

# Workaround: Node.js posix needs to be installed alone first: https://github.com/MichaIng/DietPi/issues/5181
G_EXEC_OUTPUT=1 G_EXEC npm i --no-audit --no-package-lock posix@latest

Expand All @@ -8453,7 +8456,7 @@ _EOF_
G_EXEC cd "$G_WORKING_DIR"

# Service
cat << _EOF_ > /etc/systemd/system/mineos.service
cat << '_EOF_' > /etc/systemd/system/mineos.service
[Unit]
Description=MineOS (DietPi)
Wants=network-online.target
Expand All @@ -8463,12 +8466,19 @@ After=network-online.target
SyslogIdentifier=MineOS
WorkingDirectory=/mnt/dietpi_userdata/mineos/minecraft
Environment="SHELL=/bin/bash" "HOME=/root"
ExecStart=$(command -v node) webui.js
ExecStart=/usr/local/bin/node webui.js
KillMode=process

[Install]
WantedBy=multi-user.target
_EOF_
# User and permissions
local new_user=0
getent passwd mineos &> /dev/null && new_user=1
Create_User -d /mnt/dietpi_userdata/mineos/serverdata -p "$GLOBAL_PW" mineos
G_EXEC chown -R mineos /mnt/dietpi_userdata/mineos/serverdata
# - Assure SHA512 password hash algorithm, as MineOS does not support yescrypt, default since Bullseye: https://github.com/hexparrot/mineos-node/issues/441
(( $new_user )) && G_EXEC eval "chpasswd --crypt-method SHA512 <<< 'mineos:$GLOBAL_PW'"
fi

if To_Install 46 qbittorrent # qBittorrent
Expand Down Expand Up @@ -13598,10 +13608,10 @@ _EOF_

if To_Uninstall 53 # MineOS
then
Remove_Service mineos 1 1 # User and group for pre-v6.34
Remove_Service mineos 1 1
[[ -d '/mnt/dietpi_userdata/mineos' ]] && G_EXEC rm -R /mnt/dietpi_userdata/mineos
[[ -f '/etc/mineos.conf' ]] && G_EXEC rm /etc/mineos.conf
G_EXEC rm -Rf /var/games/minecraft /usr/local/bin/mineos # Symlinks
G_EXEC rm -Rf /var/games/minecraft /usr/local/bin/mineos /etc/ssl/certs/mineos.* # Symlinks and SSL cert
[[ -d '/home/mineos' ]] && G_EXEC rm -R /home/mineos # pre-v6.34
fi

Expand Down

0 comments on commit 1d742ce

Please sign in to comment.