How to change node-red-dashboard favicon

Hi.

I’m trying to find out how to change the node-red-dashboard favicon that is displayed on the external UI or rather the public-url.

Best option would be to edit some file to point to external source.
But if that’s not possible I guess I need to add the favicon to device directory.
If so do I need to add the file to node-red container or root?
Can I add it via SSH or do I need to add to the SD card directly?

I have tried googling and found one having this issue on node-red, but he didn’t use balena.
So the solution didn’t match up.

Hi, this seems nodered specific problem, so balena forums is not the best place to ask (please correct me if I’m wrong).
I found this related topic: https://discourse.nodered.org/t/custom-site-icon-on-dashboard/11724
If you find a general solution for this, it should work with balena’s public url too.

The issue is how to access the files.
I can find them in:
/usr/local/lib/node_modules/node-red-dashboard/dist
But only when I’m in the node-red service terminal in balena.
The path above does not exist if I ssh to the device from my computer.

How can I transfer the files from my computer?

Can you please show us your project’s Dockerfile?

# base-image for node on any machine using a template variable,
# see more about dockerfile templates here:http://docs.resin.io/pages/deployment/docker-templates
# Note the node:slim image doesn't have node-gyp

FROM resin/%%RESIN_MACHINE_NAME%%-node:6-slim

# Define working directory in container
RUN mkdir -p /usr/src/app/
WORKDIR /usr/src/app

RUN apt-get update && apt-get install -y \
  cmake \
  make \
  gcc \
  g++ \
  git \
  python \
  python-dev \
  python-pip \
  wget \
  curl \
  libevent-dev \
  libpthread-stubs0-dev 

RUN pip install requests spidev RPi.GPIO

RUN JOBS=MAX npm install -g \
  node-red \
  node-red-contrib-cpu \
  node-red-contrib-persist \
  node-red-contrib-ipc \
  node-red-contrib-boolean-logic \
  node-red-contrib-resinio \
  node-red-contrib-aws-iot-hub \
  node-red-dashboard \
  node-red-node-smooth \
  node-red-contrib-statistics \
  node-red-contrib-cron \
  node-red-contrib-msg-queue \
  --production

RUN npm cache clean --force && rm -rf /tmp/*

# Set timezone
ENV TZ=CET 
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# This will copy all files in our root to the working  directory in the container
COPY ./app ./

# Enable systemd init system in container
ENV INITSYSTEM=on

# server.js will run when container starts up on the device
CMD ["bash", "/usr/src/app/start.sh"]

You must be ssh ing into hostOS instead of container.
Take a look at the docs: https://www.balena.io/docs/reference/cli/#ssh-applicationordevice-servicename
Try: balena ssh <device_uuid> <service_name>

I’m able to ssh into container.
But I’m still not 100% clear on how to transfer files with e.g. scp

I tried balena tunnel UUID -p 22222:4321
C:\Users\Username\Pictures\icons>scp -P 4321 root@127.0.0.1:/usr/local/lib/node_modules/node-red-dashboard/dist/icon.png C:\Users\Username\Pictures\icons\icon.png
scp: /usr/local/lib/node_modules/node-red-dashboard/dist/icon.png: No such file or directory

I’m guessing it doesn’t work because I’m tunneled to the HostOS and not the service container

is it possible to tunnel to a container?

Yes, as long as your container exposes that port that you are trying to tunneling to, then you should be able to tunnel straight into that container. This is assuming you have sshd listening inside the container on the port you are tunnelling to, so you can use scp on that port.
You could also scp the file to the hostOS in /tmp/ from where you can send it to the container withbalena cp`.

hmm… seems like I have another issue as I get this:
C:\Users\Username\Pictures\icons>scp -P 4321 root@127.0.0.1:/tmp/icon.png C:\Users\Username\Pictures\icons\icon.png
scp: /tmp/icon.png: No such file or directory

Are you trying to copy a file to your device? In that case the first parameter should be the file you wish to copy, e.g. C:\Users\Username\Pictures\icons\icon.png, followed by the destination, which would be root@127.0.0.1:/tmp/icon.png