diff --git a/dietpi/dietpi-software b/dietpi/dietpi-software index 1b2954a593..be9a4bd680 100755 --- a/dietpi/dietpi-software +++ b/dietpi/dietpi-software @@ -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 @@ -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 @@ -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 @@ -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