I experimented this weekend with cloning Gladys to tinker with elements that are not meant to enrich the project. For example, I wanted to add the « Last 4h » choice in the charts, even though I know (and accept) that Pierre-Gilles does not want to add it to the official Gladys release.
And I do this also because I’m curious to explore Gladys’s code, and to take on the small technical challenge (at least for me it is one) of customizing Gladys by coding…
I managed to clone from GitHub, modify the right files, run the server and front parts (outside of Docker, just with the ‹ npm start ›), and it works. Now I’d like to do a build to install this customized version on my real instance, in Docker. But the information I found about this seems to involve adding my changes to a project on GitHub. And I’m not sure of the point of doing it that way, since I won’t need to share this version for others to test it…
So my question is: How do I do a build ‹ locally ›? Then how do I deploy the result of this build into my production Docker?
But if that’s not possible or not simple, I’ll look into how to do that by going through a GitHub project…
Hi @StephaneB,
That’s exactly the solution to apply a few small building blocks in Gladys.
For your information, I’ve been running a custom Gladys version for the Pro side at my home for 4 or 5 years.
I recommend, from my personal experience, to indeed go through GitHub. For my part I went through my fork of Gladys; this allows me to track my own modifications over time and to fairly easily integrate updates from the original Gladys. The Docker build is also well integrated so it’s easy to perform.
You’ll sometimes run into a few small headaches if an update from the original Gladys touches an element that you yourself modified. Sometimes you can replace your code, sometimes you’ll have to resolve the conflicts to integrate your changes.
But overall it manages very well. And that’s the power of an open-source project. Because Gladys’s code is clean and solid, you can absolutely customize an instance.
Unlike you perhaps, however, I do have 2 instances running (3 in reality).
- An original Gladys « principale » instance that manages my scenes, my overall monitoring and all of my devices
- An original Gladys « Pod » instance in my house for Zigbee management (which exchanges data with the « principal »)
- A custom Gladys « Pro » instance that contains all the pro devices and the specific pro scenes and is modified for user management.
Don’t hesitate if you need help and want to go through GitHub / Docker Hub
Thanks @Terdious for the explanations. Okay, I’m going to create a GitHub account…
1 Like
Okay, I created the GitHub account and pushed my small changes, then I created the Docker account and built an image of my ‹ custom › version of Gladys.
I now want this version to replace the Gladys instance I’m using in production, without losing my data.
To avoid mistakes, could someone confirm the following points:
- I can stop and remove the docker gladys container on my mini-PC, and that won’t delete the database or the Zigbee, MQTT, and Node-RED configs that I created (because all of that is stored in /var/lib/gladysassistant)
- I can then do a new ‹ docker run … › using my personal repository instead of the official Gladys one, to install my custom version of Gladys. But at that step, won’t it overwrite my /var/lib/gladysassistant folder? And in that case I should back it up before the docker run to restore it afterwards… Or do I not need to worry?
- I don’t need to stop the z2m, Node-RED, mosquitto containers
- Should I stop the watchtower container so that the next official Gladys release doesn’t automatically replace my custom version?
Thanks in advance 
[quote=« StephaneB, post:4, topic:9945 »]
Je peux arrêter et
Thanks for all those details, @pierre-gilles.
And indeed, I had seen that part of the video, but it seemed to me to be done on a fresh configuration, and I wanted to be sure what would happen in my config where I’m going to ‹ replace › an existing version.
Hello @StephaneB
Your approach is really interesting, because I also have needs that aren’t necessarily meant to be integrated into Gladys for everyone, and I would have liked to take advantage of what you’ve set up to do the same on my side. Would it be possible to provide either a video or documentation that allows the actions to be carried out step by step?
I imagine that being able to easily have an environment to customize, together with @pierre-gilles’s video on coding via AI and the PR proposal, could allow Gladys to soon gain new features 
Looking forward to hearing from you,
Jean
[quote=« jean_bruder, post:7, topic:9945 »]
Would it be possible to provide either a video or documentation
1 Like
However, a small detail I hadn’t thought of (but it’s very logical, actually): the customized version is indeed accessible as long as I’m local. But from the outside, using my access with Gladys Plus, the official version is used.
Indeed, Gladys Plus is a frontend application deployed since the latest production release!