-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
openvpn3: init at 13_beta #120352
openvpn3: init at 13_beta #120352
Conversation
4b4eda7
to
165d50b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff LGTM, not sure if it works and would be secure to use.
Maybe @benshaw could tell us if it worked for him. |
165d50b
to
0814e03
Compare
I will try testing this tonight and let you know how it goes. |
@SCOTT-HAMILTON unsure if this is todo with your work or if there is some other steps required but Im getting an error But even after following the instructions and adding the user "openvpn" user and "openvpn" group i still get the error. The only other report i could find of this issue was in arch and there solution was to change the ownership of the app (https://bbs.archlinux.org/viewtopic.php?id=262372) but obviously this wont work in nixos |
Ok, do you know how I could reproduce this error ? |
create a sample.opvn file https://github.com/OpenVPN/openvpn/blob/master/sample/sample-windows/sample.ovpn |
@SCOTT-HAMILTON see discussion here for more information OpenVPN/openvpn3-linux#42 |
@SCOTT-HAMILTON How is this going? Anything i can do to help ? |
To be honest this PR should probably be maintained by someone that actually uses and knows well openvpn3. I'll make it as draft until either someone accepts to maintain it or someone finds what's wrong. |
It looks like you cannot run this on its own - you need to either make the existing openvpn module handle this or do a minimal new module that at the very least creates the required user and registers the files for dbus. |
@SCOTT-HAMILTON Unfortunately i am new to both openvpn3 and nix but ill do some research in my spare time and see what i can figure out. Thanks for the effort and work so far ! |
@peterhoeg do you know what else needs to be done for dbus services ? The package @SCOTT-HAMILTON put together creates the services in the appropriate location
|
@peterhoeg do you know what else needs to be done for dbus services ?
Add it to `services.dbus.packages`.
Couple of other things:
1. those dbus .service files expect dbus to spawn the various executables directly (they contain Exec). I'm not sure if
this is due to upstream just not doing it properly or if it has something to do with how you're building it but it
should instead use systemd to activate a service:
Example:
```conf
[D-BUS Service]
Name=net.openvpn.v3.configuration
Exec=/run/current-system/sw/bin/false
SystemdService=net.openvpn.v3.sessions.service
```
This of course requires systemd unit definitions as well.
2. there is also an empty directory structure in $out/var/lib/openvpn3/configs. I don't know if you need openvpn3 to
look in /var/lib/openvpn3/configs for anything, but if you do, that will not work.
|
So, upstream OpenVPN 3 Linux developer here :) First, in regards to the D-Bus .service files, I was not aware that That said, I'm open to fix things so that it is correct. In regards to 2), yes that directory is used. It is used by This is solved that the OpenVPN 3 front-end ( Some more details here:
I hope this helped clarifying a few more details. Feel free to reach out anytime you have questions! |
I tried this quick test-driver and it seems to work running @benshaw 's command https://gist.github.com/SCOTT-HAMILTON/33683b4265ea77b95dc1f9596d0cbc72
|
I see you add a ./configure flag. You might want to add --enable-bash-completion. To prepare for the Data Channel Offload support (ovpn-dco kernel module), you would need --enable-dco. This does not provide the kernel module itself, though. If you want to support AWS VPC integration, you can also add --enable-addon-aws. A bit more configuration steps are needed before this service is started, but it pushes VPN routes to the AWS VPC to allow the VPN client to act as a router to the networks available via the VPN. Finally, you can speed up building by adding --disable-build-test-progs. These test programs are not installed, and are more useful for various testing approaches and debugging and not something end-users would need to use. |
I might be wrong, but I think that the python packages need to be wrapped with the correct PYTHONPATH, for the import to work. (e.g launching ./result/bin/openvpn3 didn't work on my side). |
Hmm. The Also note that OpenVPN 2.x is using just |
Indeed, my bad, only Also this package needs a module for it to work since dbus service files reference the user/group openvpn. |
This works for me, after creating the necessary user and group and adding it to dbus.packages. |
@agarden can you link the config you used for setting this up ? |
I use this config and it has been working for a few months :
|
Sorry I missed the notification back in August. Here are the relevant bits of my config, still working smoothly:
|
I see that one of the configs use |
@dsommers Thank you for the tip. Why is that better? |
All the OpenVPN related processes run as the Depending on distro and security setup, system processes may be further limited to what they are allowed to do and which file area they can access. OpenVPN 3 Linux is designed to run with as few privileges and capabilities as possible. And so far only the |
I marked this as stale due to inactivity. → More info |
@SCOTT-HAMILTON I have put together functional PR #171678 based on note about missing DBus and user setup from others here. Can you please find some time to look at it? Also, this is my first PR for NixOS, so I hope I've followed contributing process correctly. |
I've put another PR #173937 with the help of Matrix server people. I used #171678 as a basis (which didn't build for me because of the hardcoded gio path) and made some fixes, namely:
I also tried to make sure there are no useless dependencies in the build, and I think I did a good job at that. Left some comments for the packaging to be easier to understand. Feel free to try it out! |
Just a heads up, we're getting close to release the v18_beta. That fixes the gio problem you've encountered. But beware, that release does a massive overhaul on the Once our internal QA gives the green light, I'll push out the updated git tree. |
Hey, thanks for the heads up! I've patched the gio problem using the f7d6d3a commit, which let me package the v17_beta in #173937 . I have, however, a few questions I'd like to clarify, if I may.
I apologize if any of those questions sound dumb, as I'm not too involved with open source community and don't know how things are usually done. I have, however, already taken it upon myself to invest my time into packaging |
So, cherry-picking commit f7d6d3a is the right solution for the glib2 issues; we have done a similar hack for the v17_beta build for Ubuntu 22.04 as well. To your questions:
There has not been any dumb questions here. You're doing exactly what's expected of any kind of open source project involvement. I'm also not a NixOS user, so I don't grasp all those details. But I know Linux very well and has been involved in the OpenVPN project for a very long time, so that's the expertise I can bring to the table. |
Thanks for the detailed explanations and for the kind words!
The completion script for Here's an example of I might try to write completions for Zsh and Fish myself and commit them to the upstream. It doesn't look overly hard on the first glance. I am a bit unsure about how that would play with the fact that |
@KFearsoff I suggest opening up a new issue in the OpenVPN 3 Linux project for improving the bash-completion, if anything needs to be done there to make it simpler. I'm open to have a zsh and fish specific completion scripts there, as long as someone is willing to maintain them (or I can put them into a contrib/ folder) My hunch is that the The main trick with
This lists all available configuration profile names which can be used with The bash-completion scripts just calls The The reason for calling |
@dsommers Thanks for the info, once again. I'll proceed by opening an issue in OpenVPN3 Linux repo, then! Will also try to do something myself. |
Preceded by #173937. |
Motivation for this change
Closes #120116
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)