Merge branch 'master' into ui-2

# Conflicts:
#	js/package.json
#	js/src/api/local/ethkey/worker.js
#	js/src/modals/FirstRun/TnC/tnc.js
#	js/src/modals/FirstRun/Welcome/welcome.js
#	js/src/ui/Form/Input/input.js
#	js/src/ui/VaultCard/Accounts/accounts.spec.js
#	js/src/views/Accounts/accounts.js
#	js/src/views/Application/TabBar/tabBar.js
#	js/src/views/Settings/Views/defaults.js
#	js/src/views/Settings/Views/views.js
#	js/webpack/app.js
#	js/webpack/libraries.js
This commit is contained in:
Jaco Greeff
2017-06-13 11:02:38 +02:00
parent 7f4a7abf49
commit 7bbd48a2bd
93 changed files with 1762 additions and 533 deletions

View File

@@ -840,6 +840,7 @@ impl Configuration {
hosts: self.ws_hosts(),
origins: self.ws_origins(),
signer_path: self.directories().signer.into(),
support_token_api: !self.args.flag_public_node,
ui_address: ui.address(),
};
@@ -1036,7 +1037,7 @@ impl Configuration {
self.args.flag_geth ||
self.args.flag_no_ui;
!ui_disabled
!ui_disabled && cfg!(feature = "ui-enabled")
}
fn verifier_settings(&self) -> VerifierSettings {
@@ -1247,6 +1248,7 @@ mod tests {
hosts: Some(vec![]),
signer_path: expected.into(),
ui_address: Some(("127.0.0.1".to_owned(), 8180)),
support_token_api: true
}, UiConfiguration {
enabled: true,
interface: "127.0.0.1".into(),

View File

@@ -102,7 +102,7 @@ impl From<UiConfiguration> for HttpConfiguration {
impl Default for UiConfiguration {
fn default() -> Self {
UiConfiguration {
enabled: true,
enabled: true && cfg!(feature = "ui-enabled"),
port: 8180,
interface: "127.0.0.1".into(),
hosts: Some(vec![]),
@@ -141,6 +141,7 @@ pub struct WsConfiguration {
pub origins: Option<Vec<String>>,
pub hosts: Option<Vec<String>>,
pub signer_path: PathBuf,
pub support_token_api: bool,
pub ui_address: Option<(String, u16)>,
}
@@ -155,6 +156,7 @@ impl Default for WsConfiguration {
origins: Some(vec!["chrome-extension://*".into()]),
hosts: Some(Vec::new()),
signer_path: replace_home(&data_dir, "$BASE/signer").into(),
support_token_api: true,
ui_address: Some(("127.0.0.1".to_owned(), 8180)),
}
}
@@ -207,9 +209,14 @@ pub fn new_ws<D: rpc_apis::Dependencies>(
let allowed_origins = into_domains(with_domain(conf.origins, domain, &[ui_address]));
let allowed_hosts = into_domains(with_domain(conf.hosts, domain, &[Some(ws_address)]));
let signer_path = conf.signer_path;
let signer_path = conf.ui_address.map(move |_| ::signer::codes_path(&signer_path));
let path = signer_path.as_ref().map(|p| p.as_path());
let signer_path;
let path = match conf.support_token_api && conf.ui_address.is_some() {
true => {
signer_path = ::signer::codes_path(&conf.signer_path);
Some(signer_path.as_path())
},
false => None
};
let start_result = rpc::start_ws(
&addr,
handler,