Skip to content
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

Use Shadowsocks library instead of launching a subprocess #3474

Merged
merged 12 commits into from
Apr 5, 2022

Conversation

dlon
Copy link
Member

@dlon dlon commented Apr 1, 2022

This updates the Shadowsocks proxy monitor to use the crates instead of launching a subprocess, and removes all related binaries and references to them. It also contains some refactoring of the OpenVPN monitor.

Related PR: mullvad/mullvadvpn-app-binaries#93


This change is Reviewable

Copy link
Collaborator

@pinkisemils pinkisemils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 10 of 14 files at r1, all commit messages.
Reviewable status: 10 of 14 files reviewed, all discussions resolved

Copy link
Member Author

@dlon dlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 9 of 14 files reviewed, 1 unresolved discussion (waiting on @pinkisemils)


talpid-core/src/tunnel/openvpn/mod.rs, line 318 at r1 (raw file):

        let handle = runtime.handle().clone();
        handle.block_on(Self::new_internal_with_runtime(

This seems sketchy in retrospect: runtime_handle.block_on(f(runtime)). This task itself will still exist when the runtime is dropped. It works, but it could be cleaner.

I think we should have a TunnelMonitor trait with async start and wait methods. But I don't want to make a bunch of unrelated changes here.

@dlon dlon force-pushed the use-library-sslocal branch 2 times, most recently from 5c72e1f to 099c364 Compare April 1, 2022 13:40
Copy link
Collaborator

@pinkisemils pinkisemils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all commit messages.
Reviewable status: 9 of 14 files reviewed, 1 unresolved discussion (waiting on @pinkisemils)

Copy link
Collaborator

@pinkisemils pinkisemils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 14 files at r1.
Reviewable status: 10 of 14 files reviewed, 2 unresolved discussions (waiting on @dlon and @pinkisemils)


talpid-core/src/tunnel/mod.rs, line 160 at r3 (raw file):

                    match proxy {
                        openvpn_types::ProxySettings::Shadowsocks(..) => {
                            return std::env::current_exe().unwrap()

Is this necessary on anything besides Windows? It's still good to have this interface, but if I understand this correctly, the only reason the path for the path to exist is to let the firewall exclude the traffic, right?

Copy link
Member Author

@dlon dlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 10 of 14 files reviewed, 2 unresolved discussions (waiting on @pinkisemils)


talpid-core/src/tunnel/mod.rs, line 160 at r3 (raw file):

Previously, pinkisemils (Emīls Piņķis) wrote…

Is this necessary on anything besides Windows? It's still good to have this interface, but if I understand this correctly, the only reason the path for the path to exist is to let the firewall exclude the traffic, right?

What changes are you proposing? This is still needed to decide whether openvpn.exe or mullvad-daemon.exe should be allowed to talk to the first hop.

Copy link
Collaborator

@pinkisemils pinkisemils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 14 files at r1, 2 of 2 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dlon)


talpid-core/src/tunnel/mod.rs, line 160 at r3 (raw file):

Previously, dlon (David Lönnhager) wrote…

What changes are you proposing? This is still needed to decide whether openvpn.exe or mullvad-daemon.exe should be allowed to talk to the first hop.

Since it's still useful, then I propose that the current code is plenty good enough.


talpid-core/src/tunnel/openvpn/mod.rs, line 318 at r1 (raw file):

Previously, dlon (David Lönnhager) wrote…

This seems sketchy in retrospect: runtime_handle.block_on(f(runtime)). This task itself will still exist when the runtime is dropped. It works, but it could be cleaner.

I think we should have a TunnelMonitor trait with async start and wait methods. But I don't want to make a bunch of unrelated changes here.

Making it async would be better.

Copy link
Collaborator

@pinkisemils pinkisemils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@dlon dlon marked this pull request as ready for review April 4, 2022 14:50
Copy link
Collaborator

@pinkisemils pinkisemils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Member Author

@dlon dlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 12 of 14 files reviewed, all discussions resolved (waiting on @pinkisemils)


talpid-core/src/tunnel/openvpn/mod.rs, line 318 at r1 (raw file):

Previously, pinkisemils (Emīls Piņķis) wrote…

Making it async would be better.

Done. I've removed the runtime. This could still be improved, but I'll leave that for another PR.

Copy link
Collaborator

@pinkisemils pinkisemils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@dlon dlon merged commit bc883b9 into master Apr 5, 2022
@dlon dlon deleted the use-library-sslocal branch April 5, 2022 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants