ycahome / pp-manager

Domoticz Python plugin manager
GNU General Public License v3.0
15 stars 22 forks source link

In case of -userdata different than domoticz home the plugin are not installed in the right folder #15

Open pipiche38 opened 5 years ago

pipiche38 commented 5 years ago

In case Domoticz is started with -userdata /var/lib/domoticz/

/usr/share/domoticz/beta-domoticz/domoticz -www 8080 -sslwww 8443 -sslcert /var/lib/domoticz/server_cert.pem -sslpass -sslmethod -ssloptions -ssldhparam -wwwroot /var/lib/domoticz/www -dbase /var/lib/domoticz/domoticz.db -userdata /var/lib/domoticz/ -debuglevel normal -loglevel normal,status,error -log /var/tmp/domoticz.log

The plugins are installed on the wrong folder as they are installed on homedirectory of the user and not under the userdata folder.

It might be optimum to use Parameters["HomeFolder"] (which is the HomFolder of pp-manager) or even better

Parameters["StartupFolder"] in case Parameters["DomoticzVersion"] >= '4.10267'

ycahome commented 5 years ago

Actually, plugin gets "current working directory" via str(os.getcwd()) + "/plugins/"

Seems that Domoticz working dir is on the profile but userdata on a different folder, right?

pipiche38 commented 5 years ago

@ycahome I beleive so. But userdata default is mostlikely also the Domoticz working dir except if we specifiy it.

So I feel that by using

Parameters["HomeFolder"]/../

Where Parameters["HomeFolder"] is the pp-manager folder You get to the plugin directory with ../

DavidTre07 commented 3 years ago

If you use the officiel docker of domoticz (domoticz/domoticz) the folder path for plugins is /opt/domoticz/userdata/plugins, wich doesn't correcpond to str(os.getcwd()) + "/plugins/" Same bug identified in a different plugin manager and corrected here: https://github.com/stas-demydiuk/domoticz-plugins-manager/commit/26459edfbde77bf19337037c264f8203a579367a