Page 1 of 1

How to contribute to install.domoticz.com script?

Posted: Sunday 08 March 2020 22:49
by MichaIng
Hi guys,

I want to contribute to the install script that is available via install.domoticz.com. I couldn't find its code on the GitHub repo, is it hosted somewhere, if so where?

Best regards,
MichaIng

Re: How to contribute to install.domoticz.com script?

Posted: Monday 09 March 2020 1:04
by waaren
MichaIng wrote: Sunday 08 March 2020 22:49 I want to contribute to the install script that is available via install.domoticz.com. I couldn't find its code on the GitHub repo, is it hosted somewhere, if so where?
Contributions are more then welcome !
Developers and forum maintainers are members of this forum too.
Best is to share your contribution first here so we can have a look and comment.

Re: How to contribute to install.domoticz.com script?

Posted: Monday 09 March 2020 18:15
by MichaIng
waaren wrote: Monday 09 March 2020 1:04Best is to share your contribution first here so we can have a look and comment.
Okay, it is all related to Debian/Raspbian.

On thing is the APT lists location:

Code: Select all

88	PKG_CACHE="/var/lib/apt/lists/"
While this is the default, it can be different and if this is already used and it's non-existence breaks the install, it should be checked in a failsafe way:

Code: Select all

PKG_CACHE=$(apt-config --format '%v' dump 'Dir::State::lists')
[[ $PKG_CACHE == '/'* ]] || PKG_CACHE="$(apt-config --format '%v%n' dump 'Dir::State' | sed -n 1p)/$PKG_CACHE"
[[ $PKG_CACHE == '/'* ]] || PKG_CACHE="$(apt-config --format '%v%n' dump 'Dir' | sed -n 1p)/$PKG_CACHE"
PKG_CACHE=${PKG_CACHE//\/\//\/}
Could be probably done more beautiful, especially double slash prevention, but at least this will work reliable ;).
The paths can be absolute or relative (without leading slash), in which case the parent path is used. Also note that the "cache" directory is a different one, where pkgcache.bin and srcpkgcache.bin are stored instead, while here the storage for original lists files is wanted.

Another thing is that at least when using HTTPS with the current pre-build downloads and installer, libssl1.0.0 is required, but it is not available anymore on Debian since Stretch: https://packages.debian.org/libssl1.0.0
It is possible to pull the package manually from the older repo or of course build it oneself, but it would be anyway good to use up-to-date libraries. Either a fresh libssl1.1 could be done, officially dropping oldoldstable Debian Jessie support, or at least the installer should check for this library or only Debian version and print a warning in case that libssl1.0.0 is required.

While there is already a systemd unit example present as preferred in the wiki, the installer still only installs a sysvinit service. Would be great to have either both or a choice or an automated choice based on [[ -d '/run/systemd/system' ]].

And yeah, I see little inconsistencies in bash coding, sometimes single square brackets, sometimes double square brackets, quotation where not required or double quotes where single quotes would be better, but this finally is a matter of taste and personal coding style as well since it does not particularly cause issues.

Re: How to contribute to install.domoticz.com script?

Posted: Tuesday 10 March 2020 23:00
by waaren
MichaIng wrote: Monday 09 March 2020 18:15 Okay, it is all related to Debian/Raspbian.
Posted on Slack but no reaction yet. Now add it as issue on github

Re: How to contribute to install.domoticz.com script?

Posted: Wednesday 11 March 2020 1:08
by MichaIng
waaren wrote: Tuesday 10 March 2020 23:00 Posted on Slack but no reaction yet. Now add it as issue on github
Many thanks. Jep it would be easiest to have the installer in GitHub, where commits can be done easier, better reviewable and discussed.

Re: How to contribute to install.domoticz.com script?

Posted: Wednesday 11 March 2020 7:27
by gizmocuz
I will make the install script available on GitHub.
The openssl dependency is maybe not needed when we make a new release, current users need to run the ./updatebeta script when they do a fresh install

Re: How to contribute to install.domoticz.com script?

Posted: Wednesday 11 March 2020 7:28
by gizmocuz
Install script can now be found on Github inside the 'scripts' folder