mbachry / mosquitto_pyauth

Mosquitto auth plugin that lets you write your auth plugins in Python!
MIT License
64 stars 33 forks source link

No module named mosquitto_auth #5

Open huytn opened 8 years ago

huytn commented 8 years ago

how to install this module

imZack commented 8 years ago

Try to set a proper PYTHONPATH environment variable should works.

FRANZEE commented 7 years ago

@imZack how to do it? help please!

viraja1 commented 7 years ago

@FRANZEE I have created a pull request to specify module path in mosquitto config instead of using PYTHONPATH https://github.com/mbachry/mosquitto_pyauth/pull/8

tanktoo commented 7 years ago

Hi, I have the same problem and don't know how to set PYTHONPATH that it will work. Any help would be great!

jaydg commented 7 years ago

PYTHONPATH is an environment variable. Have a look at https://docs.python.org/2/using/cmdline.html#envvar-PYTHONPATH

export PYTHONPATH=/path/to/module
mosquitto -c your_config_file.conf

or when using bash this will also work:

PYTHONPATH=/path/to/module mosquitto -c your_config_file.conf
DxrMorgan commented 5 years ago

in mosquitto.conf make:

auth_plugin /usr/local/lib/mosquitto/auth_plugin_pyauth.so auth_opt_pyauth_module mosquitto_auth

EXPORT pythonpath:

export PYTHONPATH=/usr/lib/mosquitto

and run

mosquitto -c /etc/mosquitto/mosquitto.conf

1561325989: mosquitto version 1.6.3 starting 1561325989: Config loaded from /etc/mosquitto/mosquitto.conf. 1561325989: Loading plugin: /usr/local/lib/mosquitto/auth_plugin_pyauth.so 1561325989: ├── Username/password checking enabled. 1561325989: ├── TLS-PSK checking enabled. 1561325989: └── Extended authentication not enabled. 1561325989: Opening ipv4 listen socket on port 8883. 1561325989: Opening ipv6 listen socket on port 8883.