-
Notifications
You must be signed in to change notification settings - Fork 359
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
Do not set default password or port for custom shadowsocks
access method
#5317
Do not set default password or port for custom shadowsocks
access method
#5317
Conversation
DES-410 Do not set a default password for custom `shadowsocks` access method
Currently, the
This is likely a remnant from the debugging phase during implementation of |
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.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)
mullvad-cli/src/cmds/api_access.rs
line 276 at r1 (raw file):
remote_ip: IpAddr, /// Password for authentication password: String,
Sorry for drive-by review. But please don't put password between IP and port. Those two belong together logically.
Is there any reason the remote endpoint is not an SocketAddr
instead?
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faern)
mullvad-cli/src/cmds/api_access.rs
line 276 at r1 (raw file):
Previously, faern (Linus Färnstrand) wrote…
Sorry for drive-by review. But please don't put password between IP and port. Those two belong together logically.
Is there any reason the remote endpoint is not an
SocketAddr
instead?
Consistency is one reason. If we change it to a SocketAddr
here, we should do the same for the bridge command, custom relays, etc.
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faern)
mullvad-cli/src/cmds/api_access.rs
line 276 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
Consistency is one reason. If we change it to a
SockAddr
here, we should do the same for the bridge command, custom relays, etc.
At the moment, remote_port
is optional due to the provided default value of 443
, and thus has to be placed after all required arguments
$ mullvad api-access add shadowsocks easy-to-remember-name 192.168.1.1 443 password
thread 'main' panicked at /home/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.2/src/builder/debug_asserts.rs:658:17:
Found non-required positional argument with a lower index than a required positional argument: "remote_port" index Some(3)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
The simplest solution is to simply remove the default remote_port
value, and then we can shuffle around the argument list so that password
appear after remote_port
.
David's point about concistency is a spot on explanation on why remote_ip: IpAddr
& remote_port: u16
is not combined into a single SocketAddr
value.
With that said, we should take the opportunity to address this before the feature is officially released 😊
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @faern and @MarkusPettersson98)
mullvad-cli/src/cmds/api_access.rs
line 276 at r1 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
At the moment,
remote_port
is optional due to the provided default value of443
, and thus has to be placed after all required arguments$ mullvad api-access add shadowsocks easy-to-remember-name 192.168.1.1 443 password thread 'main' panicked at /home/<user>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.4.2/src/builder/debug_asserts.rs:658:17: Found non-required positional argument with a lower index than a required positional argument: "remote_port" index Some(3) note: run with `RUST_BACKTRACE=1` environment variable to display a backtraceThe simplest solution is to simply remove the default
remote_port
value, and then we can shuffle around the argument list so thatpassword
appear afterremote_port
.David's point about concistency is a spot on explanation on why
remote_ip: IpAddr
&remote_port: u16
is not combined into a singleSocketAddr
value.
With that said, we should take the opportunity to address this before the feature is officially released 😊
The port should probably not be optional. But if it has to be optional, it should be long
rather than a positional argument, IMO.
mullvad-cli/src/cmds/api_access.rs
line 282 at r1 (raw file):
/// Cipher to use #[arg(value_parser = SHADOWSOCKS_CIPHERS, default_value = "aes-256-gcm")] cipher: String,
cipher
should not be a positional argument, in my opinion.
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dlon and @faern)
mullvad-cli/src/cmds/api_access.rs
line 276 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
The port should probably not be optional. But if it has to be optional, it should be
long
rather than a positional argument, IMO.
Making the remote_port
required by not providing a default value seems like the way to go IMO.
mullvad-cli/src/cmds/api_access.rs
line 282 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
cipher
should not be a positional, in my opinion.
Agree, making it a long
is clearer
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.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @dlon and @faern)
mullvad-cli/src/cmds/api_access.rs
line 276 at r1 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
Making the
remote_port
required by not providing a default value seems like the way to go IMO.
IP and port are now grouped together:
Usage: mullvad api-access add shadowsocks [OPTIONS] <NAME> <REMOTE_IP> <REMOTE_PORT> <PASSWORD>
Arguments:
<NAME> An easy to remember name for this custom proxy
<REMOTE_IP> The IP of the remote Shadowsocks-proxy
<REMOTE_PORT> Port on which the remote Shadowsocks-proxy listens for traffic
<PASSWORD> Password for authentication
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.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @dlon and @MarkusPettersson98)
mullvad-cli/src/cmds/api_access.rs
line 282 at r1 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
Agree, making it a
long
is clearer
Why does it have a default value? Is it likely that a random custom third party shadowsocks server will use this specific cipher? Is that more common than the port being 443?
I'd argue that all required arguments should be positional and all optional should be long flag arguments.
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @dlon and @MarkusPettersson98)
mullvad-cli/src/cmds/api_access.rs
line 276 at r1 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
IP and port are now grouped together:
Usage: mullvad api-access add shadowsocks [OPTIONS] <NAME> <REMOTE_IP> <REMOTE_PORT> <PASSWORD> Arguments: <NAME> An easy to remember name for this custom proxy <REMOTE_IP> The IP of the remote Shadowsocks-proxy <REMOTE_PORT> Port on which the remote Shadowsocks-proxy listens for traffic <PASSWORD> Password for authentication
🥳
shadowsocks
access methodshadowsocks
access method
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @dlon and @faern)
mullvad-cli/src/cmds/api_access.rs
line 282 at r1 (raw file):
Previously, faern (Linus Färnstrand) wrote…
Why does it have a default value? Is it likely that a random custom third party shadowsocks server will use this specific cipher? Is that more common than the port being 443?
I'd argue that all required arguments should be positional and all optional should be long flag arguments.
cipher
no longer has a default value, and is thus not optional.
Now, every required argument is positional and every optional argument is a long flag argument, except disabled
being a short flag argument in addition to being a long flag argument. This exception is the same for all other custom access methods as well.
187b9d5
to
8f118c3
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faern)
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.
Reviewed all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
mullvad-cli/src/cmds/api_access.rs
line 282 at r1 (raw file):
Previously, MarkusPettersson98 (Markus Pettersson) wrote…
cipher
no longer has a default value, and is thus not optional.Now, every required argument is positional and every optional argument is a long flag argument, except
disabled
being a short flag argument in addition to being a long flag argument. This exception is the same for all other custom access methods as well.
Noice! 👍
2d03904
to
84505d1
Compare
84505d1
to
2793d87
Compare
Do not try to set default password for custom
shadowsocks
access method.The previously provided default is the password for Mullvad's own bridge severs.
This change is