openhab / openhab-syno-spk

openHAB Synology SPK Install Package
Eclipse Public License 2.0
161 stars 42 forks source link

DSM 7: Clean up packaging files and make it conform with Synology guidelines #178

Open thopiekar opened 3 years ago

thopiekar commented 3 years ago

We've been running our scripts with root rights for a long time. With DSM 7 Synology prevents these packages to be installed and creates system users to define permissions safely.

I'm going to clean up the whole set of script and make it conform to Synology's guidelines. The download steps on preinstall will be kept, but I've got itchy fingers bundling all data in our spk. I mean, logically you won't like to have our automatic next stable URL generator in any package like this. I tried the used commands on my own and I already know what happens if someone likes to download 2.5.x, but once 3.x has been released, it will download 3.x. Our versioning here will be pointless. However: This mechanism makes only sense if we detect major and minor and then download the latest version with the same major and minor version, but the most recent patch version. Per definition patch versions shouldn't break anything. Finally, I'm wondering who tested this part of the script collection here.

But back to the topic: I've got DSM 7 beta installed here and will spend some time everyday on this. Will keep you posted.

PS: I'm also going to kill the "where to install" userdata functionality. Per Synology, you can register resources, like shares you need. Nevertheless, there is no way to say "hey, I need it optionally. I will tell you on install." Therefore, I'm going to create a "openhab" share fixed (as inspired by Docker). If someone likes to make it public, then give it "Everyone" permissions after install. And if you like to hide it, it can be done as you would do with the "docker" share. Something we can brainstorm still is a switch to link the files and directories into the share or make it "self-contained".

thopiekar commented 3 years ago

Updates: OpenHAB install in a non-persistent environment now. Basically removed all the start up scripts and read how the Karaf project suggests to start services. Works perfectly fine. Guess I will end up with a completely rewritten package.

cniweb commented 3 years ago

@thopiekar Thank you very much for your work. Let me know when you have.

thopiekar commented 3 years ago

Got only one thing left: Using the existing Synology app to display the uuid and cloud id from the userdata directory. I'm going to create a request for support at Synology on this. I just can't find any documentation about app development.

MikeD23 commented 3 years ago

Hi @thopiekar, I am currently using openhab3 on my freenas server. I like it a lot and want now to install also this version on my fathers DS411 (armv5). I successfully installed your .spk for 3.0.0-SNAPSHOT but it will not start even the log says it has ("PID file created. done."). I just have java8 installed and since OH3 needs jre11 I think that is the reason. If you are done implementing this will it also include openJDK11 for armv5? I would like to install it on my own until your done but I could not find any built version. I did not find any information about installation java11 on Synology.

thopiekar commented 3 years ago

"Your" is not really correct. I'm contributor of openHAB but never put much effort to the Synology subproject. The packaging files will be completely rewritten. Will create a pull request once I'm finished.

But you can do me a favour already.. can you access your dad's nas and run "uname -m"?

Thanks!

PS: Yes I'm planning to add OpenJDK for arm, too. Need "uname -m" for this. 😉

MikeD23 commented 3 years ago

Sorry, I just came across this repo when I was looking for a way to install openhab on a synology and did not have a closer look. I thought you were the only contributor in here.

root@DS411:/# uname -m
armv5tel

I just found a zulu build (zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32sf.tar.gz) of java 11. Might this work?

thopiekar commented 3 years ago

I'm going to use AdoptOpenJDK. They have a cleaner website and I couldn't find Arm builds by OpenJDK really. As AdoptOpenJDK provides builds for many architectures I'm taking it from there out of one hand. Nevertheless I'm going to focus on openHAB 2 first.

Generally give me some more time please 😉

MikeD23 commented 3 years ago

Sure, take your time. I've got now 3.0.0-RC2 to run with zulu java11. It took me some time (and netstat) to get to know that openhabs webservice only listens to 8443 and not 8080. But now I'm logging in and I'm fine. I'm so excited to bind all the new gadgets that santa will bring on christmas :grin:

thopiekar commented 3 years ago

I guess skip working on the UI and symlink the UUID and cloud id files to the share as I do for the other files for now. Was talking with Syno support and they told me to file a ticket, so I can get help by a more technical person.

@cniweb I have two wishes:

thopiekar commented 3 years ago

@MikeD23 Yeah, it is nice to see that OH3 has the same file structure. So no extra work for me here. Regarding Zulu builds: I need to twitch to these I guess. Was using AdoptOpenJDK but just noticed today that we (as OpenHAB family) recommend Zulu. ... Whatever the benefits are 😆

cniweb commented 3 years ago

@thopiekar can you complete your work and do a pull request, please?

thopiekar commented 3 years ago

@cniweb: PR created, but there is still some work left. How are your thoughts on the points above?

cniweb commented 3 years ago

@thopiekar I remove the sponsor button. Which points are you unclear exactly?

cniweb commented 3 years ago

I agree with you that we will focus on stable code that is feature rich.

thopiekar commented 3 years ago

@cniweb If I could get more involved into the project here. At least for the reviewing process. I'm often busy as you can see, so if that happens it won't be anything blocking - you can go ahead with the activities of course. :slightly_smiling_face:

So yeah, that would be really nice :wink:

Btw. I continued on the PR. I'm waiting there for feedback by some brave testers.

lebovitz commented 3 years ago

@thopiekar What's the status of the DSM 7 Syno package? DSM 7 is now officially released. So I guess it's time for a package :-)

thopiekar commented 3 years ago

Oh, yes. I'll rerun the build script it with the latest version of OpenHAB. Also for 2.x since I'm still staying in this version because I'm feared of compatibility bugs. At the moment my setup just works fine ™. .. due to the DSM7 release I also see lesser priority in the problem with DSM compatibility. It's like giving support for Windows XP 🤷

lebovitz commented 3 years ago

I agree on the backward compatibility for OH2. I tried your package on DSM7 and it seems to work. There are a couple of questions I do have on your package

  1. It seems from the build.sh script that you download ALL versions of OpenJDK and the just use the one that fits the CPU. Why not download just this one version from the start?
  2. In DSM7 the OH package seems to be spread over many folders. It's no longer under /public/openHAB. The userdata folder is in one place, while the conf folder is in a different place. Some of the new locations can be accessed only by sudo. Is that inherent to DSM7 or can this be changed? It makes changing things very complicated
gackelchen commented 3 years ago

Just updated to DSM 7. Do I understand right: openHAB 3 for DSM 7 is not yet ready? Is OpenJDK 16 (rednoah) the right preparation?