If you want to install frontail, execute the following script as sudo:
#This installs nodejs (it might run with version 21, too, but I am not sure). You may want to uninstall version 21 first
curl -fsSL "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key" | gpg --dearmor > /usr/share/keyrings/nodesource.gpg
echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" > /etc/apt/sources.list.d/nodesource.list
apt-get install --yes nodejs
#Install NPM
apt-get install --yes npm
#Install FRONTAIL
useradd --groups bguser,openhab -s /bin/bash -d /var/tmp frontail
mkdir -p /usr/local/lib/node_modules/frontail
git clone https://github.com/Interstellar0verdrive/frontail_AEM.git /usr/local/lib/node_modules/frontail
cd /usr/local/lib/node_modules/frontail
npm audit fix --omit=dev
npm update --audit=false --omit=dev
npm install --global --audit=false --omit=dev
echo '[Unit]
Description=Frontail openHAB instance, reachable at http://%H:9001
Documentation=https://github.com/mthenw/frontail
After=openhab.service
PartOf=openhab.service
[Service]
Type=simple
ExecStart=/usr/local/lib/node_modules/frontail/bin/frontail --disable-usage-stats --ui-highlight --ui-highlight-preset /usr/local/lib/node_modules/frontail/preset/openhab_AEM.json --theme openhab_AEM --lines 2000 --number 200 /var/log/openhab/openhab.log /var/log/openhab/events.log
Restart=always
User=frontail
Group=openhab
Environment=PATH=/usr/local/bin:/usr/bin/
Environment=NODE_ENV=production
WorkingDirectory=/usr/bin/
[Install]
WantedBy=multi-user.target' | tee /etc/systemd/system/frontail.service
chmod 644 /etc/systemd/system/frontail.service
systemctl enable --now frontail.service