-
Notifications
You must be signed in to change notification settings - Fork 4
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
Wireguard inside docker #20
Comments
Hi @Osrx currently I'm not using docker for things like this - so I really have no experience with that. But I basically like this idea. So - why not? But there are some things to clarify first:
|
I think I've found workaround but it not work. To start wg command inside docker container I should execute this command: I try to make a shell alias for user that iobroker should run this adapter:
But If i try to connect with command entered inline with ssh client connect string I receive an error:
And adapter is not working. In debug log there are this strings:
Do you have any ideas about what is happens? I think the possible workaround may be to make users possible to enter their own "wg" command to achieve result. Thank's for your Job! =) |
I see the issues - but we need to solve them from the adapter-support perspektive. I can't provide an config option to enter an individual command. This will end up in endless support due to completely wrong or simply misspelled commandlines. And in addtion there is not enough space in the admin interface because you can configure as many hosts as you like in the adapter and every single host may need another commandline. So - currently this is no option to me. My current idea is: providing a "Docker"-Checkbox next to the "sudo"-checkbox and code an underlying command which will be executed when it's checked.
But: we might have two separate security levels in this szenario. The security level of That's why some questions arise. But since your wireguard container seems to be the/an official one from docker.hub I consider to implement it the way I described and just give it a try. I assume that I need to implement an "Fritzbox"-option in the future as well. ;) |
fixed #20 : Add support for WireGuard inside a docker container
Get in mind that in this command: Some words about security. I see some options to execute this command without entering sudo password.
And final sad result after updating adapter to 1.2.0 nothing changed:
adapter still can't get result... |
I'm aware of this and accepted that some users might need to rename their container if they like to use this adapter. But since it should be a very common name for a WireGuard container, it shouldn't be many. Let's see how many users complain about this. ;-)
That's exactly what I wrote under my security point 1. ;-)
I'm aware that this line won't work out for docker users. It doesn't even work out for each and every standart installation users. It may be needed to modify it to fit the own environment. There are too many variations in path' and so on to support them all in a software or a readme and keep it handy and simple for the majority of users. I assume that users with advanced environments will have advanced skills as well to adapt their environment to fit the needs of the adapter. At least spending half an hour to read some sudoers documentation - because I think this will be the solution for most users: Creating their own sudoers line that fits for them. But ... the whole workchain of the adapter is pretty simple:
I think a sudoers line for docker users may look like: The great benefit of puzzling out and using a sudoers line is that only this single command with excatly these parameters in exactly this order will be executeded without being propmted for a password. Every variation will require a password. So in your case the first command executed is Ähhhmmmm: To make it fully clear: using docker with a sudoers line requires you to check the sudo AND the docker checkboxes. Reminder from readme (some hints to sudoers):
So this line |
In my distribution is unacceptable to enter any execution command with or without parameters. Ok, by the way this is not the main problem. Enter string
also i have try another method.
Give it a suid and execution bits bit. Try ssh:
All fine, but log from adapter is the same:
So I don't have idea where is an issue... =( |
Okay. Let's bring it into an order. So first things first:
From you logs I can see you are on a Debian Linux - me either. Therefore I know the distribution is able to accept such a sudoers line that I proposed. But anyways... To locate to real issue please:
I expect every config that doesn't prompt for a password to work in the adapter. Please tell me the results of all these tests here!
I already do:
|
Step 2 fails.
I'll make cheanges in sudoers as you write and the result as previous.
ssh session now fine. You are right about sudoers somewhere is my mistake:
but:
Try to execute ssh command directly via ssh connect string:
This issue may be in method which docker returns output... =( |
Yepp. That's the issue since docker doesn't use STDOUT for it's output. Therefore I made a change in V1.2.1 to use a pseudoTTY. That should work. Please give v1.2.1 a try - it may fix the issue with not getting any response from the docker container. After installing that fix I expect to get data in the line:
And if getting any data there the adapter gets some data to work with. |
fixes #20 - tty issue in docker option
@Osrx Please confirm wether the v1.2.1 solved the issue or not to let me know wether I can push it into stable. |
Confirmed!!!
Thank you a lot!
… 26 апр. 2022 г., в 11:09, Grizzelbee ***@***.***> написал(а):
@Osrx Please confirm wether the v1.2.1 solved the issue or not to let me know wether I can push it into stable.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Hello.
Is there any chance or possibility to run wg in container like this way:
docker exec -it wireguard /usr/bin/wg show all dump
Or may be you have another solution?
The text was updated successfully, but these errors were encountered: