Friday 5 July 2024

Dashy in Alpine from source


Install dependencies: git, yarn, npm
apk add --update git yarn npm

Get Code: git clone https://github.com/Lissy93/dashy.git and cd dashy
Configuration: Fill in you're settings in ./user-data/conf.yml (by default no changes needed)
git clone https://github.com/Lissy93/dashy.git
cd dashy

Ensure that you have the Vue CLI installed globally on your system. Run the following command:
npm install -g @vue/cli
Or just we can make sure all the project dependencies are installed. Navigate to your project directory and run from dask project dir:
npm install

We could check if we are up to date with but it 99% will brake the project build, try if you want:)
npm audit fix --force

Or we could just run:
npm audit fix --force

After that we build the package,(at least 2G of RAM for build is needed or use in compile procedure or use--memory=1024m (did not work in my case)
yarn build

The config file for dashy in located under the file .env. And finaly run the new project:
npm start

If it did not work at some place go to : https://dashy.to/docs/troubleshooting/

Auto start on BOOT


For Alpine linux we are using OpenRC not systemd or initd so we need diffrent script in /etc/init.d/
Our file will be dashy
#!/sbin/openrc-run

name="node_app"
description="Node.js Dashy application"
#define port if we want to run on diffrent
#export PORT=80

# Path to the Node.js application directory
APP_DIR="/home/USERdashy/"
PID_FILE="/var/run/${RC_SVCNAME}.pid"
LOG_FILE="/var/log/${RC_SVCNAME}.log"

command="npm"
command_args="start"
command_user="USER"

depend() {
    need net
}

start_pre() {
    checkpath -d -o ${command_user}:nogroup /var/run/${RC_SVCNAME}
    checkpath -d -o ${command_user}:nogroup /var/log/${RC_SVCNAME}
}

start() {
    ebegin "Starting ${name}"
    start-stop-daemon --start --quiet --background \
        --chdir "${APP_DIR}" \
        --exec "${command}" \
        -- ${command_args} \
        >> "${LOG_FILE}" 2>&1
    eend $?
}

stop() {
    ebegin "Stopping ${name}"
    start-stop-daemon --stop --quiet --pidfile "${PID_FILE}"
    eend $?
}

status() {
    status_of_proc -p "${PID_FILE}" "${command}" && eend 0 || eend 1
}

Now change the file to be executable, and make the script to the default runlevels to start on boot:
sudo chmod +x /etc/init.d/dashy
sudo rc-update add node_app default

And finaly run the script and connect to application to alpine IP and port 4000
And we should see the result like this:
rc-service dashy start
 

 

 

 

ICONS needed :)

So we need icons from , we will use this onehttps://github.com/walkxcode/Dashboard-Icons
 
cd /home//
git clone https://github.com/walkxcode/dashboard-icons.git

Create folder in dashy directory
mkdir -p user-data/item-icons/icons
Now move the icons to new location:
mv dashboard-icons/png/* dashy/user-data/item-icons/icons/ 
 
 

No comments:

Post a Comment