-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running addons with --privileged #201
Comments
Is the device mapping in config.json (eg |
No. I tried both with If you happen to have a RF transmitter you can try it for yourself: # Do not work
docker run -it --rm --name pilight --device /dev/mem --cap-add SYS_RAWIO pschmitt/hassio-addon-armhf-pilight
docker exec -it pilight pilight-send -p pollin -u 1 -s 1 -t
# Works
docker run -it --rm --name pilight --privileged pschmitt/hassio-addon-armhf-pilight
docker exec -it pilight pilight-send -p pollin -u 1 -s 1 -t EDIT: Whatever. This issue was more intended to be a feature request / discussion than me trying to get help for my addon |
Sure. I guess the next question is why this is an addon and not just a component/platform in main HA (which runs with |
I guess pilight could be implemented as a component, but that is a ton of work: just take a look at the source code. Anyway this |
For zabbix and official docs (https://hub.docker.com/r/zabbix/zabbix-agent/) Privileged is only a other word for "I don't know what he need so I give him all right". So we have no privileged options for addon while we work with capability (like capsh can help). At the moment we support 3 but If you need some one, we can add this. That allow us later to give a user a hint what the addon can do on his system. You need only find the correct cap to run inside docker. For host pid I will look. We need find a mix that a addon can not damage a system and protect the user and give him aware for addons vs. development of add-ons. |
For good debain multiarch image look into this: |
@pvizeli You missed the "Privileged mode" paragraph in the official documentation of zabbix-agent you linked: https://hub.docker.com/r/zabbix/zabbix-agent/
|
Perhaps a clearer definition of what hassio (and perhaps moreso, addons) is intended to do is required (or may exist, I can't find anything right now). IMHO, hassio is used to create an appliance, plug and play, all user friendly and everything happens automatically (eg updates, including the OS) or via the web interface. Anything that can potentially break this has to be closely controlled/limited, hence the restrictions on addons. Really the hassio box is just homeassistant, and whatever helpers it may need to talk to the outside world, not also a monitoring hub/server (but maybe a client of that, yes.) I think the zabbix use case isn't really a hassio one. I think you would be better off using standalone homeassistant on a "normal" OS and run zabbix alongside of it, if you desire to host both on the same machine. For now this seems the same would be the best approach for pilight as well (I think it would be great for homeassistant to have closer integration with this, but an add-on for hassio probably isn't the answer. |
@pschmitt Same with pilight, if you know with cap he need (I think SYS_ADMIN) it will be run. The Problem is with privileged Modus it is a very bad praxtic. In some case it could be make sense but it also destroy any things that will be docker stand for it. I think this discusion is very imported and I'm happy to read other opinions. |
That does not scale. How am I supposed to pass ALL devices to my agent? When packaging I cannot know the amount or even the path to said devices. Will it be /dev/sda only? /dev/vda? Will there be 5 disks /dev/sd[abcde]? There is no way to correctly guess how the hassio host will be monitored (what template will be applied) |
I'd suggest the following: implement |
Regarding pilight I managed to get it working using Sadly there isn't any way to issue a |
I add a new options I think we should go out at evening with that update and you can use pilight as add-on 👍 |
0.65 with gpio support is out |
Nice |
Thanks for the reactivity @pvizeli. The bad news is that pilight seems to require broader access to EDIT: From my tests it appears to be something within |
Do you run it with /dev/mem and SYS_RAWIO? /sys/devices/virtual/gpio was the old place of gpio interface on linux kernel 3.x |
Can you try that? Also what he need on devices. So I can make a better solution. For privileged modues. I see PR for docker they will merged in next ce release and dedicate the privileged mode. They switch to a preset like system. I think we can do the same now and defined presets they have the access where we need. |
Works: Does not: I'll try to figure out what is needed |
Got it! It's
|
Okay. I will not make it hard to implement things like this. I will add a user-friendly or developer friendly access system. I make fix and release it in 3-4 hours. Thanks to help for make it better. |
Short question for your monitor software problem. Do work: ? So you have all device inside container but no privileged rights. Maybe you need SYS_ADMIN too |
Bind-mounting I tried that nonetheless and as expected the container didn't even start:
|
True. I spoke with paulus and we add a user device selector for add-ons. That will be control over API. I hope we find a UI developer that have time to make that nice on it. That make you able to modify the device list dynamic. So you can provide a add-on with basic and imported devices for runtime. Later can the user also add more device (in your case for monitoring) that he want to control with it. But I look too for more solutions |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have the same problem with a Wireguard client add-on that i trying to build. Any idea on how to solve it ? For the Wireguard client the error is: I added in the configuration
but it is not equal to running the container with --privileged |
You can't do that @GabrielePicco, as was already discussed above. Thanks! |
I know I can't run an add-on with --privileged. But it seemed pertinent to the discussion for the alternative solutions proposed in this issue. In any case, I will specify it better in the new issue. Thanks |
Hi.
I'm trying to create an addon for pilight: https://github.com/pschmitt/hassio-addons/tree/master/pilight
Unfortunately for this to work I'd need to run the container with
--privileged
. AFAIK this is not possible right now. This and--pid=host
may be useful for other addons as well (dind, zabbix-agent)The text was updated successfully, but these errors were encountered: