-
Notifications
You must be signed in to change notification settings - Fork 66
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
gui: support user/password for RPC authentication #898
Conversation
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.
Looks good from some quick testing!
row.push(radio( | ||
format!("{}", auth_type), | ||
*auth_type, | ||
Some(*selected_auth_type), | ||
SettingsEditMessage::BitcoindRpcAuthTypeSelected, | ||
)) | ||
.spacing(30) | ||
.align_items(Alignment::Center) |
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.
Nice, i like the radio button. Just let's not make them green?
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.
Looking through the rest of the interface most buttons do get green when hovered though.
gui/src/app/view/settings.rs
Outdated
.push( | ||
form::Form::new_trimmed("User", &rpc_auth_vals.user, |value| { | ||
SettingsEditMessage::FieldEdited("user", value) | ||
}) | ||
.warning("Please enter a valid user") | ||
.size(20) | ||
.padding(5), | ||
) | ||
.push( | ||
form::Form::new_trimmed("Password", &rpc_auth_vals.password, |value| { | ||
SettingsEditMessage::FieldEdited("password", value) | ||
}) | ||
.warning("Please enter a valid password") | ||
.size(20) | ||
.padding(5), | ||
), |
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.
nit: can we add a small marging in-between the two text inputs?
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.
I've now added spacing(10)
between them in both settings and installer.
[RpcAuthType::CookieFile, RpcAuthType::UserPass] | ||
.iter() | ||
.fold( | ||
Row::new() | ||
.push(text("RPC authentication:").small().bold()) | ||
.spacing(10), | ||
|row, auth_type| { | ||
row.push(radio( | ||
format!("{}", auth_type), | ||
*auth_type, | ||
Some(*selected_auth_type), | ||
|new_selection| { | ||
Message::DefineBitcoind( | ||
message::DefineBitcoind::RpcAuthTypeSelected(new_selection), | ||
) | ||
}, | ||
)) | ||
.spacing(30) | ||
.align_items(Alignment::Center) | ||
}, | ||
), |
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.
This change updates the GUI to support the latest lianad config file with the user/password option for bitcoind RPC authentication. The settings have been updated to set either cookie file path or user and password. The installer still only supports the cookie file and has only been updated with the changes required to compile. When starting, the internal bitcoind now looks for the cookie file in the usual location rather than relying on the config file.
If using a self-managed node, this adds the option to authenticate with the RPC server using user and password.
a7400f1
to
838550b
Compare
ACK 838550b |
This adds support to the GUI for user and password RPC authentication as part of #356.
The first commit adds the user/password option to the settings page, and only updates the installer as required for it to compile. It also changes how the managed bitcoind gets the cookie location when starting so that it doesn't rely on the config file.
The second commit adds the user/password option to the installer when using a self-managed node.
Updating the managed node to use user/password can be done in a follow-up PR.