sni / Thruk

Thruk is a multibackend monitoring webinterface for Naemon, Nagios, Icinga and Shinken using the Livestatus API.
http://www.thruk.org
Other
409 stars 149 forks source link

Thruk 3 Dark&Light themes missing on ConSol Labs sles12 repo #1187

Closed klaernie closed 1 year ago

klaernie commented 2 years ago

Describe the bug The themes are missing in the packages built for the ConSol Labs repo. I took a look into https://labs.consol.de/repo/testing/sles12sp4/x86_64/thruk-base-3.00.20220722-11457.1.sles12sp4.x86_64.rpm - which still carries the old set of themes, but the new Dark and Light themes are missing.

I wanted to try the 3.0 alpha, but since running npm during the rpmbuild on OBS does not work for us (workers have no network connectivity) I hoped for at least a quick and dirty way to obtain the current themes. Ultimately this is cause no way, so I'll need to find another way to make sure the Makefiles in themes/ have all they need to run tailwindcss.

Thruk Version 3.00-alpha

To Reproduce Steps to reproduce the behavior: Download the linked RPM, inspect it with either rpm -qp --filesbypkg or just 7zip.

Expected behavior A clear and concise description of what you expected to happen. /usr/share/thruk/themes/themes-available should contain folders for the Dark and Light theme

Screenshots If applicable, add screenshots to help explain your problem. n/a

Desktop (please complete the following information): not relevant

Additional context Add any other context about the problem here.

sni commented 2 years ago

please try again, there should be new packages now.

klaernie commented 2 years ago

Ah, sorry, me at to write a quick update that I managed to compile the stylesheets, just took me a node docker container on a real Linux to do it, which was enough to build my sles15 packages in our internal OBS, so a hacky but working solution to try the alpha. Sorry for keeping you busy that late in the evening.

Btw: what way would you prefer for alpha feedback? Don't want to clog the issues list when there is a better way.

sni commented 2 years ago

no worries, thanks for letting me know. Btw, there are packages for sles 15 sp3/sp4 on OBS here: https://build.opensuse.org/project/show/home:naemon:daily Have you tried them?

And please simply open an issue if something doesn't work with the 3.x branch. It should be mostly complete and ready. So please let me know if you find anything unusual.

klaernie commented 2 years ago

Just took a look at the ConSol labs repo - that has the stylesheets now. I also looked at https://build.opensuse.org/package/show/home:naemon:daily/thruk, hoping you'd have the magic you use to build the stylesheets in OBS right there as well, but that one hasn't gotten to 3.01.20220815 yet. I'm forced by company policy to build packages locally, so I sadly have to duplicate this effort.

sni commented 2 years ago

Not so much magic hopefully. All it does is calling this Makefile. https://github.com/sni/Thruk/blob/master/themes/themes-available/Light/Makefile So you need "npm" and "npx" on the build machine. But i just checked and i never added those to the spec file, so the OBS builds probably don't have any working stylesheets yet.

klaernie commented 2 years ago

Yeah, I reverse-engineered as much. The problem for me probably won't be actually running npm (there surely are packages out there), but the node_modules make target, since that will connect to the internet for obtaining tailwindcss and friends. I'd wonder, if publishing the compiled css in the git repo would be the easier option, with a github action that automatically recompiles it if there are changes to the source.

The OBS builds don't have working stylesheets, but the build also don't fail, since the spec never calls the theme makefiles.

sni commented 2 years ago

Added npm as build dependency. Let's see how that works.

sni commented 2 years ago

didn't work :-) For the stable releases i switched to the release tarballs which contain the missing css files. But no solution for the daily builds so far. Did you find anything?

klaernie commented 2 years ago

My builds for work currently rely on running the themes Makefile inside a nodejs docker container, with the source dir mounted. To make that work longterm my thought is to wrap this in a github action, so any change to the source css files and Makefile trigger a rebuild of the ready-to-use css files. The regenerated files then could be stored back into the git repo. And if one wants to avoid the two-step approach, once could always regenerate locally before commit the change.

But of cause this "permanent solution" violates one of my core principles: store only source in git, store build results outside.