Another (silly) question ; modify Screenly OSE front-end templates (deployed with BalenaHub)

Hi everyone,

I tried to modify some stuff in front-end templates of Screenly OSE deployed on my Rpi4 few days ago.
I followed BalenaHub Tutorial, everything went fine.

Recently, I logged to all services by online terminal and installed nano to modify *.html files
After rebooting, everything disappeared and worst, during the session I can’t see any changes by reaching local or public address.

Did I miss something?
Do you know how to modifiy that files and get it persistent?

Thank you very much!

Hi there,
just to be sure, I would like to understand the question, could you please clarify the exact procedure you are following to change the application code ?

Hi @JSReds ,

Thanx for your help.

I want to add some features to the front-page :

I logged in BalenaCloud to use the terminal service by service like that

After command line sudo apt install nano I was able to change all templates *.html with that simple editor. I can’t see changes in front-end (anywhere I changed it and worst, i lose my previous installation of nano or my changes in files).

How and where I have to implement my code to make those changes?
(I’m not really familiar with Balenacloud/service etc… I started my project 10 days ago)

Thank you

Hi there,
ok thanks for the explanation. What is happening is that you are trying to change the code inside a docker container. By definition, the data inside a container does not persist. To have persistent data, a volume would be needed (but this is also not the right way to achieve what you want to do). The right way to change the code of your application is to:

  1. Download the project to your computer (using git or downloading the zip from this url: GitHub - Screenly/screenly-ose: The most popular digital signage project on Github!)
  2. Open the project with a text editor (vsCode, atom, sublime … whatever you prefer).
  3. Find the file to edit, edit it and save the changes.
  4. using balena-cli push the updated code on the application. (balena-cli push documentation balena CLI Documentation - Balena Documentation)

if you haven’t installed balena-cli yet, please have a look here: balena CLI Documentation - Balena Documentation

1 Like

Thanks @JSReds for your answer!

Wow! I understand, sorry for that, it’s my first time and I discover how works docker container. I have to improve my knowledge about that! And read a lot… I don’t know why the data can’t persist in it but there is probably a very good reason. I thought it’s possible to write or modify data and save it as I use to do.

I don’t know what is a volume but I have to learn more about it too. Do you have some links to share to improve myself? Maybe OpenClassrooms or websites like that??

I get it, I already pushed Screenly by using CLI the first time (BalenaHub Tutorial). I understand that I have to push my modified code before pushing it on the device by Balena CLI. I will use vsCode to edit my code.

Thank you very much for your step-by-step explanation, for your time, and helping a newbie like me!!

Hi Cristophe,

We are happy to help!

You can read more about Docker, how to use it and data persistence on our Docker Masterclass. You can also learn about how to push new releases for your app on our Balena CLI Masterclass.

Please let us know if we can help you with something else.

1 Like

Thank you @pipex it’s great!
I started to read (and to learn) .

I tried to push my update but still have errors… I have to check again.

Thank you!

Hi again, glad those resources are working for you.

Anything we can help with? If you provide some more information on the changes you made we might be able to help you understand why your builds are failing.

Hi @pipex,

Finally, I tried the Rahul-thakoor’s proposal and pick up the scheduler part of that.

I lost everything (all dockers container) for only unfunctional one : Main after pushing it by Balena-CLI
I didn’t evaluate good enough what i was doing exactly. I don’t want to annoy you more. I have to study master classes and get better in Balena stuff:smiley: (specially dockers)

The good news is I started again to push my first App (Screenly OSE) with improvements I did and everything works!

It took 8 minutes.

Question… can I say it’s like “compiling” a project to my device? Is there a way to only send static *.html files without sending all directories and files to the device?
How can I add a container docker with cron task see above in here which manages only the cron tasks?

// scripts

*** start.sh ***
#!/bin/bash

if [ ! -z ${ENABLE_HDMI_SWITCH+x} ] && [ “$ENABLE_HDMI_SWITCH” -eq “1” ]

then

(crontab -l; echo “${HDMI_ON:-0 6 * * *} /usr/src/hdmi_on.sh”) | crontab -

(crontab -l; echo “${HDMI_STANDBY:-03 20 * * *} /usr/src/hdmi_standby.sh”) | crontab -

fi

crond -f

*** hdmi_on.sh ***
#!/bin/bash

echo ‘on 0.0.0.0’ | cec-client -s -d 1

*** hdmi_standby.sh ***
#!/bin/bash

echo ‘standby 0.0.0.0’ | cec-client -s -d 1

To get this kind of things :

Am I on the right way??

Thank you!!

Hi

So we have something known as delta updates - which will only download the difference between the old and the new container. Most likely, this should already be enabled for you.

You can find more information about what this is and how it works on our docs page for delta updates

Hi @anujdeshpande,

I will let you know if everything goes good after updating.

Thank you very much for your advice!

Hi again @anujdeshpande,

It seems the delta update is not available for me. I read everything about it, and found by default the RESIN_SUPERVISOR_UPDATE_STRATEGY is already set (download-to-kill).
I guess there is nothing to explore more that way to force the update’s listing available…

Have I to wait for the capability to do it? Or there is something to do to lauch (and force) the delta update?

Delta updates are set to “On” by default. There is nothing you need to do to enable them. :slight_smile:

Hi @dtischler,

Thanx for your answer. I made a new application and add a new device (Rpi 4 mod.B 8Go RAM and 128 Go SD card to make some tests), and I have still the same BalenaOs version (2.73.1+rev1) and updated Supervisor to v12.5.6 (was 12.4.6 when I flashed SD card first).

I guess I have the last “mouture”. Never mind, I improve myself, day by day, step by step, and dockers are more familiar to me… I have to study more and better the BalenaCloud philosophy.

Cheers!

Hi @pesant, sounds like you are enjoying the process, right? That’s the most important part :smiley:

In case you haven’t seen it yet, let me also share our documentation on developing locally: Develop locally - Balena Documentation

Local mode accelerates the feedback cycle and makes the development more efficient. So I encourage you to take a look at that as well.

Let us know how it goes and if we could help with anything specific.

Cheers…